Unverified Commit 2d442a0c authored by Colin Ian King's avatar Colin Ian King Committed by Mark Brown
Browse files

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: cef9991e ("spi: Add Amlogic SPISG driver")
Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20250725171701.839927-1-colin.i.king@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 87aa3c8d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;