* [PATCH 1/3] staging: rtl8723bs: remove assignment in condition in core/rtw_ieee80211.c
2021-03-24 15:50 [PATCH 0/3] staging: rtl8723bs: remove assignment in conditions Fabio Aiuto
@ 2021-03-24 15:50 ` Fabio Aiuto
2021-03-24 15:50 ` [PATCH 2/3] staging: rtl8723bs: remove assignment in condition in os_dep/ioctl_cfg80211.c Fabio Aiuto
2021-03-24 15:50 ` [PATCH 3/3] staging: rtl8723bs: remove assignment in condition in os_dep/ioctl_linux.c Fabio Aiuto
2 siblings, 0 replies; 4+ messages in thread
From: Fabio Aiuto @ 2021-03-24 15:50 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, linux-kernel, Fabio Aiuto
fix the following checkpatch warning:
ERROR: do not use assignment in if condition
1118: FILE: drivers/staging/rtl8723bs/core/rtw_ieee80211.c:1118:
+ if ((addr = of_get_property(np, "local-mac-address", &len)) &&
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index cccbea555a32..e931afc3ba22 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -1115,8 +1115,9 @@ void rtw_macaddr_cfg(struct device *dev, u8 *mac_addr)
}
if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) {
- if ((addr = of_get_property(np, "local-mac-address", &len)) &&
- len == ETH_ALEN) {
+ addr = of_get_property(np, "local-mac-address", &len);
+
+ if (addr && len == ETH_ALEN) {
ether_addr_copy(mac_addr, addr);
} else {
eth_random_addr(mac_addr);
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] staging: rtl8723bs: remove assignment in condition in os_dep/ioctl_cfg80211.c
2021-03-24 15:50 [PATCH 0/3] staging: rtl8723bs: remove assignment in conditions Fabio Aiuto
2021-03-24 15:50 ` [PATCH 1/3] staging: rtl8723bs: remove assignment in condition in core/rtw_ieee80211.c Fabio Aiuto
@ 2021-03-24 15:50 ` Fabio Aiuto
2021-03-24 15:50 ` [PATCH 3/3] staging: rtl8723bs: remove assignment in condition in os_dep/ioctl_linux.c Fabio Aiuto
2 siblings, 0 replies; 4+ messages in thread
From: Fabio Aiuto @ 2021-03-24 15:50 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, linux-kernel, Fabio Aiuto
fix the following checkpatch warning:
ERROR: do not use assignment in if condition
1440: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:1440:
+ if ((wps_ie = rtw_get_wps_ie(buf, len, NULL, &wps_ielen)))
--
ERROR: do not use assignment in if condition
2465: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:2465:
+ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL)
--
ERROR: do not use assignment in if condition
2937: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:2937:
+ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) {
--
ERROR: do not use assignment in if condition
3335: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:3335:
+ if (!(ndev = wdev_to_ndev(wdev)))
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
---
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 03a784558d79..8deaf98a83dd 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -1437,7 +1437,8 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct adapter *padapter, char *b
if (len > 0)
{
- if ((wps_ie = rtw_get_wps_ie(buf, len, NULL, &wps_ielen)))
+ wps_ie = rtw_get_wps_ie(buf, len, NULL, &wps_ielen);
+ if (wps_ie)
{
#ifdef DEBUG_CFG80211
DBG_8192C("probe_req_wps_ielen =%d\n", wps_ielen);
@@ -2462,7 +2463,8 @@ static netdev_tx_t rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struc
DBG_871X("RTW_Tx:category(%u), action(%u)\n", category, action);
/* starting alloc mgmt frame to dump it */
- if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL)
+ pmgntframe = alloc_mgtxmitframe(pxmitpriv);
+ if (!pmgntframe)
goto fail;
/* update attribute */
@@ -2934,7 +2936,8 @@ static int _cfg80211_rtw_mgmt_tx(struct adapter *padapter, u8 tx_ch, const u8 *b
}
/* starting alloc mgmt frame to dump it */
- if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) {
+ pmgntframe = alloc_mgtxmitframe(pxmitpriv);
+ if (!pmgntframe) {
/* ret = -ENOMEM; */
ret = _FAIL;
goto exit;
@@ -3331,8 +3334,8 @@ void rtw_wdev_unregister(struct wireless_dev *wdev)
if (!wdev)
return;
-
- if (!(ndev = wdev_to_ndev(wdev)))
+ ndev = wdev_to_ndev(wdev);
+ if (!ndev)
return;
adapter = rtw_netdev_priv(ndev);
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] staging: rtl8723bs: remove assignment in condition in os_dep/ioctl_linux.c
2021-03-24 15:50 [PATCH 0/3] staging: rtl8723bs: remove assignment in conditions Fabio Aiuto
2021-03-24 15:50 ` [PATCH 1/3] staging: rtl8723bs: remove assignment in condition in core/rtw_ieee80211.c Fabio Aiuto
2021-03-24 15:50 ` [PATCH 2/3] staging: rtl8723bs: remove assignment in condition in os_dep/ioctl_cfg80211.c Fabio Aiuto
@ 2021-03-24 15:50 ` Fabio Aiuto
2 siblings, 0 replies; 4+ messages in thread
From: Fabio Aiuto @ 2021-03-24 15:50 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, linux-kernel, Fabio Aiuto
fix the following checkpatch warning:
ERROR: do not use assignment in if condition
2607: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:2607:
+ if (0 != (ret = rtw_change_ifname(padapter, new_ifname)))
--
ERROR: do not use assignment in if condition
4239: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:4239:
+ if (!(ext = vmalloc(len)))
--
ERROR: do not use assignment in if condition
4253: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:4253:
+ if (!(ext_dbg = vmalloc(len))) {
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
---
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 9909dece0b01..eac98e455413 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -2604,7 +2604,8 @@ static int rtw_rereg_nd_name(struct net_device *dev,
return ret;
DBG_871X("%s new_ifname:%s\n", __func__, new_ifname);
- if (0 != (ret = rtw_change_ifname(padapter, new_ifname)))
+ ret = rtw_change_ifname(padapter, new_ifname);
+ if (ret != 0)
goto exit;
strncpy(rereg_priv->old_ifname, new_ifname, IFNAMSIZ);
@@ -4236,7 +4237,8 @@ static int rtw_wx_set_priv(struct net_device *dev,
return -EFAULT;
len = dwrq->length;
- if (!(ext = vmalloc(len)))
+ ext = vmalloc(len);
+ if (!ext)
return -ENOMEM;
if (copy_from_user(ext, dwrq->pointer, len)) {
@@ -4250,7 +4252,8 @@ static int rtw_wx_set_priv(struct net_device *dev,
/* dev->name, ext)); */
#ifdef DEBUG_RTW_WX_SET_PRIV
- if (!(ext_dbg = vmalloc(len))) {
+ ext_dbg = vmalloc(len);
+ if (!ext_dbg) {
vfree(ext, len);
return -ENOMEM;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread