Merge branch 'pm-drivers'
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / core / net-sysfs.c
index 495586232aa1d9adc46b1fe7e8352832c2312f21..fdf9e61d0651fab74e2836593a872586cd8efec3 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())
@@ -232,7 +231,7 @@ NETDEVICE_SHOW(flags, fmt_hex);
 
 static int change_flags(struct net_device *net, unsigned long new_flags)
 {
-       return dev_change_flags(net, (unsigned) new_flags);
+       return dev_change_flags(net, (unsigned int) new_flags);
 }
 
 static ssize_t store_flags(struct device *dev, struct device_attribute *attr,
@@ -582,7 +581,7 @@ static ssize_t store_rps_map(struct netdev_rx_queue *queue,
                return err;
        }
 
-       map = kzalloc(max_t(unsigned,
+       map = kzalloc(max_t(unsigned int,
            RPS_MAP_SIZE(cpumask_weight(mask)), L1_CACHE_BYTES),
            GFP_KERNEL);
        if (!map) {
@@ -903,7 +902,7 @@ static ssize_t bql_set_hold_time(struct netdev_queue *queue,
                                 const char *buf, size_t len)
 {
        struct dql *dql = &queue->dql;
-       unsigned value;
+       unsigned int value;
        int err;
 
        err = kstrtouint(buf, 10, &value);
@@ -1107,7 +1106,7 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
                return err;
        }
 
-       new_dev_maps = kzalloc(max_t(unsigned,
+       new_dev_maps = kzalloc(max_t(unsigned int,
            XPS_DEV_MAPS_SIZE, L1_CACHE_BYTES), GFP_KERNEL);
        if (!new_dev_maps) {
                free_cpumask_var(mask);