Skip to contentSkip to conversation

fm10k: use an unsigned int for i in ethtool_get_strings

PATCH New Jacob Keller 2 participants 2 messages Jun 16, 2015 – Sep 2, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fm10k: use an unsigned int for i in ethtool_get_strings

The value will never be negative, and we use the %u print format. Thus, use unsigned int for the loop counter. Issue found using cppcheck.

---
 drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c +1 -1
index 4b9d9f88af70..06f0b08d9af5 100644
@@ -124,7 +124,7 @@ static void fm10k_get_strings(struct net_device *dev, u32 stringset, u8 *data)
 {
 	struct fm10k_intfc *interface = netdev_priv(dev);
 	char *p = (char *)data;
-	int i;
+	unsigned int i;
 
 	switch (stringset) {
 	case ETH_SS_TEST:
Signature · 1 line
2.4.2
#1 lore raw

PATCH 1/1 fm10k: use an unsigned int for i in ethtool_get_strings

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jacob Keller
Sent: Tuesday, June 16, 2015 1:39 PM
To: Intel Wired LAN <[email protected]>
Subject: [Intel-wired-lan] [PATCH rc2] fm10k: use an unsigned int for i in ethtool_get_strings

The value will never be negative, and we use the %u print format. Thus, use unsigned int for the loop counter. Issue found using cppcheck.

---

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan at lists.osuosl.org
http://lists.osuosl.org/mailman/listinfo/intel-wired-lan