Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932331AbbFGAwV (ORCPT ); Sat, 6 Jun 2015 20:52:21 -0400 Received: from mail-qk0-f175.google.com ([209.85.220.175]:32972 "EHLO mail-qk0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752257AbbFGAwP (ORCPT ); Sat, 6 Jun 2015 20:52:15 -0400 From: David Decotigny To: Oleg Drokin , Andreas Dilger , Greg Kroah-Hartman , HPDD-discuss@ml01.01.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Doug Oucharek , Peng Tao , Isaac Huang , Amir Shehata , David Decotigny , Liang Zhen Subject: [PATCH v2 1/2] staging: rtl8723au: core: avoid bitwise arithmetic with forced endianness Date: Sat, 6 Jun 2015 17:33:59 -0700 Message-Id: <1433637240-24223-2-git-send-email-ddecotig@gmail.com> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1433637240-24223-1-git-send-email-ddecotig@gmail.com> References: <1433637240-24223-1-git-send-email-ddecotig@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1728 Lines: 40 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] Signed-off-by: David Decotigny --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/