linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hin-Tak Leung <htl10@users.sourceforge.net>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org,
	Herton Ronaldo Krzesinski <herton@mandriva.com.br>,
	Larry Finger <Larry.Finger@lwfinger.net>
Subject: Re: [PATCH] rtl8187: consolidate MSR writes in rtl8187_bss_info_changed
Date: Fri, 30 Jul 2010 04:22:06 +0100	[thread overview]
Message-ID: <4C52455E.6010405@users.sourceforge.net> (raw)
In-Reply-To: <1280455044-26073-1-git-send-email-linville@tuxdriver.com>

John W. Linville wrote:
> Signed-off-by: John W. Linville <linville@tuxdriver.com>

Acked-by: Hin-Tak Leung <htl10@users.sourceforge.net>

Thanks for looking this over. I wondered how the code came to be like this, so I 
went to look it up - the reason was that we used to have more lines between the 
{}'s and they were gradually removed. The full list of defines for the 
RTL818X_MSR_* are :

#define RTL818X_MSR_NO_LINK		(0 << 2)
#define RTL818X_MSR_ADHOC		(1 << 2)
#define RTL818X_MSR_INFRA		(2 << 2)
#define RTL818X_MSR_MASTER		(3 << 2)
#define RTL818X_MSR_ENEDCA		(4 << 2)

but we only use 3 at the moment (not _AHOC nor _MASTER).

Hin-Tak

> ---
>  drivers/net/wireless/rtl818x/rtl8187_dev.c |    9 ++++-----
>  1 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c
> index 5738a55..0801c1d 100644
> --- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
> +++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
> @@ -1176,13 +1176,12 @@ static void rtl8187_bss_info_changed(struct ieee80211_hw *dev,
>  		else
>  			reg = 0;
>  
> -		if (is_valid_ether_addr(info->bssid)) {
> +		if (is_valid_ether_addr(info->bssid))
>  			reg |= RTL818X_MSR_INFRA;
> -			rtl818x_iowrite8(priv, &priv->map->MSR, reg);
> -		} else {
> +		else
>  			reg |= RTL818X_MSR_NO_LINK;
> -			rtl818x_iowrite8(priv, &priv->map->MSR, reg);
> -		}
> +
> +		rtl818x_iowrite8(priv, &priv->map->MSR, reg);
>  
>  		mutex_unlock(&priv->conf_mutex);
>  	}

      parent reply	other threads:[~2010-07-30  3:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-30  1:57 [PATCH] rtl8187: consolidate MSR writes in rtl8187_bss_info_changed John W. Linville
2010-07-30  3:14 ` Larry Finger
2010-07-30  3:22 ` Hin-Tak Leung [this message]

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=4C52455E.6010405@users.sourceforge.net \
    --to=htl10@users.sourceforge.net \
    --cc=Larry.Finger@lwfinger.net \
    --cc=herton@mandriva.com.br \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).