[Cbe-oss-dev] spidernet: add improved phy support in sungem_phy.c
Jens Osterkamp
jens at de.ibm.com
Thu Feb 1 21:54:49 EST 2007
Francois,
thank you for your comments. I'll send a revised patch soon.
> +#define BCM5421_MODE_MASK 1 << 5
>
> Please add parenthesis.
Done.
> "&" is fine despite the lack of parenthesis above but it is error-prone.
Corrected.
>
> +
> + if ( mode == GMII_COPPER) {
> ^^^
> + return genmii_poll_link(phy);
> + }
>
> No curly-braces for single line statements please.
I corrected this on all my additions.
> Ternary operator ?
I dont like ternary operators. Yes, I know, they are cool, but
they make the code much less readable IMHO.
> +#define BCM5461_FIBER_LINK 1 << 2
> +#define BCM5461_MODE_MASK 3 << 1
>
> Please add parenthesis.
Done.
> Join the dark side and use a ternary operator.
See above.
> +static int bcm5461_enable_fiber(struct mii_phy* phy, int autoneg)
> +{
> + /*
> + phy_write(phy, MII_NCONFIG, 0xfc0c);
> + phy_write(phy, MII_BMCR, 0x4140);
> + */
>
> Remove ?
Done.
Jens
More information about the cbe-oss-dev
mailing list