netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: LABBE Corentin <clabbe.montjoie@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: peppe.cavallaro@st.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] stmmac: replace all pr_xxx by their dev_xxx counterpart
Date: Wed, 16 Sep 2015 09:35:39 +0200	[thread overview]
Message-ID: <20150916073539.GA11061@Red> (raw)
In-Reply-To: <1441815282.17219.51.camel@perches.com>

On Wed, Sep 09, 2015 at 09:14:42AM -0700, Joe Perches wrote:
> On Wed, 2015-09-09 at 15:14 +0200, LABBE Corentin wrote:
> > The stmmac driver use lots of pr_xxx functions to print information.
> > This is bad since we cannot know which device logs the information.
> > (moreover if two stmmac device are present)
> []
> > So this patch replace all pr_xxx by their dev_xxx counterpart.
> 
> Using
> 	netdev_<level>(priv->dev, ...
> instead of
> 	dev_<level>(priv->device,
> 
> would be more consistent with other ethernet devices.
> 
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> []
> > @@ -298,7 +298,7 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
> >  			 */
> >  			spin_lock_irqsave(&priv->lock, flags);
> >  			if (priv->eee_active) {
> > -				pr_debug("stmmac: disable EEE\n");
> > +				dev_dbg(priv->device, "disable EEE\n");
> 
> 				netdev_dbg(priv->dev, ...)
> 
> > @@ -657,10 +657,10 @@ static int stmmac_init_ptp(struct stmmac_priv *priv)
> >  		priv->adv_ts = 1;
> >  
> >  	if (netif_msg_hw(priv) && priv->dma_cap.time_stamp)
> > -		pr_debug("IEEE 1588-2002 Time Stamp supported\n");
> > +		dev_dbg(priv->device, "IEEE 1588-2002 Time Stamp supported\n");
> 
> And these netif_msg_<foo> could be
> 
> 	if (priv->dma_cap.timestamp)
> 		netif_dbg(priv, hw, priv->dev, ...);
> 
> 

Hello

My main goal is to improve logging from
[    0.796804] stmmaceth 1c50000.ethernet: no reset control found
[    0.802635]  Ring mode enabled
[    0.805713]  No HW DMA feature register supported
[    0.810239]  Normal descriptors
[    0.813577]  TX Checksum insertion supported
[   23.615074] eth0: device MAC address aa:65:84:d5:a3:58
[   23.704326]  RX IPC Checksum Offload disabled
[   23.704349]  No MAC Management Counters available

to that:
[    0.788147] sun7i-dwmac 1c50000.ethernet (unnamed net_device) (uninitialized): no reset control found
[    0.797400] sun7i-dwmac 1c50000.ethernet (unnamed net_device) (uninitialized): Ring mode enabled
[    0.806211] sun7i-dwmac 1c50000.ethernet (unnamed net_device) (uninitialized): No HW DMA feature register supported
[    0.816658] sun7i-dwmac 1c50000.ethernet (unnamed net_device) (uninitialized): Normal descriptors
[    0.825522] sun7i-dwmac 1c50000.ethernet (unnamed net_device) (uninitialized): TX Checksum insertion supported
[   12.971725] sun7i-dwmac 1c50000.ethernet eth0: device MAC address 3e:62:18:6f:c7:f4
[   13.056902] sun7i-dwmac 1c50000.ethernet eth0: RX IPC Checksum Offload disabled
[   13.056929] sun7i-dwmac 1c50000.ethernet eth0: No MAC Management Counters available

But by using the netdev_ functions the first five lines are not "pretty" with the "(unnamed net_device) (uninitialized)"
Could I switch back do dev_xxx since they are "early device logging" and so make it prettier ?

Best regards

      parent reply	other threads:[~2015-09-16  7:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09 13:14 [PATCH 1/4] stmmac: replace all pr_xxx by their dev_xxx counterpart LABBE Corentin
2015-09-09 13:14 ` [PATCH 2/4] stmmac: replace hardcoded function name by __func__ LABBE Corentin
2015-09-09 13:14 ` [PATCH 3/4] stmmac: remove some __func__ printing LABBE Corentin
2015-09-09 13:14 ` [PATCH 4/4] stmmac: Fix simple style problem LABBE Corentin
2015-09-09 16:14 ` [PATCH 1/4] stmmac: replace all pr_xxx by their dev_xxx counterpart Joe Perches
2015-09-10 11:42   ` LABBE Corentin
2015-09-16  7:35   ` LABBE Corentin [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=20150916073539.GA11061@Red \
    --to=clabbe.montjoie@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.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).