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

Xianwei Zhao xianwei.zhao at amlogic.com
Mon Sep 8 22:15:17 PDT 2025


Hi Mark,
    Thanks.

On 2025/9/9 00:55, Mark Brown wrote:
> Subject:
> Re: [PATCH v4 2/3] spi: amlogic: add driver for Amlogic SPI Flash Controller
> From:
> Mark Brown <broonie at kernel.org>
> Date:
> 2025/9/9 00:55
> 
> To:
> Xianwei Zhao <xianwei.zhao at amlogic.com>
> CC:
> Rob Herring <robh at kernel.org>, Krzysztof Kozlowski <krzk+dt at kernel.org>, 
> Conor Dooley <conor+dt at kernel.org>, Liang Yang <liang.yang at amlogic.com>, 
> Feng Chen <feng.chen at amlogic.com>, linux-spi at vger.kernel.org, 
> devicetree at vger.kernel.org, linux-kernel at vger.kernel.org, 
> linux-amlogic at lists.infradead.org
> 
> 
> On Fri, Aug 29, 2025 at 01:16:14PM +0800, Xianwei Zhao wrote:
>> From: Feng Chen<feng.chen at 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.

I will fix it.



More information about the linux-amlogic mailing list