public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RFC] staging: rtl8821ae: fix invalid bit mask on MSR_AP check
@ 2014-02-14 21:50 Levente Kurusa
  2014-02-14 22:00 ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Levente Kurusa @ 2014-02-14 21:50 UTC (permalink / raw)
  To: Greg Kroah-Hartman, LKML, OSUOSL Drivers; +Cc: Levente Kurusa

Since MSR_AP is 0x3, ANDing it with 0xFC will never be true.
Add a NOT operation to 0xFC so that we will AND with the last
three bits which will result in a possibility that the condition
will succeed.

Signed-off-by: Levente Kurusa <levex@linux.com>
---
 Hi,

 This might not be the real solution since it is also possible that
 the particular condition never really happens. I seek comments
 so that I can post the proper patch.

 Thanks!
 
 drivers/staging/rtl8821ae/rtl8821ae/hw.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8821ae/rtl8821ae/hw.c b/drivers/staging/rtl8821ae/rtl8821ae/hw.c
index 5ed7a11..f204b31 100644
--- a/drivers/staging/rtl8821ae/rtl8821ae/hw.c
+++ b/drivers/staging/rtl8821ae/rtl8821ae/hw.c
@@ -1622,7 +1622,7 @@ static int _rtl8821ae_set_media_status(struct ieee80211_hw *hw,
 
 	rtl_write_byte(rtlpriv, (MSR), bt_msr);
 	rtlpriv->cfg->ops->led_control(hw, ledaction);
-	if ((bt_msr & 0xfc) == MSR_AP)
+	if ((bt_msr & ~0xfc) == MSR_AP)
 		rtl_write_byte(rtlpriv, REG_BCNTCFG + 1, 0x00);
 	else
 		rtl_write_byte(rtlpriv, REG_BCNTCFG + 1, 0x66);
-- 
1.7.9.5


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

end of thread, other threads:[~2014-02-15 10:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-14 21:50 [PATCH] [RFC] staging: rtl8821ae: fix invalid bit mask on MSR_AP check Levente Kurusa
2014-02-14 22:00 ` Dan Carpenter
2014-02-15  7:53   ` Levente Kurusa
2014-02-15 10:36     ` Dan Carpenter
2014-02-15 10:56       ` Levente Kurusa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox