lkml.org 
[lkml]   [2019]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] checkpatch: add *_NOTIFIER_HEAD as var definition
From
Date
On Tue, 2019-07-02 at 15:30 +0300, Gilad Ben-Yossef wrote:
> 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
[]
> diff --git 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\)|

I think you want "${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) {

\
 
 \ /
  Last update: 2019-07-02 15:12    [W:0.057 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site