Re: [PATCH][ppc] logical/bitand typo in powerpc/boot/4xx.c

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Roel Kluin <12o3l@...>, Andy Whitcroft <apw@...>
Cc: <jwboyer@...>, lkml <linux-kernel@...>, <linuxppc-dev@...>
Date: Wednesday, January 23, 2008 - 7:05 pm

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|{|\\|$)/) {


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH][ppc] logical/bitand typo in powerpc/boot/4xx.c, Valentine Barshak, (Tue Jan 29, 10:22 am)
Re: [PATCH][ppc] logical/bitand typo in powerpc/boot/4xx.c, Joe Perches, (Wed Jan 23, 7:05 pm)
Re: [PATCH][ppc] logical/bitand typo in powerpc/boot/4xx.c, Andy Whitcroft, (Tue Jan 29, 6:55 am)