pinctrl: pinconf: fix comparison of different types
authorJingoo Han <jg1.han@samsung.com>
Tue, 6 Aug 2013 09:10:20 +0000 (18:10 +0900)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 7 Aug 2013 20:30:32 +0000 (22:30 +0200)
Fix the following sparse warning:

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

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinconf.c

index d16ef8797f590b9fd5bfacf697a68766c65d0266..8da2d6db228c07dc17fd0f83b17f50238b2e7ef2 100644 (file)
@@ -512,7 +512,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;