Devicetree
 help / color / mirror / Atom feed
From: Xianwei Zhao <xianwei.zhao@amlogic.com>
To: Mark Brown <broonie@kernel.org>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Liang Yang <liang.yang@amlogic.com>,
	Feng Chen <feng.chen@amlogic.com>,
	linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org
Subject: Re: [PATCH v4 2/3] spi: amlogic: add driver for Amlogic SPI Flash Controller
Date: Tue, 9 Sep 2025 13:15:17 +0800	[thread overview]
Message-ID: <faae99c8-5671-4a80-b977-f0f2c9daa38d@amlogic.com> (raw)
In-Reply-To: <e010ff93-574a-45d9-a5dc-0942b3fc90f2@sirena.org.uk>

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@kernel.org>
> Date:
> 2025/9/9 00:55
> 
> To:
> Xianwei Zhao <xianwei.zhao@amlogic.com>
> CC:
> Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>, 
> Conor Dooley <conor+dt@kernel.org>, Liang Yang <liang.yang@amlogic.com>, 
> Feng Chen <feng.chen@amlogic.com>, linux-spi@vger.kernel.org, 
> devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, 
> linux-amlogic@lists.infradead.org
> 
> 
> 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.

I will fix it.

  reply	other threads:[~2025-09-09  5:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29  5:16 [PATCH v4 0/3] support for Amlogic SPI Flash Controller IP Xianwei Zhao via B4 Relay
2025-08-29  5:16 ` [PATCH v4 1/3] spi: dt-bindings: add Amlogic A113L2 SFC Xianwei Zhao via B4 Relay
2025-08-29 15:16   ` Conor Dooley
2025-08-29  5:16 ` [PATCH v4 2/3] spi: amlogic: add driver for Amlogic SPI Flash Controller Xianwei Zhao via B4 Relay
2025-09-08 16:55   ` Mark Brown
2025-09-09  5:15     ` Xianwei Zhao [this message]
2025-08-29  5:16 ` [PATCH v4 3/3] MAINTAINERS: Add an entry for Amlogic spifc driver Xianwei Zhao via B4 Relay
2025-09-12  1:11 ` [PATCH v4 0/3] support for Amlogic SPI Flash Controller IP Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=faae99c8-5671-4a80-b977-f0f2c9daa38d@amlogic.com \
    --to=xianwei.zhao@amlogic.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=feng.chen@amlogic.com \
    --cc=krzk+dt@kernel.org \
    --cc=liang.yang@amlogic.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox