Staging: rtl8723au: Remove parentheses around right side an assignment
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Fri, 13 Mar 2015 17:45:25 +0000 (20:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Mar 2015 15:23:44 +0000 (16:23 +0100)
Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:

@rule1@
identifier x, y, z;
expression E1, E2;
@@

(
x = (y == z);
|
x = (E1 == E2);
|
 x =
-(
...
-)
 ;
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_mlme_ext.c
drivers/staging/rtl8723au/core/rtw_recv.c
drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c
drivers/staging/rtl8723au/hal/rtl8723au_recv.c
drivers/staging/rtl8723au/hal/usb_halinit.c

index 0e0f73c86e53c5738dc5d728f2df0361d99c004e..d01ca1d75254d38c330ad26aab7ed6868f9e13a4 100644 (file)
@@ -3842,7 +3842,7 @@ void issue_action_BA23a(struct rtw_adapter *padapter,
                                IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK;
                } else {
                        /* immediate ack & 64 buffer size */
-                       BA_para_set = (0x1002 | ((status & 0xf) << 2));
+                       BA_para_set = 0x1002 | ((status & 0xf) << 2);
                }
 
                put_unaligned_le16(BA_para_set,
@@ -4745,7 +4745,7 @@ void report_survey_event23a(struct rtw_adapter *padapter,
        if (!pcmd_obj)
                return;
 
-       cmdsz = (sizeof(struct survey_event) + sizeof(struct C2HEvent_Header));
+       cmdsz = sizeof(struct survey_event) + sizeof(struct C2HEvent_Header);
        pevtcmd = kzalloc(cmdsz, GFP_ATOMIC);
        if (!pevtcmd) {
                kfree(pcmd_obj);
@@ -4796,7 +4796,7 @@ void report_surveydone_event23a(struct rtw_adapter *padapter)
        if (!pcmd_obj)
                return;
 
-       cmdsz = (sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header));
+       cmdsz = sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header);
        pevtcmd = kzalloc(cmdsz, GFP_ATOMIC);
        if (!pevtcmd) {
                kfree(pcmd_obj);
@@ -4840,7 +4840,7 @@ void report_join_res23a(struct rtw_adapter *padapter, int res)
        if (!pcmd_obj)
                return;
 
-       cmdsz = (sizeof(struct joinbss_event) + sizeof(struct C2HEvent_Header));
+       cmdsz = sizeof(struct joinbss_event) + sizeof(struct C2HEvent_Header);
        pevtcmd = kzalloc(cmdsz, GFP_ATOMIC);
        if (!pevtcmd) {
                kfree(pcmd_obj);
@@ -4890,7 +4890,7 @@ void report_del_sta_event23a(struct rtw_adapter *padapter,
        if (!pcmd_obj)
                return;
 
-       cmdsz = (sizeof(struct stadel_event) + sizeof(struct C2HEvent_Header));
+       cmdsz = sizeof(struct stadel_event) + sizeof(struct C2HEvent_Header);
        pevtcmd = kzalloc(cmdsz, GFP_ATOMIC);
        if (!pevtcmd) {
                kfree(pcmd_obj);
@@ -4918,7 +4918,7 @@ void report_del_sta_event23a(struct rtw_adapter *padapter,
        if (psta)
                mac_id = (int)psta->mac_id;
        else
-               mac_id = (-1);
+               mac_id = -1;
 
        pdel_sta_evt->mac_id = mac_id;
 
@@ -4944,7 +4944,7 @@ void report_add_sta_event23a(struct rtw_adapter *padapter,
        if (!pcmd_obj)
                return;
 
-       cmdsz = (sizeof(struct stassoc_event) + sizeof(struct C2HEvent_Header));
+       cmdsz = sizeof(struct stassoc_event) + sizeof(struct C2HEvent_Header);
        pevtcmd = kzalloc(cmdsz, GFP_ATOMIC);
        if (!pevtcmd) {
                kfree(pcmd_obj);
@@ -5951,7 +5951,7 @@ int set_stakey_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 
                        /* 0~3 for default key, cmd_id = macid + 3,
                           macid = aid+1; */
-                       cam_id = (psta->mac_id + 3);
+                       cam_id = psta->mac_id + 3;
 
                        DBG_8723A("Write CAM, mac_addr =%x:%x:%x:%x:%x:%x, "
                                  "cam_entry =%d\n", pparm->addr[0],
index 559dddee26485df3ced453913850eb1b2e513e49..9c783002caf2c4878aa95fe758cbf16ebdd50bf6 100644 (file)
@@ -2334,8 +2334,8 @@ void rtw_signal_stat_timer_hdl23a(unsigned long data)
 
        /* update value of signal_strength, rssi, signal_qual */
        if (!check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY)) {
-               tmp_s = (avg_signal_strength + (_alpha - 1) *
-                        recvpriv->signal_strength);
+               tmp_s = avg_signal_strength + (_alpha - 1) *
+                        recvpriv->signal_strength;
                if (tmp_s %_alpha)
                        tmp_s = tmp_s / _alpha + 1;
                else
index e46032e0077e0692696be6d1fc797970fdd6739c..7f091da0273f998b45c82b9230dcc103330373bb 100644 (file)
@@ -3208,7 +3208,7 @@ bthci_CmdDisconnectPhysicalLink(struct rtw_adapter *padapter,
        pBtDbg->dbgHciInfo.hciCmdCntDisconnectPhyLink++;
 
        PLH = *((u8 *)pHciCmd->Data);
-       PhysLinkDisconnectReason = (*((u8 *)pHciCmd->Data+1));
+       PhysLinkDisconnectReason = *((u8 *)pHciCmd->Data+1);
        RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_DISCONNECT_PHYSICAL_LINK  PhyHandle = 0x%x, Reason = 0x%x\n",
                PLH, PhysLinkDisconnectReason));
 
index ebe33392c8d9e69f219a3936a36b8df2ef537757..d3dc24b0cc46fcec33e31d6132b038df9e456767 100644 (file)
@@ -428,10 +428,10 @@ hal_ReadEFuse_WiFi(struct rtw_adapter *padapter,
                                continue;
 
                        offset |= ((efuseExtHdr & 0xF0) >> 1);
-                       wden = (efuseExtHdr & 0x0F);
+                       wden = efuseExtHdr & 0x0F;
                } else {
-                       offset = ((efuseHeader >> 4) & 0x0f);
-                       wden = (efuseHeader & 0x0f);
+                       offset = (efuseHeader >> 4) & 0x0f;
+                       wden = efuseHeader & 0x0f;
                }
 
                if (offset < EFUSE_MAX_SECTION_8723A) {
@@ -527,10 +527,10 @@ hal_ReadEFuse_BT(struct rtw_adapter *padapter,
                                        continue;
 
                                offset |= ((efuseExtHdr & 0xF0) >> 1);
-                               wden = (efuseExtHdr & 0x0F);
+                               wden = efuseExtHdr & 0x0F;
                        } else {
-                               offset = ((efuseHeader >> 4) & 0x0f);
-                               wden = (efuseHeader & 0x0f);
+                               offset = (efuseHeader >> 4) & 0x0f;
+                               wden = efuseHeader & 0x0f;
                        }
 
                        if (offset < EFUSE_BT_MAX_SECTION) {
index d34a1481b13a602ee66cc7ffaf9a62003dd47b14..38f8c3de302932674b40272f974aa3a24843be59 100644 (file)
@@ -126,7 +126,7 @@ PHY_SetBBReg(struct rtw_adapter *Adapter, u32 RegAddr, u32 BitMask, u32     Data)
        if (BitMask != bMaskDWord) {/* if not "double word" write */
                OriginalValue = rtl8723au_read32(Adapter, RegAddr);
                BitShift = phy_CalculateBitShift(BitMask);
-               Data = ((OriginalValue & (~BitMask)) | (Data << BitShift));
+               Data = (OriginalValue & (~BitMask)) | (Data << BitShift);
        }
 
        rtl8723au_write32(Adapter, RegAddr, Data);
@@ -389,7 +389,7 @@ PHY_SetRFReg(struct rtw_adapter *Adapter, enum RF_RADIO_PATH eRFPath,
        if (BitMask != bRFRegOffsetMask) {
                Original_Value = phy_RFSerialRead(Adapter, eRFPath, RegAddr);
                BitShift =  phy_CalculateBitShift(BitMask);
-               Data = ((Original_Value & (~BitMask)) | (Data << BitShift));
+               Data = (Original_Value & (~BitMask)) | (Data << BitShift);
        }
 
        phy_RFSerialWrite(Adapter, eRFPath, RegAddr, Data);
index 32c58c6124b09630dc914b54d25fac2e3d2148be..3e3f18634ffef53cb6e971b0b03f2b4b5b76f92f 100644 (file)
@@ -267,8 +267,8 @@ getTxPowerWriteValByRegulatory(struct rtw_adapter *Adapter, u8 Channel,
                        break;
                case 2: /*  Better regulatory */
                        /*  don't increase any power diff */
-                       writeVal = ((index < 2) ? powerBase0[rf] :
-                                   powerBase1[rf]);
+                       writeVal = (index < 2) ? powerBase0[rf] :
+                                   powerBase1[rf];
                        break;
                case 3: /*  Customer defined power diff. */
                        chnlGroup = 0;
index 6075b6dc1beead980e4737aa51bfcfcaca2dad3e..aae433f0e8af456c702131e78026679066d2f331 100644 (file)
@@ -194,8 +194,8 @@ void update_recvframe_phyinfo(struct recv_frame *precvframe,
        bool matchbssid = false;
        u8 *bssid;
 
-       matchbssid = (!ieee80211_is_ctl(hdr->frame_control) &&
-                     !pattrib->icv_err && !pattrib->crc_err);
+       matchbssid = !ieee80211_is_ctl(hdr->frame_control) &&
+                     !pattrib->icv_err && !pattrib->crc_err;
 
        if (matchbssid) {
                switch (hdr->frame_control &
index bd9c549f4a0a2abccc5526cd6607aec62dbe6ed1..0d08863d72bd16d5be8fa265b5a0a91834e1f21d 100644 (file)
@@ -736,8 +736,8 @@ int rtl8723au_hal_init(struct rtw_adapter *Adapter)
 
        rtl8723a_InitHalDm(Adapter);
 
-       val8 = ((WiFiNavUpperUs + HAL_8723A_NAV_UPPER_UNIT - 1) /
-               HAL_8723A_NAV_UPPER_UNIT);
+       val8 = (WiFiNavUpperUs + HAL_8723A_NAV_UPPER_UNIT - 1) /
+               HAL_8723A_NAV_UPPER_UNIT;
        rtl8723au_write8(Adapter, REG_NAV_UPPER, val8);
 
        /*  2011/03/09 MH debug only, UMC-B cut pass 2500 S5 test, but we need to fin root cause. */