mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][next] mmc: loongson2: Fix comparison of unsigned integer with less than zero
@ 2025-07-08 13:53 Colin Ian King
  2025-07-09  1:34 ` Binbin Zhou
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2025-07-08 13:53 UTC (permalink / raw)
  To: Binbin Zhou, Ulf Hansson, Huacai Chen, linux-mmc
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.i.king@intel.com>

Currently the u32 variable ret is being assigned the return value from
the call to regmap_read_poll_timeout and checking for a less than zero
error return and this check is always false. Fix this by making ret a
signed integer.

Fixes: d0f8e961deae ("mmc: loongson2: Add Loongson-2K2000 SD/SDIO/eMMC controller driver")
Signed-off-by: Colin Ian King <colin.i.king@intel.com>
---
 drivers/mmc/host/loongson2-mmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/loongson2-mmc.c b/drivers/mmc/host/loongson2-mmc.c
index 515ccf834f0a..ba6bb8fd5535 100644
--- a/drivers/mmc/host/loongson2-mmc.c
+++ b/drivers/mmc/host/loongson2-mmc.c
@@ -485,7 +485,8 @@ static irqreturn_t loongson2_mmc_irq(int irq, void *devid)
 
 static void loongson2_mmc_dll_mode_init(struct loongson2_mmc_host *host)
 {
-	u32 val, pad_delay, delay, ret;
+	u32 val, pad_delay, delay;
+	int ret;
 
 	regmap_update_bits(host->regmap, LOONGSON2_MMC_REG_SEL,
 			   LOONGSON2_MMC_SEL_DATA, LOONGSON2_MMC_SEL_DATA);
-- 
2.50.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-09  1:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-08 13:53 [PATCH][next] mmc: loongson2: Fix comparison of unsigned integer with less than zero Colin Ian King
2025-07-09  1:34 ` Binbin Zhou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®