Thread (13 messages) flat view 13 messages, 5 authors, 2011-11-09

Re: [PATCH 2/5] net/sunrpc: use kstrtoul, etc

From: Alexey Dobriyan <hidden>
Date: 2011-11-08 19:38:26
Also in: kernel-janitors, linux-nfs, lkml

On Sun, Nov 06, 2011 at 02:26:47PM +0100, Julia Lawall wrote:
@@
expression a,b;
{int,long} *c;
@@

-strict_strtoul
+kstrtoul
No, no, no!

In every case see the type or real data and use appropriate function.
kstrtou8() for ports.
This program creates lots of bogus patches in this case.
quoted hunk ↗ jump to hunk
--- a/net/sunrpc/addr.c
+++ b/net/sunrpc/addr.c
@@ -322,7 +322,7 @@ size_t rpc_uaddr2sockaddr(const char *ua
 	c = strrchr(buf, '.');
 	if (unlikely(c == NULL))
 		return 0;
-	if (unlikely(strict_strtoul(c + 1, 10, &portlo) != 0))
+	if (unlikely(kstrtoul(c + 1, 10, &portlo) != 0))
 		return 0;
 	if (unlikely(portlo > 255))
 		return 0;
@@ -331,7 +331,7 @@ size_t rpc_uaddr2sockaddr(const char *ua
 	c = strrchr(buf, '.');
 	if (unlikely(c == NULL))
 		return 0;
-	if (unlikely(strict_strtoul(c + 1, 10, &porthi) != 0))
+	if (unlikely(kstrtoul(c + 1, 10, &porthi) != 0))
 		return 0;
 	if (unlikely(porthi > 255))
 		return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help