All of lore.kernel.org
 help / color / mirror / Atom feed
* Re:  [PATCH] checkpatch: skip macros when finding missing switch/case break
@ 2020-08-01  5:03 Cambda Zhu
  2020-08-01 16:05 ` [PATCH] checkpatch: Remove missing switch/case break test Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Cambda Zhu @ 2020-08-01  5:03 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel

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 now, I think this test should be removed.

Regards,
Cambda

> 在 2020年8月1日,02:05,Joe Perches <joe@perches.com> 写道:
> 
> 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 this test should be removed altogether as
> it's never really worked well and now compilers
> find this and emit warnings.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-01 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-01  5:03 [PATCH] checkpatch: skip macros when finding missing switch/case break Cambda Zhu
2020-08-01 16:05 ` [PATCH] checkpatch: Remove missing switch/case break test Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.