summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@canonical.com>2012-03-23 23:02:18 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-24 00:58:36 +0100
commitfd1b57ac73f169a5ba7a9569989aad40184f6340 (patch)
tree7a188a1f50c00a86e790acc406fb96db45294850
parentcheckpatch: handle string concatenation in simple #defines (diff)
downloadlinux-fd1b57ac73f169a5ba7a9569989aad40184f6340.tar.xz
linux-fd1b57ac73f169a5ba7a9569989aad40184f6340.zip
checkpatch: high precedence operators do not require additional parentheses in #defines
With any very high precedence operator it is not necessary to enforce additional parentheses around simple negated expressions. This prevents us requesting further perentheses around the following: #define PMEM_IS_FREE(id, index) !(pmem[id].bitmap[index].allocated) For now add logical and bitwise not and unary minus. Signed-off-by: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 01a65988a057..ec58d3152e71 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2916,7 +2916,7 @@ sub process {
if ($dstat ne '' &&
$dstat !~ /^(?:$Ident|-?$Constant),$/ && # 10, // foo(),
$dstat !~ /^(?:$Ident|-?$Constant);$/ && # foo();
- $dstat !~ /^(?:$Ident|-?$Constant)$/ && # 10 // foo()
+ $dstat !~ /^[!~-]?(?:$Ident|$Constant)$/ && # 10 // foo() // !foo // ~foo // -foo
$dstat !~ /^'X'$/ && # character constants
$dstat !~ /$exceptions/ &&
$dstat !~ /^\.$Ident\s*=/ && # .foo =