diff options
author | Stanislaw Gruszka <stf_xl@wp.pl> | 2022-10-27 16:43:34 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2022-11-19 00:55:08 +0300 |
commit | dc3f4dee81cd85b039d07b8d75cfbae4668a15d2 (patch) | |
tree | 362527033873bef3d20571dafdf690904d7d33d8 /scripts | |
parent | 5cc81d5c81af0dee54da9a67a3ebe4be076a13db (diff) | |
download | linux-dc3f4dee81cd85b039d07b8d75cfbae4668a15d2.tar.xz |
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>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index bd1b9d7a1647..29517897baa1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5918,6 +5918,7 @@ sub process { $dstat !~ /$exceptions/ && $dstat !~ /^\.$Ident\s*=/ && # .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 !~ /^while\s*$Constant\s*$Constant\s*$/ && # while (...) {...} $dstat !~ /^for\s*$Constant$/ && # for (...) |