mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthieu CASTET <castet.matthieu@free.fr>
To: linux-kernel@vger.kernel.org
Subject: Re: Patch for link detection for R8169
Date: Tue, 06 Sep 2005 16:46:55 +0200	[thread overview]
Message-ID: <pan.2005.09.06.14.46.50.324819@free.fr> (raw)
In-Reply-To: <431DA887.2010008@zabrze.zigzag.pl>

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...


  reply	other threads:[~2005-09-06 14:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-06 14:32 Miroslaw Mieszczak
2005-09-06 14:46 ` Matthieu CASTET [this message]
2005-09-06 19:46 ` Francois Romieu
2005-09-06 20:02   ` Valdis.Kletnieks
2005-09-06 20:42     ` Francois Romieu
2005-09-06 20:59       ` Valdis.Kletnieks
2005-09-06 21:15         ` Francois Romieu
2005-09-07 14:45       ` Miroslaw Mieszczak
2005-09-07 18:17         ` Francois Romieu
     [not found]           ` <43207052.3030403@zabrze.zigzag.pl>
2005-09-08 23:49             ` Francois Romieu
2005-09-07  1:56   ` Jeff Garzik

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=pan.2005.09.06.14.46.50.324819@free.fr \
    --to=castet.matthieu@free.fr \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®