netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipconfig.c: De-clutter IP configuration report
@ 2007-09-10 12:09 Maciej W. Rozycki
  2007-09-10 22:04 ` Jan Engelhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej W. Rozycki @ 2007-09-10 12:09 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, linux-kernel

 Reformat the printk() calls removing leading new-line characters, making 
output being done line-by-line rather than partially and defining the log 
level used.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
 The new code builds fine; no semantic changes.

 Please apply,

  Maciej

patch-mips-2.6.23-rc5-20070904-ipconfig-printk-2
diff -up --recursive --new-file linux-mips-2.6.23-rc5-20070904.macro/net/ipv4/ipconfig.c linux-mips-2.6.23-rc5-20070904/net/ipv4/ipconfig.c
--- linux-mips-2.6.23-rc5-20070904.macro/net/ipv4/ipconfig.c	2007-09-04 04:56:22.000000000 +0000
+++ linux-mips-2.6.23-rc5-20070904/net/ipv4/ipconfig.c	2007-09-10 11:53:19.000000000 +0000
@@ -1364,17 +1364,17 @@ static int __init ip_auto_config(void)
 	/*
 	 * Clue in the operator.
 	 */
-	printk("IP-Config: Complete:");
-	printk("\n      device=%s", ic_dev->name);
-	printk(", addr=%u.%u.%u.%u", NIPQUAD(ic_myaddr));
-	printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask));
-	printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway));
-	printk(",\n     host=%s, domain=%s, nis-domain=%s",
-	       utsname()->nodename, ic_domain, utsname()->domainname);
-	printk(",\n     bootserver=%u.%u.%u.%u", NIPQUAD(ic_servaddr));
-	printk(", rootserver=%u.%u.%u.%u", NIPQUAD(root_server_addr));
-	printk(", rootpath=%s", root_server_path);
-	printk("\n");
+	pr_info("IP-Config: Complete:\n");
+	pr_info("      device=%s, addr=%u.%u.%u.%u, "
+		"mask=%u.%u.%u.%u, gw=%u.%u.%u.%u,\n",
+		ic_dev->name, NIPQUAD(ic_myaddr),
+		NIPQUAD(ic_netmask), NIPQUAD(ic_gateway));
+	pr_info("      host=%s, domain=%s, nis-domain=%s,\n",
+		utsname()->nodename, ic_domain, utsname()->domainname);
+	pr_info("      bootserver=%u.%u.%u.%u, "
+		"rootserver=%u.%u.%u.%u, rootpath=%s\n",
+		NIPQUAD(ic_servaddr),
+		NIPQUAD(root_server_addr), root_server_path);
 #endif /* !SILENT */
 
 	return 0;

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

* Re: [PATCH] ipconfig.c: De-clutter IP configuration report
  2007-09-10 12:09 [PATCH] ipconfig.c: De-clutter IP configuration report Maciej W. Rozycki
@ 2007-09-10 22:04 ` Jan Engelhardt
  2007-09-11  8:11   ` James Chapman
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Engelhardt @ 2007-09-10 22:04 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: netdev, David S. Miller, linux-kernel


On Sep 10 2007 13:09, Maciej W. Rozycki wrote:
> The new code builds fine; no semantic changes.
>
> Please apply,
>
>  Maciej
>
>patch-mips-2.6.23-rc5-20070904-ipconfig-printk-2
>diff -up --recursive --new-file linux-mips-2.6.23-rc5-20070904.macro/net/ipv4/ipconfig.c linux-mips-2.6.23-rc5-20070904/net/ipv4/ipconfig.c
>--- linux-mips-2.6.23-rc5-20070904.macro/net/ipv4/ipconfig.c	2007-09-04 04:56:22.000000000 +0000
>+++ linux-mips-2.6.23-rc5-20070904/net/ipv4/ipconfig.c	2007-09-10 11:53:19.000000000 +0000
>@@ -1364,17 +1364,17 @@ static int __init ip_auto_config(void)
> 	/*
> 	 * Clue in the operator.
> 	 */
>-	printk("IP-Config: Complete:");
>-	printk("\n      device=%s", ic_dev->name);
>-	printk(", addr=%u.%u.%u.%u", NIPQUAD(ic_myaddr));
>-	printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask));
>-	printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway));
>-	printk(",\n     host=%s, domain=%s, nis-domain=%s",
>-	       utsname()->nodename, ic_domain, utsname()->domainname);
>-	printk(",\n     bootserver=%u.%u.%u.%u", NIPQUAD(ic_servaddr));
>-	printk(", rootserver=%u.%u.%u.%u", NIPQUAD(root_server_addr));
>-	printk(", rootpath=%s", root_server_path);
>-	printk("\n");
>+	pr_info("IP-Config: Complete:\n");
>+	pr_info("      device=%s, addr=%u.%u.%u.%u, "
>+		"mask=%u.%u.%u.%u, gw=%u.%u.%u.%u,\n",
>+		ic_dev->name, NIPQUAD(ic_myaddr),
>+		NIPQUAD(ic_netmask), NIPQUAD(ic_gateway));
>+	pr_info("      host=%s, domain=%s, nis-domain=%s,\n",
>+		utsname()->nodename, ic_domain, utsname()->domainname);
>+	pr_info("      bootserver=%u.%u.%u.%u, "
>+		"rootserver=%u.%u.%u.%u, rootpath=%s\n",
>+		NIPQUAD(ic_servaddr),
>+		NIPQUAD(root_server_addr), root_server_path);
> #endif /* !SILENT */
> 
> 	return 0;

It should really be done in userspace. And ripped from the kernel.



	Jan
-- 

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

* Re: [PATCH] ipconfig.c: De-clutter IP configuration report
  2007-09-10 22:04 ` Jan Engelhardt
@ 2007-09-11  8:11   ` James Chapman
  0 siblings, 0 replies; 3+ messages in thread
From: James Chapman @ 2007-09-11  8:11 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Maciej W. Rozycki, netdev, David S. Miller, linux-kernel

Jan Engelhardt wrote:
> On Sep 10 2007 13:09, Maciej W. Rozycki wrote:
>> The new code builds fine; no semantic changes.
>>
>> Please apply,
>>
>>  Maciej
>>
>> patch-mips-2.6.23-rc5-20070904-ipconfig-printk-2
>> diff -up --recursive --new-file linux-mips-2.6.23-rc5-20070904.macro/net/ipv4/ipconfig.c linux-mips-2.6.23-rc5-20070904/net/ipv4/ipconfig.c
>> --- linux-mips-2.6.23-rc5-20070904.macro/net/ipv4/ipconfig.c	2007-09-04 04:56:22.000000000 +0000
>> +++ linux-mips-2.6.23-rc5-20070904/net/ipv4/ipconfig.c	2007-09-10 11:53:19.000000000 +0000
>> @@ -1364,17 +1364,17 @@ static int __init ip_auto_config(void)
>> 	/*
>> 	 * Clue in the operator.
>> 	 */
>> -	printk("IP-Config: Complete:");
>> -	printk("\n      device=%s", ic_dev->name);
>> -	printk(", addr=%u.%u.%u.%u", NIPQUAD(ic_myaddr));
>> -	printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask));
>> -	printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway));
>> -	printk(",\n     host=%s, domain=%s, nis-domain=%s",
>> -	       utsname()->nodename, ic_domain, utsname()->domainname);
>> -	printk(",\n     bootserver=%u.%u.%u.%u", NIPQUAD(ic_servaddr));
>> -	printk(", rootserver=%u.%u.%u.%u", NIPQUAD(root_server_addr));
>> -	printk(", rootpath=%s", root_server_path);
>> -	printk("\n");
>> +	pr_info("IP-Config: Complete:\n");
>> +	pr_info("      device=%s, addr=%u.%u.%u.%u, "
>> +		"mask=%u.%u.%u.%u, gw=%u.%u.%u.%u,\n",
>> +		ic_dev->name, NIPQUAD(ic_myaddr),
>> +		NIPQUAD(ic_netmask), NIPQUAD(ic_gateway));
>> +	pr_info("      host=%s, domain=%s, nis-domain=%s,\n",
>> +		utsname()->nodename, ic_domain, utsname()->domainname);
>> +	pr_info("      bootserver=%u.%u.%u.%u, "
>> +		"rootserver=%u.%u.%u.%u, rootpath=%s\n",
>> +		NIPQUAD(ic_servaddr),
>> +		NIPQUAD(root_server_addr), root_server_path);
>> #endif /* !SILENT */
>>
>> 	return 0;
> 
> It should really be done in userspace. And ripped from the kernel.

The output is useful when debugging boot problems on systems whose 
rootfs is on the network. So I think the patch is ok.

However, it would be useful to make the parameters available to 
userspace for use by boot scripts etc. A proc file listing variables and 
values in /bin/sh syntax would be easy to use. I've been meaning to do 
this for ages so I'll roll a patch.

-- 
James Chapman
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development


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

end of thread, other threads:[~2007-09-11  8:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-10 12:09 [PATCH] ipconfig.c: De-clutter IP configuration report Maciej W. Rozycki
2007-09-10 22:04 ` Jan Engelhardt
2007-09-11  8:11   ` James Chapman

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