From: Kees Cook <keescook@chromium.org>
To: Victor Erminpour <victor.erminpour@oracle.com>
Cc: a.zummo@towertech.it, alexandre.belloni@bootlin.com,
linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
trivial@kernel.org
Subject: Re: [PATCH] rtc: pcf8523: Fix GCC 12 warning
Date: Thu, 10 Feb 2022 15:48:44 -0800 [thread overview]
Message-ID: <202202101548.D2CF8DAC@keescook> (raw)
In-Reply-To: <1644453027-886-1-git-send-email-victor.erminpour@oracle.com>
On Wed, Feb 09, 2022 at 04:30:27PM -0800, Victor Erminpour wrote:
> When building with automatic stack variable initialization, GCC 12
> complains about variables defined outside of switch case statements.
> Move variables outside the switch, which silences warnings:
>
> ./drivers/rtc/rtc-pcf8523.c:284:20: error: statement will never be executed [-Werror=switch-unreachable]
> 284 | u8 mode;
> |
>
> ./drivers/rtc/rtc-pcf8523.c:245:21: error: statement will never be executed [-Werror=switch-unreachable]
> 245 | u32 value;
> | ^~~~~
>
> Signed-off-by: Victor Erminpour <victor.erminpour@oracle.com>
Thanks for finding these! I haven't done any cross compiles with GCC 12
yet. :)
Reviewed-by: Kees Cook <keescook@chromium.org>
--
Kees Cook
next prev parent reply other threads:[~2022-02-10 23:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-10 0:30 [PATCH] rtc: pcf8523: Fix GCC 12 warning Victor Erminpour
2022-02-10 23:48 ` Kees Cook [this message]
2022-02-15 22:20 ` Alexandre Belloni
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=202202101548.D2CF8DAC@keescook \
--to=keescook@chromium.org \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=trivial@kernel.org \
--cc=victor.erminpour@oracle.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;
as well as URLs for NNTP newsgroup(s).