aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorStefani Seibold <stefani@seibold.net>2010-03-05 16:43:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:44 -0500
commit22fd2d3e4f75a2596ccdfdcbdfd505c9c60bf346 (patch)
treefc9072d2d42a3da4b5ad5145b14b3f738582288d /scripts/checkpatch.pl
parent52131292c069b74f4b5f3c786ff66ff6e82b0e69 (diff)
checkpatch.pl: add union and struct to the exceptions list
Here is a small code snippet, which will be complained about by checkpatch.pl: #define __STRUCT_KFIFO_COMMON(recsize, ptrtype) \ union { \ struct { \ unsigned int in; \ unsigned int out; \ }; \ char rectype[recsize]; \ ptrtype *ptr; \ const ptrtype *ptr_const; \ }; This construct is legal and safe, so checkpatch.pl should accept this. It should be also true for struct defined in a macro. Add the `struct' and `union' keywords to the exceptions list of the checkpatch.pl script, to prevent error message "Macros with multiple statements should be enclosed in a do - while loop". Otherwise it is not possible to build a struct or union with a macro. Signed-off-by: Stefani Seibold <stefani@seibold.net> Cc: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1530dbf1dab5..623d07b97727 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2361,6 +2361,8 @@ sub process {
2361 DECLARE_PER_CPU| 2361 DECLARE_PER_CPU|
2362 DEFINE_PER_CPU| 2362 DEFINE_PER_CPU|
2363 __typeof__\(| 2363 __typeof__\(|
2364 union|
2365 struct|
2364 \.$Ident\s*=\s*| 2366 \.$Ident\s*=\s*|
2365 ^\"|\"$ 2367 ^\"|\"$
2366 }x; 2368 }x;