public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead•org>
To: Stephen Rothwell <sfr@canb•auug.org.au>,
	Progyan Bhattacharya <bprogyan@gmail•com>
Cc: linux-kernel@vger•kernel.org, linux-next@vger•kernel.org,
	narmstrong@baylibre•com, akpm@linux-foundation•org,
	Arnd Bergmann <arnd@arndb•de>,
	Daniel Golle <daniel@makrotopia•org>,
	Joe Perches <joe@perches•com>
Subject: Re: [PATCH] Build: Scripts/Makefile: Remove Repeated Lines
Date: Wed, 14 Feb 2018 21:24:55 -0800	[thread overview]
Message-ID: <bec02b84-316b-a41a-91ea-e0957d358ee3@infradead.org> (raw)
In-Reply-To: <20180215160520.5828f900@canb.auug.org.au>

On 02/14/2018 09:05 PM, Stephen Rothwell wrote:
> Hi Progyan,
> 
> On Thu, 15 Feb 2018 09:50:03 +0530 Progyan Bhattacharya <bprogyan@gmail•com> wrote:
>>
> 
>> PS: I have another question, Is use of range expression within case
>> statements allowed in Kernel? If not, are we using If-Else ladder for that?
> 
> I am not sure if we have a policy on ranges in case labels, but it is
> not standard C (well, C11 at least).  If-else ladders are certainly
> common.

I found 964 case ranges in 4.16-rc1.

or you use something like:

	switch (val) {
	case 5:
	case 10:
	case 15:
		// handle multiples of 5:
		break;
	default:
	}



-- 
~Randy

  reply	other threads:[~2018-02-15  5:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14  9:25 [PATCH] Build: Scripts/Makefile: Remove Repeated Lines Progyan Bhattacharya
2018-02-14 11:49 ` Stephen Rothwell
     [not found]   ` <CAGyWO1-9scERtpPw5CCwQcUbCU0SpcqpNq2eiBWRtwpRC-kB-A@mail.gmail.com>
2018-02-15  5:05     ` Stephen Rothwell
2018-02-15  5:24       ` Randy Dunlap [this message]
     [not found]         ` <CAGyWO1_tmrSB8WwyARGWXhYCz=SL-xqqU4d3Y0A1vqGWQ_8Trg@mail.gmail.com>
2018-02-15 17:52           ` Randy Dunlap
     [not found]     ` <CAGyWO1-356ncU=122yrqCoL96pCVfaqJwdFvkmqfot3fzVF6pg@mail.gmail.com>
2018-02-15  5:09       ` Stephen Rothwell

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=bec02b84-316b-a41a-91ea-e0957d358ee3@infradead.org \
    --to=rdunlap@infradead$(echo .)org \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=arnd@arndb$(echo .)de \
    --cc=bprogyan@gmail$(echo .)com \
    --cc=daniel@makrotopia$(echo .)org \
    --cc=joe@perches$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=narmstrong@baylibre$(echo .)com \
    --cc=sfr@canb$(echo .)auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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