Skip to content

Commit 2d442a0

Browse files
ColinIanKingbroonie
authored andcommitted
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: cef9991 ("spi: Add Amlogic SPISG driver") Signed-off-by: Colin Ian King <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 87aa3c8 commit 2d442a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-amlogic-spisg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ struct spisg_device {
163163

164164
static int spi_delay_to_sclk(u32 slck_speed_hz, struct spi_delay *delay)
165165
{
166-
u32 ns;
166+
s32 ns;
167167

168168
if (!delay)
169169
return 0;

0 commit comments

Comments
 (0)