Staging: rtl8188eu: Remove parentheses around right side an assignment
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Fri, 13 Mar 2015 16:55:55 +0000 (19:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Mar 2015 15:08:01 +0000 (16:08 +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/rtl8188eu/core/rtw_efuse.c
drivers/staging/rtl8188eu/core/rtw_ieee80211.c
drivers/staging/rtl8188eu/core/rtw_mlme.c
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
drivers/staging/rtl8188eu/core/rtw_recv.c
drivers/staging/rtl8188eu/core/rtw_sreset.c
drivers/staging/rtl8188eu/core/rtw_wlan_util.c
drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c
drivers/staging/rtl8188eu/hal/odm_HWConfig.c
drivers/staging/rtl8188eu/hal/phy.c
drivers/staging/rtl8188eu/hal/rf.c

index defec6b7883d09e48f8658bc893827c614f4d303..b66746160223ab51823836ffa0fc8510e321c240 100644 (file)
@@ -150,12 +150,12 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8  *pbuf)
                                continue;
                        } else {
                                offset = ((rtemp8 & 0xF0) >> 1) | u1temp;
-                               wren = (rtemp8 & 0x0F);
+                               wren = rtemp8 & 0x0F;
                                eFuse_Addr++;
                        }
                } else {
-                       offset = ((rtemp8 >> 4) & 0x0f);
-                       wren = (rtemp8 & 0x0f);
+                       offset = (rtemp8 >> 4) & 0x0f;
+                       wren = rtemp8 & 0x0f;
                }
 
                if (offset < EFUSE_MAX_SECTION_88E) {
index f2c3ca79c0c93026f142635028e6802d166e9976..555efa1da676617a4a8b8f49a0e0d1d0442550f1 100644 (file)
@@ -663,7 +663,7 @@ int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie,
 
        /* Search required WPA or WPA2 IE and copy to sec_ie[] */
 
-       cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_);
+       cnt = _TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_;
 
        sec_idx = 0;
 
index bd87b7d79cb43d286e4af77e1603fe1ff940dbae..6c91aa58d924dc316022d9c7549490f176c27260 100644 (file)
@@ -2042,7 +2042,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len)
        p = rtw_get_ie(pie+sizeof(struct ndis_802_11_fixed_ie), _HT_CAPABILITY_IE_, &len, ie_len-sizeof(struct ndis_802_11_fixed_ie));
        if (p && len > 0) {
                pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2);
-               max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR);
+               max_ampdu_sz = pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR;
                max_ampdu_sz = 1 << (max_ampdu_sz+3); /*  max_ampdu_sz (kbytes); */
                phtpriv->rx_ampdu_maxlen = max_ampdu_sz;
        }
index ec808604a7a28c821a9080dbd0c9ecf7c3573a5c..86d955fadc4b2da543431d14794efcb0acdb43d1 100644 (file)
@@ -1639,7 +1639,7 @@ unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_fr
                        break;
                case RTW_WLAN_ACTION_ADDBA_RESP: /* ADDBA response */
                        status = get_unaligned_le16(&frame_body[3]);
-                       tid = ((frame_body[5] >> 2) & 0x7);
+                       tid = (frame_body[5] >> 2) & 0x7;
                        if (status == 0) {      /* successful */
                                DBG_88E("agg_enable for TID=%d\n", tid);
                                psta->htpriv.agg_enable_bitmap |= 1 << tid;
@@ -2491,7 +2491,7 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short
 
                /* setting IV for auth seq #3 */
                if ((pmlmeinfo->auth_seq == 3) && (pmlmeinfo->state & WIFI_FW_AUTH_STATE) && (use_shared_key == 1)) {
-                       val32 = ((pmlmeinfo->iv++) | (pmlmeinfo->key_index << 30));
+                       val32 = (pmlmeinfo->iv++) | (pmlmeinfo->key_index << 30);
                        le_tmp32 = cpu_to_le32(val32);
                        pframe = rtw_set_fixed_ie(pframe, 4, (unsigned char *)&le_tmp32, &(pattrib->pktlen));
 
@@ -3331,7 +3331,7 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch
                        } while (pmlmeinfo->dialogToken == 0);
                        pframe = rtw_set_fixed_ie(pframe, 1, &(pmlmeinfo->dialogToken), &(pattrib->pktlen));
 
-                       BA_para_set = (0x1002 | ((status & 0xf) << 2)); /* immediate ack & 64 buffer size */
+                       BA_para_set = 0x1002 | ((status & 0xf) << 2); /* immediate ack & 64 buffer size */
                        le_tmp = cpu_to_le16(BA_para_set);
                        pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(le_tmp)), &(pattrib->pktlen));
 
@@ -4247,7 +4247,7 @@ void report_survey_event(struct adapter *padapter,
        if (pcmd_obj == NULL)
                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 == NULL) {
                kfree(pcmd_obj);
@@ -4299,7 +4299,7 @@ void report_surveydone_event(struct adapter *padapter)
        if (pcmd_obj == NULL)
                return;
 
-       cmdsz = (sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header));
+       cmdsz = sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header);
        pevtcmd = kzalloc(cmdsz, GFP_KERNEL);
        if (pevtcmd == NULL) {
                kfree(pcmd_obj);
@@ -4345,7 +4345,7 @@ void report_join_res(struct adapter *padapter, int res)
        if (pcmd_obj == NULL)
                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 == NULL) {
                kfree(pcmd_obj);
@@ -4398,7 +4398,7 @@ void report_del_sta_event(struct adapter *padapter, unsigned char *MacAddr, unsi
        if (pcmd_obj == NULL)
                return;
 
-       cmdsz = (sizeof(struct stadel_event) + sizeof(struct C2HEvent_Header));
+       cmdsz = sizeof(struct stadel_event) + sizeof(struct C2HEvent_Header);
        pevtcmd = kzalloc(cmdsz, GFP_KERNEL);
        if (pevtcmd == NULL) {
                kfree(pcmd_obj);
@@ -4428,7 +4428,7 @@ void report_del_sta_event(struct adapter *padapter, unsigned char *MacAddr, unsi
        if (psta)
                mac_id = (int)psta->mac_id;
        else
-               mac_id = (-1);
+               mac_id = -1;
 
        pdel_sta_evt->mac_id = mac_id;
 
@@ -4453,7 +4453,7 @@ void report_add_sta_event(struct adapter *padapter, unsigned char *MacAddr, int
        if (pcmd_obj == NULL)
                return;
 
-       cmdsz = (sizeof(struct stassoc_event) + sizeof(struct C2HEvent_Header));
+       cmdsz = sizeof(struct stassoc_event) + sizeof(struct C2HEvent_Header);
        pevtcmd = kzalloc(cmdsz, GFP_KERNEL);
        if (pevtcmd == NULL) {
                kfree(pcmd_obj);
@@ -5356,7 +5356,7 @@ u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf)
 
                psta = rtw_get_stainfo(pstapriv, pparm->addr);
                if (psta) {
-                       ctrl = (BIT(15) | ((pparm->algorithm) << 2));
+                       ctrl = BIT(15) | ((pparm->algorithm) << 2);
 
                        DBG_88E("r871x_set_stakey_hdl(): enc_algorithm=%d\n", pparm->algorithm);
 
@@ -5365,7 +5365,7 @@ u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf)
                                return H2C_REJECTED;
                        }
 
-                       cam_id = (psta->mac_id + 3);/* 0~3 for default key, cmd_id = macid + 3, macid = aid+1; */
+                       cam_id = psta->mac_id + 3;/* 0~3 for default key, cmd_id = macid + 3, macid = aid+1; */
 
                        DBG_88E("Write CAM, mac_addr =%x:%x:%x:%x:%x:%x, cam_entry=%d\n", pparm->addr[0],
                                pparm->addr[1], pparm->addr[2], pparm->addr[3], pparm->addr[4],
index 258336ffff8e2b725bd4899f10d12c12be1990bf..cda725a8f9cdf22af090f6a0e35bf7a62cfa949b 100644 (file)
@@ -2163,7 +2163,7 @@ void rtw_signal_stat_timer_hdl(unsigned long data)
 
                /* update value of signal_strength, rssi, signal_qual */
                if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == false) {
-                       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
@@ -2171,7 +2171,7 @@ void rtw_signal_stat_timer_hdl(unsigned long data)
                        if (tmp_s > 100)
                                tmp_s = 100;
 
-                       tmp_q = (avg_signal_qual+(_alpha-1)*recvpriv->signal_qual);
+                       tmp_q = avg_signal_qual+(_alpha-1)*recvpriv->signal_qual;
                        if (tmp_q % _alpha)
                                tmp_q = tmp_q/_alpha + 1;
                        else
index cd4e344e6ffd0c93c94bc6d74c1539cc089910f4..e725a4708775cf7af72119680d09bf551406ae81 100644 (file)
@@ -47,7 +47,7 @@ u8 sreset_get_wifi_status(struct adapter *padapter)
 
        if (WIFI_STATUS_SUCCESS != psrtpriv->Wifi_Error_Status) {
                DBG_88E("==>%s error_status(0x%x)\n", __func__, psrtpriv->Wifi_Error_Status);
-               status = (psrtpriv->Wifi_Error_Status & (~(USB_READ_PORT_FAIL|USB_WRITE_PORT_FAIL)));
+               status = psrtpriv->Wifi_Error_Status & (~(USB_READ_PORT_FAIL|USB_WRITE_PORT_FAIL));
        }
        DBG_88E("==> %s wifi_status(0x%x)\n", __func__, status);
 
index 4ba05b97e487f3caf026293f97a264fa94f5bd66..2b371757cbfe03dc81e5ccba52326e578b5d0faf 100644 (file)
@@ -462,14 +462,14 @@ void write_cam(struct adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key)
        for (j = 5; j >= 0; j--) {
                switch (j) {
                case 0:
-                       val = (ctrl | (mac[0] << 16) | (mac[1] << 24));
+                       val = ctrl | (mac[0] << 16) | (mac[1] << 24);
                        break;
                case 1:
-                       val = (mac[2] | (mac[3] << 8) | (mac[4] << 16) | (mac[5] << 24));
+                       val = mac[2] | (mac[3] << 8) | (mac[4] << 16) | (mac[5] << 24);
                        break;
                default:
                        i = (j - 2) << 2;
-                       val = (key[i] | (key[i+1] << 8) | (key[i+2] << 16) | (key[i+3] << 24));
+                       val = key[i] | (key[i+1] << 8) | (key[i+2] << 16) | (key[i+3] << 24);
                        break;
                }
 
@@ -564,7 +564,7 @@ void WMMOnAssocRsp(struct adapter *padapter)
                /* AIFS = AIFSN * slot time + SIFS - r2t phy delay */
                AIFS = (pmlmeinfo->WMM_param.ac_param[i].ACI_AIFSN & 0x0f) * pmlmeinfo->slotTime + aSifsTime;
 
-               ECWMin = (pmlmeinfo->WMM_param.ac_param[i].CW & 0x0f);
+               ECWMin = pmlmeinfo->WMM_param.ac_param[i].CW & 0x0f;
                ECWMax = (pmlmeinfo->WMM_param.ac_param[i].CW & 0xf0) >> 4;
                TXOP = le16_to_cpu(pmlmeinfo->WMM_param.ac_param[i].TXOP_limit);
 
@@ -741,14 +741,14 @@ void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE)
                } else {
                        /* modify from  fw by Thomas 2010/11/17 */
                        if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3) > (pIE->data[i] & 0x3))
-                               max_AMPDU_len = (pIE->data[i] & 0x3);
+                               max_AMPDU_len = pIE->data[i] & 0x3;
                        else
-                               max_AMPDU_len = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3);
+                               max_AMPDU_len = pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3;
 
                        if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c) > (pIE->data[i] & 0x1c))
-                               min_MPDU_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c);
+                               min_MPDU_spacing = pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c;
                        else
-                               min_MPDU_spacing = (pIE->data[i] & 0x1c);
+                               min_MPDU_spacing = pIE->data[i] & 0x1c;
 
                        pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para = max_AMPDU_len | min_MPDU_spacing;
                }
@@ -1256,7 +1256,7 @@ unsigned int update_MSC_rate(struct HT_caps_element *pHT_caps)
 {
        unsigned int mask = 0;
 
-       mask = ((pHT_caps->u.HT_cap_element.MCS_rate[0] << 12) | (pHT_caps->u.HT_cap_element.MCS_rate[1] << 20));
+       mask = (pHT_caps->u.HT_cap_element.MCS_rate[0] << 12) | (pHT_caps->u.HT_cap_element.MCS_rate[1] << 20);
 
        return mask;
 }
index 8d63c83afee49f1aa4904e37ae2dd88564cac9fe..353ff3761a2aee3a20dcf63b14fb33481e4122f2 100644 (file)
@@ -619,7 +619,7 @@ u8 ODM_RA_GetDecisionRate_8188E(struct odm_dm_struct *dm_odm, u8 macid)
 
        if ((NULL == dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM))
                return 0;
-       DecisionRate = (dm_odm->RAInfo[macid].DecisionRate);
+       DecisionRate = dm_odm->RAInfo[macid].DecisionRate;
        ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
                (" macid =%d DecisionRate = 0x%x\n", macid, DecisionRate));
        return DecisionRate;
@@ -631,7 +631,7 @@ u8 ODM_RA_GetHwPwrStatus_8188E(struct odm_dm_struct *dm_odm, u8 macid)
 
        if ((NULL == dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM))
                return 0;
-       PTStage = (dm_odm->RAInfo[macid].PTStage);
+       PTStage = dm_odm->RAInfo[macid].PTStage;
        ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
                     ("macid =%d PTStage = 0x%x\n", macid, PTStage));
        return PTStage;
index f8fae18341faf28bf63a7d669a43e88400bc3ff4..36afe45d1c9a6dc11102cbbb3ee13cf1df4572c6 100644 (file)
@@ -124,7 +124,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
                /* The RSSI formula should be modified according to the gain table */
                /* In 88E, cck_highpwr is always set to 1 */
                LNA_idx = (cck_agc_rpt & 0xE0) >> 5;
-               VGA_idx = (cck_agc_rpt & 0x1F);
+               VGA_idx = cck_agc_rpt & 0x1F;
                switch (LNA_idx) {
                case 7:
                        if (VGA_idx <= 27)
index f3b195e69057a4a9f62869a75accdd469e7a11e1..6e4c3ee0399a42b579cb421b381ad8dc7444c346 100644 (file)
@@ -60,7 +60,7 @@ void phy_set_bb_reg(struct adapter *adapt, u32 regaddr, u32 bitmask, u32 data)
        if (bitmask != bMaskDWord) { /* if not "double word" write */
                original_value = usb_read32(adapt, regaddr);
                bit_shift = cal_bit_shift(bitmask);
-               data = ((original_value & (~bitmask)) | (data << bit_shift));
+               data = (original_value & (~bitmask)) | (data << bit_shift);
        }
 
        usb_write32(adapt, regaddr, data);
@@ -143,7 +143,7 @@ void phy_set_rf_reg(struct adapter *adapt, enum rf_radio_path rf_path,
        if (bit_mask != bRFRegOffsetMask) {
                original_value = rf_serial_read(adapt, rf_path, reg_addr);
                bit_shift =  cal_bit_shift(bit_mask);
-               data = ((original_value & (~bit_mask)) | (data << bit_shift));
+               data = (original_value & (~bit_mask)) | (data << bit_shift);
        }
 
        rf_serial_write(adapt, rf_path, reg_addr, data);
@@ -393,12 +393,12 @@ void rtl88eu_dm_txpower_track_adjust(struct odm_dm_struct *dm_odm, u8 type,
 
                if (dm_odm->BbSwingIdxOfdm <= dm_odm->BbSwingIdxOfdmBase) {
                        *direction = 1;
-                       pwr_value = (dm_odm->BbSwingIdxOfdmBase -
-                                    dm_odm->BbSwingIdxOfdm);
+                       pwr_value = dm_odm->BbSwingIdxOfdmBase -
+                                    dm_odm->BbSwingIdxOfdm;
                } else {
                        *direction = 2;
-                       pwr_value = (dm_odm->BbSwingIdxOfdm -
-                                    dm_odm->BbSwingIdxOfdmBase);
+                       pwr_value = dm_odm->BbSwingIdxOfdm -
+                                    dm_odm->BbSwingIdxOfdmBase;
                }
 
        } else if (type == 1) { /* For CCK adjust. */
@@ -408,12 +408,12 @@ void rtl88eu_dm_txpower_track_adjust(struct odm_dm_struct *dm_odm, u8 type,
 
                if (dm_odm->BbSwingIdxCck <= dm_odm->BbSwingIdxCckBase) {
                        *direction = 1;
-                       pwr_value = (dm_odm->BbSwingIdxCckBase -
-                                    dm_odm->BbSwingIdxCck);
+                       pwr_value = dm_odm->BbSwingIdxCckBase -
+                                    dm_odm->BbSwingIdxCck;
                } else {
                        *direction = 2;
-                       pwr_value = (dm_odm->BbSwingIdxCck -
-                                    dm_odm->BbSwingIdxCckBase);
+                       pwr_value = dm_odm->BbSwingIdxCck -
+                                    dm_odm->BbSwingIdxCckBase;
                }
 
        }
index eea4c8a6022b6643d6164a09102ceb6ed07bc8d1..097092772a860d4b66845394ab0ca46e3b005b09 100644 (file)
@@ -201,7 +201,7 @@ static void get_rx_power_val_by_reg(struct adapter *adapt, u8 channel,
                        break;
                case 2: /*  Better regulatory */
                                /*  don't increase any power diff */
-                       write_val = ((index < 2) ? powerbase0[rf] : powerbase1[rf]);
+                       write_val = (index < 2) ? powerbase0[rf] : powerbase1[rf];
                        break;
                case 3: /*  Customer defined power diff. */
                                /*  increase power diff defined by customer. */