* net: ethernet: starfire: while loop that is never executed
@ 2024-10-29 22:02 Colin King (gmail)
0 siblings, 0 replies; only message in thread
From: Colin King (gmail) @ 2024-10-29 22:02 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-10-29 22:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-29 22:02 net: ethernet: starfire: while loop that is never executed Colin King (gmail)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox