mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Alex Dubov <oakad@yahoo.com>
Cc: linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] memstick: mark expected switch fall-throughs
Date: Tue, 23 Apr 2019 10:10:32 -0500	[thread overview]
Message-ID: <021d3df9-9804-262d-9db8-5a1850521cb9@embeddedor.com> (raw)
In-Reply-To: <9dfec9a9-1a20-f6ab-5773-d7ee03343036@embeddedor.com>

Hi all,

If no one cares, I'll add this to my tree for 5.2.

Thanks
--
Gustavo

On 3/20/19 12:40 PM, Gustavo A. R. Silva wrote:
> Hi,
> 
> Friendly ping:
> 
> Who can take this?
> 
> Thanks
> --
> Gustavo
> 
> On 2/12/19 8:57 PM, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch
>> cases where we are expecting to fall through.
>>
>> This patch fixes the following warnings:
>>
>> drivers/memstick/host/jmb38x_ms.c: In function ‘jmb38x_ms_write_data’:
>> drivers/memstick/host/jmb38x_ms.c:261:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>    host->io_pos++;
>>    ~~~~~~~~~~~~^~
>> drivers/memstick/host/jmb38x_ms.c:262:2: note: here
>>   case 2:
>>   ^~~~
>> drivers/memstick/host/jmb38x_ms.c:264:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>    host->io_pos++;
>>    ~~~~~~~~~~~~^~
>> drivers/memstick/host/jmb38x_ms.c:265:2: note: here
>>   case 1:
>>   ^~~~
>> drivers/memstick/host/tifm_ms.c: In function ‘tifm_ms_write_data’:
>> drivers/memstick/host/tifm_ms.c:168:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>    host->io_pos++;
>>    ~~~~~~~~~~~~^~
>> drivers/memstick/host/tifm_ms.c:169:2: note: here
>>   case 2:
>>   ^~~~
>> drivers/memstick/host/tifm_ms.c:171:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>    host->io_pos++;
>>    ~~~~~~~~~~~~^~
>> drivers/memstick/host/tifm_ms.c:172:2: note: here
>>   case 1:
>>   ^~~~
>>
>> Warning level 3 was used: -Wimplicit-fallthrough=3
>>
>> This patch is part of the ongoing efforts to enable
>> -Wimplicit-fallthrough.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>>  drivers/memstick/host/jmb38x_ms.c | 2 ++
>>  drivers/memstick/host/tifm_ms.c   | 2 ++
>>  2 files changed, 4 insertions(+)
>>
>> diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c
>> index bcdca9fbef51..49c71f55489f 100644
>> --- a/drivers/memstick/host/jmb38x_ms.c
>> +++ b/drivers/memstick/host/jmb38x_ms.c
>> @@ -259,9 +259,11 @@ static unsigned int jmb38x_ms_write_data(struct jmb38x_ms_host *host,
>>  	case 3:
>>  		host->io_word[0] |= buf[off + 2] << 16;
>>  		host->io_pos++;
>> +		/* fall through */
>>  	case 2:
>>  		host->io_word[0] |= buf[off + 1] << 8;
>>  		host->io_pos++;
>> +		/* fall through */
>>  	case 1:
>>  		host->io_word[0] |= buf[off];
>>  		host->io_pos++;
>> diff --git a/drivers/memstick/host/tifm_ms.c b/drivers/memstick/host/tifm_ms.c
>> index bed205849d02..1bbb2ead9556 100644
>> --- a/drivers/memstick/host/tifm_ms.c
>> +++ b/drivers/memstick/host/tifm_ms.c
>> @@ -166,9 +166,11 @@ static unsigned int tifm_ms_write_data(struct tifm_ms *host,
>>  	case 3:
>>  		host->io_word |= buf[off + 2] << 16;
>>  		host->io_pos++;
>> +		/* fall through */
>>  	case 2:
>>  		host->io_word |= buf[off + 1] << 8;
>>  		host->io_pos++;
>> +		/* fall through */
>>  	case 1:
>>  		host->io_word |= buf[off];
>>  		host->io_pos++;
>>

  reply	other threads:[~2019-04-23 15:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13  2:57 Gustavo A. R. Silva
2019-03-20 17:40 ` Gustavo A. R. Silva
2019-04-23 15:10   ` Gustavo A. R. Silva [this message]
2019-04-23 15:15 ` Kees Cook
2019-04-23 15:24   ` Gustavo A. R. Silva

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=021d3df9-9804-262d-9db8-5a1850521cb9@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oakad@yahoo.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

all inboxes | Powered by JetHome®