From: Levente Kurusa <levex@linux.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
LKML <linux-kernel@vger.kernel.org>,
OSUOSL Drivers <devel@driverdev.osuosl.org>
Cc: Levente Kurusa <levex@linux.com>
Subject: [PATCH] [RFC] staging: rtl8821ae: fix invalid bit mask on MSR_AP check
Date: Fri, 14 Feb 2014 22:50:23 +0100 [thread overview]
Message-ID: <1392414623-4369-1-git-send-email-levex@linux.com> (raw)
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
next reply other threads:[~2014-02-14 21:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-14 21:50 Levente Kurusa [this message]
2014-02-14 22:00 ` [PATCH] [RFC] staging: rtl8821ae: fix invalid bit mask on MSR_AP check Dan Carpenter
2014-02-15 7:53 ` Levente Kurusa
2014-02-15 10:36 ` Dan Carpenter
2014-02-15 10:56 ` Levente Kurusa
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=1392414623-4369-1-git-send-email-levex@linux.com \
--to=levex@linux.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.