diff mbox

TG3: &&/|| confusion

Message ID 49989494.6010804@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

roel kluin Feb. 15, 2009, 10:17 p.m. UTC
phyid Can't be both TG3_PHY_OUI_1 and TG3_PHY_OUI_2 and TG3_PHY_OUI_3.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
// vi drivers/net/tg3.h +2698
#define TG3_PHY_OUI_1                   0x00206000
#define TG3_PHY_OUI_2                   0x0143bc00
#define TG3_PHY_OUI_3                   0x03625c00

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Michael Chan Feb. 16, 2009, 5:27 p.m. UTC | #1
Roel Kluin wrote:

> phyid Can't be both TG3_PHY_OUI_1 and TG3_PHY_OUI_2 and TG3_PHY_OUI_3.
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> // vi drivers/net/tg3.h +2698
> #define TG3_PHY_OUI_1                   0x00206000
> #define TG3_PHY_OUI_2                   0x0143bc00
> #define TG3_PHY_OUI_3                   0x03625c00
>
> diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
> index 4595962..b080f94 100644
> --- a/drivers/net/tg3.c
> +++ b/drivers/net/tg3.c
> @@ -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;
>                       }
>
>

Thanks, this looks good to me, but I need Matt to ACK this patch.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Matt Carlson Feb. 17, 2009, 6:34 p.m. UTC | #2
On Mon, Feb 16, 2009 at 09:27:19AM -0800, Michael Chan wrote:
> Roel Kluin wrote:
> 
> > phyid Can't be both TG3_PHY_OUI_1 and TG3_PHY_OUI_2 and TG3_PHY_OUI_3.
> >
> > Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> > ---
> > // vi drivers/net/tg3.h +2698
> > #define TG3_PHY_OUI_1                   0x00206000
> > #define TG3_PHY_OUI_2                   0x0143bc00
> > #define TG3_PHY_OUI_3                   0x03625c00
> >
> > diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
> > index 4595962..b080f94 100644
> > --- a/drivers/net/tg3.c
> > +++ b/drivers/net/tg3.c
> > @@ -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;
> >                       }
> >
> >
> 
> Thanks, this looks good to me, but I need Matt to ACK this patch.

Yes.  This is correct.

Acked-by: Matt Carlson <mcarlson@broadcom.com>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Feb. 19, 2009, 1:42 a.m. UTC | #3
From: "Matt Carlson" <mcarlson@broadcom.com>
Date: Tue, 17 Feb 2009 10:34:39 -0800

> On Mon, Feb 16, 2009 at 09:27:19AM -0800, Michael Chan wrote:
> > Roel Kluin wrote:
> > 
> > > phyid Can't be both TG3_PHY_OUI_1 and TG3_PHY_OUI_2 and TG3_PHY_OUI_3.
> > >
> > > Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
 ...
> Yes.  This is correct.
> 
> Acked-by: Matt Carlson <mcarlson@broadcom.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 4595962..b080f94 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -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;
 			}