lkml.org 
[lkml]   [2022]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] rtc: Move variable into switch case statement
Date
On Wed, 8 Dec 2021 20:39:15 -0800, Kees Cook wrote:
> When building with automatic stack variable initialization, GCC 12
> complains about variables defined outside of switch case statements.
> Move the variable into the case that uses it, which silences the warning:
>
> drivers/rtc/dev.c: In function 'rtc_dev_ioctl':
> drivers/rtc/dev.c:394:30: warning: statement will never be executed [-Wswitch-unreachable]
> 394 | long offset;
> | ^~~~~~
>
> [...]

Applied, thanks!

[1/1] rtc: Move variable into switch case statement
commit: ba52eac083e1598e748811ff58d259f77e4c5c4d

Best regards,
--
Alexandre Belloni <alexandre.belloni@bootlin.com>

\
 
 \ /
  Last update: 2022-01-05 01:07    [W:0.040 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site