public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* RFC: Convert printks with net_device to dev_<level>
@ 2010-01-29 20:01 Joe Perches
  2010-01-29 20:25 ` Ben Hutchings
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2010-01-29 20:01 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Greg Kroah-Hartman

I've been playing with a cocci script and some additional
scripts to automate a conversion of printk and pr_<level>
logging messages with a reference to a struct net_device
to dev_<level>(&net_device->dev, ...)

A sample conversion:

-	printk(KERN_INFO "%s: Using MII transceiver %d, status %4.4x.\n",
-	       dev->name, tp->phys[0], tulip_mdio_read(dev, tp->phys[0], 1));
+	dev_info(&dev->dev, "Using MII transceiver %d, status %04x\n",
+		 tp->phys[0], tulip_mdio_read(dev, tp->phys[0], 1));

I submitted conversions for drivers/net/tulip/.
I did not convert any calls with KERN_DEBUG.
http://patchwork.ozlabs.org/patch/43889/

The logging messages are a bit more verbose/complete.
Code size increases a small amount.

Is this sort of conversion useful?
Should more conversions be submitted?
Would it be useful to convert the KERN_DEBUG calls?
Any automated conversion could use:

	printk(KERN_DEBUG "%s: ...", dev->name
	dev_printk(KERN_DEBUG, &dev->dev, "...


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-30  2:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-29 20:01 RFC: Convert printks with net_device to dev_<level> Joe Perches
2010-01-29 20:25 ` Ben Hutchings
2010-01-30  2:26   ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox