The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Geyslan G. Bem" <geyslan@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Andy Whitcroft <apw@canonical.com>
Cc: Peter Senna Tschudin <peter.senna@gmail.com>,
	Robo Bot <apw@canonical.com>
Subject: Re: [BUG] checkpatch warning default switch case
Date: Fri, 11 Dec 2015 12:08:31 -0800	[thread overview]
Message-ID: <1449864511.3564.4.camel@perches.com> (raw)
In-Reply-To: <CAGG-pUR5GgrbgurcrTwGCpPMdMyJBvn_JSah77wVG2t7TBEpBw@mail.gmail.com>

On Fri, 2015-12-11 at 16:34 -0300, Geyslan G. Bem wrote:
> Hello,
> 
> Running
> scripts/checkpatch.pl -f drivers/usb/host/ehci-sched.c
> 
> I got this
> ...
> ERROR: spaces required around that ':' (ctx:VxE)
> #496: FILE: drivers/usb/host/ehci-sched.c:496:
> +                       default:
> ...
> 
> 
> 496:            default:
>                         ehci_dbg (ehci,
>                                 "periodic frame %d bogus type %d\n",
>                                 frame, type);
>                 }
> 
> It seems a correct use of default switch case. Maybe the test concerns
> to ternary conditional.
> 
> Let me know.

Yes, it's a checkpatch defect.

It's because a c99 style comment is immediately before this line.

	switch (foo) {
	case 1:
		break;
	// foo
	default:
		break;
	}

emits this ERROR

I suggest you fix the comment and the message will go away.

Andy?  Do you care to fix this defect?


  reply	other threads:[~2015-12-11 20:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 19:34 [BUG] checkpatch warning default switch case Geyslan G. Bem
2015-12-11 20:08 ` Joe Perches [this message]
2015-12-11 20:21   ` Geyslan G. Bem
2015-12-11 21:56     ` Geyslan G. Bem
2015-12-12  1:34       ` Joe Perches
2015-12-12  1:51         ` Geyslan G. Bem

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=1449864511.3564.4.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=geyslan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.senna@gmail.com \
    /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