Skip to contentSkip to conversation

TG3: limit reaches -1

PATCH Applied Roel Kluin 4 participants 7 messages Feb 11, 2009 – Feb 19, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 TG3: limit reaches -1

With while (limit--) { ... } limit reaches -1, so 0 means success.

---

drivers/net/tg3.c +2 -2
index 8b3f846..4595962 100644
@@ -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;
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Roel Kluin

With while (limit--) { ... } limit reaches -1, so 0 means success.

Thanks.

Quoted 28 lines

---

drivers/net/tg3.c +2 -3
index 8b3f846..4595962 100644
@@ -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

author
#3 lore raw

PATCH 1/1 TG3: &&/|| confusion

In reply to Roel Kluin

phyid 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
index 4595962..b080f94 100644
@@ -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;
 			}
#4 lore raw

Re: [PATCH] TG3: &&/|| confusion

Quoted 24 lines · Roel Kluin

phyid 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
index 4595962..b080f94 100644
@@ -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.

Acked-by
#5 lore raw

Re: [PATCH] TG3: &&/|| confusion

Quoted 24 lines · Michael Chan
Quoted 22 lines · Roel Kluin

phyid 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 +1 -2
index 4595962..b080f94 100644
@@ -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.