Re: [PATCH] checkpatch: add --strict "pointer comparison to NULL" test

2015-08-27 Thread Joe Perches
On Thu, 2015-08-27 at 09:09 +0200, Nicolas Morey Chaisemartin wrote: > > From: "Joe Perches" [] > > And because most likely, "CONST test variable" checks like > > NULL != foo > > and > > 0 < bar > > > > should probably be a separate test. [] > > diff --git a/scripts/checkpatch.pl b/script

Re: [PATCH] checkpatch: add --strict "pointer comparison to NULL" test

2015-08-27 Thread Nicolas Morey Chaisemartin
- Original Message - > From: "Joe Perches" > To: "Viresh Kumar" > Cc: "Andrew Morton" , "Dan Carpenter" > , "Greg KH" > , "LKML" , "Mike > Holmes" , > nmo...@kalray.eu > Sent: Thursday, 27

Re: [PATCH] checkpatch: add --strict "pointer comparison to NULL" test

2015-08-26 Thread Joe Perches
On Thu, 2015-08-27 at 07:49 +0530, Viresh Kumar wrote: > Few colleagues asked me why isn't checkpatch warning for (NULL == ptr) > or (NULL != ptr) checks, as it warns for (ptr == NULL) and (ptr != NULL). > > Did you miss it? or was it intentional ? I didn't miss it. NULL == foo is relatively unu

Re: [PATCH] checkpatch: add --strict "pointer comparison to NULL" test

2015-08-26 Thread Viresh Kumar
On Fri, Nov 14, 2014 at 12:27 AM, Joe Perches wrote: > It seems there are more and more uses of "if (!ptr)" > in preference to "if (ptr == NULL)" so add a --strict > test to emit a message when using the latter form. > > This also finds (ptr != NULL). > > Fix it too if desired. > > Signed-off-by: