Le Tue, 06 Sep 2005 16:32:39 +0200, Miroslaw Mieszczak a écrit :
> There is a patch to driver of RLT8169 network card. This match make
> possible detection of the link status even if network interface is down.
> This is usefull for laptop users.
>
>
>
> --- r8169.c 2005-09-02 15:34:52.000000000 +0200
> +++ linux/drivers/net/r8169.c 2005-09-05 21:11:15.000000000 +0200
> @@ -538,14 +538,27 @@
>
> static unsigned int rtl8169_tbi_link_ok(void __iomem *ioaddr)
> {
> - return RTL_R32(TBICSR) & TBILinkOk;
> + return (RTL_R32(TBICSR) & TBILinkOk) == TBILinkOk ? 1:0;
> }
>
> static unsigned int rtl8169_xmii_link_ok(void __iomem *ioaddr)
> {
> - return RTL_R8(PHYstatus) & LinkStatus;
> + return (RTL_R8(PHYstatus) & LinkStatus) == LinkStatus ? 1:0;
> }
>
(a==b)?1:0 is stupid just use (a==b) ...
And in this case I am sure we care only if it is null or non-null,
so there no need to change that...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
|
|