Thread (8 messages) 8 messages, 4 authors, 2025-09-12

Re: [PATCH v4 2/3] spi: amlogic: add driver for Amlogic SPI Flash Controller

From: Mark Brown <broonie@kernel.org>
Date: 2025-09-08 16:55:21
Also in: linux-amlogic, linux-spi, lkml

On Fri, Aug 29, 2025 at 01:16:14PM +0800, Xianwei Zhao wrote:
From: Feng Chen <feng.chen@amlogic.com>

This driver provides support for the SPI mode of the Amlogic
Flash Controller. It supports both SPI NOR flash and SPI NAND
flash. For SPI NAND, the Host ECC hardware engine can be enabled.
This breaks an x86 allmodconfig build with clang-19 for me:

/build/stage/linux/drivers/spi/spi-amlogic-spifc-a4.c:592:7: error: variable 'is
_datain' is used uninitialized whenever 'if' condition is false [-Werror,-Wsomet
imes-uninitialized]
  592 |                 if (!buf) {
      |                     ^~~~
/build/stage/linux/drivers/spi/spi-amlogic-spifc-a4.c:601:12: note: uninitialize
d use occurs here
  601 |                                        is_datain ? sfc->info_buf : NULL,
      |                                        ^~~~~~~~~
/build/stage/linux/drivers/spi/spi-amlogic-spifc-a4.c:592:3: note: remove the 'i
f' if its condition is always true
  592 |                 if (!buf) {
      |                 ^~~~~~~~~
/build/stage/linux/drivers/spi/spi-amlogic-spifc-a4.c:590:13: error: variable 'is_datain' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
  590 |         } else if (op->data.dir == SPI_MEM_DATA_OUT) {
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/stage/linux/drivers/spi/spi-amlogic-spifc-a4.c:601:12: note: uninitialized use occurs here
  601 |                                        is_datain ? sfc->info_buf : NULL,
      |                                        ^~~~~~~~~
/build/stage/linux/drivers/spi/spi-amlogic-spifc-a4.c:590:9: note: remove the 'if' if its condition is always true
  590 |         } else if (op->data.dir == SPI_MEM_DATA_OUT) {
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/stage/linux/drivers/spi/spi-amlogic-spifc-a4.c:568:16: note: initialize the variable 'is_datain' to silence this warning
  568 |         bool is_datain;
      |                       ^
      |                        = 0
/build/stage/linux/drivers/spi/spi-amlogic-spifc-a4.c:590:13: error: variable 'buf' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
  590 |         } else if (op->data.dir == SPI_MEM_DATA_OUT) {
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/stage/linux/drivers/spi/spi-amlogic-spifc-a4.c:600:38: note: uninitialized use occurs here
  600 |         ret = aml_sfc_dma_buffer_setup(sfc, buf, op->data.nbytes,
      |                                             ^~~
/build/stage/linux/drivers/spi/spi-amlogic-spifc-a4.c:590:9: note: remove the 'if' if its condition is always true
  590 |         } else if (op->data.dir == SPI_MEM_DATA_OUT) {
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/stage/linux/drivers/spi/spi-amlogic-spifc-a4.c:566:11: note: initialize the variable 'buf' to silence this warning
  566 |         void *buf;
      |                  ^
      |                   = NULL
3 errors generated.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help