public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Fabio Aiuto <fabioaiuto83@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Joe Perches <joe@perches.com>,
	gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 02/49] staging: rtl8723bs: replace DBG_871X_SEL log macro with netdev_dbg()
Date: Wed, 28 Apr 2021 11:47:34 +0200	[thread overview]
Message-ID: <20210428094733.GA1427@agape.jhs> (raw)
In-Reply-To: <20210428092842.GQ1981@kadam>

On Wed, Apr 28, 2021 at 12:28:42PM +0300, Dan Carpenter wrote:
> On Fri, Apr 23, 2021 at 06:52:49PM +0200, Fabio Aiuto wrote:
> > On Fri, Apr 23, 2021 at 08:27:58AM -0700, Joe Perches wrote:
> > > On Fri, 2021-04-23 at 16:57 +0200, Fabio Aiuto wrote:
> > > > replace DBG_871X_SEL log macro with the net device driver
> > > > recommended netdev_dbg().
> > > > 
> > > > This macro by default does a raw printk, and the alternative
> > > > behaviour, never triggered is a seq_print() call.
> > > []
> > > > diff --git a/drivers/staging/rtl8723bs/core/rtw_debug.c b/drivers/staging/rtl8723bs/core/rtw_debug.c
> > > []
> > > > @@ -23,9 +23,10 @@ void mac_reg_dump(void *sel, struct adapter *adapter)
> > > >  	for (i = 0x0; i < 0x800; i += 4) {
> > > >  		if (j%4 == 1)
> > > >  			netdev_dbg(adapter->pnetdev, "0x%03x", i);
> > > > -		DBG_871X_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
> > > > +		netdev_dbg(adapter->pnetdev, " 0x%08x ",
> > > > +			   rtw_read32(adapter, i));
> > > >  		if ((j++)%4 == 0)
> > > > -			DBG_871X_SEL(sel, "\n");
> > > > +			netdev_dbg(adapter->pnetdev, "\n");
> > > >  	}
> > > 
> > > This makes a mess of the output as each netdev_dbg call
> > > is a separate line.
> > > 
> > > Dumping 1000 register lines into output logs seems impolite
> > > at best, even for debugging.
> > > 
> > > This _might_ be rewritten to something like:
> > > 
> > > void dump_4_regs(struct adapter *adapter, int offset)
> > > {
> > > 	u32 reg[4];
> > > 	int i;
> > > 
> > > 	for (i = 0; i < 4; i++)
> > > 		reg[i] = rtw_read32(adapter, offset + i);
> > > 
> > > 	netdev_dbg(adapter->pnetdev, "0x%03x 0x%08x 0x%08x 0x%08x 0x%08x\n",
> > > 		   i, reg[0], reg[1], reg[2], reg[3]);
> > > }
> > > 
> > > void mac_reg_dump(...)
> > > {
> > > 	...
> > > 
> > > 	for (i = 0; i < 0x800; i += 4)
> > > 		dump_4_regs(adapter, i);
> > > 
> > > 
> > > 
> > 
> > interesting, sure that will be matter of another patch series,
> > the ugly output was already there, old macro used to wrap a raw
> > printk...
> 
> The raw printk doesn't automatically add a new line at the end but a
> netdev_dbg() does.  (You're still supposed to add a manual \n to those
> but if you don't the lower layers will do it automatically.)
> 
> regards,
> dan carpenter

got it,

thank you,

fabio

  reply	other threads:[~2021-04-28  9:47 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 14:57 [PATCH 00/49] staging: rtl8723bs: remove all remaining debug macros in rtw_debug.h Fabio Aiuto
2021-04-23 14:57 ` [PATCH 01/49] staging: rtl8723bs: remove unused log function Fabio Aiuto
2021-04-23 14:57 ` [PATCH 02/49] staging: rtl8723bs: replace DBG_871X_SEL log macro with netdev_dbg() Fabio Aiuto
2021-04-23 15:27   ` Joe Perches
2021-04-23 16:52     ` Fabio Aiuto
2021-04-28  9:28       ` Dan Carpenter
2021-04-28  9:47         ` Fabio Aiuto [this message]
2021-04-23 14:57 ` [PATCH 03/49] staging: rtl8723bs: remove DBG_871X_SEL macro declaration Fabio Aiuto
2021-04-23 14:57 ` [PATCH 04/49] staging: rtl8723bs: remove unused _DBG_871X_LEVEL macro Fabio Aiuto
2021-04-23 14:57 ` [PATCH 05/49] staging: rtl8723bs: remove unused mac_reg_dump() function argument Fabio Aiuto
2021-04-23 14:57 ` [PATCH 06/49] staging: rtl8723bs: remove unused bb_reg_dump() " Fabio Aiuto
2021-04-23 14:57 ` [PATCH 07/49] staging: rtl8723bs: remove unused rf_reg_dump() " Fabio Aiuto
2021-04-23 14:57 ` [PATCH 08/49] staging: rtl8723bs: remove unused RTW_DBGDUMP macro definition Fabio Aiuto
2021-04-23 14:58 ` [PATCH 09/49] staging: rtl8723bs: remove all defs related to _dbgdump macro Fabio Aiuto
2021-04-23 14:58 ` [PATCH 10/49] staging: rtl8723bs: remove unused debug variables declarations and initialization Fabio Aiuto
2021-04-23 14:58 ` [PATCH 11/49] staging: rtl8723bs: remove unneeded header file Fabio Aiuto
2021-04-23 14:58 ` [PATCH 12/49] staging: rtl8723bs: remove unused debug macro definitions Fabio Aiuto
2021-04-23 14:58 ` [PATCH 13/49] staging: rtl8723bs: remove debug macros related to core/rtw_xmit.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 14/49] staging: rtl8723bs: remove debug macros related to os_dep/xmit_linux.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 15/49] staging: rtl8723bs: remove debug macros related to core/rtw_recv.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 16/49] staging: rtl8723bs: remove debug macros related to os_dep/recv_linux.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 17/49] staging: rtl8723bs: remove debug macros related to core/rtw_mlme.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 18/49] staging: rtl8723bs: remove debug macros related to os_dep/mlme_linux.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 19/49] staging: rtl8723bs: move static array definition from header to .c file Fabio Aiuto
2021-04-23 14:58 ` [PATCH 20/49] staging: rtl8723bs: remove debug macros related to core/rtw_mlme_ext.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 21/49] staging: rtl8723bs: remove debug macros related to core/rtw_sta_mgt.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 22/49] staging: rtl8723bs: remove debug macros related to core/rtw_cmd.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 23/49] staging: rtl8723bs: remove obsolete debug macro definitions Fabio Aiuto
2021-04-23 14:58 ` [PATCH 24/49] staging: rtl8723bs: remove debug macros related to core/rtw_io.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 25/49] staging: rtl8723bs: remove obsolete _IO_OSDEP_C_ debug macro definition Fabio Aiuto
2021-04-23 14:58 ` [PATCH 26/49] staging: rtl8723bs: remove debug macros related to os_dep/os_intfs.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 27/49] staging: rtl8723bs: remove debug macros related to core/rtw_security.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 28/49] staging: rtl8723bs: remove debug macros related to core/rtw_eeprom.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 29/49] staging: rtl8723bs: remove debug macros related to hal/hal_intf.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 30/49] staging: rtl8723bs: remove debug macros related to hal/sdio_halinit.c tracing Fabio Aiuto
2021-04-23 14:58 ` [PATCH 31/49] staging: rtl8723bs: remove unused debug macros tied to _RTL871X_IOCTL_C_ definition Fabio Aiuto
2021-04-23 14:58 ` [PATCH 32/49] staging: rtl8723bs: remove unused debug macros tied to _RTL871X_IOCTL_SET_C_ definition Fabio Aiuto
2021-04-23 14:58 ` [PATCH 33/49] staging: rtl8723bs: remove unused debug macros tied to _RTL871X_IOCTL_QUERY_C_ definition Fabio Aiuto
2021-04-23 14:58 ` [PATCH 34/49] staging: rtl8723bs: remove unused debug macros tied to _RTL871X_PWRCTRL_C_ definition Fabio Aiuto
2021-04-23 14:58 ` [PATCH 35/49] staging: rtl8723bs: remove unused macros tied to core/rtw_pwrctrl.c debug Fabio Aiuto
2021-04-23 14:58 ` [PATCH 36/49] staging: rtl8723bs: remove unused macros tied to os_dep/sdio_intf.c debug Fabio Aiuto
2021-04-23 14:58 ` [PATCH 37/49] staging: rtl8723bs: remove unused debug macros tied to _HCI_OPS_C_ definition Fabio Aiuto
2021-04-23 14:58 ` [PATCH 38/49] staging: rtl8723bs: remove unused debug macros tied to hal/sdio_ops.c debug Fabio Aiuto
2021-04-23 14:58 ` [PATCH 39/49] staging: rtl8723bs: remove unused debug macros tied to os_dep/osdep_service.c debug Fabio Aiuto
2021-04-23 14:58 ` [PATCH 40/49] staging: rtl8723bs: remove unused _module_mp_ def Fabio Aiuto
2021-04-23 14:58 ` [PATCH 41/49] staging: rtl8723bs: remove unused macros tied to _HCI_OPS_OS_C_ definition Fabio Aiuto
2021-04-23 14:58 ` [PATCH 42/49] staging: rtl8723bs: remove unused macros tied to _RTL871X_IOCTL_LINUX_C definition Fabio Aiuto
2021-04-23 14:58 ` [PATCH 43/49] staging: rtl8723bs: remove unused macros tied to _RTL8712_CMD_C_ definition Fabio Aiuto
2021-04-23 14:58 ` [PATCH 44/49] staging: rtl8723bs: remove commented out macro definition Fabio Aiuto
2021-04-23 14:58 ` [PATCH 45/49] staging: rtl8723bs: remove unused debug macro definitions Fabio Aiuto
2021-04-23 14:58 ` [PATCH 46/49] staging: rtl8723bs: remove unused macros tied to core/rtw_efuse.c debug Fabio Aiuto
2021-04-23 14:58 ` [PATCH 47/49] staging: rtl8723bs: remove unsed debug macros tied to no particular code debug Fabio Aiuto
2021-04-23 14:58 ` [PATCH 48/49] staging: rtl8723bs: remove last unused debug macros Fabio Aiuto
2021-04-23 14:58 ` [PATCH 49/49] staging: rtl8723bs: macro DRIVER_PREFIX expands to lowercase driver name Fabio Aiuto

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=20210428094733.GA1427@agape.jhs \
    --to=fabioaiuto83@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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