[PATCH 2/7] staging: r8188eu: convert DBG_88E calls in core/rtw_xmit.c

From: Phillip Potter
Date: Sun Jan 09 2022 - 16:54:52 EST


Convert the DBG_88E macro calls in core/rtw_xmit.c to use pr_debug
or netdev_dbg appropriately, as their information may be useful to
observers, and this gets the driver closer to the point of being
able to remove DBG_88E itself. Also remove some commented out
DBG_88E calls altogether.

Some calls are at points in the call chain where use of dev_dbg or
netdev_dbg isn't possible due to lack of device pointer, so plain
pr_debug is appropriate here.

Signed-off-by: Phillip Potter <phil@xxxxxxxxxxxxxxxx>
---
drivers/staging/r8188eu/core/rtw_xmit.c | 30 ++++++++++++-------------
1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 8503059edc46..334644e46000 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -372,7 +372,7 @@ u8 qos_acm(u8 acm_mask, u8 priority)
change_priority = 5;
break;
default:
- DBG_88E("qos_acm(): invalid pattrib->priority: %d!!!\n", priority);
+ pr_debug("invalid pattrib->priority: %d!!!\n", priority);
break;
}

@@ -489,7 +489,6 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p

if (psta) {
pattrib->mac_id = psta->mac_id;
- /* DBG_88E("%s ==> mac_id(%d)\n", __func__, pattrib->mac_id); */
pattrib->psta = psta;
} else {
/* if we cannot get psta => drop the pkt */
@@ -895,7 +894,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
return _FAIL;

if (!pxmitframe->buf_addr) {
- DBG_88E("==> %s buf_addr == NULL\n", __func__);
+ netdev_dbg(padapter->pnetdev, "buf_addr == NULL\n");
return _FAIL;
}

@@ -906,7 +905,8 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
mem_start = pbuf_start + hw_hdr_offset;

if (rtw_make_wlanhdr(padapter, mem_start, pattrib) == _FAIL) {
- DBG_88E("rtw_xmitframe_coalesce: rtw_make_wlanhdr fail; drop pkt\n");
+ netdev_dbg(padapter->pnetdev,
+ "rtw_make_wlanhdr fail; drop pkt\n");
res = _FAIL;
goto exit;
}
@@ -1003,7 +1003,8 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
}

if (xmitframe_addmic(padapter, pxmitframe) == _FAIL) {
- DBG_88E("xmitframe_addmic(padapter, pxmitframe) == _FAIL\n");
+ netdev_dbg(padapter->pnetdev,
+ "xmitframe_addmic(padapter, pxmitframe) == _FAIL\n");
res = _FAIL;
goto exit;
}
@@ -1134,7 +1135,7 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)
/* pxmitbuf->ext_tag = true; */

if (pxmitbuf->sctx) {
- DBG_88E("%s pxmitbuf->sctx is not NULL\n", __func__);
+ pr_debug("pxmitbuf->sctx is not NULL\n");
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
}
}
@@ -1171,8 +1172,6 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv)
struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue;
unsigned long flags;

- /* DBG_88E("+rtw_alloc_xmitbuf\n"); */
-
spin_lock_irqsave(&pfree_xmitbuf_queue->lock, flags);

if (list_empty(&pfree_xmitbuf_queue->queue)) {
@@ -1191,7 +1190,7 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv)
pxmitpriv->free_xmitbuf_cnt--;
pxmitbuf->priv_data = NULL;
if (pxmitbuf->sctx) {
- DBG_88E("%s pxmitbuf->sctx is not NULL\n", __func__);
+ pr_debug("pxmitbuf->sctx is not NULL\n");
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
}
}
@@ -1209,7 +1208,7 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
return _FAIL;

if (pxmitbuf->sctx) {
- DBG_88E("%s pxmitbuf->sctx is not NULL\n", __func__);
+ pr_debug("pxmitbuf->sctx is not NULL\n");
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_FREE);
}

@@ -1479,7 +1478,7 @@ s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe)

if (!psta) {
res = _FAIL;
- DBG_88E("rtw_xmit_classifier: psta == NULL\n");
+ netdev_dbg(padapter->pnetdev, "psta == NULL\n");
goto exit;
}

@@ -1725,7 +1724,8 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)

pxmitframe = rtw_alloc_xmitframe(pxmitpriv);
if (!pxmitframe) {
- DBG_88E("DBG_TX_DROP_FRAME %s no more pxmitframe\n", __func__);
+ netdev_dbg(padapter->pnetdev,
+ "DBG_TX_DROP_FRAME no more pxmitframe\n");
return -1;
}

@@ -2150,7 +2150,7 @@ int rtw_sctx_wait(struct submit_ctx *sctx)
if (!wait_for_completion_timeout(&sctx->done, expire)) {
/* timeout, do something?? */
status = RTW_SCTX_DONE_TIMEOUT;
- DBG_88E("%s timeout\n", __func__);
+ pr_debug("timeout\n");
} else {
status = sctx->status;
}
@@ -2180,7 +2180,7 @@ void rtw_sctx_done_err(struct submit_ctx **sctx, int status)
{
if (*sctx) {
if (rtw_sctx_chk_waring_status(status))
- DBG_88E("%s status:%d\n", __func__, status);
+ pr_debug("status:%d\n", status);
(*sctx)->status = status;
complete(&((*sctx)->done));
*sctx = NULL;
@@ -2205,5 +2205,5 @@ void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status)
if (pxmitpriv->ack_tx)
rtw_sctx_done_err(&pack_tx_ops, status);
else
- DBG_88E("%s ack_tx not set\n", __func__);
+ pr_debug("ack_tx not set\n");
}
--
2.33.1