提交 e1e420c7 编写于 作者: S Shuah Khan 提交者: David S. Miller

net/core: simple_strtoul cleanup

Changed net/core/net-sysfs.c: netdev_store() to use kstrtoul()
instead of obsolete simple_strtoul().
Signed-off-by: NShuah Khan <shuahkhan@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1caf09df
......@@ -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())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册