* [PATCH] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op()
@ 2025-01-11 19:08 Nathan Chancellor
2025-01-11 19:27 ` Miguel Ojeda
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Nathan Chancellor @ 2025-01-11 19:08 UTC (permalink / raw)
To: Raju Rangoju, Mark Brown, Miquel Raynal
Cc: linux-spi, llvm, patches, kernel test robot, Nathan Chancellor
After commit e6204f39fe3a ("spi: amd: Drop redundant check"), clang warns (or
errors with CONFIG_WERROR=y):
drivers/spi/spi-amd.c:695:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
695 | return ret;
| ^~~
drivers/spi/spi-amd.c:673:9: note: initialize the variable 'ret' to silence this warning
673 | int ret;
| ^
| = 0
1 error generated.
ret is no longer set on anything other than the default switch path.
Replace ret with a direct return of 0 at the end of the function and
-EOPNOTSUPP in the default case to resolve the warning.
Fixes: e6204f39fe3a ("spi: amd: Drop redundant check")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501112315.ugYQ7Ce7-lkp@intel.com/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
drivers/spi/spi-amd.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-amd.c b/drivers/spi/spi-amd.c
index fbe795bbcf507abcbbd973b226b5db0de1584898..c85997478b81903c97636d271baf7d378914c50a 100644
--- a/drivers/spi/spi-amd.c
+++ b/drivers/spi/spi-amd.c
@@ -670,7 +670,6 @@ static int amd_spi_exec_mem_op(struct spi_mem *mem,
const struct spi_mem_op *op)
{
struct amd_spi *amd_spi;
- int ret;
amd_spi = spi_controller_get_devdata(mem->spi->controller);
@@ -689,10 +688,10 @@ static int amd_spi_exec_mem_op(struct spi_mem *mem,
amd_spi_mem_data_out(amd_spi, op);
break;
default:
- ret = -EOPNOTSUPP;
+ return -EOPNOTSUPP;
}
- return ret;
+ return 0;
}
static const struct spi_controller_mem_ops amd_spi_mem_ops = {
---
base-commit: 226d6cb3cb799aae46d0dd19a521133997d9db11
change-id: 20250111-spi-amd-fix-uninitialized-ret-bcbc2e33af94
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op()
2025-01-11 19:08 [PATCH] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op() Nathan Chancellor
@ 2025-01-11 19:27 ` Miguel Ojeda
2025-01-13 10:42 ` Miquel Raynal
2025-01-13 16:45 ` Mark Brown
2 siblings, 0 replies; 7+ messages in thread
From: Miguel Ojeda @ 2025-01-11 19:27 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Raju Rangoju, Mark Brown, Miquel Raynal, linux-spi, llvm, patches,
kernel test robot
On Sat, Jan 11, 2025 at 8:09 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> After commit e6204f39fe3a ("spi: amd: Drop redundant check"), clang warns (or
> errors with CONFIG_WERROR=y):
Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
Cheers,
Miguel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op()
2025-01-11 19:08 [PATCH] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op() Nathan Chancellor
2025-01-11 19:27 ` Miguel Ojeda
@ 2025-01-13 10:42 ` Miquel Raynal
2025-01-13 16:45 ` Mark Brown
2 siblings, 0 replies; 7+ messages in thread
From: Miquel Raynal @ 2025-01-13 10:42 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Raju Rangoju, Mark Brown, linux-spi, llvm, patches,
kernel test robot
Hello,
On 11/01/2025 at 12:08:38 -07, Nathan Chancellor <nathan@kernel.org> wrote:
> After commit e6204f39fe3a ("spi: amd: Drop redundant check"), clang warns (or
> errors with CONFIG_WERROR=y):
>
> drivers/spi/spi-amd.c:695:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
> 695 | return ret;
> | ^~~
> drivers/spi/spi-amd.c:673:9: note: initialize the variable 'ret' to silence this warning
> 673 | int ret;
> | ^
> | = 0
> 1 error generated.
>
> ret is no longer set on anything other than the default switch path.
> Replace ret with a direct return of 0 at the end of the function and
> -EOPNOTSUPP in the default case to resolve the warning.
Correct, thanks.
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op()
2025-01-11 19:08 [PATCH] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op() Nathan Chancellor
2025-01-11 19:27 ` Miguel Ojeda
2025-01-13 10:42 ` Miquel Raynal
@ 2025-01-13 16:45 ` Mark Brown
2025-01-14 10:03 ` Miquel Raynal
2 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2025-01-13 16:45 UTC (permalink / raw)
To: Raju Rangoju, Miquel Raynal, Nathan Chancellor
Cc: linux-spi, llvm, patches, kernel test robot
On Sat, 11 Jan 2025 12:08:38 -0700, Nathan Chancellor wrote:
> After commit e6204f39fe3a ("spi: amd: Drop redundant check"), clang warns (or
> errors with CONFIG_WERROR=y):
>
> drivers/spi/spi-amd.c:695:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
> 695 | return ret;
> | ^~~
> drivers/spi/spi-amd.c:673:9: note: initialize the variable 'ret' to silence this warning
> 673 | int ret;
> | ^
> | = 0
> 1 error generated.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op()
commit: ea2680e9cc96b957927ea3ea36b2b4ecb5da3d03
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op()
2025-01-13 16:45 ` Mark Brown
@ 2025-01-14 10:03 ` Miquel Raynal
2025-01-14 15:17 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: Miquel Raynal @ 2025-01-14 10:03 UTC (permalink / raw)
To: Mark Brown
Cc: Raju Rangoju, Nathan Chancellor, linux-spi, llvm, patches,
kernel test robot
Hi Mark,
On 13/01/2025 at 16:45:09 GMT, Mark Brown <broonie@kernel.org> wrote:
> On Sat, 11 Jan 2025 12:08:38 -0700, Nathan Chancellor wrote:
>> After commit e6204f39fe3a ("spi: amd: Drop redundant check"), clang warns (or
>> errors with CONFIG_WERROR=y):
>>
>> drivers/spi/spi-amd.c:695:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
>> 695 | return ret;
>> | ^~~
>> drivers/spi/spi-amd.c:673:9: note: initialize the variable 'ret' to silence this warning
>> 673 | int ret;
>> | ^
>> | = 0
>> 1 error generated.
>>
>> [...]
>
> Applied to
>
> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
>
> Thanks!
I'm wondering whether it's relevant to pull the branch you shared
as-is. Do you plan on pushing this patch of top of it? Or shall I wait
-rc1 for the SPI NAND part?
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op()
2025-01-14 10:03 ` Miquel Raynal
@ 2025-01-14 15:17 ` Mark Brown
2025-01-15 18:30 ` Miquel Raynal
0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2025-01-14 15:17 UTC (permalink / raw)
To: Miquel Raynal
Cc: Raju Rangoju, Nathan Chancellor, linux-spi, llvm, patches,
kernel test robot
[-- Attachment #1: Type: text/plain, Size: 3645 bytes --]
On Tue, Jan 14, 2025 at 11:03:22AM +0100, Miquel Raynal wrote:
> On 13/01/2025 at 16:45:09 GMT, Mark Brown <broonie@kernel.org> wrote:
> > Applied to
> > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
> > Thanks!
> I'm wondering whether it's relevant to pull the branch you shared
> as-is. Do you plan on pushing this patch of top of it? Or shall I wait
> -rc1 for the SPI NAND part?
Well, it's not a branch but rather a tag which complicates matters a
bit. I could cherry pick the patch over and make a new tag I guess? Or
you could just not do allmodconfig builds with clang?
The following changes since commit 9d89551994a430b50c4fffcb1e617a057fa76e20:
Linux 6.13-rc6 (2025-01-05 14:13:40 -0800)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git tags/spi-mem-dtr-2
for you to fetch changes up to e896c04890aeff2292364c19632fc15d890d436c:
spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op() (2025-01-14 15:07:11 +0000)
----------------------------------------------------------------
spi: Support DTR in spi-mem
Changes to support DTR with spi-mem.
----------------------------------------------------------------
Miquel Raynal (20):
spi: spi-mem: Extend spi-mem operations with a per-operation maximum frequency
spi: spi-mem: Add a new controller capability
spi: amd: Support per spi-mem operation frequency switches
spi: amd: Drop redundant check
spi: amlogic-spifc-a1: Support per spi-mem operation frequency switches
spi: cadence-qspi: Support per spi-mem operation frequency switches
spi: dw: Support per spi-mem operation frequency switches
spi: fsl-qspi: Support per spi-mem operation frequency switches
spi: microchip-core-qspi: Support per spi-mem operation frequency switches
spi: mt65xx: Support per spi-mem operation frequency switches
spi: mxic: Support per spi-mem operation frequency switches
spi: nxp-fspi: Support per spi-mem operation frequency switches
spi: rockchip-sfc: Support per spi-mem operation frequency switches
spi: spi-sn-f-ospi: Support per spi-mem operation frequency switches
spi: spi-ti-qspi: Support per spi-mem operation frequency switches
spi: zynq-qspi: Support per spi-mem operation frequency switches
spi: zynqmp-gqspi: Support per spi-mem operation frequency switches
spi: spi-mem: Reorder spi-mem macro assignments
spi: spi-mem: Create macros for DTR operation
spi: spi-mem: Estimate the time taken by operations
Nathan Chancellor (1):
spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op()
drivers/mtd/nand/spi/core.c | 2 ++
drivers/spi/spi-amd.c | 26 +++++++-------
drivers/spi/spi-amlogic-spifc-a1.c | 7 +++-
drivers/spi/spi-cadence-quadspi.c | 3 +-
drivers/spi/spi-dw-core.c | 10 ++++--
drivers/spi/spi-fsl-qspi.c | 12 +++++--
drivers/spi/spi-mem.c | 64 +++++++++++++++++++++++++++++++++++
drivers/spi/spi-microchip-core-qspi.c | 26 +++++++++++---
drivers/spi/spi-mt65xx.c | 7 +++-
drivers/spi/spi-mxic.c | 3 +-
drivers/spi/spi-nxp-fspi.c | 12 +++++--
drivers/spi/spi-rockchip-sfc.c | 11 ++++--
drivers/spi/spi-sn-f-ospi.c | 8 +++--
drivers/spi/spi-ti-qspi.c | 7 +++-
drivers/spi/spi-zynq-qspi.c | 13 +++++--
drivers/spi/spi-zynqmp-gqspi.c | 13 ++++---
include/linux/spi/spi-mem.h | 56 +++++++++++++++++++++++++++++-
17 files changed, 237 insertions(+), 43 deletions(-)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op()
2025-01-14 15:17 ` Mark Brown
@ 2025-01-15 18:30 ` Miquel Raynal
0 siblings, 0 replies; 7+ messages in thread
From: Miquel Raynal @ 2025-01-15 18:30 UTC (permalink / raw)
To: Mark Brown
Cc: Raju Rangoju, Nathan Chancellor, linux-spi, llvm, patches,
kernel test robot
>> I'm wondering whether it's relevant to pull the branch you shared
>> as-is. Do you plan on pushing this patch of top of it? Or shall I wait
>> -rc1 for the SPI NAND part?
>
> Well, it's not a branch but rather a tag which complicates matters a
> bit. I could cherry pick the patch over and make a new tag I guess? Or
> you could just not do allmodconfig builds with clang?
I'm worried about the others, if Linus happens to pull my tree before
yours :) I don't specifically use clang :)
> for you to fetch changes up to e896c04890aeff2292364c19632fc15d890d436c:
>
> spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op() (2025-01-14
> 15:07:11 +0000)
Pulled into nand/next. Thanks a lot!
Miquèl
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-01-15 18:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-11 19:08 [PATCH] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op() Nathan Chancellor
2025-01-11 19:27 ` Miguel Ojeda
2025-01-13 10:42 ` Miquel Raynal
2025-01-13 16:45 ` Mark Brown
2025-01-14 10:03 ` Miquel Raynal
2025-01-14 15:17 ` Mark Brown
2025-01-15 18:30 ` Miquel Raynal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox