netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docbook: fix printk of ip address
@ 2009-07-30 19:25 Randy Dunlap
  2009-07-30 19:31 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2009-07-30 19:25 UTC (permalink / raw)
  To: netdev; +Cc: davem, Tobias Klauser

Does this need to be changed to __be32?

---
From: Tobias Klauser <tklauser@distanz.ch>

Use the %pI4 format string instead of %d.%d.%d.%d and NIPQUAD.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 Documentation/DocBook/kernel-hacking.tmpl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.31-rc4-git3.orig/Documentation/DocBook/kernel-hacking.tmpl
+++ linux-2.6.31-rc4-git3/Documentation/DocBook/kernel-hacking.tmpl
@@ -450,7 +450,7 @@ printk(KERN_INFO "i = %u\n", i);
 
    <programlisting>
 __u32 ipaddress;
-printk(KERN_INFO "my ip: %d.%d.%d.%d\n", NIPQUAD(ipaddress));
+printk(KERN_INFO "my ip: %pI4\n", &amp;ipaddress);
    </programlisting>
 
    <para>



---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/

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

* Re: [PATCH] docbook: fix printk of ip address
  2009-07-30 19:25 [PATCH] docbook: fix printk of ip address Randy Dunlap
@ 2009-07-30 19:31 ` David Miller
  2009-07-30 19:37   ` [PATCH v2] " Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2009-07-30 19:31 UTC (permalink / raw)
  To: randy.dunlap; +Cc: netdev, tklauser

From: Randy Dunlap <randy.dunlap@oracle.com>
Date: Thu, 30 Jul 2009 12:25:18 -0700

> Does this need to be changed to __be32?

Yes, the value passed in must be in network byte order
when using %pI4.

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

* [PATCH v2] docbook: fix printk of ip address
  2009-07-30 19:31 ` David Miller
@ 2009-07-30 19:37   ` Randy Dunlap
  2009-07-30 20:10     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2009-07-30 19:37 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, tklauser

From: Tobias Klauser <tklauser@distanz.ch>

Use the %pI4 format string instead of %d.%d.%d.%d and NIPQUAD.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 Documentation/DocBook/kernel-hacking.tmpl |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.31-rc4-git3.orig/Documentation/DocBook/kernel-hacking.tmpl
+++ linux-2.6.31-rc4-git3/Documentation/DocBook/kernel-hacking.tmpl
@@ -449,8 +449,8 @@ printk(KERN_INFO "i = %u\n", i);
    </para>
 
    <programlisting>
-__u32 ipaddress;
-printk(KERN_INFO "my ip: %d.%d.%d.%d\n", NIPQUAD(ipaddress));
+__be32 ipaddress;
+printk(KERN_INFO "my ip: %pI4\n", &amp;ipaddress);
    </programlisting>
 
    <para>



---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/

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

* Re: [PATCH v2] docbook: fix printk of ip address
  2009-07-30 19:37   ` [PATCH v2] " Randy Dunlap
@ 2009-07-30 20:10     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2009-07-30 20:10 UTC (permalink / raw)
  To: randy.dunlap; +Cc: netdev, tklauser

From: Randy Dunlap <randy.dunlap@oracle.com>
Date: Thu, 30 Jul 2009 12:37:46 -0700

> From: Tobias Klauser <tklauser@distanz.ch>
> 
> Use the %pI4 format string instead of %d.%d.%d.%d and NIPQUAD.
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>

Applied, thanks.

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

end of thread, other threads:[~2009-07-30 20:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-30 19:25 [PATCH] docbook: fix printk of ip address Randy Dunlap
2009-07-30 19:31 ` David Miller
2009-07-30 19:37   ` [PATCH v2] " Randy Dunlap
2009-07-30 20:10     ` 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).