From: Gilad Ben-Yossef <gilad@benyossef.com>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Cc: Ofir Drang <ofir.drang@arm.com>, linux-kernel@vger.kernel.org
Subject: [PATCH v2] checkpatch: add *_NOTIFIER_HEAD as var definition
Date: Thu, 4 Jul 2019 13:44:57 +0300 [thread overview]
Message-ID: <20190704104457.30045-1-gilad@benyossef.com> (raw)
Add *_NOTIFIER_HEAD as variable definition to avoid code like this:
ATOMIC_NOTIFIER_HEAD(foo);
EXPORT_SYMBOL_GPL(foo);
From triggering the the following warning:
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---
Changes from v1:
- Better RegExp as suggested by Joe Perches.
scripts/checkpatch.pl | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 342c7c781ba5..9cadda7024ae 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3864,6 +3864,7 @@ sub process {
^.DEFINE_$Ident\(\Q$name\E\)|
^.DECLARE_$Ident\(\Q$name\E\)|
^.LIST_HEAD\(\Q$name\E\)|
+ ^.{$Ident}_NOTIFIER_HEAD\(\Q$name\E\)|
^.(?:$Storage\s+)?$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(|
\b\Q$name\E(?:\s+$Attribute)*\s*(?:;|=|\[|\()
)/x) {
--
2.21.0
next reply other threads:[~2019-07-04 10:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-04 10:44 Gilad Ben-Yossef [this message]
2019-07-04 18:55 ` [PATCH v2] checkpatch: add *_NOTIFIER_HEAD as var definition Joe Perches
2019-08-19 12:29 Gilad Ben-Yossef
2019-08-19 18:28 ` John Hubbard
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=20190704104457.30045-1-gilad@benyossef.com \
--to=gilad@benyossef.com \
--cc=apw@canonical.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ofir.drang@arm.com \
/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;
as well as URLs for NNTP newsgroup(s).