2020-01-15 02:24:42

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build warning after merge of the spi tree

Hi all,

After merging the spi tree, today's linux-next build (x86_64 allmodconfig)
produced this warning:

drivers/spi/spi-ti-qspi.c: In function 'ti_qspi_start_transfer_one':
drivers/spi/spi-ti-qspi.c:392:8: warning: 'rx_wlen' may be used uninitialized in this function [-Wmaybe-uninitialized]
392 | if (rx_wlen >= 32)
| ^
drivers/spi/spi-ti-qspi.c:318:12: note: 'rx_wlen' was declared here
318 | u8 rxlen, rx_wlen;
| ^~~~~~~

Introduced by commit

e7cc5cfbea4c ("spi: spi-ti-qspi: optimize byte-transfers")

Looks like it may be a false positive.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2020-01-15 09:11:31

by Jean Pihet

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the spi tree

Hi Stephen,

I did not have this warning, it may be a combination of compiler
version and build flags. Do you need a fixup patch for it?

Thanks,
Jean

On Wed, Jan 15, 2020 at 3:23 AM Stephen Rothwell <[email protected]> wrote:
>
> Hi all,
>
> After merging the spi tree, today's linux-next build (x86_64 allmodconfig)
> produced this warning:
>
> drivers/spi/spi-ti-qspi.c: In function 'ti_qspi_start_transfer_one':
> drivers/spi/spi-ti-qspi.c:392:8: warning: 'rx_wlen' may be used uninitialized in this function [-Wmaybe-uninitialized]
> 392 | if (rx_wlen >= 32)
> | ^
> drivers/spi/spi-ti-qspi.c:318:12: note: 'rx_wlen' was declared here
> 318 | u8 rxlen, rx_wlen;
> | ^~~~~~~
>
> Introduced by commit
>
> e7cc5cfbea4c ("spi: spi-ti-qspi: optimize byte-transfers")
>
> Looks like it may be a false positive.
>
> --
> Cheers,
> Stephen Rothwell

2020-01-15 10:29:12

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the spi tree

Hi Jean,

On Wed, 15 Jan 2020 10:10:09 +0100 Jean Pihet <[email protected]> wrote:
>
> I did not have this warning, it may be a combination of compiler
> version and build flags. Do you need a fixup patch for it?

That is up to Mark, really. Unfortunately, Linus will probably get
this warning during the merge window which he will complain about.

It is really weird, as there are three other references to rx_wlen
immediately before the one complained about ... so maybe this is a bug
in the compiler I am using (gcc 9.2.1 from Debian, cross compiler
ppc64le hosted).

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2020-01-15 11:40:21

by Jean Pihet

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the spi tree

Stephen,

On Wed, Jan 15, 2020 at 11:28 AM Stephen Rothwell <[email protected]> wrote:
>
> Hi Jean,
>
> On Wed, 15 Jan 2020 10:10:09 +0100 Jean Pihet <[email protected]> wrote:
> >
> > I did not have this warning, it may be a combination of compiler
> > version and build flags. Do you need a fixup patch for it?
>
> That is up to Mark, really. Unfortunately, Linus will probably get
> this warning during the merge window which he will complain about.

Ok I just sent a fixup patch to Mark (on spi ML). Could it still reach 5.6?

>
> It is really weird, as there are three other references to rx_wlen
> immediately before the one complained about ... so maybe this is a bug
> in the compiler I am using (gcc 9.2.1 from Debian, cross compiler
> ppc64le hosted).
Yes indeed it is weird. Only some compiler versions are throwing the warning.

Thanks,
Jean

>
> --
> Cheers,
> Stephen Rothwell