aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000
diff options
context:
space:
mode:
authorRoel Kluin <12o3l@tiscali.nl>2007-12-05 14:57:30 -0500
committerJeff Garzik <jeff@garzik.org>2007-12-07 15:01:43 -0500
commitc32bc6e9b0778c891f7f3b97cd05c8cdf98b6721 (patch)
treec65214a5e8cedacf517d9337fa100ec0810e4d7a /drivers/net/e1000
parent70eba18b5664f90d7620905e005b89388e5fd94b (diff)
e1000: fix memcpy in e1000_get_strings
drivers/net/e1000/e1000_ethtool.c:113: #define E1000_TEST_LEN sizeof(e1000_gstrings_test) / ETH_GSTRING_LEN drivers/net/e1000e/ethtool.c:106: #define E1000_TEST_LEN sizeof(e1000_gstrings_test) / ETH_GSTRING_LEN E1000_TEST_LEN*ETH_GSTRING_LEN will expand to sizeof(e1000_gstrings_test) / (ETH_GSTRING_LEN * ETH_GSTRING_LEN) A lack of parentheses around defines causes unexpected results due to operator precedences. Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r--drivers/net/e1000/e1000_ethtool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 667f18bcc172..b83ccce8a9b7 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1923,7 +1923,7 @@ e1000_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data)
1923 switch (stringset) { 1923 switch (stringset) {
1924 case ETH_SS_TEST: 1924 case ETH_SS_TEST:
1925 memcpy(data, *e1000_gstrings_test, 1925 memcpy(data, *e1000_gstrings_test,
1926 E1000_TEST_LEN*ETH_GSTRING_LEN); 1926 sizeof(e1000_gstrings_test));
1927 break; 1927 break;
1928 case ETH_SS_STATS: 1928 case ETH_SS_STATS:
1929 for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) { 1929 for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) {