Re: [PATCH] staging: greybus: audio: expect 0 from kstrtoint(), not 1
From: Dan Carpenter
Date: Sat May 23 2026 - 05:55:47 EST
On Fri, May 22, 2026 at 07:07:10AM +0200, Greg Kroah-Hartman wrote:
> > total: 1 errors, 0 warnings, 0 checks, 16 lines checked
> >
> > NOTE: For some of the reported defects, checkpatch may be able to
> > mechanically convert to the typical style using --fix or --fix-inplace.
>
> What about trying --strict?
>
> Anyway, think about rewriting the check for "== 0" now, that is not
> normal kernel style.
The checkpatch rules is only for NULL. You're, of course, right that
== 0 is bad style here but there are be times where it is idiomatic to
check for == 0 or != 0.
I only bring this up to promote my blog.
https://staticthinking.wordpress.com/2024/02/20/when-to-use-0/
#SEO
regards,
dan carpenter