Skip to content

Commit

Permalink
staging: r8188eu: Remove unnecessary parentheses
Browse files Browse the repository at this point in the history
Clang warns several times across the driver along the lines of:

drivers/staging/r8188eu/core/rtw_pwrctrl.c:222:21: warning: equality
comparison with extraneous parentheses [-Wparentheses-equality]
        if ((pwrpriv->rpwm == pslv)) {
             ~~~~~~~~~~~~~~^~~~~~~
drivers/staging/r8188eu/core/rtw_pwrctrl.c:222:21: note: remove
extraneous parentheses around the comparison to silence this warning
        if ((pwrpriv->rpwm == pslv)) {
            ~              ^      ~
drivers/staging/r8188eu/core/rtw_pwrctrl.c:222:21: note: use '=' to turn
this equality comparison into an assignment
        if ((pwrpriv->rpwm == pslv)) {
                           ^~
                           =
1 warning generated.

The compilers have agreed that single parentheses are used for equality
and double parentheses are used for assignment within control flow
statements such as if and while so remove them in these places to fix
the warning.

Reviewed-by: Nick Desaulniers <[email protected]>
Signed-off-by: Nathan Chancellor <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
nathanchance authored and gregkh committed Aug 5, 2021
1 parent d48401b commit 717d933
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/r8188eu/core/rtw_pwrctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv)
pslv = PS_STATE_S3;
}

if ((pwrpriv->rpwm == pslv))
if (pwrpriv->rpwm == pslv)
return;

if ((padapter->bSurpriseRemoved) ||
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/r8188eu/core/rtw_security.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
pframe = ((struct xmit_frame *)pxmitframe)->buf_addr + hw_hdr_offset;

/* 4 start to encrypt each fragment */
if ((pattrib->encrypt == _AES_)) {
if (pattrib->encrypt == _AES_) {
if (pattrib->psta)
stainfo = pattrib->psta;
else
Expand Down Expand Up @@ -1452,7 +1452,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)

pframe = (unsigned char *)((struct recv_frame *)precvframe)->rx_data;
/* 4 start to encrypt each fragment */
if ((prxattrib->encrypt == _AES_)) {
if (prxattrib->encrypt == _AES_) {
stainfo = rtw_get_stainfo(&padapter->stapriv, &prxattrib->ta[0]);
if (stainfo) {
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_aes_decrypt: stainfo!= NULL!!!\n"));
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/r8188eu/core/rtw_wlan_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ int support_short_GI(struct adapter *padapter, struct HT_caps_element *pHT_caps)
if (!(pmlmeinfo->HT_enable))
return _FAIL;

if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_RALINK))
if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_RALINK)
return _FAIL;

bit_offset = (pmlmeext->cur_bwmode & HT_CHANNEL_WIDTH_40) ? 6 : 5;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/r8188eu/hal/odm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,7 @@ void odm_EdcaTurboCheckCE(struct odm_dm_struct *pDM_Odm)
struct mlme_ext_priv *pmlmeext = &(Adapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);

if ((pregpriv->wifi_spec == 1))/* (pmlmeinfo->HT_enable == 0)) */
if (pregpriv->wifi_spec == 1)
goto dm_CheckEdcaTurbo_EXIT;

if (pmlmeinfo->assoc_AP_vendor >= HT_IOT_PEER_MAX)
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/r8188eu/hal/usb_halinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ static void hw_var_set_opmode(struct adapter *Adapter, u8 variable, u8 *val)
StopTxBeacon(Adapter);

rtw_write8(Adapter, REG_BCN_CTRL, 0x19);/* disable atim wnd */
} else if ((mode == _HW_STATE_ADHOC_)) {
} else if (mode == _HW_STATE_ADHOC_) {
ResumeTxBeacon(Adapter);
rtw_write8(Adapter, REG_BCN_CTRL, 0x1a);
} else if (mode == _HW_STATE_AP_) {
Expand Down

0 comments on commit 717d933

Please sign in to comment.