net/core: simple_strtoul cleanup
authorShuah Khan <shuahkhan@gmail.com>
Thu, 12 Apr 2012 09:28:13 +0000 (09:28 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Apr 2012 20:09:08 +0000 (16:09 -0400)
Changed net/core/net-sysfs.c: netdev_store() to use kstrtoul()
instead of obsolete simple_strtoul().

Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/net-sysfs.c

index 495586232aa1d9adc46b1fe7e8352832c2312f21..97d0f2453a0e628f3eb8c7e674bf6d4e7159b665 100644 (file)
@@ -74,15 +74,14 @@ static ssize_t netdev_store(struct device *dev, struct device_attribute *attr,
                            int (*set)(struct net_device *, unsigned long))
 {
        struct net_device *net = to_net_dev(dev);
-       char *endp;
        unsigned long new;
        int ret = -EINVAL;
 
        if (!capable(CAP_NET_ADMIN))
                return -EPERM;
 
-       new = simple_strtoul(buf, &endp, 0);
-       if (endp == buf)
+       ret = kstrtoul(buf, 0, &new);
+       if (ret)
                goto err;
 
        if (!rtnl_trylock())