linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/ipv4/ipconfig: Rejoin broken lines in console output
@ 2015-11-24 13:08 Geert Uytterhoeven
  2015-11-24 17:00 ` David Miller
  2015-11-24 17:40 ` Joe Perches
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2015-11-24 13:08 UTC (permalink / raw)
  To: David S. Miller, Bastian Stender
  Cc: Joe Perches, netdev, linux-kernel, Geert Uytterhoeven

Commit 09605cc12c078306 ("net ipv4: use preferred log methods") replaced
a few calls of pr_cont() after a console print without a trailing
newline by pr_info(), causing lines to be split during IP
autoconfiguration, like:

    .
    ,
     OK
    IP-Config: Got DHCP answer from 192.168.97.254,
    my address is 192.168.97.44

Convert these back to using pr_cont(), so it prints again:

    ., OK
    IP-Config: Got DHCP answer from 192.168.97.254, my address is 192.168.97.44

Absorb the printing of "my address ..." into the previous call to
pr_info(), as there's no reason to use a continuation there.

Convert one more pr_info() to print nameservers while we're at it.

Fixes: 09605cc12c078306 ("net ipv4: use preferred log methods")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 net/ipv4/ipconfig.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index e86e8a9738ea9b1e..67f7c9de0b16689d 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1239,13 +1239,13 @@ static int __init ic_dynamic(void)
 		    (ic_proto_enabled & IC_USE_DHCP) &&
 		    ic_dhcp_msgtype != DHCPACK) {
 			ic_got_reply = 0;
-			pr_notice(",");
+			pr_cont(",");
 			continue;
 		}
 #endif /* IPCONFIG_DHCP */
 
 		if (ic_got_reply) {
-			pr_notice(" OK\n");
+			pr_cont(" OK\n");
 			break;
 		}
 
@@ -1253,7 +1253,7 @@ static int __init ic_dynamic(void)
 			continue;
 
 		if (! --retries) {
-			pr_notice(" timed out!\n");
+			pr_cont(" timed out!\n");
 			break;
 		}
 
@@ -1263,7 +1263,7 @@ static int __init ic_dynamic(void)
 		if (timeout > CONF_TIMEOUT_MAX)
 			timeout = CONF_TIMEOUT_MAX;
 
-		pr_notice(".");
+		pr_cont(".");
 	}
 
 #ifdef IPCONFIG_BOOTP
@@ -1280,11 +1280,10 @@ static int __init ic_dynamic(void)
 		return -1;
 	}
 
-	pr_info("IP-Config: Got %s answer from %pI4, ",
+	pr_info("IP-Config: Got %s answer from %pI4, my address is %pI4\n",
 		((ic_got_reply & IC_RARP) ? "RARP"
 		: (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"),
-		&ic_addrservaddr);
-	pr_info("my address is %pI4\n", &ic_myaddr);
+		&ic_addrservaddr, &ic_myaddr);
 
 	return 0;
 }
@@ -1527,14 +1526,14 @@ static int __init ip_auto_config(void)
 		pr_cont(", mtu=%d", ic_dev_mtu);
 	for (i = 0; i < CONF_NAMESERVERS_MAX; i++)
 		if (ic_nameservers[i] != NONE) {
-			pr_info("     nameserver%u=%pI4",
+			pr_cont("     nameserver%u=%pI4",
 				i, &ic_nameservers[i]);
 			break;
 		}
 	for (i++; i < CONF_NAMESERVERS_MAX; i++)
 		if (ic_nameservers[i] != NONE)
-			pr_info(", nameserver%u=%pI4", i, &ic_nameservers[i]);
-	pr_info("\n");
+			pr_cont(", nameserver%u=%pI4", i, &ic_nameservers[i]);
+	pr_cont("\n");
 #endif /* !SILENT */
 
 	return 0;
-- 
1.9.1


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

* Re: [PATCH] net/ipv4/ipconfig: Rejoin broken lines in console output
  2015-11-24 13:08 [PATCH] net/ipv4/ipconfig: Rejoin broken lines in console output Geert Uytterhoeven
@ 2015-11-24 17:00 ` David Miller
  2015-11-24 17:40 ` Joe Perches
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-11-24 17:00 UTC (permalink / raw)
  To: geert+renesas; +Cc: bst, joe, netdev, linux-kernel

From: Geert Uytterhoeven <geert+renesas@glider.be>
Date: Tue, 24 Nov 2015 14:08:23 +0100

> Commit 09605cc12c078306 ("net ipv4: use preferred log methods") replaced
> a few calls of pr_cont() after a console print without a trailing
> newline by pr_info(), causing lines to be split during IP
> autoconfiguration, like:
> 
>     .
>     ,
>      OK
>     IP-Config: Got DHCP answer from 192.168.97.254,
>     my address is 192.168.97.44
> 
> Convert these back to using pr_cont(), so it prints again:
> 
>     ., OK
>     IP-Config: Got DHCP answer from 192.168.97.254, my address is 192.168.97.44
> 
> Absorb the printing of "my address ..." into the previous call to
> pr_info(), as there's no reason to use a continuation there.
> 
> Convert one more pr_info() to print nameservers while we're at it.
> 
> Fixes: 09605cc12c078306 ("net ipv4: use preferred log methods")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Applied, thank you.

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

* Re: [PATCH] net/ipv4/ipconfig: Rejoin broken lines in console output
  2015-11-24 13:08 [PATCH] net/ipv4/ipconfig: Rejoin broken lines in console output Geert Uytterhoeven
  2015-11-24 17:00 ` David Miller
@ 2015-11-24 17:40 ` Joe Perches
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2015-11-24 17:40 UTC (permalink / raw)
  To: Geert Uytterhoeven, David S. Miller, Bastian Stender; +Cc: netdev, linux-kernel

On Tue, 2015-11-24 at 14:08 +0100, Geert Uytterhoeven wrote:
> Commit 09605cc12c078306 ("net ipv4: use preferred log methods") replaced
> a few calls of pr_cont() after a console print without a trailing
> newline by pr_info(), causing lines to be split during IP
> autoconfiguration


Thanks Geert.

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

end of thread, other threads:[~2015-11-24 17:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-24 13:08 [PATCH] net/ipv4/ipconfig: Rejoin broken lines in console output Geert Uytterhoeven
2015-11-24 17:00 ` David Miller
2015-11-24 17:40 ` Joe Perches

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