[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4e16e1bf-e5fb-4771-bc92-c5cba9aac473@stanley.mountain>
Date: Fri, 14 Mar 2025 13:10:15 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Longbin Li <looong.bin@...il.com>
Cc: Mark Brown <broonie@...nel.org>, linux-spi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] spi: sg2044-nor: fix signedness bug in
sg2044_spifmc_write()
The "ret" variable needs to be signed for the error handling to work.
It should be type int, since it only holds zero and negative error
codes.
Fixes: de16c322eefb ("spi: sophgo: add SG2044 SPI NOR controller driver")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
drivers/spi/spi-sg2044-nor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-sg2044-nor.c b/drivers/spi/spi-sg2044-nor.c
index 454153a63b42..baa4cf677663 100644
--- a/drivers/spi/spi-sg2044-nor.c
+++ b/drivers/spi/spi-sg2044-nor.c
@@ -216,7 +216,7 @@ static ssize_t sg2044_spifmc_write(struct sg2044_spifmc *spifmc,
size_t xfer_size;
const u8 *dout = op->data.buf.out;
int i, offset;
- size_t ret;
+ int ret;
u32 reg;
reg = sg2044_spifmc_init_reg(spifmc);
--
2.47.2
Powered by blists - more mailing lists