Skip to contentSkip to conversation

tg3_phy_copper_begin: duplicated argument to ||

DISCUSSION Fengguang Wu 1 participant 1 message Jul 25, 2012 Kernel janitors

lore
Share & tools
lore
#0 lore raw

Hi Matt,

coccinelle complaints about:

drivers/net/ethernet/broadcom/tg3.c:4053:8-39: duplicated argument to && or ||

I'm not sure if the code intends to retry the operation (or a silly copy&paste error). If it's the former case, it might be better to add a comment..

4046 if (!tg3_readphy(tp, MII_BMCR, &orig_bmcr) &&
4047 (bmcr != orig_bmcr)) {
4048 tg3_writephy(tp, MII_BMCR, BMCR_LOOPBACK);
4049 for (i = 0; i < 1500; i++) {
4050 u32 tmp;
4051
4052 udelay(10);
4053 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if (tg3_readphy(tp, MII_BMSR, &tmp) ||
4054 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tg3_readphy(tp, MII_BMSR, &tmp))
4055 continue;
4056 if (!(tmp & BMSR_LSTATUS)) {
4057 udelay(40);
4058 break;
4059 }
4060 }
4061 tg3_writephy(tp, MII_BMCR, bmcr);

---
0-DAY kernel build testing backend Open Source Technology Centre
Fengguang Wu <[email protected]> Intel Corporation