linux-next: build warning after merge of the spi tree
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
Mark Brown
maintainerQuoted 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 parameterpriv->rx_bytesis not 0.please let me know if you think that I still need to modify the
npcm_pspi_recvto fix kbuilt warning.
Please, it's going to create noise for people working on the kernel if they get a spurious warning.