TG3: limit reaches -1
Subsystems (2)
PATCH 1/1 TG3: limit reaches -1
With while (limit--) { ... } limit reaches -1, so 0 means success.
---
drivers/net/tg3.c +2 -2
@@ -852,7 +852,7 @@ static int tg3_bmcr_reset(struct tg3 *tp) }udelay (10 ); } -if (limit <=0 ) +if (limit <0 )return -EBUSY ;return 0 ;
@@ -1603,7 +1603,7 @@ static int tg3_wait_macro_done(struct tg3 *tp)break ; } } -if (limit <=0 ) +if (limit <0 )return -EBUSY ;return 0 ;
Quoted 3 lines · Roel Kluin
With while (limit--) { ... } limit reaches -1, so 0 means success.
Signed-off-by Roel Kluin <[email protected]>
Thanks.
Quoted 28 lines
---
drivers/net/tg3.c +2
-3@@ -852,7 +852,7 @@ static int tg3_bmcr_reset(struct tg3 *tp) }udelay (10 ); } -if (limit <=0 ) +if (limit <0 )return -EBUSY ;return 0 ;@@ -1603,7 +1603,7 @@ static int tg3_wait_macro_done(struct tg3 *tp)break ; } } -if (limit <=0 ) +if (limit <0 )return -EBUSY ;return 0 ; --To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: "Michael Chan" <[email protected]>
Date: Wed, 11 Feb 2009 12:40:16 -0800
Quoted 7 lines · Roel Kluin
Quoted 3 lines
With while (limit--) { ... } limit reaches -1, so 0 means success.
Signed-off-by Roel Kluin <[email protected]>Acked-by Michael Chan <[email protected]>
Applied.
PATCH 1/1 TG3: &&/|| confusion
In reply to Roel Kluinphyid Can't be both TG3_PHY_OUI_1 and TG3_PHY_OUI_2 and TG3_PHY_OUI_3.
---
// vi drivers/net/tg3.h +2698
#define TG3_PHY_OUI_1 0x00206000 #define TG3_PHY_OUI_2 0x0143bc00 #define TG3_PHY_OUI_3 0x03625c00
drivers/net/tg3.c +2 -2
@@ -2237,8 +2237,8 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) phyid = phydev->drv->phy_id & phydev->drv->phy_id_mask;if (phyid !=TG3_PHY_ID_BCMAC131 ) { phyid &=TG3_PHY_OUI_MASK ; -if (phyid ==TG3_PHY_OUI_1 && - phyid ==TG3_PHY_OUI_2 && +if (phyid ==TG3_PHY_OUI_1 || + phyid ==TG3_PHY_OUI_2 || phyid ==TG3_PHY_OUI_3 ) do_low_power = true; }
Re: [PATCH] TG3: &&/|| confusion
Quoted 24 lines · Roel Kluin
phyid Can't be both
TG3_PHY_OUI_1andTG3_PHY_OUI_2andTG3_PHY_OUI_3.Signed-off-by Roel Kluin <[email protected]>---
// vidrivers/net/tg3.h+2698#define TG3_PHY_OUI_1 0x00206000 #define TG3_PHY_OUI_2 0x0143bc00 #define TG3_PHY_OUI_3 0x03625c00drivers/net/tg3.c +2
-2@@ -2237,8 +2237,8 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) phyid = phydev->drv->phy_id & phydev->drv->phy_id_mask;if (phyid !=TG3_PHY_ID_BCMAC131 ) { phyid &=TG3_PHY_OUI_MASK ; -if (phyid ==TG3_PHY_OUI_1 && - phyid ==TG3_PHY_OUI_2 && +if (phyid ==TG3_PHY_OUI_1 || + phyid ==TG3_PHY_OUI_2 || phyid ==TG3_PHY_OUI_3 )
Quoted 4 lines
do_low_power = true;
}Thanks, this looks good to me, but I need Matt to ACK this patch.
Matt Carlson
Acked-byRe: [PATCH] TG3: &&/|| confusion
Quoted 24 lines · Michael Chan
Quoted 22 lines · Roel Kluin
phyid Can't be both
TG3_PHY_OUI_1andTG3_PHY_OUI_2andTG3_PHY_OUI_3.Signed-off-by Roel Kluin <[email protected]>---
// vidrivers/net/tg3.h+2698#define TG3_PHY_OUI_1 0x00206000 #define TG3_PHY_OUI_2 0x0143bc00 #define TG3_PHY_OUI_3 0x03625c00drivers/net/tg3.c +1
-2@@ -2237,8 +2237,8 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) phyid = phydev->drv->phy_id & phydev->drv->phy_id_mask;if (phyid !=TG3_PHY_ID_BCMAC131 ) { phyid &=TG3_PHY_OUI_MASK ; - if (phyid == TG3_PHY_OUI_1 && - phyid == TG3_PHY_OUI_2 && + if (phyid == TG3_PHY_OUI_1 ||
Quoted 8 lines
Quoted 6 lines
drivers/net/tg3.c +1
-0+ phyid ==TG3_PHY_OUI_2 || phyid == TG3_PHY_OUI_3)do_low_power = true; }Thanks, this looks good to me, but I need Matt to ACK this patch.
Yes. This is correct.
Re: [PATCH] TG3: &&/|| confusion
From: "Matt Carlson" <[email protected]>
Date: Tue, 17 Feb 2009 10:34:39 -0800
Quoted 6 lines · Michael Chan
Quoted 5 lines
Quoted 3 lines · Roel Kluin
phyid Can't be both
TG3_PHY_OUI_1andTG3_PHY_OUI_2andTG3_PHY_OUI_3.Signed-off-by Roel Kluin <[email protected]>
...
Quoted 3 lines
Yes. This is correct.
Acked-by Matt Carlson <[email protected]>
Applied.