Thread (8 messages) 8 messages, 4 authors, 2007-02-01

Re: spidernet: add improved phy support in sungem_phy.c

From: Linas Vepstas <hidden>
Date: 2007-01-30 22:30:50
Also in: linuxppc-dev

On Sat, Jan 27, 2007 at 12:38:09AM +0100, Francois Romieu wrote:
quoted hunk ↗ jump to hunk
Jens Osterkamp [off-list ref] :
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help