Skip to content

Commit 3c9403f

Browse files
qasim-ijazbroonie
authored andcommitted
spi: sophgo: fix incorrect type for ret in sg2044_spifmc_write()
The sg2044_spifmc_write() function uses 'ret' of unsigned type size_t to capture return values from sg2044_spifmc_wait_xfer_size() and sg2044_spifmc_wait_int(). Since these functions may return negative error codes, using an unsigned type prevents proper error detection, as size_t cannot represent negative values. Change 'ret' to type int so that negative values are handled correctly. Fixes: de16c32 ("spi: sophgo: add SG2044 SPI NOR controller driver") Signed-off-by: Qasim Ijaz <qasdev00@gmail.com> Link: https://patch.msgid.link/20250313214545.7444-1-qasdev00@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 336a41c commit 3c9403f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-sg2044-nor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static ssize_t sg2044_spifmc_write(struct sg2044_spifmc *spifmc,
216216
size_t xfer_size;
217217
const u8 *dout = op->data.buf.out;
218218
int i, offset;
219-
size_t ret;
219+
int ret;
220220
u32 reg;
221221

222222
reg = sg2044_spifmc_init_reg(spifmc);

0 commit comments

Comments
 (0)