From: David Decotigny <ddecotig@gmail.com>
To: Oleg Drokin <oleg.drokin@intel.com>,
Andreas Dilger <andreas.dilger@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
HPDD-discuss@ml01.01.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Cc: Doug Oucharek <doug.s.oucharek@intel.com>,
Peng Tao <bergwolf@gmail.com>, Isaac Huang <he.huang@intel.com>,
Amir Shehata <amir.shehata@intel.com>,
David Decotigny <ddecotig@gmail.com>,
Liang Zhen <liang.zhen@intel.com>
Subject: [PATCH v2 1/2] staging: rtl8723au: core: avoid bitwise arithmetic with forced endianness
Date: Sat, 6 Jun 2015 17:33:59 -0700 [thread overview]
Message-ID: <1433637240-24223-2-git-send-email-ddecotig@gmail.com> (raw)
In-Reply-To: <1433637240-24223-1-git-send-email-ddecotig@gmail.com>
This fixes bitwise arithmetic performed on the host on a variable
previously converted to little-endian, and subsequently converted
again to little-endian:
- issue_action_BA23a() called with "status" crafted in host byte order
- "status" converted to LE
- bitwise arithmetic on the (LE) "status", performed with masks and
shifts in host byte order
- result converted to LE (again) and stored in device structure
Sparse warning addressed by this patch:
drivers/staging/rtl8723au/core/rtw_mlme_ext.c:3806:16: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8723au/core/rtw_mlme_ext.c:3806:16: expected unsigned short [unsigned] status
drivers/staging/rtl8723au/core/rtw_mlme_ext.c:3806:16: got restricted __le16 [usertype] <noident>
Signed-off-by: David Decotigny <ddecotig@gmail.com>
---
drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
index 196beaf..7c3b5dd 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
@@ -3803,8 +3803,6 @@ void issue_action_BA23a(struct rtw_adapter *padapter,
pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr) + 1;
- status = cpu_to_le16(status);
-
switch (action) {
case WLAN_ACTION_ADDBA_REQ:
pattrib->pktlen += sizeof(mgmt->u.action.u.addba_req);
--
2.2.0.rc0.207.ga3a616c
next prev parent reply other threads:[~2015-06-07 0:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-07 0:33 [PATCH v2 0/2] staging: rtl8723au: core: endianness issues David Decotigny
2015-06-07 0:33 ` David Decotigny [this message]
2015-06-07 11:20 ` [PATCH v2 1/2] staging: rtl8723au: core: avoid bitwise arithmetic with forced endianness Dan Carpenter
2015-06-08 0:33 ` David Decotigny
2015-06-07 0:34 ` [PATCH v2 2/2] staging: rtl8723au: core: remove redundant endianness conversion David Decotigny
2015-06-07 12:09 ` Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2015-06-08 0:43 [PATCH v2 0/2] staging: rtl8723au: core: endianness issues David Decotigny
2015-06-08 0:43 ` [PATCH v2 1/2] staging: rtl8723au: core: avoid bitwise arithmetic with forced endianness David Decotigny
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=1433637240-24223-2-git-send-email-ddecotig@gmail.com \
--to=ddecotig@gmail.com \
--cc=HPDD-discuss@ml01.01.org \
--cc=amir.shehata@intel.com \
--cc=andreas.dilger@intel.com \
--cc=bergwolf@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=doug.s.oucharek@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=he.huang@intel.com \
--cc=liang.zhen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg.drokin@intel.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