Skip to contentSkip to conversation

staging: rtl8723bs: Replace the comparision method

PATCH New [email protected] 2 participants 3 messages Oct 26, 2020 – Oct 27, 2020 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: Replace the comparision method

From: Izabela Bakollari <[email protected]>

Replace the value comparision method by using the logical NOT operator instead of comparing the value to NULL.

---
 drivers/staging/rtl8723bs/core/rtw_ap.c       |  18 ++--
 drivers/staging/rtl8723bs/core/rtw_cmd.c      | 102 +++++++++---------
 .../staging/rtl8723bs/core/rtw_ioctl_set.c    |   4 +-
 drivers/staging/rtl8723bs/core/rtw_mlme.c     |   4 +-
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c |  62 +++++------
 drivers/staging/rtl8723bs/core/rtw_security.c |   6 +-
 drivers/staging/rtl8723bs/include/rtw_recv.h  |  10 +-
 .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c |  30 +++---
 .../staging/rtl8723bs/os_dep/ioctl_linux.c    |  44 ++++----
 drivers/staging/rtl8723bs/os_dep/os_intfs.c   |   4 +-
 drivers/staging/rtl8723bs/os_dep/recv_linux.c |   2 +-
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c  |  12 +--
 12 files changed, 149 insertions(+), 149 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ap.c +9 -9
index 4f270d509ad3..125ecf0eea81 100644
@@ -1137,7 +1137,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
 			break;
 		}
 
-		if ((p == NULL) || (ie_len == 0))
+		if (!p || ie_len == 0)
 				break;
 	}
 
@@ -1166,7 +1166,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
 				break;
 			}
 
-			if ((p == NULL) || (ie_len == 0))
+			if (!p || ie_len == 0)
 				break;
 		}
 	}
@@ -1297,7 +1297,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
 	psta = rtw_get_stainfo(&padapter->stapriv, pbss_network->MacAddress);
 	if (!psta) {
 		psta = rtw_alloc_stainfo(&padapter->stapriv, pbss_network->MacAddress);
-		if (psta == NULL)
+		if (!psta)
 			return _FAIL;
 	}
 
@@ -1454,7 +1454,7 @@ u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta)
 	}
 
 	psetstakey_para = rtw_zmalloc(sizeof(struct set_stakey_parm));
-	if (psetstakey_para == NULL) {
+	if !(psetstakey_para) {
 		kfree(ph2c);
 		res = _FAIL;
 		goto exit;
@@ -1492,12 +1492,12 @@ static int rtw_ap_set_key(
 	/* DBG_871X("%s\n", __func__); */
 
 	pcmd = rtw_zmalloc(sizeof(struct cmd_obj));
-	if (pcmd == NULL) {
+	if (!pcmd) {
 		res = _FAIL;
 		goto exit;
 	}
 	psetkeyparm = rtw_zmalloc(sizeof(struct setkey_parm));
-	if (psetkeyparm == NULL) {
+	if (!psetkeyparm) {
 		kfree(pcmd);
 		res = _FAIL;
 		goto exit;
@@ -1669,11 +1669,11 @@ static void update_bcn_wps_ie(struct adapter *padapter)
 		&wps_ielen
 	);
 
-	if (pwps_ie == NULL || wps_ielen == 0)
+	if (!pwps_ie || wps_ielen == 0)
 		return;
 
 	pwps_ie_src = pmlmepriv->wps_beacon_ie;
-	if (pwps_ie_src == NULL)
+	if (!pwps_ie_src)
 		return;
 
 	wps_offset = (uint)(pwps_ie - ie);
@@ -2323,7 +2323,7 @@ void rtw_ap_restore_network(struct adapter *padapter)
 	for (i = 0; i < chk_alive_num; i++) {
 		psta = rtw_get_stainfo_by_offset(pstapriv, chk_alive_list[i]);
 
-		if (psta == NULL) {
+		if (!psta) {
 			DBG_871X(FUNC_ADPT_FMT" sta_info is null\n", FUNC_ADPT_ARG(padapter));
 		} else if (psta->state & _FW_LINKED) {
 			rtw_sta_media_status_rpt(padapter, psta, 1);
drivers/staging/rtl8723bs/core/rtw_cmd.c +51 -51

387 lines not on this page · raw message

drivers/staging/rtl8723bs/core/rtw_ioctl_set.c +2 -2
index 8b5f6a66bfb8..ac19a1e3a07f 100644
@@ -508,7 +508,7 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_s
 
 	RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("+rtw_set_802_11_bssid_list_scan(), fw_state =%x\n", get_fwstate(pmlmepriv)));
 
-	if (padapter == NULL) {
+	if (!padapter) {
 		res = false;
 		goto exit;
 	}
@@ -649,7 +649,7 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
 		return 0;
 
 	psta = rtw_get_stainfo(&adapter->stapriv, get_bssid(pmlmepriv));
-	if (psta == NULL)
+	if (!psta)
 		return 0;
 
 	short_GI = query_ra_short_GI(psta);
drivers/staging/rtl8723bs/core/rtw_mlme.c +2 -2
index 9531ba54e95b..4f1577f3b9c6 100644
@@ -472,7 +472,7 @@ struct	wlan_network	*rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
 		pwlan = LIST_CONTAINOR(plist, struct wlan_network, list);
 
 		if (!pwlan->fixed) {
-			if (oldest == NULL || time_after(oldest->last_scanned, pwlan->last_scanned))
+			if (!oldest || time_after(oldest->last_scanned, pwlan->last_scanned))
 				oldest = pwlan;
 		}
 
@@ -603,7 +603,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
 			/* TODO: don't  select netowrk in the same ess as oldest if it's new enough*/
 		}
 
-		if (oldest == NULL || time_after(oldest->last_scanned, pnetwork->last_scanned))
+		if (!oldest || time_after(oldest->last_scanned, pnetwork->last_scanned))
 			oldest = pnetwork;
 
 		plist = get_next(plist);
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +31 -31

236 lines not on this page · raw message

drivers/staging/rtl8723bs/core/rtw_security.c +3 -3
index 159d32ace2bc..7afa3c79cf68 100644
@@ -1912,7 +1912,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe)
 	ori_len = pattrib->pkt_len-WLAN_HDR_A3_LEN+BIP_AAD_SIZE;
 	BIP_AAD = rtw_zmalloc(ori_len);
 
-	if (BIP_AAD == NULL) {
+	if (!BIP_AAD) {
 		DBG_871X("BIP AAD allocate fail\n");
 		return _FAIL;
 	}
@@ -2224,7 +2224,7 @@ static void *aes_encrypt_init(u8 *key, size_t len)
 	if (len != 16)
 		return NULL;
 	rk = rtw_malloc(AES_PRIV_SIZE);
-	if (rk == NULL)
+	if (!rk)
 		return NULL;
 	rijndaelKeySetupEnc(rk, key);
 	return rk;
@@ -2277,7 +2277,7 @@ static int omac1_aes_128_vector(u8 *key, size_t num_elem,
 	size_t i, e, left, total_len;
 
 	ctx = aes_encrypt_init(key, 16);
-	if (ctx == NULL)
+	if (!ctx)
 		return -1;
 	memset(cbc, 0, AES_BLOCK_SIZE);
 
drivers/staging/rtl8723bs/include/rtw_recv.h +5 -5
index 60bf00f35cae..3332c379596a 100644
@@ -402,7 +402,7 @@ void rtw_reordering_ctrl_timeout_handler(struct timer_list *t);
 static inline u8 *get_rxmem(union recv_frame *precvframe)
 {
 	/* always return rx_head... */
-	if (precvframe == NULL)
+	if (!precvframe)
 		return NULL;
 
 	return precvframe->u.hdr.rx_head;
@@ -412,7 +412,7 @@ static inline u8 *get_recvframe_data(union recv_frame *precvframe)
 {
 
 	/* alwasy return rx_data */
-	if (precvframe == NULL)
+	if (!precvframe)
 		return NULL;
 
 	return precvframe->u.hdr.rx_data;
@@ -426,7 +426,7 @@ static inline u8 *recvframe_pull(union recv_frame *precvframe, sint sz)
 	/* used for extract sz bytes from rx_data, update rx_data and return the updated rx_data to the caller */
 
 
-	if (precvframe == NULL)
+	if (!precvframe)
 		return NULL;
 
 
@@ -452,7 +452,7 @@ static inline u8 *recvframe_put(union recv_frame *precvframe, sint sz)
 	/* after putting, rx_tail must be still larger than rx_end. */
 	unsigned char * prev_rx_tail;
 
-	if (precvframe == NULL)
+	if (!precvframe)
 		return NULL;
 
 	prev_rx_tail = precvframe->u.hdr.rx_tail;
@@ -480,7 +480,7 @@ static inline u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz)
 	/* used for extract sz bytes from rx_end, update rx_end and return the updated rx_end to the caller */
 	/* after pulling, rx_end must be still larger than rx_data. */
 
-	if (precvframe == NULL)
+	if (!precvframe)
 		return NULL;
 
 	precvframe->u.hdr.rx_tail -= sz;
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +15 -15
index 9bb97c39f1a2..11a787bfd07d 100644
@@ -419,7 +419,7 @@ void rtw_cfg80211_ibss_indicate_connect(struct adapter *padapter)
 		}
 		else
 		{
-			if (scanned == NULL) {
+			if (!scanned) {
 				rtw_warn_on(1);
 				return;
 			}
@@ -467,7 +467,7 @@ void rtw_cfg80211_indicate_connect(struct adapter *padapter)
 
 		/* DBG_871X(FUNC_ADPT_FMT" BSS not found\n", FUNC_ADPT_ARG(padapter)); */
 
-		if (scanned == NULL) {
+		if (!scanned) {
 			rtw_warn_on(1);
 			goto check_bss;
 		}
@@ -598,7 +598,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa
 		}
 	}
 
-	if (strcmp(param->u.crypt.alg, "none") == 0 && (psta == NULL))
+	if (strcmp(param->u.crypt.alg, "none") == 0 && !psta)
 	{
 		/* todo:clear default encryption keys */
 
@@ -608,7 +608,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa
 	}
 
 
-	if (strcmp(param->u.crypt.alg, "WEP") == 0 && (psta == NULL))
+	if (strcmp(param->u.crypt.alg, "WEP") == 0 && !psta)
 	{
 		DBG_8192C("r871x_set_encryption, crypt.alg = WEP\n");
 
@@ -932,7 +932,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
 		if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_MP_STATE) == true) /* sta mode */
 		{
 			psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv));
-			if (psta == NULL) {
+			if (!psta) {
 				/* DEBUG_ERR(("Set wpa_set_encryption: Obtain Sta_info fail\n")); */
 				DBG_8192C("%s, : Obtain Sta_info fail\n", __func__);
 			}
@@ -1002,7 +1002,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
 			}
 
 			pbcmc_sta = rtw_get_bcmc_stainfo(padapter);
-			if (pbcmc_sta == NULL)
+			if (!pbcmc_sta)
 			{
 				/* DEBUG_ERR(("Set OID_802_11_ADD_KEY: bcmc stainfo is null\n")); */
 			}
@@ -1051,7 +1051,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
 
 	param_len = sizeof(struct ieee_param) + params->key_len;
 	param = rtw_malloc(param_len);
-	if (param == NULL)
+	if (!param)
 		return -1;
 
 	memset(param, 0, param_len);
@@ -1215,7 +1215,7 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,
 	}
 
 	psta = rtw_get_stainfo(pstapriv, (u8 *)mac);
-	if (psta == NULL) {
+	if (!psta) {
 		DBG_8192C("%s, sta_info is null\n", __func__);
 		ret = -ENOENT;
 		goto exit;
@@ -1464,7 +1464,7 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct adapter *padapter, char *b
 			}
 
 			pmlmepriv->wps_probe_req_ie = rtw_malloc(wps_ielen);
-			if (pmlmepriv->wps_probe_req_ie == NULL) {
+			if (!(pmlmepriv->wps_probe_req_ie)) {
 				DBG_8192C("%s()-%d: rtw_malloc() ERROR!\n", __func__, __LINE__);
 				return -EINVAL;
 
@@ -1497,7 +1497,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
 	struct rtw_wdev_priv *pwdev_priv;
 	struct mlme_priv *pmlmepriv;
 
-	if (ndev == NULL) {
+	if (!ndev) {
 		ret = -EINVAL;
 		goto exit;
 	}
@@ -1785,7 +1785,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
 	u8 *pwpa, *pwpa2;
 	u8 null_addr[] = {0, 0, 0, 0, 0, 0};
 
-	if (pie == NULL || !ielen) {
+	if (!pie || !ielen) {
 		/* Treat this as normal case, but need to clear WIFI_UNDER_WPS */
 		_clr_fwstate_(&padapter->mlmepriv, WIFI_UNDER_WPS);
 		goto exit;
@@ -1797,7 +1797,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
 	}
 
 	buf = rtw_zmalloc(ielen);
-	if (buf == NULL) {
+	if (!buf) {
 		ret =  -ENOMEM;
 		goto exit;
 	}
@@ -2140,7 +2140,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
 			wep_key_len = wep_key_len <= 5 ? 5 : 13;
 			wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
 			pwep = rtw_malloc(wep_total_len);
-			if (pwep == NULL) {
+			if (!pwep) {
 				DBG_871X(" wpa_set_encryption: pwep allocate fail !!!\n");
 				ret = -ENOMEM;
 				goto exit;
@@ -3075,7 +3075,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
 	struct adapter *padapter;
 	struct rtw_wdev_priv *pwdev_priv;
 
-	if (ndev == NULL) {
+	if (!ndev) {
 		ret = -EINVAL;
 		goto exit;
 	}
@@ -3168,7 +3168,7 @@ static int cfg80211_rtw_sched_scan_start(struct wiphy *wiphy,
 		rtw_scan_abort(padapter);
 	}
 
-	if (request == NULL) {
+	if (!request) {
 		DBG_871X("%s: invalid cfg80211_requests parameters.\n", __func__);
 		return -EINVAL;
 	}
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +22 -22

171 lines not on this page · raw message

drivers/staging/rtl8723bs/os_dep/os_intfs.c +2 -2
index dac466bba066..e61928360927 100644
@@ -525,7 +525,7 @@ void rtw_unregister_netdevs(struct dvobj_priv *dvobj)
 
 	padapter = dvobj->padapters;
 
-	if (padapter == NULL)
+	if (!padapter)
 		return;
 
 	pnetdev = padapter->pnetdev;
@@ -638,7 +638,7 @@ struct dvobj_priv *devobj_init(void)
 	struct dvobj_priv *pdvobj = NULL;
 
 	pdvobj = rtw_zmalloc(sizeof(*pdvobj));
-	if (pdvobj == NULL)
+	if (!pdvobj)
 		return NULL;
 
 	mutex_init(&pdvobj->hw_init_mutex);
drivers/staging/rtl8723bs/os_dep/recv_linux.c +1 -1
index 900ff3a3b014..48635b7a1eb2 100644
@@ -252,7 +252,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
 	pfree_recv_queue = &(precvpriv->free_recv_queue);
 
 	skb = precv_frame->u.hdr.pkt;
-	if (skb == NULL) {
+	if (!skb) {
 		RT_TRACE(_module_recv_osdep_c_, _drv_err_, ("rtw_recv_indicatepkt():skb == NULL something wrong!!!!\n"));
 		goto _recv_indicatepkt_drop;
 	}
drivers/staging/rtl8723bs/os_dep/sdio_intf.c +6 -6
index 79b55ec827a4..e771289624c0 100644
@@ -239,7 +239,7 @@ static struct dvobj_priv *sdio_dvobj_init(struct sdio_func *func)
 	struct sdio_data *psdio;
 
 	dvobj = devobj_init();
-	if (dvobj == NULL) {
+	if (!dvobj) {
 		goto exit;
 	}
 
@@ -288,7 +288,7 @@ void rtw_set_hal_ops(struct adapter *padapter)
 
 static void sd_intf_start(struct adapter *padapter)
 {
-	if (padapter == NULL) {
+	if (!padapter) {
 		DBG_8192C(KERN_ERR "%s: padapter is NULL!\n", __func__);
 		return;
 	}
@@ -299,7 +299,7 @@ static void sd_intf_start(struct adapter *padapter)
 
 static void sd_intf_stop(struct adapter *padapter)
 {
-	if (padapter == NULL) {
+	if (!padapter) {
 		DBG_8192C(KERN_ERR "%s: padapter is NULL!\n", __func__);
 		return;
 	}
@@ -317,7 +317,7 @@ static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct
 	struct sdio_data *psdio = &dvobj->intf_data;
 
 	padapter = vzalloc(sizeof(*padapter));
-	if (padapter == NULL) {
+	if (!padapter) {
 		goto exit;
 	}
 
@@ -462,13 +462,13 @@ static int rtw_drv_init(
 	struct dvobj_priv *dvobj;
 
 	dvobj = sdio_dvobj_init(func);
-	if (dvobj == NULL) {
+	if (!dvobj) {
 		RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("initialize device object priv Failed!\n"));
 		goto exit;
 	}
 
 	if1 = rtw_sdio_if1_init(dvobj, id);
-	if (if1 == NULL) {
+	if (!if1) {
 		DBG_871X("rtw_init_primarystruct adapter Failed!\n");
 		goto free_dvobj;
 	}
Signature · 1 line
2.18.4
#1 lore raw
Thank you for the patch! Yet something to improve:

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/izabela-bakollari-gmail-com/staging-rtl8723bs-Replace-the-comparision-method/20201027-061116
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 9ab476ba001ead1f64430a3a61c9466ac0fa91ed
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/1be7587c45233c40c20f755e8da6867c36dde9ca
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review izabela-bakollari-gmail-com/staging-rtl8723bs-Replace-the-comparision-method/20201027-061116 git checkout 1be7587c45233c40c20f755e8da6867c36dde9ca
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

In file included from drivers/staging/rtl8723bs/include/drv_types.h:25,

                    from drivers/staging/rtl8723bs/core/rtw_ap.c:9:
   drivers/staging/rtl8723bs/include/ieee80211.h:745:1: warning: alignment 1 of 'struct ieee80211_assoc_request_frame' is less than 2 [-Wpacked-not-aligned]
     745 | } __attribute__ ((packed));
         | ^
   drivers/staging/rtl8723bs/include/ieee80211.h:752:1: warning: alignment 1 of 'struct ieee80211_assoc_response_frame' is less than 2 [-Wpacked-not-aligned]
     752 | } __attribute__ ((packed));
         | ^
   drivers/staging/rtl8723bs/core/rtw_ap.c: In function 'rtw_ap_set_pairwise_key':
>> drivers/staging/rtl8723bs/core/rtw_ap.c:1457:5: error: expected '(' before '!' token
    1457 |  if !(psetstakey_para) {
         |     ^
         |     (
   drivers/staging/rtl8723bs/core/rtw_ap.c:1457:5: warning: statement with no effect [-Wunused-value]
    1457 |  if !(psetstakey_para) {
         |     ^~~~~~~~~~~~~~~~~~
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:42,
                    from drivers/staging/rtl8723bs/core/rtw_ap.c:9:
   At top level:
   drivers/staging/rtl8723bs/include/rtw_security.h:371:28: warning: 'K' defined but not used [-Wunused-const-variable=]
     371 | static const unsigned long K[64] = {
         |                            ^

vim +1457 drivers/staging/rtl8723bs/core/rtw_ap.c

1442
1443 u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta)
1444 {
1445 struct cmd_obj *ph2c;
1446 struct set_stakey_parm *psetstakey_para;
1447 struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
1448 u8 res = _SUCCESS;
1449
1450 ph2c = rtw_zmalloc(sizeof(struct cmd_obj));
1451 if (!ph2c) {
1452 res = _FAIL;
1453 goto exit;
1454 }
1455
1456 psetstakey_para = rtw_zmalloc(sizeof(struct set_stakey_parm));

> 1457		if !(psetstakey_para) {

1458 kfree(ph2c);
1459 res = _FAIL;
1460 goto exit;
1461 }
1462
1463 init_h2fwcmd_w_parm_no_rsp(ph2c, psetstakey_para, _SetStaKey_CMD_);
1464
1465 psetstakey_para->algorithm = (u8)psta->dot118021XPrivacy;
1466
1467 memcpy(psetstakey_para->addr, psta->hwaddr, ETH_ALEN);
1468
1469 memcpy(psetstakey_para->key, &psta->dot118021x_UncstKey, 16);
1470
1471 res = rtw_enqueue_cmd(pcmdpriv, ph2c);
1472
1473 exit:
1474
1475 return res;
1476 }
1477

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#2 lore raw
In reply to [email protected]
Thank you for the patch! Yet something to improve:

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/izabela-bakollari-gmail-com/staging-rtl8723bs-Replace-the-comparision-method/20201027-061116
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 9ab476ba001ead1f64430a3a61c9466ac0fa91ed
config: powerpc64-randconfig-r001-20201026 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project f2c25c70791de95d2466e09b5b58fc37f6ccd7a4)

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://github.com/0day-ci/linux/commit/1be7587c45233c40c20f755e8da6867c36dde9ca
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review izabela-bakollari-gmail-com/staging-rtl8723bs-Replace-the-comparision-method/20201027-061116 git checkout 1be7587c45233c40c20f755e8da6867c36dde9ca
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

^
arch/powerpc/include/asm/io.h:542:56: note: expanded from macro '__do_insw'

   #define __do_insw(p, b, n)      readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/staging/rtl8723bs/core/rtw_ap.c:9:
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:21:
   In file included from drivers/staging/rtl8723bs/include/osdep_service.h:15:
   In file included from drivers/staging/rtl8723bs/include/osdep_service_linux.h:19:
   In file included from include/linux/netdevice.h:37:
   In file included from include/linux/ethtool.h:18:
   In file included from include/uapi/linux/ethtool.h:19:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:31:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:30:1: note: expanded from here
   __do_insl
   ^
   arch/powerpc/include/asm/io.h:543:56: note: expanded from macro '__do_insl'
   #define __do_insl(p, b, n)      readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/staging/rtl8723bs/core/rtw_ap.c:9:
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:21:
   In file included from drivers/staging/rtl8723bs/include/osdep_service.h:15:
   In file included from drivers/staging/rtl8723bs/include/osdep_service_linux.h:19:
   In file included from include/linux/netdevice.h:37:
   In file included from include/linux/ethtool.h:18:
   In file included from include/uapi/linux/ethtool.h:19:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:31:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:32:1: note: expanded from here
   __do_outsb
   ^
   arch/powerpc/include/asm/io.h:544:58: note: expanded from macro '__do_outsb'
   #define __do_outsb(p, b, n)     writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/staging/rtl8723bs/core/rtw_ap.c:9:
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:21:
   In file included from drivers/staging/rtl8723bs/include/osdep_service.h:15:
   In file included from drivers/staging/rtl8723bs/include/osdep_service_linux.h:19:
   In file included from include/linux/netdevice.h:37:
   In file included from include/linux/ethtool.h:18:
   In file included from include/uapi/linux/ethtool.h:19:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:31:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:34:1: note: expanded from here
   __do_outsw
   ^
   arch/powerpc/include/asm/io.h:545:58: note: expanded from macro '__do_outsw'
   #define __do_outsw(p, b, n)     writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/staging/rtl8723bs/core/rtw_ap.c:9:
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:21:
   In file included from drivers/staging/rtl8723bs/include/osdep_service.h:15:
   In file included from drivers/staging/rtl8723bs/include/osdep_service_linux.h:19:
   In file included from include/linux/netdevice.h:37:
   In file included from include/linux/ethtool.h:18:
   In file included from include/uapi/linux/ethtool.h:19:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:31:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:36:1: note: expanded from here
   __do_outsl
   ^
   arch/powerpc/include/asm/io.h:546:58: note: expanded from macro '__do_outsl'
   #define __do_outsl(p, b, n)     writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
>> drivers/staging/rtl8723bs/core/rtw_ap.c:1457:5: error: expected '(' after 'if'
           if !(psetstakey_para) {
              ^

12 warnings and 1 error generated.

vim +1457 drivers/staging/rtl8723bs/core/rtw_ap.c

1442
1443 u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta)
1444 {
1445 struct cmd_obj *ph2c;
1446 struct set_stakey_parm *psetstakey_para;
1447 struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
1448 u8 res = _SUCCESS;
1449
1450 ph2c = rtw_zmalloc(sizeof(struct cmd_obj));
1451 if (!ph2c) {
1452 res = _FAIL;
1453 goto exit;
1454 }
1455
1456 psetstakey_para = rtw_zmalloc(sizeof(struct set_stakey_parm));

> 1457		if !(psetstakey_para) {

1458 kfree(ph2c);
1459 res = _FAIL;
1460 goto exit;
1461 }
1462
1463 init_h2fwcmd_w_parm_no_rsp(ph2c, psetstakey_para, _SetStaKey_CMD_);
1464
1465 psetstakey_para->algorithm = (u8)psta->dot118021XPrivacy;
1466
1467 memcpy(psetstakey_para->addr, psta->hwaddr, ETH_ALEN);
1468
1469 memcpy(psetstakey_para->key, &psta->dot118021x_UncstKey, 16);
1470
1471 res = rtw_enqueue_cmd(pcmdpriv, ph2c);
1472
1473 exit:
1474
1475 return res;
1476 }
1477

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org