diff options
author | Andy Whitcroft <apw@canonical.com> | 2009-10-26 19:50:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-29 10:39:31 -0400 |
commit | 99423c2065b62fee41cdbd8da7e63bf1f8f9e9b0 (patch) | |
tree | cce6a6498daee4630e0c1fa9f48ef922457cad68 /scripts | |
parent | 2ceb532b04b7a3b8f534d11a6e839f8b8bff94c1 (diff) |
checkpatch: fix __attribute__ matching
In the following code,
union thread_union init_thread_union
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) };
There is a non-conforming declaration. It should really be like the
following,
union thread_union init_thread_union
__attribute__((__section__(".data.init_task"))) = {
INIT_THREAD_INFO(init_task)
};
However, checkpatch doesn't catch this right now because it doesn't
correctly evaluate the "__attribute__".
It is not at all clear that we care what preceeds an assignment style
attribute when we find the open brace. Relax the test so we do not need
to check the __attribute__.
Reported-by: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index cb2dac37aaff..ba105a848396 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -1669,8 +1669,8 @@ sub process { | |||
1669 | } | 1669 | } |
1670 | 1670 | ||
1671 | # check for initialisation to aggregates open brace on the next line | 1671 | # check for initialisation to aggregates open brace on the next line |
1672 | if ($prevline =~ /$Declare\s*$Ident\s*=\s*$/ && | 1672 | if ($line =~ /^.\s*{/ && |
1673 | $line =~ /^.\s*{/) { | 1673 | $prevline =~ /(?:^|[^=])=\s*$/) { |
1674 | ERROR("that open brace { should be on the previous line\n" . $hereprev); | 1674 | ERROR("that open brace { should be on the previous line\n" . $hereprev); |
1675 | } | 1675 | } |
1676 | 1676 | ||