* [patch] pinctrl: remove an unnecessary cast
@ 2013-09-17 10:47 Dan Carpenter
2013-09-23 8:47 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-09-17 10:47 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-kernel, kernel-janitors
sizeof() is already size_t so there is no need to cast here. Generally,
casting inside the min() macro instead of using min_t() is considered
bad style.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c
index a138965..abe66d4 100644
--- a/drivers/pinctrl/pinconf.c
+++ b/drivers/pinctrl/pinconf.c
@@ -508,7 +508,7 @@ static int pinconf_dbg_config_write(struct file *file,
int i;
/* Get userspace string and assure termination */
- buf_size = min(count, (size_t)(sizeof(buf)-1));
+ buf_size = min(count, sizeof(buf) - 1);
if (copy_from_user(buf, user_buf, buf_size))
return -EFAULT;
buf[buf_size] = 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-23 8:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-17 10:47 [patch] pinctrl: remove an unnecessary cast Dan Carpenter
2013-09-23 8:47 ` Linus Walleij
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®