diff options
author | Abhijit Pawar <abhi.c.pawar@gmail.com> | 2012-12-09 18:12:28 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-10 14:09:00 -0500 |
commit | 4b5511ebc7e1cf94e4f13be19c2cf3e90edc3395 (patch) | |
tree | e6882f930d0952aa08162fba55b166a87cebf410 | |
parent | 008d4278072216bd2459a6e41b07b688fe95ee83 (diff) |
net: remove obsolete simple_strto<foo>
This patch replace the obsolete simple_strto<foo> with kstrto<foo>
Signed-off-by: Abhijit Pawar <abhi.c.pawar@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/netpoll.c | 5 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_CLUSTERIP.c | 9 | ||||
-rw-r--r-- | net/mac80211/debugfs_sta.c | 3 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 5 |
4 files changed, 18 insertions, 4 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 77a0388fc3be..12c129f726f9 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -674,7 +674,8 @@ int netpoll_parse_options(struct netpoll *np, char *opt) | |||
674 | if ((delim = strchr(cur, '@')) == NULL) | 674 | if ((delim = strchr(cur, '@')) == NULL) |
675 | goto parse_failed; | 675 | goto parse_failed; |
676 | *delim = 0; | 676 | *delim = 0; |
677 | np->local_port = simple_strtol(cur, NULL, 10); | 677 | if (kstrtou16(cur, 10, &np->local_port)) |
678 | goto parse_failed; | ||
678 | cur = delim; | 679 | cur = delim; |
679 | } | 680 | } |
680 | cur++; | 681 | cur++; |
@@ -706,6 +707,8 @@ int netpoll_parse_options(struct netpoll *np, char *opt) | |||
706 | if (*cur == ' ' || *cur == '\t') | 707 | if (*cur == ' ' || *cur == '\t') |
707 | np_info(np, "warning: whitespace is not allowed\n"); | 708 | np_info(np, "warning: whitespace is not allowed\n"); |
708 | np->remote_port = simple_strtol(cur, NULL, 10); | 709 | np->remote_port = simple_strtol(cur, NULL, 10); |
710 | if (kstrtou16(cur, 10, &np->remote_port)) | ||
711 | goto parse_failed; | ||
709 | cur = delim; | 712 | cur = delim; |
710 | } | 713 | } |
711 | cur++; | 714 | cur++; |
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index fe5daea5214d..75e33a7048f8 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
@@ -661,6 +661,7 @@ static ssize_t clusterip_proc_write(struct file *file, const char __user *input, | |||
661 | #define PROC_WRITELEN 10 | 661 | #define PROC_WRITELEN 10 |
662 | char buffer[PROC_WRITELEN+1]; | 662 | char buffer[PROC_WRITELEN+1]; |
663 | unsigned long nodenum; | 663 | unsigned long nodenum; |
664 | int rc; | ||
664 | 665 | ||
665 | if (size > PROC_WRITELEN) | 666 | if (size > PROC_WRITELEN) |
666 | return -EIO; | 667 | return -EIO; |
@@ -669,11 +670,15 @@ static ssize_t clusterip_proc_write(struct file *file, const char __user *input, | |||
669 | buffer[size] = 0; | 670 | buffer[size] = 0; |
670 | 671 | ||
671 | if (*buffer == '+') { | 672 | if (*buffer == '+') { |
672 | nodenum = simple_strtoul(buffer+1, NULL, 10); | 673 | rc = kstrtoul(buffer+1, 10, &nodenum); |
674 | if (rc) | ||
675 | return rc; | ||
673 | if (clusterip_add_node(c, nodenum)) | 676 | if (clusterip_add_node(c, nodenum)) |
674 | return -ENOMEM; | 677 | return -ENOMEM; |
675 | } else if (*buffer == '-') { | 678 | } else if (*buffer == '-') { |
676 | nodenum = simple_strtoul(buffer+1, NULL,10); | 679 | rc = kstrtoul(buffer+1, 10, &nodenum); |
680 | if (rc) | ||
681 | return rc; | ||
677 | if (clusterip_del_node(c, nodenum)) | 682 | if (clusterip_del_node(c, nodenum)) |
678 | return -ENOENT; | 683 | return -ENOENT; |
679 | } else | 684 | } else |
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index 49a1c70bbd70..0dedb4bd9623 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c | |||
@@ -221,6 +221,9 @@ static ssize_t sta_agg_status_write(struct file *file, const char __user *userbu | |||
221 | return -EINVAL; | 221 | return -EINVAL; |
222 | 222 | ||
223 | tid = simple_strtoul(buf, NULL, 0); | 223 | tid = simple_strtoul(buf, NULL, 0); |
224 | ret = kstrtoul(buf, 0, &tid); | ||
225 | if (ret) | ||
226 | return ret; | ||
224 | 227 | ||
225 | if (tid >= IEEE80211_NUM_TIDS) | 228 | if (tid >= IEEE80211_NUM_TIDS) |
226 | return -EINVAL; | 229 | return -EINVAL; |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index af175166fffa..37d9e628106d 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -1409,7 +1409,7 @@ EXPORT_SYMBOL_GPL(nf_ct_alloc_hashtable); | |||
1409 | 1409 | ||
1410 | int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp) | 1410 | int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp) |
1411 | { | 1411 | { |
1412 | int i, bucket; | 1412 | int i, bucket, rc; |
1413 | unsigned int hashsize, old_size; | 1413 | unsigned int hashsize, old_size; |
1414 | struct hlist_nulls_head *hash, *old_hash; | 1414 | struct hlist_nulls_head *hash, *old_hash; |
1415 | struct nf_conntrack_tuple_hash *h; | 1415 | struct nf_conntrack_tuple_hash *h; |
@@ -1423,6 +1423,9 @@ int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp) | |||
1423 | return param_set_uint(val, kp); | 1423 | return param_set_uint(val, kp); |
1424 | 1424 | ||
1425 | hashsize = simple_strtoul(val, NULL, 0); | 1425 | hashsize = simple_strtoul(val, NULL, 0); |
1426 | rc = kstrtouint(val, 0, &hashsize); | ||
1427 | if (rc) | ||
1428 | return rc; | ||
1426 | if (!hashsize) | 1429 | if (!hashsize) |
1427 | return -EINVAL; | 1430 | return -EINVAL; |
1428 | 1431 | ||