lkml.org 
[lkml]   [2018]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] clk: samsung: s3c: Mark expected switch fall-through
From
Date


On 04/05/2018 03:24 PM, Stephen Boyd wrote:
> Quoting Gustavo A. R. Silva (2018-04-03 18:09:31)
>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>> where we are expecting to fall through.
>>
>> Notice that in this particular case I replaced the comma wiht a dash,
>
> s/wiht/with/
>

Thanks for this.

>> which is what GCC is expecting to find when there are other comments
>> in the same line in which "fall through" appears.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>> This code was compiled with GCC 7.3.0
>
> What's the GCC warning? Please include in the commit text.
>

drivers/clk/samsung/clk-s3c2443.c:430:3: warning: this statement may
fall through [-Wimplicit-fallthrough=]
samsung_clk_register_alias(ctx, s3c2450_aliases,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ARRAY_SIZE(s3c2450_aliases));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/samsung/clk-s3c2443.c:433:2: note: here
case S3C2416:
^~~~


> Also what's the implicit-fallthrough level you're using? 3? Can you file
> a bug so GCC can update their regex to accept a comma in addition to
> whitespace characters?
>

Yeah, I can talk to the GCC guys about that.

> And maybe we can change the level to 2 or 1 in the kernel's makefile so
> we don't need to patch comments for this.
>

Yeah, with level 2 I don't get that warning.

Thanks
--
Gustavo

\
 
 \ /
  Last update: 2018-04-06 01:11    [W:0.059 / U:6.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site