Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

debug: Avoid setting BUGFLAG_WARNING twice

Dan reported that his static checking complains about BUGFLAG_WARNING
being set on both sides of the bitwise-or, it figures that that might've
been an unintentional mistake.

Since there are no architectures that implement __WARN_TAINT() (I
converted them all to implement __WARN_FLAGS()), and all __WARN_FLAGS()
implementations already set BUGFLAG_WARNING, we can remove the bit from
BUGFLAG_TAINT() and make Dan's checker happy.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170410084939.4bwhrvpmauwfzauq@hirez.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Peter Zijlstra and committed by
Ingo Molnar
f26dee15 a8b7a923

+1 -1
+1 -1
include/asm-generic/bug.h
··· 7 7 #define BUGFLAG_WARNING (1 << 0) 8 8 #define BUGFLAG_ONCE (1 << 1) 9 9 #define BUGFLAG_DONE (1 << 2) 10 - #define BUGFLAG_TAINT(taint) (BUGFLAG_WARNING | ((taint) << 8)) 10 + #define BUGFLAG_TAINT(taint) ((taint) << 8) 11 11 #define BUG_GET_TAINT(bug) ((bug)->flags >> 8) 12 12 #endif 13 13