mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cambda Zhu <cambda@linux.alibaba.com>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re:  [PATCH] checkpatch: skip macros when finding missing switch/case break
Date: Sat, 1 Aug 2020 13:03:48 +0800	[thread overview]
Message-ID: <46F62293-BC9E-4428-94BD-186B0E3D3A5E@linux.alibaba.com> (raw)

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.


             reply	other threads:[~2020-08-01  5:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-01  5:03 Cambda Zhu [this message]
2020-08-01 16:05 ` [PATCH] checkpatch: Remove missing switch/case break test Joe Perches
  -- strict thread matches above, loose matches on Subject: below --
2020-07-29 12:59 [PATCH] checkpatch: skip macros when finding missing switch/case break Cambda Zhu
2020-07-31 18:05 ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46F62293-BC9E-4428-94BD-186B0E3D3A5E@linux.alibaba.com \
    --to=cambda@linux.alibaba.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®