Patchwork [3/4] DSA: Convert printk calls to netdev_info calls

login
register
mail settings
Submitter Barry Grussling
Date Jan. 3, 2013, 1:54 a.m.
Message ID <1357178098-4057-4-git-send-email-barry@grussling.com>
Download mbox | patch
Permalink /patch/209170/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Barry Grussling - Jan. 3, 2013, 1:54 a.m.
Convert DSA printk calls to netdev_info calls as recommended by
checkpatch.pl.

Signed-off-by: Barry Grussling <barry@grussling.com>
---
 drivers/net/dsa/mv88e6060.c |    4 ++--
 drivers/net/dsa/mv88e6xxx.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
Joe Perches - Jan. 3, 2013, 7:06 p.m.
On Wed, 2013-01-02 at 17:54 -0800, Barry Grussling wrote:
> Convert DSA printk calls to netdev_info calls as recommended by
> checkpatch.pl.

Some defects here.

> diff --git a/drivers/net/dsa/mv88e6060.c b/drivers/net/dsa/mv88e6060.c
[]
> @@ -237,7 +237,7 @@ static void mv88e6060_poll_link(struct dsa_switch *ds)
>  
>  		if (!link) {
>  			if (netif_carrier_ok(dev)) {
> -				printk(KERN_INFO "%s: link down\n", dev->name);
> +				netdev_info(dev, "%s: link down\n", dev->name);

Take out the "%s: ...", dev->name uses in these
conversions because netdev_printk adds them.

				netdev_info(dev, "link down\n");

> @@ -248,7 +248,7 @@ static void mv88e6060_poll_link(struct dsa_switch *ds)
>  		fc = ((port_status & 0xc000) == 0xc000) ? 1 : 0;
>  
>  		if (!netif_carrier_ok(dev)) {
> -			printk(KERN_INFO "%s: link up, %d Mb/s, %s duplex, "
> +			netdev_info(dev, "%s: link up, %d Mb/s, %s duplex, "
>  					 "flow control %sabled\n", dev->name,
>  					 speed, duplex ? "full" : "half",
>  					 fc ? "en" : "dis");

coalesce formats too

			netdev_info(dev, "link up, %d Mb/s, %s duplex, flow control %sabled\n"
				    speed, duplex ? "full" : "half",
				    fc ? "en" : "dis");
etc.

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

Patch

diff --git a/drivers/net/dsa/mv88e6060.c b/drivers/net/dsa/mv88e6060.c
index fa6bc7d..dc8b4c1 100644
--- a/drivers/net/dsa/mv88e6060.c
+++ b/drivers/net/dsa/mv88e6060.c
@@ -237,7 +237,7 @@  static void mv88e6060_poll_link(struct dsa_switch *ds)
 
 		if (!link) {
 			if (netif_carrier_ok(dev)) {
-				printk(KERN_INFO "%s: link down\n", dev->name);
+				netdev_info(dev, "%s: link down\n", dev->name);
 				netif_carrier_off(dev);
 			}
 			continue;
@@ -248,7 +248,7 @@  static void mv88e6060_poll_link(struct dsa_switch *ds)
 		fc = ((port_status & 0xc000) == 0xc000) ? 1 : 0;
 
 		if (!netif_carrier_ok(dev)) {
-			printk(KERN_INFO "%s: link up, %d Mb/s, %s duplex, "
+			netdev_info(dev, "%s: link up, %d Mb/s, %s duplex, "
 					 "flow control %sabled\n", dev->name,
 					 speed, duplex ? "full" : "half",
 					 fc ? "en" : "dis");
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index a2f9e9b6..5260191 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -366,7 +366,7 @@  void mv88e6xxx_poll_link(struct dsa_switch *ds)
 
 		if (!link) {
 			if (netif_carrier_ok(dev)) {
-				printk(KERN_INFO "%s: link down\n", dev->name);
+				netdev_info(dev, "%s: link down\n", dev->name);
 				netif_carrier_off(dev);
 			}
 			continue;
@@ -390,7 +390,7 @@  void mv88e6xxx_poll_link(struct dsa_switch *ds)
 		fc = (port_status & 0x8000) ? 1 : 0;
 
 		if (!netif_carrier_ok(dev)) {
-			printk(KERN_INFO "%s: link up, %d Mb/s, %s duplex, "
+			netdev_info(dev, "%s: link up, %d Mb/s, %s duplex, "
 					 "flow control %sabled\n", dev->name,
 					 speed, duplex ? "full" : "half",
 					 fc ? "en" : "dis");