|
@@ -17,6 +17,7 @@
|
|
#include <linux/errno.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/ethtool.h>
|
|
#include <linux/ethtool.h>
|
|
#include <linux/netdevice.h>
|
|
#include <linux/netdevice.h>
|
|
|
|
+#include <linux/bitops.h>
|
|
#include <asm/uaccess.h>
|
|
#include <asm/uaccess.h>
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -216,7 +217,7 @@ static noinline int ethtool_get_drvinfo(struct net_device *dev, void __user *use
|
|
|
|
|
|
/*
|
|
/*
|
|
* this method of obtaining string set info is deprecated;
|
|
* this method of obtaining string set info is deprecated;
|
|
- * consider using ETHTOOL_GSSET_INFO instead
|
|
|
|
|
|
+ * Use ETHTOOL_GSSET_INFO instead.
|
|
*/
|
|
*/
|
|
if (ops->get_sset_count) {
|
|
if (ops->get_sset_count) {
|
|
int rc;
|
|
int rc;
|
|
@@ -265,9 +266,7 @@ static noinline int ethtool_get_sset_info(struct net_device *dev,
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
/* calculate size of return buffer */
|
|
/* calculate size of return buffer */
|
|
- for (i = 0; i < 64; i++)
|
|
|
|
- if (sset_mask & (1ULL << i))
|
|
|
|
- n_bits++;
|
|
|
|
|
|
+ n_bits = hweight64(sset_mask);
|
|
|
|
|
|
memset(&info, 0, sizeof(info));
|
|
memset(&info, 0, sizeof(info));
|
|
info.cmd = ETHTOOL_GSSET_INFO;
|
|
info.cmd = ETHTOOL_GSSET_INFO;
|