Re: [PATCH 4/6] dma: pxa_dma: no need to check return value of debugfs_create functions

From: Robert Jarzmik
Date: Tue Aug 13 2019 - 17:21:12 EST

Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> writes:

> On Sat, Aug 10, 2019 at 09:27:26PM +0200, Robert Jarzmik wrote:
>> Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> writes:
>> This is not strictly equivalent.
>> Imagine that the debugfs_create_dir() fails and returns NULL :
> How can that happen?
Well in v5.0-rc1 that could happen ... unfortunately that's also the code I
checked ...

>> - in the former case, neither "state", "descriptors" nor "requesters" would be
>> created
>> - in the new code, "state", "descriptors" nor "requesters" will be created in
>> the debugfs root directory
> I agree, but debugfs_create_dir() does not return a NULL on an error
> since many kernel releases. Neither can debugfs_create_file() so really
> this test is not working at all as-is :)
Ah yes, you're right, I wasn't aware of the debugfs changes ...

But checking a bit further, your original mail is 2 monthes old, and this patch
was already merged in v5.2. I probably fell in a time-space anomaly, as I
received this mail only a couple of days ago.

Have a nice day.