Re: [PATCH] checkpatch: skip macros when finding missing switch/case break

2020-07-31 Thread Cambda Zhu
I agree with you. Actually there are some false warnings not mentioned in my patch, such as: case xxx: { if () { return; } else { if () { return; } else { return; } } } case xxx: ... Since compiler can do this

Re: [PATCH] checkpatch: skip macros when finding missing switch/case break

2020-07-31 Thread Joe Perches
On Wed, 2020-07-29 at 20:59 +0800, Cambda Zhu wrote: > The checkpatch.pl only searches 3 previous lines when finding missing > switch/case break, and macros are treated as normal statements. If the > cases are surrounded with CONFIG, checkpatch.pl may report false > warnings. For example: Likely

[PATCH] checkpatch: skip macros when finding missing switch/case break

2020-07-29 Thread Cambda Zhu
The checkpatch.pl only searches 3 previous lines when finding missing switch/case break, and macros are treated as normal statements. If the cases are surrounded with CONFIG, checkpatch.pl may report false warnings. For example: \+#if xxx \+ case xxx: { \+ ... \+