Skip to content

Commit

Permalink
net/core: simple_strtoul cleanup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shuah Khan authored and David S. Miller committed Apr 12, 2012
1 parent 1caf09d commit e1e420c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/core/net-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit e1e420c

Please sign in to comment.