On Wed, 2008-01-23 at 23:37 +0100, Roel Kluin wrote:
I think this pattern should be added to checkpatch
Signed-off-by: Joe Perches <joe@perches.com>
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 579f50f..147e573 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1337,6 +1337,11 @@ sub process {
}
}
+# Check for bitwise tests written as boolean
+ if ($line =~ /\&\&\s*0[xX]/) {
+ WARN("boolean test with hexadecimal, perhaps just 1 \&?\n" . $herecurr);
+ }
+
# if and else should not have general statements after it
if ($line =~ /^.\s*(?:}\s*)?else\b(.*)/ &&
$1 !~ /^\s*(?:\sif|{|\\|$)/) {
--