Skip to contentSkip to conversation

pinctrl: pinconf: fix comparison of different types

PATCH In review Jingoo Han 2 participants 2 messages Aug 6, 2013 – Aug 7, 2013 Pin control

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/3 pinctrl: pinconf: fix comparison of different types

Fix the following sparse warning:

drivers/pinctrl/pinconf.c:521:20: error: incompatible types in comparison expression (different type sizes)

---
 drivers/pinctrl/pinconf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinconf.c +1 -1
index e875f21..1516fb0 100644
@@ -518,7 +518,7 @@ static int pinconf_dbg_config_write(struct file *file,
 	int i;
 
 	/* Get userspace string and assure termination */
-	buf_size = min(count, (sizeof(buf)-1));
+	buf_size = min(count, (size_t)(sizeof(buf)-1));
 	if (copy_from_user(buf, user_buf, buf_size))
 		return -EFAULT;
 	buf[buf_size] = 0;
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 5 lines · Jingoo Han

Fix the following sparse warning:

drivers/pinctrl/pinconf.c:521:20: error: incompatible types in comparison expression (different type sizes)

Patch applied, thanks!

Yours,
Linus Walleij