Re: [PATCH] qspinlock: no need to check return value of debugfs_create functions

From: Greg Kroah-Hartman
Date: Wed Jan 23 2019 - 04:22:49 EST


On Wed, Jan 23, 2019 at 09:10:18AM +0000, Will Deacon wrote:
> On Tue, Jan 22, 2019 at 04:21:43PM +0100, 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.
> >
> > Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> > Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> > Cc: Will Deacon <will.deacon@xxxxxxx>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> > ---
> > kernel/locking/qspinlock_stat.h | 18 ++++--------------
> > 1 file changed, 4 insertions(+), 14 deletions(-)
>
> Curious, but are you planning to make these functions return void after
> you've modified all of the callers?

I wish, but I can't, as those values are needed for some other debugfs
calls.

thanks,

greg k-h