]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: add control statement test to SINGLE_STATEMENT_DO_WHILE_MACRO
authorJoe Perches <joe@perches.com>
Tue, 21 Aug 2012 23:15:53 +0000 (16:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 21 Aug 2012 23:45:02 +0000 (16:45 -0700)
commit32950a965f8bb9fd9fd294b0568c8809d24bf458
treed2eae9170d79c302d99c0d7a27da134060fde69e
parent8df40dfe8d22cb838aeccf69d30da191794b1fd4
checkpatch: add control statement test to SINGLE_STATEMENT_DO_WHILE_MACRO

Commit 21846ccb60d9 ("checkpatch: add checks for do {} while (0) macro
misuses") added a test that is overly simplistic for single statement
macros.

Macros that start with control tests should be enclosed in a do {} while
(0) loop.

Add the necessary control tests to the check.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
Tested-by: Franz Schrober <franzschrober@yahoo.de>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl