netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Francois Romieu <romieu@fr.zoreil.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] drivers/net/r8169.c - trivial - add KERN_DEBUG to dprintk and PFX before KERN_ uses
Date: Tue, 02 Oct 2007 10:06:37 -0700	[thread overview]
Message-ID: <1191344797.13170.41.camel@localhost> (raw)
In-Reply-To: <47027895.3050208@garzik.org>

On Tue, 2007-10-02 at 12:57 -0400, Jeff Garzik wrote:
> \> @@ -1924,7 +1925,7 @@ static void rtl_hw_start_8169(struct net_device *dev)
> >  
> >  	if ((tp->mac_version == RTL_GIGA_MAC_VER_02) ||
> >  	    (tp->mac_version == RTL_GIGA_MAC_VER_03)) {
> > -		dprintk(KERN_INFO PFX "Set MAC Reg C+CR Offset 0xE0. "
> > +		dprintk("Set MAC Reg C+CR Offset 0xE0. "
> >  			"Bit-3 and bit-14 MUST be 1\n");
> >  		tp->cp_cmd |= (1 << 14);
> >  	}
> 
> NAK these, the author clearly prefers his debugging output at KERN_INFO 
> level

This fixes an expanded printk(PFX KERN_INFO PFX foo) bug.

That the author "clearly prefers" is dubious.

The rest of the dprintk uses are undefined.

$ grep dprintk drivers/net/r8169.c
        dprintk("mac_version = 0x%02x\n", tp->mac_version);
                        dprintk("phy_version == %s (%04x)\n", p->msg, p->reg);
        dprintk("phy_version == Unknown\n");
        dprintk("MAC version != 0 && PHY version == 0 or 1\n");
        dprintk("Do final_reg2.cfg\n");
        dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
                dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
                dprintk("Set PHY Reg 0x0bh = 0x00h\n");
                dprintk(KERN_INFO PFX "Set MAC Reg C+CR Offset 0xE0. "

If the author does so prefer KERN_INFO levels, it's better to use:

#define dprintk(fmt, arg...) \
	do { printk(KERN_INFO PFX fmt, ## arg); } while (0)

cheers,  Joe



      reply	other threads:[~2007-10-02 17:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-02 16:37 [PATCH] drivers/net/r8169.c - trivial - add KERN_DEBUG to dprintk and PFX before KERN_ uses Joe Perches
2007-10-02 16:57 ` Jeff Garzik
2007-10-02 17:06   ` Joe Perches [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=1191344797.13170.41.camel@localhost \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    --cc=romieu@fr.zoreil.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).