Skip to contentSkip to conversation

staging: rtl8723bs: Drop empty rtw_bug_check function

PATCH Superseded Priit Laes 4 participants 15 messages Feb 20 – Feb 21 1 message not in the archive Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Priit Laes

author
#1 lore raw

PATCH 1/11 staging: stl8723bs: Use common round_up macro

---
 drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c    | 6 +++---
 drivers/staging/rtl8723bs/hal/sdio_ops.c          | 4 ++--
 drivers/staging/rtl8723bs/include/osdep_service.h | 2 --
 3 files changed, 5 insertions(+), 7 deletions(-)
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +3 -3
index a1f2cbf2cf55..c5b172c2f839 100644
@@ -232,7 +232,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv
 				/*  check xmit_buf size enough or not */
 				txlen = txdesc_size + rtw_wlan_pkt_size(pxmitframe);
 				if (!pxmitbuf ||
-					((_RND(pxmitbuf->len, 8) + txlen) > max_xmit_len) ||
+					((round_up(pxmitbuf->len, 8) + txlen) > max_xmit_len) ||
 					(k >= (rtw_hal_sdio_max_txoqt_free_space(padapter) - 1))
 				) {
 					if (pxmitbuf) {
@@ -303,8 +303,8 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv
 					txlen = txdesc_size + pxmitframe->attrib.last_txcmdsz;
 					pxmitframe->pg_num = (txlen + 127) / 128;
 					pxmitbuf->pg_num += (txlen + 127) / 128;
-					pxmitbuf->ptail += _RND(txlen, 8); /*  round to 8 bytes alignment */
-					pxmitbuf->len = _RND(pxmitbuf->len, 8) + txlen;
+					pxmitbuf->ptail += round_up(txlen, 8);
+					pxmitbuf->len = round_up(pxmitbuf->len, 8) + txlen;
 				}
 
 				if (k != 1)
drivers/staging/rtl8723bs/hal/sdio_ops.c +2 -2
index c9cb20c61a2b..6bfb8c0e519c 100644
@@ -401,7 +401,7 @@ static u32 sdio_read_port(
 	hal_sdio_get_cmd_addr_8723b(adapter, addr, hal->SdioRxFIFOCnt++, &addr);
 
 	if (cnt > psdio->block_transfer_len)
-		cnt = _RND(cnt, psdio->block_transfer_len);
+		cnt = round_up(cnt, psdio->block_transfer_len);
 
 	err = _sd_read(intfhdl, addr, cnt, mem);
 
@@ -448,7 +448,7 @@ static u32 sdio_write_port(
 	hal_sdio_get_cmd_addr_8723b(adapter, addr, cnt >> 2, &addr);
 
 	if (cnt > psdio->block_transfer_len)
-		cnt = _RND(cnt, psdio->block_transfer_len);
+		cnt = round_up(cnt, psdio->block_transfer_len);
 
 	err = sd_write(intfhdl, addr, cnt, xmitbuf->pdata);
 
drivers/staging/rtl8723bs/include/osdep_service.h +0 -2
index 955e8678dc26..404f81756b27 100644
@@ -78,8 +78,6 @@ static inline int rtw_bug_check(void *parg1, void *parg2, void *parg3, void *par
 
 }
 
-#define _RND(sz, r) ((((sz)+((r)-1))/(r))*(r))
-
 extern void rtw_free_netdev(struct net_device *netdev);
 
 /* Macros for handling unaligned memory accesses */
Signature · 1 line
2.53.0
author
#2 lore raw

PATCH 2/11 staging: rtl8723bs: Remove unused BIT32..BIT36 definitions

In reply to a message not in the archive
---
 drivers/staging/rtl8723bs/include/osdep_service.h | 5 -----
 1 file changed, 5 deletions(-)
drivers/staging/rtl8723bs/include/osdep_service.h +0 -5
index 404f81756b27..f7b647db1a75 100644
@@ -46,11 +46,6 @@
 #define BIT29	0x20000000
 #define BIT30	0x40000000
 #define BIT31	0x80000000
-#define BIT32	0x0100000000
-#define BIT33	0x0200000000
-#define BIT34	0x0400000000
-#define BIT35	0x0800000000
-#define BIT36	0x1000000000
 
 extern int RTW_STATUS_CODE(int error_code);
 
Signature · 1 line
2.53.0
author
#3 lore raw

PATCH 3/11 staging: rtl8723bs: Drop empty rtw_bug_check function

In reply to a message not in the archive

This function was just returning True.

---
 drivers/staging/rtl8723bs/core/rtw_mlme.c         | 10 ----------
 drivers/staging/rtl8723bs/include/osdep_service.h |  8 --------
 2 files changed, 18 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme.c +0 -10
index 22dc36e8e38a..7a346cbf2708 100644
@@ -358,9 +358,6 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 fea
 	u16 s_cap, d_cap;
 	__le16 tmps, tmpd;
 
-	if (rtw_bug_check(dst, src, &s_cap, &d_cap) == false)
-		return false;
-
 	memcpy((u8 *)&tmps, rtw_get_capability_from_ie(src->ies), 2);
 	memcpy((u8 *)&tmpd, rtw_get_capability_from_ie(dst->ies), 2);
 
@@ -464,11 +461,6 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex
 {
 	struct	mlme_priv *pmlmepriv = &adapter->mlmepriv;
 
-	rtw_bug_check(&pmlmepriv->cur_network.network,
-		&pmlmepriv->cur_network.network,
-		&pmlmepriv->cur_network.network,
-		&pmlmepriv->cur_network.network);
-
 	if (check_fwstate(pmlmepriv, _FW_LINKED) && (is_same_network(&pmlmepriv->cur_network.network, pnetwork, 0))) {
 		update_network(&pmlmepriv->cur_network.network, pnetwork, adapter, true);
 		rtw_update_protection(adapter, (pmlmepriv->cur_network.network.ies) + sizeof(struct ndis_802_11_fix_ie),
@@ -493,8 +485,6 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
 	list_for_each(plist, phead) {
 		pnetwork = list_entry(plist, struct wlan_network, list);
 
-		rtw_bug_check(pnetwork, pnetwork, pnetwork, pnetwork);
-
 		if (is_same_network(&pnetwork->network, target, feature)) {
 			target_find = 1;
 			break;
drivers/staging/rtl8723bs/include/osdep_service.h +0 -8
index f7b647db1a75..d6710e5835f0 100644
@@ -65,14 +65,6 @@ static inline void flush_signals_thread(void)
 
 #define rtw_warn_on(condition) WARN_ON(condition)
 
-static inline int rtw_bug_check(void *parg1, void *parg2, void *parg3, void *parg4)
-{
-	int ret = true;
-
-	return ret;
-
-}
-
 extern void rtw_free_netdev(struct net_device *netdev);
 
 /* Macros for handling unaligned memory accesses */
Signature · 1 line
2.53.0
author
#4 lore raw

PATCH 4/11 staging: rtl8723bs: Remove unused rtw_sprintf macro

In reply to a message not in the archive
---
 drivers/staging/rtl8723bs/include/osdep_service.h | 6 ------
 1 file changed, 6 deletions(-)
drivers/staging/rtl8723bs/include/osdep_service.h +0 -6
index d6710e5835f0..cf75760d364a 100644
@@ -85,10 +85,4 @@ bool rtw_cbuf_push(struct rtw_cbuf *cbuf, void *buf);
 void *rtw_cbuf_pop(struct rtw_cbuf *cbuf);
 struct rtw_cbuf *rtw_cbuf_alloc(u32 size);
 
-/*  String handler */
-/*
- * Write formatted output to sized buffer
- */
-#define rtw_sprintf(buf, size, format, arg...)	snprintf(buf, size, format, ##arg)
-
 #endif
Signature · 1 line
2.53.0
author
#5 lore raw

PATCH 5/11 staging: rtl8723bs: Drop unused _kfree(...) declaration.

In reply to a message not in the archive
---
 drivers/staging/rtl8723bs/include/osdep_service.h | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/rtl8723bs/include/osdep_service.h +0 -2
index cf75760d364a..59fc2cdb195d 100644
@@ -49,8 +49,6 @@
 
 extern int RTW_STATUS_CODE(int error_code);
 
-void _kfree(u8 *pbuf, u32 sz);
-
 int _rtw_netif_rx(struct net_device *ndev, struct sk_buff *skb);
 
 #define rtw_netif_rx(ndev, skb) _rtw_netif_rx(ndev, skb)
Signature · 1 line
2.53.0
author
#6 lore raw

PATCH 6/11 staging: rtl8723bs: Get rid of unused _rtw_init_queue

In reply to a message not in the archive

Remove all the mentions of _rtw_init_queue. All the uncommented code calling this function has been converted few years earlier.

---
 drivers/staging/rtl8723bs/core/rtw_recv.c         | 3 ---
 drivers/staging/rtl8723bs/core/rtw_sta_mgt.c      | 1 -
 drivers/staging/rtl8723bs/core/rtw_xmit.c         | 4 ----
 drivers/staging/rtl8723bs/include/osdep_service.h | 2 --
 4 files changed, 10 deletions(-)
drivers/staging/rtl8723bs/core/rtw_recv.c +0 -3
index 337671b1211f..e0c901a5459e 100644
@@ -21,9 +21,6 @@ void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
 
 	spin_lock_init(&psta_recvpriv->lock);
 
-	/* for (i = 0; i<MAX_RX_NUMBLKS; i++) */
-	/* _rtw_init_queue(&psta_recvpriv->blk_strms[i]); */
-
 	INIT_LIST_HEAD(&psta_recvpriv->defrag_q.queue);
 	spin_lock_init(&psta_recvpriv->defrag_q.lock);
 }
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +0 -1
index bdd4b6d8fd2e..76d32ae8ac9e 100644
@@ -67,7 +67,6 @@ u32 _rtw_init_sta_priv(struct	sta_priv *pstapriv)
 
 	spin_lock_init(&pstapriv->sta_hash_lock);
 
-	/* _rtw_init_queue(&pstapriv->asoc_q); */
 	pstapriv->asoc_sta_count = 0;
 	INIT_LIST_HEAD(&pstapriv->sleep_q.queue);
 	spin_lock_init(&pstapriv->sleep_q.lock);
drivers/staging/rtl8723bs/core/rtw_xmit.c +0 -4
index 222851e8d985..c2833f3cd10b 100644
@@ -43,10 +43,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
 	init_completion(&pxmitpriv->xmit_comp);
 	init_completion(&pxmitpriv->terminate_xmitthread_comp);
 
-	/*
-	 * Please insert all the queue initialization using _rtw_init_queue below
-	 */
-
 	pxmitpriv->adapter = padapter;
 
 	INIT_LIST_HEAD(&pxmitpriv->be_pending.queue);
drivers/staging/rtl8723bs/include/osdep_service.h +0 -2
index 59fc2cdb195d..37e8ddb01dcd 100644
@@ -53,8 +53,6 @@ int _rtw_netif_rx(struct net_device *ndev, struct sk_buff *skb);
 
 #define rtw_netif_rx(ndev, skb) _rtw_netif_rx(ndev, skb)
 
-extern void _rtw_init_queue(struct __queue	*pqueue);
-
 static inline void flush_signals_thread(void)
 {
 	if (signal_pending(current))
Signature · 1 line
2.53.0
author
#7 lore raw

PATCH 7/11 staging: rtl8723bs: Drop unused NDEV-related formatting macros

In reply to a message not in the archive
---
 drivers/staging/rtl8723bs/include/osdep_service_linux.h | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/rtl8723bs/include/osdep_service_linux.h +0 -3
index 2ec54f9e180c..c8274da940ff 100644
@@ -98,10 +98,7 @@ static inline void rtw_netif_stop_queue(struct net_device *pnetdev)
 
 #define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)), (sig), 1)
 
-#define NDEV_ARG(ndev) ndev->name
 #define ADPT_ARG(adapter) adapter->pnetdev->name
-#define FUNC_NDEV_FMT "%s(%s)"
-#define FUNC_NDEV_ARG(ndev) __func__, ndev->name
 #define FUNC_ADPT_FMT "%s(%s)"
 #define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name
 
Signature · 1 line
2.53.0
author
#8 lore raw

PATCH 8/11 staging: rtl8723bs: Drop workqueue wrapper functions

In reply to a message not in the archive
---
 drivers/staging/rtl8723bs/core/rtw_cmd.c          |  4 ++--
 drivers/staging/rtl8723bs/core/rtw_pwrctrl.c      |  6 +++---
 drivers/staging/rtl8723bs/hal/sdio_ops.c          |  4 ++--
 .../rtl8723bs/include/osdep_service_linux.h       | 15 ---------------
 4 files changed, 7 insertions(+), 22 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +2 -2
index b2e7f479f72b..d0694a659259 100644
@@ -201,7 +201,7 @@ int rtw_init_evt_priv(struct evt_priv *pevtpriv)
 	atomic_set(&pevtpriv->event_seq, 0);
 	pevtpriv->evt_done_cnt = 0;
 
-	_init_workitem(&pevtpriv->c2h_wk, c2h_wk_callback, NULL);
+	INIT_WORK(&pevtpriv->c2h_wk, c2h_wk_callback);
 	pevtpriv->c2h_wk_alive = false;
 	pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1);
 	if (!pevtpriv->c2h_queue)
@@ -212,7 +212,7 @@ int rtw_init_evt_priv(struct evt_priv *pevtpriv)
 
 void _rtw_free_evt_priv(struct	evt_priv *pevtpriv)
 {
-	_cancel_workitem_sync(&pevtpriv->c2h_wk);
+	cancel_work_sync(&pevtpriv->c2h_wk);
 	while (pevtpriv->c2h_wk_alive)
 		msleep(10);
 
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +3 -3
index 1c9e02732687..c93c7357b3f0 100644
@@ -670,7 +670,7 @@ static void pwr_rpwm_timeout_handler(struct timer_list *t)
 	if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2))
 		return;
 
-	_set_workitem(&pwrpriv->rpwmtimeoutwi);
+	schedule_work(&pwrpriv->rpwmtimeoutwi);
 }
 
 static inline void register_task_alive(struct pwrctrl_priv *pwrctrl, u32 tag)
@@ -971,11 +971,11 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)
 
 	rtw_hal_set_hwreg(padapter, HW_VAR_SET_RPWM, (u8 *)(&pwrctrlpriv->rpwm));
 
-	_init_workitem(&pwrctrlpriv->cpwm_event, cpwm_event_callback, NULL);
+	INIT_WORK(&pwrctrlpriv->cpwm_event, cpwm_event_callback);
 
 	pwrctrlpriv->brpwmtimeout = false;
 	pwrctrlpriv->adapter = padapter;
-	_init_workitem(&pwrctrlpriv->rpwmtimeoutwi, rpwmtimeout_workitem_callback, NULL);
+	INIT_WORK(&pwrctrlpriv->rpwmtimeoutwi, rpwmtimeout_workitem_callback);
 	timer_setup(&pwrctrlpriv->pwr_rpwm_timer, pwr_rpwm_timeout_handler, 0);
 	timer_setup(&pwrctrlpriv->pwr_state_check_timer,
 		    pwr_state_check_handler, 0);
drivers/staging/rtl8723bs/hal/sdio_ops.c +2 -2
index 6bfb8c0e519c..ea373276f9cd 100644
@@ -876,7 +876,7 @@ void sd_int_dpc(struct adapter *adapter)
 
 		SdioLocalCmd52Read1Byte(adapter, SDIO_REG_HCPWM1_8723B);
 
-		_set_workitem(&(pwrctl->cpwm_event));
+		schedule_work(&pwrctl->cpwm_event);
 	}
 
 	if (hal->sdio_hisr & SDIO_HISR_TXERR) {
@@ -912,7 +912,7 @@ void sd_int_dpc(struct adapter *adapter)
 		} else {
 			/* Error handling for malloc fail */
 			rtw_cbuf_push(adapter->evtpriv.c2h_queue, NULL);
-			_set_workitem(&adapter->evtpriv.c2h_wk);
+			schedule_work(&adapter->evtpriv.c2h_wk);
 		}
 	}
 
drivers/staging/rtl8723bs/include/osdep_service_linux.h +0 -15
index c8274da940ff..ebaa2f1d4af7 100644
@@ -58,21 +58,6 @@ static inline void _set_timer(struct timer_list *ptimer, u32 delay_time)
 	mod_timer(ptimer, (jiffies + (delay_time * HZ / 1000)));
 }
 
-static inline void _init_workitem(struct work_struct *pwork, void *pfunc, void *cntx)
-{
-	INIT_WORK(pwork, pfunc);
-}
-
-static inline void _set_workitem(struct work_struct *pwork)
-{
-	schedule_work(pwork);
-}
-
-static inline void _cancel_workitem_sync(struct work_struct *pwork)
-{
-	cancel_work_sync(pwork);
-}
-
 static inline int rtw_netif_queue_stopped(struct net_device *pnetdev)
 {
 	return (netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 0)) &&
Signature · 1 line
2.53.0
author
#9 lore raw

PATCH 9/11 staging: rtl8273bs: Reduce useless function wrapping in regulator code

In reply to a message not in the archive
---
 drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 27 +++-----------------
 1 file changed, 4 insertions(+), 23 deletions(-)
drivers/staging/rtl8723bs/os_dep/wifi_regd.c +4 -23
index f9c4d487badf..878a2ee08d25 100644
@@ -91,40 +91,21 @@ static int _rtw_reg_notifier_apply(struct wiphy *wiphy,
 	return 0;
 }
 
-static const struct ieee80211_regdomain *_rtw_regdomain_select(struct
-							       rtw_regulatory
-							       *reg)
-{
-	return &rtw_regdom_rd;
-}
-
-static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg,
-				 struct wiphy *wiphy,
-				 void (*reg_notifier)(struct wiphy *wiphy,
-						      struct
-						      regulatory_request *
-						      request))
+void rtw_regd_init(struct wiphy *wiphy,
+		   void (*reg_notifier)(struct wiphy *wiphy,
+					struct regulatory_request *request))
 {
-	const struct ieee80211_regdomain *regd;
-
 	wiphy->reg_notifier = reg_notifier;
 
 	wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
 	wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG;
 	wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS;
 
-	regd = _rtw_regdomain_select(reg);
-	wiphy_apply_custom_regulatory(wiphy, regd);
+	wiphy_apply_custom_regulatory(wiphy, &rtw_regdom_rd);
 
 	/* Hard code flags */
 	_rtw_reg_apply_flags(wiphy);
-}
 
-void rtw_regd_init(struct wiphy *wiphy,
-		   void (*reg_notifier)(struct wiphy *wiphy,
-					struct regulatory_request *request))
-{
-	_rtw_regd_init_wiphy(NULL, wiphy, reg_notifier);
 }
 
 void rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
Signature · 1 line
2.53.0
author
#10 lore raw

PATCH 10/11 staging: rtl8723bs: Remove useless wrapper functions in rtw_cmd.c

In reply to a message not in the archive
---
 drivers/staging/rtl8723bs/core/rtw_cmd.c      | 88 ++++++++-----------
 drivers/staging/rtl8723bs/include/cmd_osdep.h |  7 +-
 2 files changed, 39 insertions(+), 56 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +38 -50
index d0694a659259..60e2de7991d4 100644
@@ -210,32 +210,6 @@ int rtw_init_evt_priv(struct evt_priv *pevtpriv)
 	return 0;
 }
 
-void _rtw_free_evt_priv(struct	evt_priv *pevtpriv)
-{
-	cancel_work_sync(&pevtpriv->c2h_wk);
-	while (pevtpriv->c2h_wk_alive)
-		msleep(10);
-
-	while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
-		void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
-
-		if (c2h && c2h != (void *)pevtpriv)
-			kfree(c2h);
-	}
-	kfree(pevtpriv->c2h_queue);
-}
-
-void _rtw_free_cmd_priv(struct	cmd_priv *pcmdpriv)
-{
-	if (pcmdpriv) {
-		kfree(pcmdpriv->cmd_allocated_buf);
-
-		kfree(pcmdpriv->rsp_allocated_buf);
-
-		mutex_destroy(&pcmdpriv->sctx_mutex);
-	}
-}
-
 /*
  * Calling Context:
  *
@@ -246,7 +220,7 @@ void _rtw_free_cmd_priv(struct	cmd_priv *pcmdpriv)
  *
  */
 
-int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)
+static int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)
 {
 	unsigned long irqL;
 
@@ -265,38 +239,35 @@ int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)
 	return _SUCCESS;
 }
 
-struct	cmd_obj	*_rtw_dequeue_cmd(struct __queue *queue)
+void rtw_free_evt_priv(struct	evt_priv *pevtpriv)
 {
-	unsigned long irqL;
-	struct cmd_obj *obj;
-
-	/* spin_lock_bh(&(queue->lock)); */
-	spin_lock_irqsave(&queue->lock, irqL);
-	if (list_empty(&queue->queue)) {
-		obj = NULL;
-	} else {
-		obj = container_of(get_next(&queue->queue), struct cmd_obj, list);
-		list_del_init(&obj->list);
-	}
+	cancel_work_sync(&pevtpriv->c2h_wk);
+	while (pevtpriv->c2h_wk_alive)
+		msleep(10);
 
-	/* spin_unlock_bh(&(queue->lock)); */
-	spin_unlock_irqrestore(&queue->lock, irqL);
+	while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
+		void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
 
-	return obj;
-}
+		if (c2h && c2h != (void *)pevtpriv)
+			kfree(c2h);
+	}
+	kfree(pevtpriv->c2h_queue);
 
-void rtw_free_evt_priv(struct	evt_priv *pevtpriv)
-{
-	_rtw_free_evt_priv(pevtpriv);
 }
 
 void rtw_free_cmd_priv(struct	cmd_priv *pcmdpriv)
 {
-	_rtw_free_cmd_priv(pcmdpriv);
+	if (pcmdpriv) {
+		kfree(pcmdpriv->cmd_allocated_buf);
+
+		kfree(pcmdpriv->rsp_allocated_buf);
+
+		mutex_destroy(&pcmdpriv->sctx_mutex);
+	}
+
 }
 
-int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj);
-int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
+static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
 {
 	u8 bAllow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */
 
@@ -337,7 +308,24 @@ int rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
 
 struct	cmd_obj	*rtw_dequeue_cmd(struct cmd_priv *pcmdpriv)
 {
-	return _rtw_dequeue_cmd(&pcmdpriv->cmd_queue);
+	unsigned long irqL;
+	struct cmd_obj *obj;
+	struct __queue *queue = &pcmdpriv->cmd_queue;
+
+	/* spin_lock_bh(&(queue->lock)); */
+	spin_lock_irqsave(&queue->lock, irqL);
+	if (list_empty(&queue->queue)) {
+		obj = NULL;
+	} else {
+		obj = container_of(get_next(&queue->queue), struct cmd_obj, list);
+		list_del_init(&obj->list);
+	}
+
+	/* spin_unlock_bh(&(queue->lock)); */
+	spin_unlock_irqrestore(&queue->lock, irqL);
+
+	return obj;
+
 }
 
 void rtw_free_cmd_obj(struct cmd_obj *pcmd)
drivers/staging/rtl8723bs/include/cmd_osdep.h +1 -6
index 5506f513dc01..b0ac41d2be24 100644
@@ -7,12 +7,7 @@
 #ifndef __CMD_OSDEP_H_
 #define __CMD_OSDEP_H_
 
-
-int rtw_init_cmd_priv(struct	cmd_priv *pcmdpriv);
+int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv);
 int rtw_init_evt_priv(struct evt_priv *pevtpriv);
-extern void _rtw_free_evt_priv(struct	evt_priv *pevtpriv);
-extern void _rtw_free_cmd_priv(struct	cmd_priv *pcmdpriv);
-int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj);
-extern struct	cmd_obj	*_rtw_dequeue_cmd(struct __queue *queue);
 
 #endif
Signature · 1 line
2.53.0
#11 lore raw

Re: [PATCH 10/11] staging: rtl8723bs: Remove useless wrapper functions in rtw_cmd.c

drivers/staging/rtl8723bs/core/rtw_cmd.c

Quoted 9 lines · Priit Laes
---
 drivers/staging/rtl8723bs/core/rtw_cmd.c      | 88 ++++++++-----------
 drivers/staging/rtl8723bs/include/cmd_osdep.h |  7 +-
 2 files changed, 39 insertions(+), 56 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +0 -1
index d0694a659259..60e2de7991d4 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c

You must have a description of your patch in your commit body for the git log.

Thanks,

ET

author
#12 lore raw

PATCH 11/11 staging: rtl8723bs: rtw_ieee80211: Reduce global symbols

In reply to a message not in the archive

Also drop some unused

---
 .../staging/rtl8723bs/core/rtw_ieee80211.c    | 41 +++++++++----------
 drivers/staging/rtl8723bs/include/ieee80211.h | 30 --------------
 2 files changed, 19 insertions(+), 52 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +19 -22
index 6cf217e21593..c5dedf8a13f2 100644
@@ -11,26 +11,23 @@
 #include <linux/unaligned.h>
 
 u8 RTW_WPA_OUI_TYPE[] = { 0x00, 0x50, 0xf2, 1 };
-u16 RTW_WPA_VERSION = 1;
-u8 WPA_AUTH_KEY_MGMT_NONE[] = { 0x00, 0x50, 0xf2, 0 };
-u8 WPA_AUTH_KEY_MGMT_UNSPEC_802_1X[] = { 0x00, 0x50, 0xf2, 1 };
-u8 WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X[] = { 0x00, 0x50, 0xf2, 2 };
-u8 WPA_CIPHER_SUITE_NONE[] = { 0x00, 0x50, 0xf2, 0 };
-u8 WPA_CIPHER_SUITE_WEP40[] = { 0x00, 0x50, 0xf2, 1 };
-u8 WPA_CIPHER_SUITE_TKIP[] = { 0x00, 0x50, 0xf2, 2 };
-u8 WPA_CIPHER_SUITE_WRAP[] = { 0x00, 0x50, 0xf2, 3 };
-u8 WPA_CIPHER_SUITE_CCMP[] = { 0x00, 0x50, 0xf2, 4 };
-u8 WPA_CIPHER_SUITE_WEP104[] = { 0x00, 0x50, 0xf2, 5 };
-
-u16 RSN_VERSION_BSD = 1;
-u8 RSN_AUTH_KEY_MGMT_UNSPEC_802_1X[] = { 0x00, 0x0f, 0xac, 1 };
-u8 RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X[] = { 0x00, 0x0f, 0xac, 2 };
-u8 RSN_CIPHER_SUITE_NONE[] = { 0x00, 0x0f, 0xac, 0 };
-u8 RSN_CIPHER_SUITE_WEP40[] = { 0x00, 0x0f, 0xac, 1 };
-u8 RSN_CIPHER_SUITE_TKIP[] = { 0x00, 0x0f, 0xac, 2 };
-u8 RSN_CIPHER_SUITE_WRAP[] = { 0x00, 0x0f, 0xac, 3 };
-u8 RSN_CIPHER_SUITE_CCMP[] = { 0x00, 0x0f, 0xac, 4 };
-u8 RSN_CIPHER_SUITE_WEP104[] = { 0x00, 0x0f, 0xac, 5 };
+
+#define WPA_SELECTOR_LEN 4
+static const u8 WPA_CIPHER_SUITE_NONE[] = { 0x00, 0x50, 0xf2, 0 };
+static const u8 WPA_CIPHER_SUITE_WEP40[] = { 0x00, 0x50, 0xf2, 1 };
+static const u8 WPA_CIPHER_SUITE_TKIP[] = { 0x00, 0x50, 0xf2, 2 };
+static const u8 WPA_CIPHER_SUITE_WRAP[] = { 0x00, 0x50, 0xf2, 3 };
+static const u8 WPA_CIPHER_SUITE_CCMP[] = { 0x00, 0x50, 0xf2, 4 };
+static const u8 WPA_CIPHER_SUITE_WEP104[] = { 0x00, 0x50, 0xf2, 5 };
+
+#define RSN_SELECTOR_LEN 4
+static const u8 RSN_CIPHER_SUITE_NONE[] = { 0x00, 0x0f, 0xac, 0 };
+static const u8 RSN_CIPHER_SUITE_WEP40[] = { 0x00, 0x0f, 0xac, 1 };
+static const u8 RSN_CIPHER_SUITE_TKIP[] = { 0x00, 0x0f, 0xac, 2 };
+static const u8 RSN_CIPHER_SUITE_WRAP[] = { 0x00, 0x0f, 0xac, 3 };
+static const u8 RSN_CIPHER_SUITE_CCMP[] = { 0x00, 0x0f, 0xac, 4 };
+static const u8 RSN_CIPHER_SUITE_WEP104[] = { 0x00, 0x0f, 0xac, 5 };
+
 /*  */
 /*  for adhoc-master to generate ie and provide supported-rate to fw */
 /*  */
@@ -406,7 +403,7 @@ unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit)
 	return rtw_get_ie(pie, WLAN_EID_RSN, rsn_ie_len, limit);
 }
 
-int rtw_get_wpa_cipher_suite(u8 *s)
+static int rtw_get_wpa_cipher_suite(u8 *s)
 {
 	if (!memcmp(s, WPA_CIPHER_SUITE_NONE, WPA_SELECTOR_LEN))
 		return WPA_CIPHER_NONE;
@@ -422,7 +419,7 @@ int rtw_get_wpa_cipher_suite(u8 *s)
 	return 0;
 }
 
-int rtw_get_wpa2_cipher_suite(u8 *s)
+static int rtw_get_wpa2_cipher_suite(u8 *s)
 {
 	if (!memcmp(s, RSN_CIPHER_SUITE_NONE, RSN_SELECTOR_LEN))
 		return WPA_CIPHER_NONE;
drivers/staging/rtl8723bs/include/ieee80211.h +0 -30
index 0f28c904a714..7e6858c712c0 100644
@@ -94,35 +94,7 @@ enum {
 #define WPA_CIPHER_TKIP		BIT(3)
 #define WPA_CIPHER_CCMP		BIT(4)
 
-
-
-#define WPA_SELECTOR_LEN 4
-extern u8 RTW_WPA_OUI_TYPE[];
-extern u16 RTW_WPA_VERSION;
-extern u8 WPA_AUTH_KEY_MGMT_NONE[];
-extern u8 WPA_AUTH_KEY_MGMT_UNSPEC_802_1X[];
-extern u8 WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X[];
-extern u8 WPA_CIPHER_SUITE_NONE[];
-extern u8 WPA_CIPHER_SUITE_WEP40[];
-extern u8 WPA_CIPHER_SUITE_TKIP[];
-extern u8 WPA_CIPHER_SUITE_WRAP[];
-extern u8 WPA_CIPHER_SUITE_CCMP[];
-extern u8 WPA_CIPHER_SUITE_WEP104[];
-
-
 #define RSN_HEADER_LEN 4
-#define RSN_SELECTOR_LEN 4
-
-extern u16 RSN_VERSION_BSD;
-extern u8 RSN_AUTH_KEY_MGMT_UNSPEC_802_1X[];
-extern u8 RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X[];
-extern u8 RSN_CIPHER_SUITE_NONE[];
-extern u8 RSN_CIPHER_SUITE_WEP40[];
-extern u8 RSN_CIPHER_SUITE_TKIP[];
-extern u8 RSN_CIPHER_SUITE_WRAP[];
-extern u8 RSN_CIPHER_SUITE_CCMP[];
-extern u8 RSN_CIPHER_SUITE_WEP104[];
-
 
 enum {
 	RATEID_IDX_BGN_40M_2SS = 0,
@@ -740,8 +712,6 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode);
 
 unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit);
 unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit);
-int rtw_get_wpa_cipher_suite(u8 *s);
-int rtw_get_wpa2_cipher_suite(u8 *s);
 int rtw_get_wapi_ie(u8 *in_ie, uint in_len, u8 *wapi_ie, u16 *wapi_len);
 int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwise_cipher, int *is_8021x);
 int rtw_parse_wpa2_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwise_cipher, int *is_8021x);
Signature · 1 line
2.53.0
#13 lore raw

Re: [PATCH 11/11] staging: rtl8723bs: rtw_ieee80211: Reduce global symbols

kernel test robot noticed the following build warnings:

Hi Priit,

kernel test robot noticed the following build warnings:

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

url:    https://github.com/intel-lab-lkp/linux/commits/Priit-Laes/staging-rtl8723bs-Remove-unused-BIT32-BIT36-definitions/20260221-013719
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20260220173104.2410217-1-plaes%40plaes.org
patch subject: [PATCH 11/11] staging: rtl8723bs: rtw_ieee80211: Reduce global symbols
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20260221/[email protected]/config)
compiler: m68k-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260221/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/staging/rtl8723bs/core/rtw_ieee80211.c:27:17: warning: 'RSN_CIPHER_SUITE_WRAP' defined but not used [-Wunused-const-variable=]
      27 | static const u8 RSN_CIPHER_SUITE_WRAP[] = { 0x00, 0x0f, 0xac, 3 };
         |                 ^~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/rtl8723bs/core/rtw_ieee80211.c:19:17: warning: 'WPA_CIPHER_SUITE_WRAP' defined but not used [-Wunused-const-variable=]
      19 | static const u8 WPA_CIPHER_SUITE_WRAP[] = { 0x00, 0x50, 0xf2, 3 };
         |                 ^~~~~~~~~~~~~~~~~~~~~

vim +/RSN_CIPHER_SUITE_WRAP +27 drivers/staging/rtl8723bs/core/rtw_ieee80211.c

    14	
    15	#define WPA_SELECTOR_LEN 4
    16	static const u8 WPA_CIPHER_SUITE_NONE[] = { 0x00, 0x50, 0xf2, 0 };
    17	static const u8 WPA_CIPHER_SUITE_WEP40[] = { 0x00, 0x50, 0xf2, 1 };
    18	static const u8 WPA_CIPHER_SUITE_TKIP[] = { 0x00, 0x50, 0xf2, 2 };
  > 19	static const u8 WPA_CIPHER_SUITE_WRAP[] = { 0x00, 0x50, 0xf2, 3 };
    20	static const u8 WPA_CIPHER_SUITE_CCMP[] = { 0x00, 0x50, 0xf2, 4 };
    21	static const u8 WPA_CIPHER_SUITE_WEP104[] = { 0x00, 0x50, 0xf2, 5 };
    22	
    23	#define RSN_SELECTOR_LEN 4
    24	static const u8 RSN_CIPHER_SUITE_NONE[] = { 0x00, 0x0f, 0xac, 0 };
    25	static const u8 RSN_CIPHER_SUITE_WEP40[] = { 0x00, 0x0f, 0xac, 1 };
    26	static const u8 RSN_CIPHER_SUITE_TKIP[] = { 0x00, 0x0f, 0xac, 2 };
  > 27	static const u8 RSN_CIPHER_SUITE_WRAP[] = { 0x00, 0x0f, 0xac, 3 };
    28	static const u8 RSN_CIPHER_SUITE_CCMP[] = { 0x00, 0x0f, 0xac, 4 };
    29	static const u8 RSN_CIPHER_SUITE_WEP104[] = { 0x00, 0x0f, 0xac, 5 };
    30	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#14 lore raw

Re: [PATCH 11/11] staging: rtl8723bs: rtw_ieee80211: Reduce global symbols

In reply to Priit Laes
kernel test robot noticed the following build warnings:

Hi Priit,

kernel test robot noticed the following build warnings:

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

url:    https://github.com/intel-lab-lkp/linux/commits/Priit-Laes/staging-rtl8723bs-Remove-unused-BIT32-BIT36-definitions/20260221-013719
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20260220173104.2410217-1-plaes%40plaes.org
patch subject: [PATCH 11/11] staging: rtl8723bs: rtw_ieee80211: Reduce global symbols
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260221/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260221/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/staging/rtl8723bs/core/rtw_ieee80211.c:19:17: warning: unused variable 'WPA_CIPHER_SUITE_WRAP' [-Wunused-const-variable]
      19 | static const u8 WPA_CIPHER_SUITE_WRAP[] = { 0x00, 0x50, 0xf2, 3 };
         |                 ^~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/rtl8723bs/core/rtw_ieee80211.c:27:17: warning: unused variable 'RSN_CIPHER_SUITE_WRAP' [-Wunused-const-variable]
      27 | static const u8 RSN_CIPHER_SUITE_WRAP[] = { 0x00, 0x0f, 0xac, 3 };
         |                 ^~~~~~~~~~~~~~~~~~~~~

2 warnings generated.

vim +/WPA_CIPHER_SUITE_WRAP +19 drivers/staging/rtl8723bs/core/rtw_ieee80211.c

    14	
    15	#define WPA_SELECTOR_LEN 4
    16	static const u8 WPA_CIPHER_SUITE_NONE[] = { 0x00, 0x50, 0xf2, 0 };
    17	static const u8 WPA_CIPHER_SUITE_WEP40[] = { 0x00, 0x50, 0xf2, 1 };
    18	static const u8 WPA_CIPHER_SUITE_TKIP[] = { 0x00, 0x50, 0xf2, 2 };
  > 19	static const u8 WPA_CIPHER_SUITE_WRAP[] = { 0x00, 0x50, 0xf2, 3 };
    20	static const u8 WPA_CIPHER_SUITE_CCMP[] = { 0x00, 0x50, 0xf2, 4 };
    21	static const u8 WPA_CIPHER_SUITE_WEP104[] = { 0x00, 0x50, 0xf2, 5 };
    22	
    23	#define RSN_SELECTOR_LEN 4
    24	static const u8 RSN_CIPHER_SUITE_NONE[] = { 0x00, 0x0f, 0xac, 0 };
    25	static const u8 RSN_CIPHER_SUITE_WEP40[] = { 0x00, 0x0f, 0xac, 1 };
    26	static const u8 RSN_CIPHER_SUITE_TKIP[] = { 0x00, 0x0f, 0xac, 2 };
  > 27	static const u8 RSN_CIPHER_SUITE_WRAP[] = { 0x00, 0x0f, 0xac, 3 };
    28	static const u8 RSN_CIPHER_SUITE_CCMP[] = { 0x00, 0x0f, 0xac, 4 };
    29	static const u8 RSN_CIPHER_SUITE_WEP104[] = { 0x00, 0x0f, 0xac, 5 };
    30	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#15 lore raw

Re: [PATCH 11/11] staging: rtl8723bs: rtw_ieee80211: Reduce global symbols

In reply to Priit Laes

Some of these patches don't have a commit message (they just have a title) and we don't allow that in staging so you're going to have to resend.

Quoted 1 line · Priit Laes

Also drop some unused

If you're reading this email on lore it looks like this:

https://lore.kernel.org/all/[email protected]/

The subject is hard to see. Same on my email client also. I quite often only see the title or only see the commit message. So think of the commit message as a totally different thing from the title and not part of the same sentence.

regards,
dan carpenter