Re: [PATCH] memstick: mark expected switch fall-throughs

From: Gustavo A. R. Silva
Date: Tue Apr 23 2019 - 11:24:42 EST




On 4/23/19 10:15 AM, Kees Cook wrote:
> On Tue, Feb 12, 2019 at 6:57 PM Gustavo A. R. Silva
> <gustavo@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx>
>
> Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>
>

Thanks, Kees!

--
Gustavo