netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net ipv4 ipconfig: use preferred log methods
@ 2015-09-25  9:58 Bastian Stender
  2015-09-28  5:37 ` Stephen Hemminger
  2015-09-29  5:24 ` David Miller
  0 siblings, 2 replies; 12+ messages in thread
From: Bastian Stender @ 2015-09-25  9:58 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy
  Cc: netdev, trivial, kernel, Bastian Stender

Replace printk calls with preferred log method calls to keep kernel
messages clean.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
---
 net/ipv4/ipconfig.c | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index ed4ef09..60882de 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -69,7 +69,7 @@
 #undef IPCONFIG_DEBUG
 
 #ifdef IPCONFIG_DEBUG
-#define DBG(x) printk x
+#define DBG(x) pr_debug(x)
 #else
 #define DBG(x) do { } while(0)
 #endif
@@ -460,7 +460,8 @@ static int __init ic_defaults(void)
 			       &ic_myaddr);
 			return -1;
 		}
-		printk("IP-Config: Guessing netmask %pI4\n", &ic_netmask);
+		pr_notice("IP-Config: Guessing netmask %pI4\n",
+			  &ic_netmask);
 	}
 
 	return 0;
@@ -672,7 +673,7 @@ ic_dhcp_init_options(u8 *options)
 	int len;
 
 #ifdef IPCONFIG_DEBUG
-	printk("DHCP: Sending message type %d\n", mt);
+	pr_debug("DHCP: Sending message type %d\n", mt);
 #endif
 
 	memcpy(e, ic_bootp_cookie, 4);	/* RFC1048 Magic Cookie */
@@ -833,7 +834,8 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
 	else if (dev->type == ARPHRD_FDDI)
 		b->htype = ARPHRD_ETHER;
 	else {
-		printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name);
+		pr_warn("Unknown ARP type 0x%04x for device %s\n", dev->type,
+			dev->name);
 		b->htype = dev->type; /* can cause undefined behavior */
 	}
 
@@ -857,12 +859,12 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
 	if (dev_hard_header(skb, dev, ntohs(skb->protocol),
 			    dev->broadcast, dev->dev_addr, skb->len) < 0) {
 		kfree_skb(skb);
-		printk("E");
+		pr_alert("E");
 		return;
 	}
 
 	if (dev_queue_xmit(skb) < 0)
-		printk("E");
+		pr_alert("E");
 }
 
 
@@ -893,10 +895,10 @@ static void __init ic_do_bootp_ext(u8 *ext)
 #ifdef IPCONFIG_DEBUG
 	u8 *c;
 
-	printk("DHCP/BOOTP: Got extension %d:",*ext);
+	pr_debug("DHCP/BOOTP: Got extension %d:", *ext);
 	for (c=ext+2; c<ext+2+ext[1]; c++)
-		printk(" %02x", *c);
-	printk("\n");
+		pr_debug(" %02x", *c);
+	pr_debug("\n");
 #endif
 
 	switch (*ext++) {
@@ -1067,7 +1069,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
 			}
 
 #ifdef IPCONFIG_DEBUG
-			printk("DHCP: Got message type %d\n", mt);
+			pr_debug("DHCP: Got message type %d\n", mt);
 #endif
 
 			switch (mt) {
@@ -1082,8 +1084,8 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
 				ic_myaddr = b->your_ip;
 				ic_servaddr = server_id;
 #ifdef IPCONFIG_DEBUG
-				printk("DHCP: Offered address %pI4 by server %pI4\n",
-				       &ic_myaddr, &b->iph.saddr);
+				pr_debug("DHCP: Offered address %pI4 by server %pI4\n",
+					 &ic_myaddr, &b->iph.saddr);
 #endif
 				/* The DHCP indicated server address takes
 				 * precedence over the bootp header one if
@@ -1281,10 +1283,10 @@ static int __init ic_dynamic(void)
 		return -1;
 	}
 
-	printk("IP-Config: Got %s answer from %pI4, ",
+	pr_info("IP-Config: Got %s answer from %pI4, ",
 		((ic_got_reply & IC_RARP) ? "RARP"
-		 : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"),
-	       &ic_addrservaddr);
+		: (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"),
+		&ic_addrservaddr);
 	pr_cont("my address is %pI4\n", &ic_myaddr);
 
 	return 0;
-- 
2.1.4

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

end of thread, other threads:[~2015-11-18 18:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-25  9:58 [PATCH] net ipv4 ipconfig: use preferred log methods Bastian Stender
2015-09-28  5:37 ` Stephen Hemminger
2015-09-29  5:24 ` David Miller
2015-09-30  9:20   ` [PATCH] net ipv4: " Bastian Stender
2015-09-30  9:31     ` kbuild test robot
2015-09-30  9:31     ` kbuild test robot
2015-09-30 11:07     ` Bastian Stender
2015-09-30 15:00   ` Bastian Stender
2015-10-01  7:55     ` Uwe Kleine-König
2015-11-13 10:40     ` [PATCH v2] " Bastian Stender
2015-11-13 10:40       ` [PATCH] " Bastian Stender
2015-11-18 18:38         ` David Miller

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).