From: Colin Ian King Date: Fri, 25 Jul 2025 17:17:01 +0000 (+0100) Subject: spi: SPISG: Fix less than zero comparison on a u32 variable X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d442a0c781403702de27ccfbc4bb233721585f5;p=thirdparty%2Flinux.git spi: SPISG: Fix less than zero comparison on a u32 variable The check for ns < 0 is always false because variable ns is a u32 which is not a signed type. Fix this by making ns a s32 type. Fixes: cef9991e04ae ("spi: Add Amlogic SPISG driver") Signed-off-by: Colin Ian King Link: https://patch.msgid.link/20250725171701.839927-1-colin.i.king@gmail.com Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-amlogic-spisg.c b/drivers/spi/spi-amlogic-spisg.c index 48a5325b4db7b..2ab8bdf2a6761 100644 --- a/drivers/spi/spi-amlogic-spisg.c +++ b/drivers/spi/spi-amlogic-spisg.c @@ -163,7 +163,7 @@ struct spisg_device { static int spi_delay_to_sclk(u32 slck_speed_hz, struct spi_delay *delay) { - u32 ns; + s32 ns; if (!delay) return 0;