On 6/12/2019 8:25 AM, Greg Kroah-Hartman wrote:
> When calling debugfs functions, there is no need to ever check the
> return value. The function can work or not, but the code logic should
> never do something different based on this.
>
> Also, because there is no need to save the file dentry, remove the
> variables that were saving them as they were never even being used once
> set.
>
> Cc: Sinan Kaya <[email protected]>
> Cc: Andy Gross <[email protected]>
> Cc: David Brown <[email protected]>
> Cc: Dan Williams <[email protected]>
> Cc: Vinod Koul <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Interesting. Wouldn't debugfs_create_file() blow up if dir is NULL
for some reason?
+ debugfs_create_file("stats", S_IRUGO, dir, chan,
+ &hidma_chan_fops);
Note that code ignores the return value of hidma_debug_init();
It was just trying to do clean up on debugfs failure by calling
debugfs_remove_recursive(dmadev->debugfs);