From: linas@austin.ibm.com (Linas Vepstas)
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: James K Lewis <jim@jklewis.com>,
linuxppc-dev@ozlabs.org, netdev@vger.kernel.org,
jgarzik@pobox.com, cbe-oss-dev@ozlabs.org
Subject: Re: spidernet: add improved phy support in sungem_phy.c
Date: Tue, 30 Jan 2007 16:30:50 -0600 [thread overview]
Message-ID: <20070130223050.GE5616@austin.ibm.com> (raw)
In-Reply-To: <20070126233809.GA16660@electric-eye.fr.zoreil.com>
On Sat, Jan 27, 2007 at 12:38:09AM +0100, Francois Romieu wrote:
> Jens Osterkamp <jens@de.ibm.com> :
> >
> Index: linux-2.6.20-rc5/drivers/net/sungem_phy.c
> ===================================================================
> --- linux-2.6.20-rc5.orig/drivers/net/sungem_phy.c
> +++ linux-2.6.20-rc5/drivers/net/sungem_phy.c
> @@ -311,6 +311,107 @@ static int bcm5411_init(struct mii_phy*
> [...]
> + if ( (phy_reg & 0x0020) >> 5 ) {
Shifting to the right by 5 bits has no effect on the result
of this conditional. Either the bit is set, or its not.
There is no need to shift.
> + if ( (phy_reg & 0x0020) >> 7 ) {
The result here will always be zero, since the bit,
if set, will be shifted off the end. Bits on the lef
are padded with zero. Ergo, this is a bug.
--linas
WARNING: multiple messages have this Message-ID (diff)
From: linas@austin.ibm.com (Linas Vepstas)
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: Jens Osterkamp <jens@de.ibm.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Ishizaki Kou <kou.ishizaki@toshiba.co.jp>,
linuxppc-dev@ozlabs.org, netdev@vger.kernel.org,
cbe-oss-dev@ozlabs.org, jgarzik@pobox.com,
James K Lewis <jim@jklewis.com>
Subject: Re: spidernet: add improved phy support in sungem_phy.c
Date: Tue, 30 Jan 2007 16:30:50 -0600 [thread overview]
Message-ID: <20070130223050.GE5616@austin.ibm.com> (raw)
In-Reply-To: <20070126233809.GA16660@electric-eye.fr.zoreil.com>
On Sat, Jan 27, 2007 at 12:38:09AM +0100, Francois Romieu wrote:
> Jens Osterkamp <jens@de.ibm.com> :
> >
> Index: linux-2.6.20-rc5/drivers/net/sungem_phy.c
> ===================================================================
> --- linux-2.6.20-rc5.orig/drivers/net/sungem_phy.c
> +++ linux-2.6.20-rc5/drivers/net/sungem_phy.c
> @@ -311,6 +311,107 @@ static int bcm5411_init(struct mii_phy*
> [...]
> + if ( (phy_reg & 0x0020) >> 5 ) {
Shifting to the right by 5 bits has no effect on the result
of this conditional. Either the bit is set, or its not.
There is no need to shift.
> + if ( (phy_reg & 0x0020) >> 7 ) {
The result here will always be zero, since the bit,
if set, will be shifted off the end. Bits on the lef
are padded with zero. Ergo, this is a bug.
--linas
next prev parent reply other threads:[~2007-01-30 22:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-26 13:07 spidernet: add improved phy support in sungem_phy.c Jens Osterkamp
2007-01-26 13:07 ` Jens Osterkamp
2007-01-26 20:20 ` Benjamin Herrenschmidt
2007-01-26 20:20 ` Benjamin Herrenschmidt
2007-01-26 22:31 ` Jens Osterkamp
2007-01-26 22:31 ` Jens Osterkamp
2007-01-26 23:38 ` Francois Romieu
2007-01-26 23:38 ` Francois Romieu
2007-01-30 22:30 ` Linas Vepstas [this message]
2007-01-30 22:30 ` Linas Vepstas
2007-02-01 10:55 ` Jens Osterkamp
2007-02-01 10:55 ` Jens Osterkamp
2007-02-01 10:57 ` [PATCH] [v2] spidernet: add improved phy support Jens Osterkamp
2007-02-01 10:57 ` Jens Osterkamp
2007-02-01 10:54 ` spidernet: add improved phy support in sungem_phy.c Jens Osterkamp
2007-02-01 10:54 ` Jens Osterkamp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070130223050.GE5616@austin.ibm.com \
--to=linas@austin.ibm.com \
--cc=cbe-oss-dev@ozlabs.org \
--cc=jgarzik@pobox.com \
--cc=jim@jklewis.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.