lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 29 Jan 2010 12:01:26 -0800
From:	Joe Perches <joe@...ches.com>
To:	netdev <netdev@...r.kernel.org>
Cc:	David Miller <davem@...emloft.net>,
	Greg Kroah-Hartman <gregkh@...e.de>
Subject: RFC: Convert printks with net_device to dev_<level>

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, "...

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ