* [PATCH] staging: rtl8192ee: Correct bitmask in comparsion
@ 2014-07-04 23:40 Andrey Utkin
2014-07-08 11:49 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Andrey Utkin @ 2014-07-04 23:40 UTC (permalink / raw)
To: kernel-janitors, Larry.Finger, linux-kernel, drivers_staging; +Cc: Andrey Utkin
See https://bugzilla.kernel.org/show_bug.cgi?id=78041
---8<---
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
---
drivers/staging/rtl8192ee/base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192ee/base.c b/drivers/staging/rtl8192ee/base.c
index a7c69f7..71ed12e 100644
--- a/drivers/staging/rtl8192ee/base.c
+++ b/drivers/staging/rtl8192ee/base.c
@@ -827,7 +827,7 @@ static u8 _rtl_get_vht_highest_n_rate(struct ieee80211_hw *hw,
u16 map = le16_to_cpu(sta->vht_cap.vht_mcs.tx_mcs_map);
if ((get_rf_type(rtlphy) == RF_2T2R) &&
- (map & 0x000c) != 0x000c0) {
+ (map & 0x000c) != 0x000c) {
if ((map & 0x000c) >> 2 == IEEE80211_VHT_MCS_SUPPORT_0_7)
hw_rate =
rtlpriv->cfg->maps[RTL_RC_VHT_RATE_2SS_MCS7];
--
1.8.3.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: rtl8192ee: Correct bitmask in comparsion
2014-07-04 23:40 Andrey Utkin
@ 2014-07-08 11:49 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-07-08 11:49 UTC (permalink / raw)
To: Andrey Utkin; +Cc: kernel-janitors, Larry.Finger, linux-kernel, drivers_staging
On Sat, Jul 05, 2014 at 02:40:13AM +0300, Andrey Utkin wrote:
> See https://bugzilla.kernel.org/show_bug.cgi?id=78041
> ---8<---
> Reported-by: David Binderman <dcb314@hotmail.com>
> Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Following the link to bugzilla, this is a static checker fix.
As far as I can see this patch is just based on guess work? Otherwise
put some kind of description why your fix is correct in the changelog.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] staging: rtl8192ee: Correct bitmask in comparsion
@ 2014-07-08 13:54 Andrey Utkin
2014-07-08 15:07 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Andrey Utkin @ 2014-07-08 13:54 UTC (permalink / raw)
To: linux-kernel, devel, kernel-janitors
Cc: gregkh, gulsah.1004, Larry.Finger, paulmck, linville,
dan.carpenter, Andrey Utkin
The issue is discovered by static checker. The proposed change (0x000c0
-> 0x000c) is likely correct because:
1. 16-bit `map` holds value coming from struct
ieee80211_vht_mcs_info.tx_mcs_map, which is described so: "TX MCS map 2
bits for each stream, total 8 streams". The changed code refers to case
of 2 TX streams, and 0x000c mask filters two bits related to the second
stream. Some codelines below 0x0003 mask is used to test first stream.
2. Mask 0x000c is used 3 more times in that place.
3. Specifying 5 digits of hex value is uncommon, especially while working
with `u16` variable. So likely the trailing zero is a typo.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78041
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
---
drivers/staging/rtl8192ee/base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192ee/base.c b/drivers/staging/rtl8192ee/base.c
index a7c69f7..71ed12e 100644
--- a/drivers/staging/rtl8192ee/base.c
+++ b/drivers/staging/rtl8192ee/base.c
@@ -827,7 +827,7 @@ static u8 _rtl_get_vht_highest_n_rate(struct ieee80211_hw *hw,
u16 map = le16_to_cpu(sta->vht_cap.vht_mcs.tx_mcs_map);
if ((get_rf_type(rtlphy) == RF_2T2R) &&
- (map & 0x000c) != 0x000c0) {
+ (map & 0x000c) != 0x000c) {
if ((map & 0x000c) >> 2 == IEEE80211_VHT_MCS_SUPPORT_0_7)
hw_rate =
rtlpriv->cfg->maps[RTL_RC_VHT_RATE_2SS_MCS7];
--
1.8.3.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: rtl8192ee: Correct bitmask in comparsion
2014-07-08 13:54 [PATCH] staging: rtl8192ee: Correct bitmask in comparsion Andrey Utkin
@ 2014-07-08 15:07 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-07-08 15:07 UTC (permalink / raw)
To: Andrey Utkin
Cc: linux-kernel, devel, kernel-janitors, gulsah.1004, gregkh,
linville, paulmck, Larry.Finger
On Tue, Jul 08, 2014 at 04:54:59PM +0300, Andrey Utkin wrote:
> The issue is discovered by static checker. The proposed change (0x000c0
> -> 0x000c) is likely correct because:
> 1. 16-bit `map` holds value coming from struct
> ieee80211_vht_mcs_info.tx_mcs_map, which is described so: "TX MCS map 2
> bits for each stream, total 8 streams". The changed code refers to case
> of 2 TX streams, and 0x000c mask filters two bits related to the second
> stream. Some codelines below 0x0003 mask is used to test first stream.
> 2. Mask 0x000c is used 3 more times in that place.
> 3. Specifying 5 digits of hex value is uncommon, especially while working
> with `u16` variable. So likely the trailing zero is a typo.
This changelog is perfect. Thanks.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-07-08 15:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-08 13:54 [PATCH] staging: rtl8192ee: Correct bitmask in comparsion Andrey Utkin
2014-07-08 15:07 ` Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2014-07-04 23:40 Andrey Utkin
2014-07-08 11:49 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox