net/ipv4: replace simple_strtoul with kstrtoul

Replace simple_strtoul with kstrtoul in three similar occurrences, all setup
handlers:
* route.c: set_rhash_entries
* tcp.c: set_thash_entries
* udp.c: set_uhash_entries

Also check if the conversion failed.

Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eldad Zack
2012-05-19 14:13:18 +00:00
committed by David S. Miller
parent b37f4d7b01
commit 413c27d869
3 changed files with 21 additions and 3 deletions

View File

@@ -3408,9 +3408,15 @@ struct ip_rt_acct __percpu *ip_rt_acct __read_mostly;
static __initdata unsigned long rhash_entries;
static int __init set_rhash_entries(char *str)
{
ssize_t ret;
if (!str)
return 0;
rhash_entries = simple_strtoul(str, &str, 0);
ret = kstrtoul(str, 0, &rhash_entries);
if (ret)
return 0;
return 1;
}
__setup("rhash_entries=", set_rhash_entries);