From: Jonathan Cameron <jic23@kernel.org>
To: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: Julia Lawall <julia.lawall@inria.fr>, Su Hui <suhui@nfschina.com>,
jagathjog1996@gmail.com, lars@metafoo.de, nathan@kernel.org,
ndesaulniers@google.com, morbo@google.com,
justinstitt@google.com, benato.denis96@gmail.com,
Jonathan.Cameron@huawei.com, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] iio: bmi323: mark bmi323_ext_reg_savestate as maybe unused
Date: Sat, 12 Oct 2024 11:51:21 +0100 [thread overview]
Message-ID: <20241012115121.037be954@jic23-huawei> (raw)
In-Reply-To: <e210f9c6-9070-4b6d-b938-9a35b7a16380@gmail.com>
On Sat, 12 Oct 2024 12:08:39 +0200
Javier Carrasco <javier.carrasco.cruz@gmail.com> wrote:
> On 12/10/2024 11:11, Julia Lawall wrote:
> >
> >
> > On Sat, 12 Oct 2024, Su Hui wrote:
> >
> >> When running 'make CC=clang drivers/iio/imu/bmi323/bmi323_core.o', there
> >> is a clang warning as follows:
> >>
> >> drivers/iio/imu/bmi323/bmi323_core.c:133:27: error:
> >> variable 'bmi323_ext_reg_savestate' is not needed and will not be emitted
> >> [-Werror,-Wunneeded-internal-declaration]
> >> 133 | static const unsigned int bmi323_ext_reg_savestate[] = {
> >> | ^~~~~~~~~~~~~~~~~~~~~~~~
> >> 1 error generated.
> >>
> >> Mark bmi323_ext_reg_savestate as __maybe_unused to silent this warning.
> >
> > Why might it be unused?
> >
> > julia
> >
> >>
> >> Fixes: 16531118ba63 ("iio: bmi323: peripheral in lowest power state on suspend")
> >> Signed-off-by: Su Hui <suhui@nfschina.com>
> >> ---
> >> drivers/iio/imu/bmi323/bmi323_core.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/iio/imu/bmi323/bmi323_core.c b/drivers/iio/imu/bmi323/bmi323_core.c
> >> index beda8d2de53f..1167984809c5 100644
> >> --- a/drivers/iio/imu/bmi323/bmi323_core.c
> >> +++ b/drivers/iio/imu/bmi323/bmi323_core.c
> >> @@ -130,7 +130,7 @@ static const unsigned int bmi323_reg_savestate[] = {
> >> BMI323_FIFO_CONF_REG
> >> };
> >>
> >> -static const unsigned int bmi323_ext_reg_savestate[] = {
> >> +static const unsigned int bmi323_ext_reg_savestate[] __maybe_unused = {
> >> BMI323_GEN_SET1_REG,
> >> BMI323_TAP1_REG,
> >> BMI323_TAP2_REG,
> >> --
> >> 2.30.2
> >>
> >>
> >>
> >
>
> This issue has already been found and discussed here:
>
> https://lore.kernel.org/linux-iio/AS8PR02MB10217F8B5827B69E6438488679C762@AS8PR02MB10217.eurprd02.prod.outlook.com/
>
> where I got lectured by Nathan Chancellor about such warnings.
>
> The fix was not marking the array as unused, because it should have been
> used. The proper fix can be found in iio/fixes-togreg.
>
> Best regards,
> Javier Carrasco
Busy week so I haven't gotten a pull request out yet. Should send one with this
fix later this weekend.
Jonathan
next prev parent reply other threads:[~2024-10-12 10:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-12 8:37 Su Hui
2024-10-12 9:11 ` Julia Lawall
2024-10-12 10:08 ` Javier Carrasco
2024-10-12 10:26 ` Su Hui
2024-10-12 10:51 ` Jonathan Cameron [this message]
2024-10-12 10:21 ` Su Hui
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=20241012115121.037be954@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=benato.denis96@gmail.com \
--cc=jagathjog1996@gmail.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=julia.lawall@inria.fr \
--cc=justinstitt@google.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=suhui@nfschina.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®