aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/r8188eu/core/rtw_xmit.c
diff options
context:
space:
mode:
authorPhillip Potter <phil@philpotter.co.uk>2022-02-16 01:07:06 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-17 16:00:36 +0100
commitfee26e2257c58b390b813f668a3982049e8d19ff (patch)
treed7f6cc14b3875ef19c499afe56fdaf6009d8500e /drivers/staging/r8188eu/core/rtw_xmit.c
parentstaging: r8188eu: remove rtw_debug module parameter (diff)
downloadlinux-dev-fee26e2257c58b390b813f668a3982049e8d19ff.tar.xz
linux-dev-fee26e2257c58b390b813f668a3982049e8d19ff.zip
staging: r8188eu: fix lines modified by DBG_88E cleanup
A number of style problems were left behind by the DBG_88E cleanup: (1) Empty if/else blocks. (2) Parenthesised if/while statements containing only one line. (3) Entire blocks which server zero purpose after removal of DBG_88E. (4) Various warnings about whitespace, and constant comparison order. (5) Use of __constant_htons instead when htons should be used. Fix up these issues across the driver in any file touched by the previous cleanup. Long line warnings will be addresses in a later patch. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20220216010709.791-13-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/r8188eu/core/rtw_xmit.c')
-rw-r--r--drivers/staging/r8188eu/core/rtw_xmit.c43
1 files changed, 15 insertions, 28 deletions
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 3ad124f6f3c7..0b87ce342bfb 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -458,7 +458,6 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
}
}
}
- } else if (0x888e == pattrib->ether_type) {
}
if ((pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1))
@@ -887,9 +886,8 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
if (!psta)
return _FAIL;
- if (!pxmitframe->buf_addr) {
+ if (!pxmitframe->buf_addr)
return _FAIL;
- }
pbuf_start = pxmitframe->buf_addr;
@@ -1123,9 +1121,8 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)
pxmitbuf->priv_data = NULL;
/* pxmitbuf->ext_tag = true; */
- if (pxmitbuf->sctx) {
+ if (pxmitbuf->sctx)
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
- }
}
spin_unlock_irqrestore(&pfree_queue->lock, flags);
@@ -1177,9 +1174,8 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv)
if (pxmitbuf) {
pxmitpriv->free_xmitbuf_cnt--;
pxmitbuf->priv_data = NULL;
- if (pxmitbuf->sctx) {
+ if (pxmitbuf->sctx)
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
- }
}
spin_unlock_irqrestore(&pfree_xmitbuf_queue->lock, flags);
@@ -1194,9 +1190,8 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
if (!pxmitbuf)
return _FAIL;
- if (pxmitbuf->sctx) {
+ if (pxmitbuf->sctx)
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_FREE);
- }
if (pxmitbuf->ext_tag) {
rtw_free_xmitbuf_ext(pxmitpriv, pxmitbuf);
@@ -1588,9 +1583,8 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
}
newskb = skb_copy(skb, GFP_ATOMIC);
- if (!newskb) {
+ if (!newskb)
return -1;
- }
dev_kfree_skb_any(skb);
*pskb = skb = newskb;
@@ -1602,19 +1596,15 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
}
}
- if (skb_is_nonlinear(skb))
- ;
-
res = skb_linearize(skb);
- if (res < 0) {
- return -1;
- }
+ if (res < 0)
+ return -1;
res = nat25_db_handle(padapter, skb, NAT25_INSERT);
if (res < 0) {
- if (res == -2) {
+ if (res == -2)
return -1;
- }
+
return 0;
}
}
@@ -1633,9 +1623,9 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
}
/* check if SA is equal to our MAC */
- if (memcmp(skb->data + ETH_ALEN, GET_MY_HWADDR(padapter), ETH_ALEN)) {
+ if (memcmp(skb->data + ETH_ALEN, GET_MY_HWADDR(padapter), ETH_ALEN))
return -1;
- }
+
return 0;
}
@@ -1702,9 +1692,8 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
s32 res;
pxmitframe = rtw_alloc_xmitframe(pxmitpriv);
- if (!pxmitframe) {
+ if (!pxmitframe)
return -1;
- }
rcu_read_lock();
br_port = rcu_dereference(padapter->pnetdev->rx_handler_data);
@@ -2124,12 +2113,11 @@ int rtw_sctx_wait(struct submit_ctx *sctx)
int status = 0;
expire = sctx->timeout_ms ? msecs_to_jiffies(sctx->timeout_ms) : MAX_SCHEDULE_TIMEOUT;
- if (!wait_for_completion_timeout(&sctx->done, expire)) {
+ if (!wait_for_completion_timeout(&sctx->done, expire))
/* timeout, do something?? */
status = RTW_SCTX_DONE_TIMEOUT;
- } else {
+ else
status = sctx->status;
- }
if (status == RTW_SCTX_DONE_SUCCESS)
ret = _SUCCESS;
@@ -2155,8 +2143,7 @@ static bool rtw_sctx_chk_waring_status(int status)
void rtw_sctx_done_err(struct submit_ctx **sctx, int status)
{
if (*sctx) {
- if (rtw_sctx_chk_waring_status(status))
- ;
+ rtw_sctx_chk_waring_status(status);
(*sctx)->status = status;
complete(&((*sctx)->done));
*sctx = NULL;