[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220209163029.2299009-1-trix@redhat.com>
Date: Wed, 9 Feb 2022 08:30:29 -0800
From: trix@...hat.com
To: lhjeff911@...il.com, broonie@...nel.org, nathan@...nel.org,
ndesaulniers@...gle.com
Cc: linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, Tom Rix <trix@...hat.com>
Subject: [PATCH] spi: initialize ret variable
From: Tom Rix <trix@...hat.com>
Clang build fails with
spi-sunplus-sp7021.c:405:2: error: variable 'ret' is used
uninitialized whenever switch default is taken
default:
^~~~~~~
Restore initializing ret.
Fixes: 47e8fe57a66f ("spi: Modify irq request position and modify parameters")
Signed-off-by: Tom Rix <trix@...hat.com>
---
drivers/spi/spi-sunplus-sp7021.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-sunplus-sp7021.c b/drivers/spi/spi-sunplus-sp7021.c
index ba5ed9f7277a3..fc61578ce5c47 100644
--- a/drivers/spi/spi-sunplus-sp7021.c
+++ b/drivers/spi/spi-sunplus-sp7021.c
@@ -375,7 +375,7 @@ static int sp7021_spi_slave_transfer_one(struct spi_controller *ctlr, struct spi
{
struct sp7021_spi_ctlr *pspim = spi_master_get_devdata(ctlr);
struct device *dev = pspim->dev;
- int mode, ret;
+ int mode, ret = 0;
mode = SP7021_SPI_IDLE;
if (xfer->tx_buf && xfer->rx_buf) {
--
2.26.3
Powered by blists - more mailing lists