linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Phillip Potter <phil@philpotter.co.uk>
Cc: gregkh@linuxfoundation.org, Larry.Finger@lwfinger.net,
	insafonov@gmail.com, martin@kaiser.cx, straube.linux@gmail.com,
	simon.fodin@gmail.com, yepeilin.cs@gmail.com,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8188eu: convert DBG_88E calls in core/rtw_recv.c
Date: Mon, 14 Jun 2021 15:27:49 +0300	[thread overview]
Message-ID: <20210614122749.GO1955@kadam> (raw)
In-Reply-To: <20210612232835.1378-1-phil@philpotter.co.uk>

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@philpotter.co.uk>
> ---
>  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


      reply	other threads:[~2021-06-14 12:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-12 23:28 [PATCH] staging: rtl8188eu: convert DBG_88E calls in core/rtw_recv.c Phillip Potter
2021-06-14 12:27 ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210614122749.GO1955@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=insafonov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=martin@kaiser.cx \
    --cc=phil@philpotter.co.uk \
    --cc=simon.fodin@gmail.com \
    --cc=straube.linux@gmail.com \
    --cc=yepeilin.cs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).