Browse Source

Fix sparse false positives re BUG_ON(ptr)

sparse now warns if one compares pointers with integers. However, there are
false positives, like:

	fs/filesystems.c:72:2: warning: Using plain integer as NULL pointer

Every time BUG_ON(ptr) is used, ptr is checked against integer zero.  Avoid
that and save ~70 false positives from allyesconfig run.

mentioned by Al.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Josh Triplett <josh@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Alexey Dobriyan 18 years ago
parent
commit
2a41de48b8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      include/asm-generic/bug.h

+ 1 - 1
include/asm-generic/bug.h

@@ -28,7 +28,7 @@ struct bug_entry {
 #endif
 #endif
 
 
 #ifndef HAVE_ARCH_BUG_ON
 #ifndef HAVE_ARCH_BUG_ON
-#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
+#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)
 #endif
 #endif
 
 
 #ifndef HAVE_ARCH_WARN_ON
 #ifndef HAVE_ARCH_WARN_ON