Staging: rtl8192u: Remove parentheses around right side an assignment
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Fri, 13 Mar 2015 17:50:52 +0000 (20:50 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Mar 2015 14:56:46 +0000 (15:56 +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/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
drivers/staging/rtl8192u/r8192U_core.c
drivers/staging/rtl8192u/r8192U_dm.c
drivers/staging/rtl8192u/r819xU_phy.c

index 32177c6..788704b 100644 (file)
@@ -130,8 +130,8 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
                       (WLAN_FC_GET_STYPE(fc) & 0x08));
        */
        /* fixed by David :2006.9.6 */
-       qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) &&
-                      (WLAN_FC_GET_STYPE(fc) & 0x80));
+       qc_included = (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) &&
+                      (WLAN_FC_GET_STYPE(fc) & 0x80);
        aad_len = 22;
        if (a4_included)
                aad_len += 6;
index 5f9ba77..66b1587 100644 (file)
@@ -877,7 +877,7 @@ static struct sk_buff *ieee80211_assoc_resp(struct ieee80211_device *ieee,
                crypt = ieee->crypt[ieee->tx_keyidx];
        else crypt = NULL;
 
-       encrypt = (crypt && crypt->ops);
+       encrypt = crypt && crypt->ops;
 
        if (encrypt)
                assoc->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY);
index c6ff2f0..c3c06f1 100644 (file)
@@ -2078,10 +2078,10 @@ static u8 rtl8192_getSupportedWireleeMode(struct net_device *dev)
        case RF_8225:
        case RF_8256:
        case RF_PSEUDO_11N:
-               ret = (WIRELESS_MODE_N_24G|WIRELESS_MODE_G|WIRELESS_MODE_B);
+               ret = WIRELESS_MODE_N_24G|WIRELESS_MODE_G|WIRELESS_MODE_B;
                break;
        case RF_8258:
-               ret = (WIRELESS_MODE_A|WIRELESS_MODE_N_5G);
+               ret = WIRELESS_MODE_A|WIRELESS_MODE_N_5G;
                break;
        default:
                ret = WIRELESS_MODE_B;
@@ -2687,7 +2687,7 @@ static bool rtl8192_adapter_start(struct net_device *dev)
 
        read_nic_dword(dev, CPU_GEN, &dwRegRead);
        if (priv->LoopbackMode == RTL819xU_NO_LOOPBACK)
-               dwRegRead = ((dwRegRead & CPU_GEN_NO_LOOPBACK_MSK) | CPU_GEN_NO_LOOPBACK_SET);
+               dwRegRead = (dwRegRead & CPU_GEN_NO_LOOPBACK_MSK) | CPU_GEN_NO_LOOPBACK_SET;
        else if (priv->LoopbackMode == RTL819xU_MAC_LOOPBACK)
                dwRegRead |= CPU_CCK_LOOPBACK;
        else
@@ -3643,7 +3643,7 @@ static u8 HwRateToMRate90(bool bIsHT, u8 rate)
                                ret_rate = MGN_MCS15;
                                break;
                        case DESC90_RATEMCS32:
-                               ret_rate = (0x80|0x20);
+                               ret_rate = 0x80|0x20;
                                break;
 
                        default:
@@ -4228,9 +4228,9 @@ static void TranslateRxSignalStuff819xUsb(struct sk_buff *skb,
        praddr = hdr->addr1;
 
        /* Check if the received packet is acceptable. */
-       bpacket_match_bssid = ((IEEE80211_FTYPE_CTL != type) &&
+       bpacket_match_bssid = (IEEE80211_FTYPE_CTL != type) &&
                               (eqMacAddr(priv->ieee80211->current_network.bssid,  (fc & IEEE80211_FCTL_TODS) ? hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : hdr->addr3))
-                              && (!pstats->bHwError) && (!pstats->bCRC) && (!pstats->bICV));
+                              && (!pstats->bHwError) && (!pstats->bCRC) && (!pstats->bICV);
        bpacket_toself =  bpacket_match_bssid & (eqMacAddr(praddr, priv->ieee80211->dev->dev_addr));
 
        if (WLAN_FC_GET_FRAMETYPE(fc) == IEEE80211_STYPE_BEACON)
index 4c62cb8..8669162 100644 (file)
@@ -717,7 +717,7 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device *dev)
                if (tmpCCK40Mindex >= CCK_Table_length)
                        tmpCCK40Mindex = CCK_Table_length-1;
        } else {
-               tmpval = ((u8)tmpRegA - priv->ThermalMeter[0]);
+               tmpval = (u8)tmpRegA - priv->ThermalMeter[0];
 
                if (tmpval >= 6) /* higher temperature */
                        tmpOFDMindex = tmpCCK20Mindex = 0; /* max to +6dB */
@@ -2270,10 +2270,10 @@ static void dm_check_edca_turbo(
                                /*  For Each time updating EDCA parameter, reset EDCA turbo mode status. */
                                dm_init_edca_turbo(dev);
                                u1bAIFS = qos_parameters->aifs[0] * ((mode&(IEEE_G|IEEE_N_24G)) ? 9 : 20) + aSifsTime;
-                               u4bAcParam = ((((u32)(qos_parameters->tx_op_limit[0])) << AC_PARAM_TXOP_LIMIT_OFFSET)|
+                               u4bAcParam = (((u32)(qos_parameters->tx_op_limit[0])) << AC_PARAM_TXOP_LIMIT_OFFSET)|
                                        (((u32)(qos_parameters->cw_max[0])) << AC_PARAM_ECW_MAX_OFFSET)|
                                        (((u32)(qos_parameters->cw_min[0])) << AC_PARAM_ECW_MIN_OFFSET)|
-                                       ((u32)u1bAIFS << AC_PARAM_AIFS_OFFSET));
+                                       ((u32)u1bAIFS << AC_PARAM_AIFS_OFFSET);
                                /*write_nic_dword(dev, WDCAPARA_ADD[i], u4bAcParam);*/
                                write_nic_dword(dev, EDCAPARA_BE,  u4bAcParam);
 
index 3451ec7..a64c9fc 100644 (file)
@@ -823,8 +823,8 @@ static void rtl8192_BB_Config_ParaFile(struct net_device *dev)
        write_nic_byte_E(dev, 0x5e, 0x00);
        if (priv->card_8192_version == (u8)VERSION_819xU_A) {
                /* Antenna gain offset from B/C/D to A */
-               reg_u32 = (priv->AntennaTxPwDiff[1]<<4 |
-                          priv->AntennaTxPwDiff[0]);
+               reg_u32 = priv->AntennaTxPwDiff[1]<<4 |
+                          priv->AntennaTxPwDiff[0];
                rtl8192_setBBreg(dev, rFPGA0_TxGainStage, (bXBTxAGC|bXCTxAGC),
                                 reg_u32);