From e96bb5ab8b5c7e1dcda4ffeffc64d6b120579baf Mon Sep 17 00:00:00 2001
From: "Ping.Li" <Ping.Li@rfi.com.au>
Date: Wed, 26 Apr 2023 13:52:53 +0930
Subject: [PATCH] Fix comparison of signed and unsigned integers in adgs1408.c
Signed-off-by: Ping.Li <Ping.Li@rfi.com.au>
---
drivers/mux/adgs1408.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
@@ -89,7 +89,9 @@ static int adgs1408_probe(struct spi_device *spi)
case MUX_IDLE_AS_IS:
case 0 ... 7:
/* adgs1409 supports only 4 states */
- if (idle_state < mux->states) {
+ /* the idle_state will be implicitly converted to an unsigned int in
+ the comparison, which will fail the comparison if without (int) */
+ if (idle_state < (int)mux->states) {
mux->idle_state = idle_state;
break;
}
--
2.25.1