]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: add --strict "pointer comparison to NULL" test
authorJoe Perches <joe@perches.com>
Wed, 10 Dec 2014 23:52:02 +0000 (15:52 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Dec 2014 01:41:12 +0000 (17:41 -0800)
commiteb225cd7e6cdf33c28d695ee8a516d39e96909f2
treefbc657be2fa3993e8639d5e083f4962811b025c5
parentbb5519097b3b64f5b09737398697ad19a045b044
checkpatch: add --strict "pointer comparison to NULL" test

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: Joe Perches <joe@perches.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl