scripts: checkpatch: allow "case" macros
Do not report errors like below: ./scripts/checkpatch.pl -f drivers/net/wireless/ath/ath10k/wmi.h ERROR: Macros with complex values should be enclosed in parentheses +#define C2S(x) case x: return #x since many "case ..." macros are already used by some in-kernel drivers. Link: https://lkml.kernel.org/r/20221027134334.164301-1-stf_xl@wp.pl Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Acked-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Родитель
5cc81d5c81
Коммит
dc3f4dee81
|
@ -5918,6 +5918,7 @@ sub process {
|
||||||
$dstat !~ /$exceptions/ &&
|
$dstat !~ /$exceptions/ &&
|
||||||
$dstat !~ /^\.$Ident\s*=/ && # .foo =
|
$dstat !~ /^\.$Ident\s*=/ && # .foo =
|
||||||
$dstat !~ /^(?:\#\s*$Ident|\#\s*$Constant)\s*$/ && # stringification #foo
|
$dstat !~ /^(?:\#\s*$Ident|\#\s*$Constant)\s*$/ && # stringification #foo
|
||||||
|
$dstat !~ /^case\b/ && # case ...
|
||||||
$dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...)
|
$dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...)
|
||||||
$dstat !~ /^while\s*$Constant\s*$Constant\s*$/ && # while (...) {...}
|
$dstat !~ /^while\s*$Constant\s*$Constant\s*$/ && # while (...) {...}
|
||||||
$dstat !~ /^for\s*$Constant$/ && # for (...)
|
$dstat !~ /^for\s*$Constant$/ && # for (...)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче