linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtl8187: consolidate MSR writes in rtl8187_bss_info_changed
@ 2010-07-30  1:57 John W. Linville
  2010-07-30  3:14 ` Larry Finger
  2010-07-30  3:22 ` Hin-Tak Leung
  0 siblings, 2 replies; 3+ messages in thread
From: John W. Linville @ 2010-07-30  1:57 UTC (permalink / raw)
  To: linux-wireless
  Cc: Herton Ronaldo Krzesinski, Hin-Tak Leung, Larry Finger, John W. Linville

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 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);
 	}
-- 
1.7.1.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] rtl8187: consolidate MSR writes in rtl8187_bss_info_changed
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Larry Finger @ 2010-07-30  3:14 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Herton Ronaldo Krzesinski, Hin-Tak Leung

On 07/29/2010 08:57 PM, John W. Linville wrote:
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
ACK.

Larry

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rtl8187: consolidate MSR writes in rtl8187_bss_info_changed
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Hin-Tak Leung @ 2010-07-30  3:22 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Herton Ronaldo Krzesinski, Larry Finger

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);
>  	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-30  3:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).