[<prev] [next>] [day] [month] [year] [list]
Message-ID: <cf40ac34-1655-4eee-85dc-c836e77eb301@gmail.com>
Date: Tue, 29 Oct 2024 22:02:41 +0000
From: "Colin King (gmail)" <colin.i.king@...il.com>
To: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: net: ethernet: starfire: while loop that is never executed
Hi,
There is a while-loop in function set_vlan_mode in source
drivers/net/ethernet/adaptec/starfire.c that currently never gets
executed, the code is as follows:
for_each_set_bit(vid, np->active_vlans, VLAN_N_VID) {
if (vlan_count == 32)
break;
writew(vid, filter_addr);
filter_addr += 16;
vlan_count++;
}
if (vlan_count == 32) {
ret |= PerfectFilterVlan;
while (vlan_count < 32) {
writew(0, filter_addr);
filter_addr += 16;
vlan_count++;
}
}
return ret;
the while (vlan_count < 32) loop will never get executed because the
outer if statement is only executed if val_count is equal to 32 hence
val_count < 32 will be false. I'm assuming the while loop is filing the
unused slots with zero, so I suspect the code should be:
if (vlan_count == 32)
ret |= PerfectFilterVlan;
while (vlan_count < 32) {
writew(0, filter_addr);
filter_addr += 16;
vlan_count++;
}
..however I can't find any info on this H/W and I can't test it, so I'm
not confident my assumption here is correct.
Colin
Powered by blists - more mailing lists