]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
spi: SPISG: Fix less than zero comparison on a u32 variable
authorColin Ian King <colin.i.king@gmail.com>
Fri, 25 Jul 2025 17:17:01 +0000 (18:17 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 25 Jul 2025 17:46:31 +0000 (18:46 +0100)
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 <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20250725171701.839927-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-amlogic-spisg.c

index 48a5325b4db7bd012babb8cd5e2728ebb31f30e8..2ab8bdf2a6761e90852355540f20c48423ad851c 100644 (file)
@@ -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;