From: Andy Whitcroft <apw@canonical.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Joe Perches <joe@perches.com>,
linux-kernel@vger.kernel.org, Andy Whitcroft <apw@canonical.com>
Subject: [PATCH 4/5] checkpatch: high precidence operators do not require additional parentheses in #defines
Date: Thu, 1 Mar 2012 12:44:09 +0000 [thread overview]
Message-ID: <1330605850-7873-5-git-send-email-apw@canonical.com> (raw)
In-Reply-To: <1330605850-7873-1-git-send-email-apw@canonical.com>
With any very high precidence 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>
---
scripts/checkpatch.pl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 35189de..610036e 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2850,7 +2850,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 =
--
1.7.9
next prev parent reply other threads:[~2012-03-01 12:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-01 12:44 [PATCH 0/5] checkpatch update Andy Whitcroft
2012-03-01 12:44 ` [PATCH 1/5] checkpatch: catch [ ... ] usage when not at the beginning of defination Andy Whitcroft
2012-03-01 12:44 ` [PATCH 2/5] checkpatch: allow simple character constants in #defines Andy Whitcroft
2012-03-01 12:44 ` [PATCH 3/5] checkpatch: handle string concatenation in simple #defines Andy Whitcroft
2012-03-01 12:44 ` Andy Whitcroft [this message]
2012-03-01 12:44 ` [PATCH 5/5] checkpatch: add [] to type extensions Andy Whitcroft
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1330605850-7873-5-git-send-email-apw@canonical.com \
--to=apw@canonical.com \
--cc=akpm@linux-foundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®