Skip to contentSkip to conversation

linux-next: build warning after merge of the spi tree

DISCUSSION Stephen Rothwell 2 participants 2 messages Nov 14, 2018 – Nov 15, 2018 1 message not in the archive Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi Mark,

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

drivers/spi/spi-npcm-pspi.c: In function 'npcm_pspi_recv':
drivers/spi/spi-npcm-pspi.c:226:17: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
*priv->rx_buf = val;
~~~~~~~~~~~~~~^~~~~

Introduced by commit

2a22f1b30cee ("spi: npcm: add NPCM PSPI controller driver")

Signature · 2 lines
Cheers,
Stephen Rothwell

A message that is not in the archive (sent off-list or not yet received): CAP6Zq1gp+hmNkvk8D2uv8FUqTXE4+ZMPhMB7A7vLMaM6swHy4g@mail.gmail.com

maintainer
#2 lore raw
Quoted 6 lines · Tomer Maimon

Hi Mark and Stephen,

I saw the warning from the kbuilt, in this matter the ioread() function will call every time (and the val parameter will used) because rsize can be 1 or 2.

Quoted 7 lines

rsize = min(bytes_per_word(priv->bits_per_word), priv->rx_bytes); bytes_per_word(priv->bits_per_word)function return 1 or 2. npcm_pspi_recv()function will called only if parameter priv->rx_bytes is not 0.

please let me know if you think that I still need to modify the npcm_pspi_recv to fix kbuilt warning.

Please, it's going to create noise for people working on the kernel if they get a spurious warning.