From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
To: David Binderman <dcb314@hotmail.com>,
"jagathjog1996@gmail.com" <jagathjog1996@gmail.com>,
"jic23@kernel.org" <jic23@kernel.org>,
"lars@metafoo.de" <lars@metafoo.de>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: linux-6.12-rc1/drivers/iio/imu/bmi323/bmi323_core.c:133: Array contents defined but not used ?
Date: Mon, 30 Sep 2024 15:58:06 +0200 [thread overview]
Message-ID: <7e9ae281-448c-429b-9ca5-86581f777f68@gmail.com> (raw)
In-Reply-To: <AS8PR02MB10217F8B5827B69E6438488679C762@AS8PR02MB10217.eurprd02.prod.outlook.com>
On 30/09/2024 15:49, David Binderman wrote:
> Hello there,
>
> I just tried to build linux-6.12-rc1 with clang. It said:
>
> drivers/iio/imu/bmi323/bmi323_core.c:133:27: warning: variable 'bmi323_ext_reg_savestate' is not needed and will not be emitted [-Wunneeded-internal-declaration]
>
> A grep for the identifier shows the following strange results::
>
> inux-6.12-rc1 $ grep bmi323_ext_reg_savestate drivers/iio/imu/bmi323/bmi323_core.c
> static const unsigned int bmi323_ext_reg_savestate[] = {
> unsigned int ext_reg_settings[ARRAY_SIZE(bmi323_ext_reg_savestate)];
> for (unsigned int i = 0; i < ARRAY_SIZE(bmi323_ext_reg_savestate); i++) {
> for (unsigned int i = 0; i < ARRAY_SIZE(bmi323_ext_reg_savestate); i++) {
> linux-6.12-rc1 $
>
> I see no mention of bmi323_ext_reg_savestate[ i]. Is there a possible
> cut'n'paste error in one of the two for loops ?
>
> Regards
>
> David Binderman
I think that is a bug in clang:
https://bugs.llvm.org/show_bug.cgi?id=33068
That happens because clang sees that bmi323_ext_reg_savestate is not
used but to gets its size, and that means for it that the variable is
not needed. That does not happen for example with
bmi323_ext_reg_savestate (right above bmi323_ext_reg_savestate) because
that one is used beyond ARRAY_SIZE.
Safe to ignore?
Best regards,
Javier Carrasco
next prev parent reply other threads:[~2024-09-30 13:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 13:49 David Binderman
2024-09-30 13:58 ` Javier Carrasco [this message]
2024-09-30 14:04 ` Javier Carrasco
2024-09-30 15:15 ` Nathan Chancellor
2024-09-30 16:50 ` Javier Carrasco
2024-09-30 20:26 ` Nathan Chancellor
2024-09-30 20:46 ` Javier Carrasco
2024-09-30 14:19 ` Lars-Peter Clausen
2024-09-30 14:47 ` Jonathan Cameron
2024-09-30 14:47 ` Denis Benato
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=7e9ae281-448c-429b-9ca5-86581f777f68@gmail.com \
--to=javier.carrasco.cruz@gmail.com \
--cc=dcb314@hotmail.com \
--cc=jagathjog1996@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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®