net: ethtool: pass a pointer to parameters to get/set_rxfh ethtool ops
[linux-2.6-microblaze.git] / net / ethtool / common.c
index 11d8797..6b2a360 100644 (file)
@@ -589,8 +589,8 @@ err_free_info:
 
 int ethtool_get_max_rxfh_channel(struct net_device *dev, u32 *max)
 {
+       struct ethtool_rxfh_param rxfh = {};
        u32 dev_size, current_max = 0;
-       u32 *indir;
        int ret;
 
        if (!dev->ethtool_ops->get_rxfh_indir_size ||
@@ -600,21 +600,21 @@ int ethtool_get_max_rxfh_channel(struct net_device *dev, u32 *max)
        if (dev_size == 0)
                return -EOPNOTSUPP;
 
-       indir = kcalloc(dev_size, sizeof(indir[0]), GFP_USER);
-       if (!indir)
+       rxfh.indir = kcalloc(dev_size, sizeof(rxfh.indir[0]), GFP_USER);
+       if (!rxfh.indir)
                return -ENOMEM;
 
-       ret = dev->ethtool_ops->get_rxfh(dev, indir, NULL, NULL);
+       ret = dev->ethtool_ops->get_rxfh(dev, &rxfh);
        if (ret)
                goto out;
 
        while (dev_size--)
-               current_max = max(current_max, indir[dev_size]);
+               current_max = max(current_max, rxfh.indir[dev_size]);
 
        *max = current_max;
 
 out:
-       kfree(indir);
+       kfree(rxfh.indir);
        return ret;
 }