Re: [PATCH] staging: rtl8188eu: convert DBG_88E calls in core/rtw_recv.c

From: Dan Carpenter
Date: Mon Jun 14 2021 - 08:28:16 EST


On Sun, Jun 13, 2021 at 12:28:35AM +0100, Phillip Potter wrote:
> Convert all calls to the DBG_88E macro in core/rtw_recv.c into
> netdev_dbg calls. The DBG_88E macro is unnecessary, as visibility of
> debug messages can be controlled more precisely by just using debugfs.
> It is important to keep these messages still, as they are displayable
> via a kernel module parameter when using DBG_88E.
>
> One such converted call is after a failed skb allocation, but as it prints
> additional information besides just stating failure, I've left it in
> despite the checkpatch warning.
>
> Signed-off-by: Phillip Potter <phil@xxxxxxxxxxxxxxxx>
> ---
> drivers/staging/rtl8188eu/core/rtw_recv.c | 55 ++++++++++++++++-------
> 1 file changed, 38 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
> index 5a8170d4eab6..008f9fd9fc10 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_recv.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
> @@ -189,7 +189,7 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter)
>
> while ((pending_frame = rtw_alloc_recvframe(&adapter->recvpriv.uc_swdec_pending_queue))) {
> rtw_free_recvframe(pending_frame, &adapter->recvpriv.free_recv_queue);
> - DBG_88E("%s: dequeue uc_swdec_pending_queue\n", __func__);
> + netdev_dbg(adapter->pnetdev, "dequeue uc_swdec_pending_queue");

This printk has no useful information.

> cnt++;
> }
>
> @@ -229,7 +229,7 @@ static int recvframe_chkmic(struct adapter *adapter,
> res = _FAIL;
> RT_TRACE(_module_rtl871x_recv_c_, _drv_err_,
> ("\n %s: didn't install group key!!!!!!!!!!\n", __func__));
> - DBG_88E("\n %s: didn't install group key!!!!!!!!!!\n", __func__);
> + netdev_dbg(adapter->pnetdev, "didn't install group key!!!!!!!!!!");

This condition is impossible. Otherwise it would be better to make
this an error message.


> goto exit;
> }
> mickey = &psecuritypriv->dot118021XGrprxmickey[prxattrib->key_index].skey[0];
> @@ -318,10 +318,14 @@ static int recvframe_chkmic(struct adapter *adapter,
> if ((prxattrib->bdecrypted) && (brpt_micerror)) {
> rtw_handle_tkip_mic_err(adapter, (u8)is_multicast_ether_addr(prxattrib->ra));
> RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" mic error :prxattrib->bdecrypted=%d ", prxattrib->bdecrypted));
> - DBG_88E(" mic error :prxattrib->bdecrypted=%d\n", prxattrib->bdecrypted);
> + netdev_dbg(adapter->pnetdev,
> + "mic error :prxattrib->bdecrypted=%d",
> + prxattrib->bdecrypted);
> } else {
> RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" mic error :prxattrib->bdecrypted=%d ", prxattrib->bdecrypted));
> - DBG_88E(" mic error :prxattrib->bdecrypted=%d\n", prxattrib->bdecrypted);
> + netdev_dbg(adapter->pnetdev,
> + "mic error :prxattrib->bdecrypted=%d",
> + prxattrib->bdecrypted);

Both sides of this if statement are the same.

> }
> res = _FAIL;
> } else {
> @@ -361,7 +365,8 @@ static struct recv_frame *decryptor(struct adapter *padapter,
> prxattrib->key_index = (((iv[3]) >> 6) & 0x3);
>
> if (prxattrib->key_index > WEP_KEYS) {
> - DBG_88E("prxattrib->key_index(%d)>WEP_KEYS\n", prxattrib->key_index);
> + netdev_dbg(padapter->pnetdev,
> + "prxattrib->key_index(%d)>WEP_KEYS", prxattrib->key_index);

This should be an error message if it's possible. I just feel like
this debugging is a random grab bag of printks. A lot of them are
pretty pointless and there was no thought to it at all.

We'd be better off with a mass delete.

regards,
dan carpenter