Skip to contentSkip to conversation

staging: r8188eu: another round of xmit cleanups

PATCH New Martin Kaiser 1 participant 10 messages Jan 30, 2023 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: r8188eu: another round of xmit cleanups

Here's some more cleanups for the xmit code. Amongst other things, there's one more __queue that can be replaced with a list_head.

Martin Kaiser (9):
staging: r8188eu: rtw_free_xmitframe_queue needs no spinlock
staging: r8188eu: change function param from __queue to list_head
staging: r8188eu: change another function param from __queue to
list_head
staging: r8188eu: make sta_pending a list_head
staging: r8188eu: use kernel helper to iterate over a list
staging: r8188eu: legacy_dz is initialised but never used
staging: r8188eu: apsd is initialised but never used
staging: r8188eu: option in struct sta_xmit_priv is not used
staging: r8188eu: replace switch-case with if

 drivers/staging/r8188eu/core/rtw_sta_mgt.c    | 10 +++---
 drivers/staging/r8188eu/core/rtw_xmit.c       | 31 +++++--------------
 drivers/staging/r8188eu/hal/rtl8188eu_xmit.c  |  4 +--
 drivers/staging/r8188eu/include/rtw_xmit.h    |  8 ++---
 .../staging/r8188eu/os_dep/usb_ops_linux.c    |  8 +----
 5 files changed, 18 insertions(+), 43 deletions(-)
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/9 staging: r8188eu: rtw_free_xmitframe_queue needs no spinlock

There's no need for a spinlock in rtw_free_xmitframe_queue.

This function is called only from rtw_free_stainfo. rtw_free_stainfo holds pxmitpriv->lock during all rtw_free_xmitframe_queue calls.

---
 drivers/staging/r8188eu/core/rtw_xmit.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +0 -3
index f50e10f0d51f..4e49f1d49eb5 100644
@@ -1330,8 +1330,6 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pfram
 	struct list_head *plist, *phead;
 	struct	xmit_frame	*pxmitframe;
 
-	spin_lock_bh(&pframequeue->lock);
-
 	phead = get_list_head(pframequeue);
 	plist = phead->next;
 
@@ -1342,7 +1340,6 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pfram
 
 		rtw_free_xmitframe(pxmitpriv, pxmitframe);
 	}
-	spin_unlock_bh(&pframequeue->lock);
 }
 
 struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i)
Signature · 1 line
2.30.2
#2 lore raw

PATCH 2/9 staging: r8188eu: change function param from __queue to list_head

In reply to Martin Kaiser

Modify the dequeue_xmitframes_to_sleeping_queue function to take a list_head pointer instead of a __queue pointer.

This is an intermediate step towards changing struct tx_servq's sta_pending from __queue to list_head.

---
 drivers/staging/r8188eu/core/rtw_xmit.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +7 -8
index 4e49f1d49eb5..3117db41d749 100644
@@ -1788,16 +1788,15 @@ int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fra
 	return ret;
 }
 
-static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struct sta_info *psta, struct __queue *pframequeue)
+static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struct sta_info *psta, struct list_head *phead)
 {
-	struct list_head *plist, *phead;
+	struct list_head *plist;
 	u8	ac_index;
 	struct tx_servq	*ptxservq;
 	struct pkt_attrib	*pattrib;
 	struct xmit_frame	*pxmitframe;
 	struct hw_xmit *phwxmits =  padapter->xmitpriv.hwxmits;
 
-	phead = get_list_head(pframequeue);
 	plist = phead->next;
 
 	while (phead != plist) {
@@ -1834,21 +1833,21 @@ void stop_sta_xmit(struct adapter *padapter, struct sta_info *psta)
 
 	pstapriv->sta_dz_bitmap |= BIT(psta->aid);
 
-	dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->vo_q.sta_pending);
+	dequeue_xmitframes_to_sleeping_queue(padapter, psta, get_list_head(&pstaxmitpriv->vo_q.sta_pending));
 	list_del_init(&pstaxmitpriv->vo_q.tx_pending);
 
-	dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->vi_q.sta_pending);
+	dequeue_xmitframes_to_sleeping_queue(padapter, psta, get_list_head(&pstaxmitpriv->vi_q.sta_pending));
 	list_del_init(&pstaxmitpriv->vi_q.tx_pending);
 
-	dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->be_q.sta_pending);
+	dequeue_xmitframes_to_sleeping_queue(padapter, psta, get_list_head(&pstaxmitpriv->be_q.sta_pending));
 	list_del_init(&pstaxmitpriv->be_q.tx_pending);
 
-	dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->bk_q.sta_pending);
+	dequeue_xmitframes_to_sleeping_queue(padapter, psta, get_list_head(&pstaxmitpriv->bk_q.sta_pending));
 	list_del_init(&pstaxmitpriv->bk_q.tx_pending);
 
 	/* for BC/MC Frames */
 	pstaxmitpriv = &psta_bmc->sta_xmitpriv;
-	dequeue_xmitframes_to_sleeping_queue(padapter, psta_bmc, &pstaxmitpriv->be_q.sta_pending);
+	dequeue_xmitframes_to_sleeping_queue(padapter, psta_bmc, get_list_head(&pstaxmitpriv->be_q.sta_pending));
 	list_del_init(&pstaxmitpriv->be_q.tx_pending);
 
 	spin_unlock_bh(&pxmitpriv->lock);
Signature · 1 line
2.30.2
#3 lore raw

PATCH 3/9 staging: r8188eu: change another function param from __queue to list_head

In reply to Martin Kaiser

Modify the rtw_free_xmitframe_queue function to take a list_head pointer instead of a __queue pointer.

This is an intermediate step towards changing struct tx_servq's sta_pending from __queue to list_head.

Now that the function takes a list instead of a queue, we should also rename it to rtw_free_xmitframe_list.

---
 drivers/staging/r8188eu/core/rtw_sta_mgt.c | 10 +++++-----
 drivers/staging/r8188eu/core/rtw_xmit.c    |  9 ++++-----
 drivers/staging/r8188eu/include/rtw_xmit.h |  3 +--
 3 files changed, 10 insertions(+), 12 deletions(-)
drivers/staging/r8188eu/core/rtw_sta_mgt.c +5 -5
index b4aee8623099..49a92725c5ed 100644
@@ -260,22 +260,22 @@ void rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
 
 	spin_lock_bh(&pxmitpriv->lock);
 
-	rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
+	rtw_free_xmitframe_list(pxmitpriv, get_list_head(&psta->sleep_q));
 	psta->sleepq_len = 0;
 
-	rtw_free_xmitframe_queue(pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);
+	rtw_free_xmitframe_list(pxmitpriv, get_list_head(&pstaxmitpriv->vo_q.sta_pending));
 
 	list_del_init(&pstaxmitpriv->vo_q.tx_pending);
 
-	rtw_free_xmitframe_queue(pxmitpriv, &pstaxmitpriv->vi_q.sta_pending);
+	rtw_free_xmitframe_list(pxmitpriv, get_list_head(&pstaxmitpriv->vi_q.sta_pending));
 
 	list_del_init(&pstaxmitpriv->vi_q.tx_pending);
 
-	rtw_free_xmitframe_queue(pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);
+	rtw_free_xmitframe_list(pxmitpriv, get_list_head(&pstaxmitpriv->bk_q.sta_pending));
 
 	list_del_init(&pstaxmitpriv->bk_q.tx_pending);
 
-	rtw_free_xmitframe_queue(pxmitpriv, &pstaxmitpriv->be_q.sta_pending);
+	rtw_free_xmitframe_list(pxmitpriv, get_list_head(&pstaxmitpriv->be_q.sta_pending));
 
 	list_del_init(&pstaxmitpriv->be_q.tx_pending);
 
drivers/staging/r8188eu/core/rtw_xmit.c +4 -5
index 3117db41d749..d272166a99ec 100644
@@ -1325,15 +1325,14 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
 	return _SUCCESS;
 }
 
-void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pframequeue)
+void rtw_free_xmitframe_list(struct xmit_priv *pxmitpriv, struct list_head *xframe_list)
 {
-	struct list_head *plist, *phead;
+	struct list_head *plist;
 	struct	xmit_frame	*pxmitframe;
 
-	phead = get_list_head(pframequeue);
-	plist = phead->next;
+	plist = xframe_list->next;
 
-	while (phead != plist) {
+	while (xframe_list != plist) {
 		pxmitframe = container_of(plist, struct xmit_frame, list);
 
 		plist = plist->next;
drivers/staging/r8188eu/include/rtw_xmit.h +1 -2
index d8808e68f778..8557b311e809 100644
@@ -309,8 +309,7 @@ s32 rtw_put_snap(u8 *data, u16 h_proto);
 struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv);
 s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv,
 		       struct xmit_frame *pxmitframe);
-void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv,
-			      struct __queue *pframequeue);
+void rtw_free_xmitframe_list(struct xmit_priv *pxmitpriv, struct list_head *xframe_list);
 struct tx_servq *rtw_get_sta_pending(struct adapter *padapter,
 				     struct sta_info *psta, int up, u8 *ac);
 struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv,
Signature · 1 line
2.30.2
#4 lore raw

PATCH 4/9 staging: r8188eu: make sta_pending a list_head

In reply to Martin Kaiser

We can now change sta_pending in struct tx_servq from __queue to list_head. The driver defines __queue as list_head + spinlock, the spinlock is not used for sta_pending.

---
 drivers/staging/r8188eu/core/rtw_sta_mgt.c   |  8 ++++----
 drivers/staging/r8188eu/core/rtw_xmit.c      | 16 ++++++++--------
 drivers/staging/r8188eu/hal/rtl8188eu_xmit.c |  4 ++--
 drivers/staging/r8188eu/include/rtw_xmit.h   |  2 +-
 4 files changed, 15 insertions(+), 15 deletions(-)
drivers/staging/r8188eu/core/rtw_sta_mgt.c +4 -4
index 49a92725c5ed..a9c29b2bf230 100644
@@ -263,19 +263,19 @@ void rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
 	rtw_free_xmitframe_list(pxmitpriv, get_list_head(&psta->sleep_q));
 	psta->sleepq_len = 0;
 
-	rtw_free_xmitframe_list(pxmitpriv, get_list_head(&pstaxmitpriv->vo_q.sta_pending));
+	rtw_free_xmitframe_list(pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);
 
 	list_del_init(&pstaxmitpriv->vo_q.tx_pending);
 
-	rtw_free_xmitframe_list(pxmitpriv, get_list_head(&pstaxmitpriv->vi_q.sta_pending));
+	rtw_free_xmitframe_list(pxmitpriv, &pstaxmitpriv->vi_q.sta_pending);
 
 	list_del_init(&pstaxmitpriv->vi_q.tx_pending);
 
-	rtw_free_xmitframe_list(pxmitpriv, get_list_head(&pstaxmitpriv->bk_q.sta_pending));
+	rtw_free_xmitframe_list(pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);
 
 	list_del_init(&pstaxmitpriv->bk_q.tx_pending);
 
-	rtw_free_xmitframe_list(pxmitpriv, get_list_head(&pstaxmitpriv->be_q.sta_pending));
+	rtw_free_xmitframe_list(pxmitpriv, &pstaxmitpriv->be_q.sta_pending);
 
 	list_del_init(&pstaxmitpriv->be_q.tx_pending);
 
drivers/staging/r8188eu/core/rtw_xmit.c +8 -8
index d272166a99ec..24cf11e7b4bc 100644
@@ -17,7 +17,7 @@ static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 };
 static void _init_txservq(struct tx_servq *ptxservq)
 {
 	INIT_LIST_HEAD(&ptxservq->tx_pending);
-	rtw_init_queue(&ptxservq->sta_pending);
+	INIT_LIST_HEAD(&ptxservq->sta_pending);
 	ptxservq->qcnt = 0;
 }
 
@@ -1361,7 +1361,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi
 	for (i = 0; i < HWXMIT_ENTRY; i++) {
 		phwxmit = phwxmit_i + inx[i];
 		list_for_each_entry_safe(ptxservq, tmp_txservq, phwxmit->sta_list, tx_pending) {
-			xframe_list = get_list_head(&ptxservq->sta_pending);
+			xframe_list = &ptxservq->sta_pending;
 			if (list_empty(xframe_list))
 				continue;
 
@@ -1444,7 +1444,7 @@ s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe)
 	if (list_empty(&ptxservq->tx_pending))
 		list_add_tail(&ptxservq->tx_pending, phwxmits[ac_index].sta_list);
 
-	list_add_tail(&pxmitframe->list, get_list_head(&ptxservq->sta_pending));
+	list_add_tail(&pxmitframe->list, &ptxservq->sta_pending);
 	ptxservq->qcnt++;
 	phwxmits[ac_index].accnt++;
 exit:
@@ -1832,21 +1832,21 @@ void stop_sta_xmit(struct adapter *padapter, struct sta_info *psta)
 
 	pstapriv->sta_dz_bitmap |= BIT(psta->aid);
 
-	dequeue_xmitframes_to_sleeping_queue(padapter, psta, get_list_head(&pstaxmitpriv->vo_q.sta_pending));
+	dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->vo_q.sta_pending);
 	list_del_init(&pstaxmitpriv->vo_q.tx_pending);
 
-	dequeue_xmitframes_to_sleeping_queue(padapter, psta, get_list_head(&pstaxmitpriv->vi_q.sta_pending));
+	dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->vi_q.sta_pending);
 	list_del_init(&pstaxmitpriv->vi_q.tx_pending);
 
-	dequeue_xmitframes_to_sleeping_queue(padapter, psta, get_list_head(&pstaxmitpriv->be_q.sta_pending));
+	dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->be_q.sta_pending);
 	list_del_init(&pstaxmitpriv->be_q.tx_pending);
 
-	dequeue_xmitframes_to_sleeping_queue(padapter, psta, get_list_head(&pstaxmitpriv->bk_q.sta_pending));
+	dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->bk_q.sta_pending);
 	list_del_init(&pstaxmitpriv->bk_q.tx_pending);
 
 	/* for BC/MC Frames */
 	pstaxmitpriv = &psta_bmc->sta_xmitpriv;
-	dequeue_xmitframes_to_sleeping_queue(padapter, psta_bmc, get_list_head(&pstaxmitpriv->be_q.sta_pending));
+	dequeue_xmitframes_to_sleeping_queue(padapter, psta_bmc, &pstaxmitpriv->be_q.sta_pending);
 	list_del_init(&pstaxmitpriv->be_q.tx_pending);
 
 	spin_unlock_bh(&pxmitpriv->lock);
drivers/staging/r8188eu/hal/rtl8188eu_xmit.c +2 -2
index 18557738dbad..5aa33fc4041d 100644
@@ -461,7 +461,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt)
 	}
 	spin_lock_bh(&pxmitpriv->lock);
 
-	xmitframe_phead = get_list_head(&ptxservq->sta_pending);
+	xmitframe_phead = &ptxservq->sta_pending;
 	xmitframe_plist = xmitframe_phead->next;
 
 	while (xmitframe_phead != xmitframe_plist) {
@@ -512,7 +512,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt)
 		}
 	} /* end while (aggregate same priority and same DA(AP or STA) frames) */
 
-	if (list_empty(&ptxservq->sta_pending.queue))
+	if (list_empty(&ptxservq->sta_pending))
 		list_del_init(&ptxservq->tx_pending);
 
 	spin_unlock_bh(&pxmitpriv->lock);
drivers/staging/r8188eu/include/rtw_xmit.h +1 -1
index 8557b311e809..dfdc1c57d5d4 100644
@@ -221,7 +221,7 @@ struct xmit_frame {
 
 struct tx_servq {
 	struct list_head tx_pending;
-	struct __queue sta_pending;
+	struct list_head sta_pending;
 	int qcnt;
 };
 
Signature · 1 line
2.30.2
#5 lore raw

PATCH 5/9 staging: r8188eu: use kernel helper to iterate over a list

In reply to Martin Kaiser

rtw_free_xmitframe_list iterates over the list of xmit_frames and frees each entry. We can use list_for_each_entry_safe instead of coding this manually. We need the _safe version as the current pxmitframe will be removed from the list by rtw_free_xmitframe.

---
 drivers/staging/r8188eu/core/rtw_xmit.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +2 -10
index 24cf11e7b4bc..c2b1e6f1d358 100644
@@ -1327,18 +1327,10 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
 
 void rtw_free_xmitframe_list(struct xmit_priv *pxmitpriv, struct list_head *xframe_list)
 {
-	struct list_head *plist;
-	struct	xmit_frame	*pxmitframe;
-
-	plist = xframe_list->next;
-
-	while (xframe_list != plist) {
-		pxmitframe = container_of(plist, struct xmit_frame, list);
-
-		plist = plist->next;
+	struct	xmit_frame *pxmitframe, *tmp_xmitframe;
 
+	list_for_each_entry_safe(pxmitframe, tmp_xmitframe, xframe_list, list)
 		rtw_free_xmitframe(pxmitpriv, pxmitframe);
-	}
 }
 
 struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i)
Signature · 1 line
2.30.2
#6 lore raw

PATCH 6/9 staging: r8188eu: legacy_dz is initialised but never used

In reply to Martin Kaiser

legacy_dz in struct sta_xmit_priv is initialised but not used. It can be removed.

---
 drivers/staging/r8188eu/core/rtw_xmit.c    | 1 -
 drivers/staging/r8188eu/include/rtw_xmit.h | 1 -
 2 files changed, 2 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +0 -1
index c2b1e6f1d358..797e24b852b1 100644
@@ -29,7 +29,6 @@ void	_rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv)
 	_init_txservq(&psta_xmitpriv->bk_q);
 	_init_txservq(&psta_xmitpriv->vi_q);
 	_init_txservq(&psta_xmitpriv->vo_q);
-	INIT_LIST_HEAD(&psta_xmitpriv->legacy_dz);
 	INIT_LIST_HEAD(&psta_xmitpriv->apsd);
 }
 
drivers/staging/r8188eu/include/rtw_xmit.h +0 -1
index dfdc1c57d5d4..8566e731514c 100644
@@ -232,7 +232,6 @@ struct sta_xmit_priv {
 	struct tx_servq	bk_q;			/* priority == 1,2 */
 	struct tx_servq	vi_q;			/* priority == 4,5 */
 	struct tx_servq	vo_q;			/* priority == 6,7 */
-	struct list_head legacy_dz;
 	struct list_head apsd;
 	u16 txseq_tid[16];
 };
Signature · 1 line
2.30.2
#7 lore raw

PATCH 7/9 staging: r8188eu: apsd is initialised but never used

In reply to Martin Kaiser

apsd in struct sta_xmit_priv is initialised but not used. It can be removed.

---
 drivers/staging/r8188eu/core/rtw_xmit.c    | 1 -
 drivers/staging/r8188eu/include/rtw_xmit.h | 1 -
 2 files changed, 2 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +0 -1
index 797e24b852b1..91f92ec5ef69 100644
@@ -29,7 +29,6 @@ void	_rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv)
 	_init_txservq(&psta_xmitpriv->bk_q);
 	_init_txservq(&psta_xmitpriv->vi_q);
 	_init_txservq(&psta_xmitpriv->vo_q);
-	INIT_LIST_HEAD(&psta_xmitpriv->apsd);
 }
 
 static int rtw_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf,
drivers/staging/r8188eu/include/rtw_xmit.h +0 -1
index 8566e731514c..4c508ab4c870 100644
@@ -232,7 +232,6 @@ struct sta_xmit_priv {
 	struct tx_servq	bk_q;			/* priority == 1,2 */
 	struct tx_servq	vi_q;			/* priority == 4,5 */
 	struct tx_servq	vo_q;			/* priority == 6,7 */
-	struct list_head apsd;
 	u16 txseq_tid[16];
 };
 
Signature · 1 line
2.30.2
#8 lore raw

PATCH 8/9 staging: r8188eu: option in struct sta_xmit_priv is not used

In reply to Martin Kaiser

The option component in struct sta_xmit_priv is not used, remove it.

---
 drivers/staging/r8188eu/include/rtw_xmit.h | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/r8188eu/include/rtw_xmit.h +0 -1
index 4c508ab4c870..b332c2a86dbb 100644
@@ -227,7 +227,6 @@ struct tx_servq {
 
 struct sta_xmit_priv {
 	spinlock_t lock;
-	int	option;
 	struct tx_servq	be_q;			/* priority == 0,3 */
 	struct tx_servq	bk_q;			/* priority == 1,2 */
 	struct tx_servq	vi_q;			/* priority == 4,5 */
Signature · 1 line
2.30.2
#9 lore raw

PATCH 9/9 staging: r8188eu: replace switch-case with if

In reply to Martin Kaiser

Replace a switch-case in rtw_write_port with an if statement and make the code a bit shorter.

---
 drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/staging/r8188eu/os_dep/usb_ops_linux.c +1 -7
index c9ee1173a1d6..48c96f731ce1 100644
@@ -121,14 +121,8 @@ u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
 	status = usb_submit_urb(purb, GFP_ATOMIC);
 	if (status) {
 		rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_WRITE_PORT_ERR);
-
-		switch (status) {
-		case -ENODEV:
+		if (status == -ENODEV)
 			padapter->bDriverStopped = true;
-			break;
-		default:
-			break;
-		}
 		goto exit;
 	}
 
Signature · 1 line
2.30.2