Skip to contentSkip to conversation

linux-next: build warning after merge of the net-next tree

PATCH Applied Stephen Rothwell 3 participants 3 messages May 23, 2019 – May 24, 2019

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

Hi all,

After merging the net-next tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

drivers/net/ethernet/xilinx/ll_temac_main.c: In function 'temac_set_multicast_list':
drivers/net/ethernet/xilinx/ll_temac_main.c:490:8: warning: 'i' may be used uninitialized in this function [-Wmaybe-uninitialized]

  while (i < MULTICAST_CAM_TABLE_NUM) {
        ^

Introduced by commit

1b3fa5cf859b ("net: ll_temac: Cleanup multicast filter on change")

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

PATCH 1/1 net: ll_temac: Fix compile error

Fixes 1b3fa5cf859b ("net: ll_temac: Cleanup multicast filter on change")
---
 drivers/net/ethernet/xilinx/ll_temac_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/xilinx/ll_temac_main.c +1 -2
index 22a52b884821..21c1b4322ea7 100644
@@ -452,7 +452,7 @@ static void temac_set_multicast_list(struct net_device *ndev)
 {
 	struct temac_local *lp = netdev_priv(ndev);
 	u32 multi_addr_msw, multi_addr_lsw;
-	int i;
+	int i = 0;
 	unsigned long flags;
 	bool promisc_mode_disabled = false;
 
@@ -468,7 +468,6 @@ static void temac_set_multicast_list(struct net_device *ndev)
 	if (!netdev_mc_empty(ndev)) {
 		struct netdev_hw_addr *ha;
 
-		i = 0;
 		netdev_for_each_mc_addr(ha, ndev) {
 			if (WARN_ON(i >= MULTICAST_CAM_TABLE_NUM))
 				break;
Signature · 1 line
2.21.0