staging: rtl8723bs: Remove unnecessary parentheses
cover staging: rtl8723bs: Remove unnecessary parentheses
Challenge suggested by coccinelle
This patchset removes unnecessary parentheses while returning a value by evaluating an expression, using following semantic patch:
@@
expression e;
@@
return
- (
e
- )
;
Payal Kshirsagar (8):
staging: rtl8723bs: hal: sdio_ops.c: Remove unnecessary parentheses
staging: rtl8723bs: hal: rtl8723b_phycfg.c: Remove unnecessary
parentheses
staging: rtl8723bs: hal: hal_com.c: Remove unnecessary parentheses
staging: rtl8723bs: hal: odm_HWConfig.c: Remove unnecessary
parentheses
staging: rtl8723bs: core: rtw_mlme.c: Remove unnecessary parentheses
staging: rtl8723bs: core: rtw_wlan_util.c: Remove unnecessary
parentheses
staging: rtl8723bs: core: rtw_ieee80211.c: Remove unnecessary
parentheses
staging: rtl8723bs: os_dep: ioctl_linux.c: Remove unnecessary
parentheses
drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 6 +++--- drivers/staging/rtl8723bs/core/rtw_mlme.c | 8 ++++---- drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8723bs/hal/hal_com.c | 6 +++--- drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 2 +- drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c | 2 +- drivers/staging/rtl8723bs/hal/sdio_ops.c | 6 +++--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/8 staging: rtl8723bs: hal: sdio_ops.c: Remove unnecessary parentheses
Challenge suggested by coccinelle.
Remove unnecessary parentheses around expressions.
--- drivers/staging/rtl8723bs/hal/sdio_ops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/hal/sdio_ops.c +3 -3
@@ -560,7 +560,7 @@ static s32 _sdio_local_read( n =RND4 (cnt); tmpbuf =rtw_malloc (n);if (!tmpbuf) -return (-1 ); +return -1 ; err =_sd_read (intfhdl, addr, n, tmpbuf);if (!err)
@@ -601,7 +601,7 @@ s32 sdio_local_read( n =RND4 (cnt); tmpbuf =rtw_malloc (n);if (!tmpbuf) -return (-1 ); +return -1 ; err =sd_read (intfhdl, addr, n, tmpbuf);if (!err)
@@ -646,7 +646,7 @@ s32 sdio_local_write( tmpbuf =rtw_malloc (cnt);if (!tmpbuf) -return (-1 ); +return -1 ;memcpy (tmpbuf, buf, cnt);
Signature · 1 line
2.7.4
PATCH 2/8 staging: rtl8723bs: hal: rtl8723b_phycfg.c: Remove unnecessary parentheses
In reply to Payal KshirsagarChallenge suggested by coccinelle.
Remove unnecessary parentheses around an expression.
--- drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -1
@@ -827,7 +827,7 @@ static u8 phy_GetSecondaryChnl_8723B(struct adapter *Adapter) }RT_TRACE (_module_hal_init_c_, _drv_info_, ("SCMapping: SC Value %x\n" , ((SCSettingOf40 <<4 ) | SCSettingOf20))); -return ((SCSettingOf40 <<4 ) | SCSettingOf20); +return (SCSettingOf40 <<4 ) | SCSettingOf20; }static void phy_PostSetBwMode8723B (struct adapter *Adapter)
Signature · 1 line
2.7.4
PATCH 3/8 staging: rtl8723bs: hal: hal_com.c: Remove unnecessary parentheses
In reply to Payal KshirsagarChallenge suggested by coccinelle.
Remove unnecessary parentheses around expressions.
--- drivers/staging/rtl8723bs/hal/hal_com.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/hal/hal_com.c +3 -3
@@ -1389,11 +1389,11 @@ bool IsHexDigit(char chTmp)u32 MapCharToHexDigit (char chTmp) {if (chTmp >='0' && chTmp <='9' ) -return (chTmp -'0' ); +return chTmp -'0' ;else if (chTmp >='a' && chTmp <='f' ) -return (10 + (chTmp -'a' )); +return 10 + (chTmp -'a' );else if (chTmp >='A' && chTmp <='F' ) -return (10 + (chTmp -'A' )); +return 10 + (chTmp -'A' );else return 0 ; }
Signature · 1 line
2.7.4
PATCH 4/8 staging: rtl8723bs: hal: odm_HWConfig.c: Remove unnecessary parentheses
In reply to Payal KshirsagarChallenge suggested by coccinelle.
Remove unnecessary parentheses around an expression, add spaces around operator and remove trailing space.
--- drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/hal/odm_HWConfig.c +1 -1
@@ -19,7 +19,7 @@ static u8 odm_QueryRxPwrPercentage(s8 AntPower)else if (AntPower >=0 )return 100 ;else -return (100 +AntPower); +return 100 + AntPower; }
Signature · 1 line
2.7.4
PATCH 5/8 staging: rtl8723bs: core: rtw_mlme.c: Remove unnecessary parentheses
In reply to Payal KshirsagarChallenge suggested by coccinelle.
Remove unnecessary parentheses around expressions.
--- drivers/staging/rtl8723bs/core/rtw_mlme.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme.c +4 -4
@@ -332,7 +332,7 @@ void rtw_generate_random_ibss(u8 *pibss)u8 *rtw_get_capability_from_ie (u8 *ie) { -return (ie +8 +2 ); +return ie +8 +2 ; }
@@ -347,7 +347,7 @@ u16 rtw_get_capability(struct wlan_bssid_ex *bss)u8 *rtw_get_beacon_interval_from_ie (u8 *ie) { -return (ie +8 ); +return ie +8 ; }
@@ -451,14 +451,14 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 fea s_cap =le16_to_cpu (tmps); d_cap =le16_to_cpu (tmpd); -return ((src->Ssid.SsidLength == dst->Ssid.SsidLength) && +return (src->Ssid.SsidLength == dst->Ssid.SsidLength) &&/* (src->Configuration.DSConfig == dst->Configuration.DSConfig) && */ ((!memcmp (src->MacAddress, dst->MacAddress,ETH_ALEN ))) && ((!memcmp (src->Ssid.Ssid, dst->Ssid.Ssid, src->Ssid.SsidLength))) && ((s_cap &WLAN_CAPABILITY_IBSS ) == (d_cap &WLAN_CAPABILITY_IBSS )) && ((s_cap &WLAN_CAPABILITY_BSS ) == - (d_cap &WLAN_CAPABILITY_BSS ))); + (d_cap &WLAN_CAPABILITY_BSS )); }
Signature · 1 line
2.7.4
PATCH 6/8 staging: rtl8723bs: core: rtw_wlan_util.c: Remove unnecessary parentheses
In reply to Payal KshirsagarChallenge suggested by coccinelle.
Remove unnecessary parentheses around an expression.
--- drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_wlan_util.c +1 -1
@@ -518,7 +518,7 @@ unsigned int decide_wait_for_beacon_timeout(unsigned int bcn_interval)else if ((bcn_interval <<2 ) >WAIT_FOR_BCN_TO_MAX )return WAIT_FOR_BCN_TO_MAX ;else -return ((bcn_interval <<2 )); +return bcn_interval <<2 ; }void invalidate_cam_all (struct adapter *padapter)
Signature · 1 line
2.7.4
PATCH 7/8 staging: rtl8723bs: core: rtw_ieee80211.c: Remove unnecessary parentheses
In reply to Payal KshirsagarChallenge suggested by coccinelle.
Remove unnecessary parentheses around expressions.
--- drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +3 -3
@@ -114,7 +114,7 @@ u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *sourc {memcpy ((void *)pbuf, (void *)source, len); *frlen = *frlen + len; -return (pbuf + len); +return pbuf + len; }/* rtw_set_ie will update frame length */
@@ -136,7 +136,7 @@ u8 *rtw_set_ie *frlen = *frlen + (len +2 ); -return (pbuf + len +2 ); +return pbuf + len +2 ; }/*----------------------------------------------------------------------------
@@ -706,7 +706,7 @@ int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, } } -return (*rsn_len + *wpa_len); +return *rsn_len + *wpa_len; }u8 rtw_is_wps_ie (u8 *ie_ptr,uint *wps_ielen)
Signature · 1 line
2.7.4
PATCH 8/8 staging: rtl8723bs: os_dep: ioctl_linux.c: Remove unnecessary parentheses
In reply to Payal KshirsagarChallenge suggested by coccinelle.
Remove unnecessary parentheses around an expression and fix identation issue.
--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1 -1
@@ -961,7 +961,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,if (pPMK->cmd ==IW_PMKSA_ADD ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" );if (!memcmp (strIssueBssid, strZeroMacAddress,ETH_ALEN )) -return (intReturn); +return intReturn;else intReturn = true;
Signature · 1 line
2.7.4
Re: [Outreachy kernel] [PATCH 8/8] staging: rtl8723bs: os_dep: ioctl_linux.c: Remove unnecessary parentheses
Quoted 14 lines · Payal Kshirsagar
Challenge suggested by coccinelle.
Remove unnecessary parentheses around an expression and fix identation issue.Signed-off-by Payal Kshirsagar <[email protected]>--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0
-0
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 966
Quoted 7 lines
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1
-1@@ -961,7 +961,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,if (pPMK->cmd ==IW_PMKSA_ADD ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" );if (!memcmp (strIssueBssid, strZeroMacAddress,ETH_ALEN )) -return (intReturn); +return intReturn;else intReturn = true;
I think you could really make another patch in the series for the indentation issue and fix up both branches of the if. It looks a bit odd now.
julia
Quoted 11 lines
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0
-1--2.7.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/c92a25aaae32172a4c04e3b1cdcbb676ba316672.1553921776.git.payal.s.kshirsagar.98%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Re: [Outreachy kernel] [PATCH 8/8] staging: rtl8723bs: os_dep: ioctl_linux.c: Remove unnecessary parentheses
Quoted 15 lines · Julia Lawall
Review
Quoted 10 lines · Payal Kshirsagar
Challenge suggested by coccinelle.
Remove unnecessary parentheses around an expression and fix identation issue.Signed-off-by Payal Kshirsagar <[email protected]>--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
Quoted 16 lines
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 966
Quoted 11 lines
index 8fb03ef..e43ad33 100644
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1
-1@@ -961,7 +961,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,if (pPMK->cmd ==IW_PMKSA_ADD ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" );if (!memcmp (strIssueBssid, strZeroMacAddress,ETH_ALEN )) -return (intReturn); +return intReturn;else intReturn = true;I think you could really make another patch in the series for the indentation issue and fix up both branches of the if. It looks a bit odd now.
Okay I will do corrections.
thanks,
payal
Quoted 29 lines
julia
Quoted 6 lines
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0
-1--2.7.4
--
You received this message because you are subscribed to the GoogleGroups "outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
Quoted 2 lines
To post to this group, send email to [email protected]. To view this discussion on the web visit
Quoted 2 lines
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected]. To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.21.1903300742280.2817%40hadrien
.
For more options, visit https://groups.google.com/d/optout.