docbook: fix printk of ip address
Subsystems (3)
PATCH 1/1 docbook: fix printk of ip address
Does this need to be changed to __be32?
---
From: Tobias Klauser <[email protected]>
Use the %pI4 format string instead of %d.%d.%d.%d and NIPQUAD.
--- Documentation/DocBook/kernel-hacking.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/DocBook/kernel-hacking.tmpl +1 -1
@@ -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", &ipaddress); </programlisting> <para>
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
David Miller
maintainerFrom: Randy Dunlap <[email protected]>
Date: Thu, 30 Jul 2009 12:25:18 -0700
Quoted 1 line
Does this need to be changed to
__be32?
Yes, the value passed in must be in network byte order when using %pI4.
PATCH v2 1/1 docbook: fix printk of ip address
From: Tobias Klauser <[email protected]>
Use the %pI4 format string instead of %d.%d.%d.%d and NIPQUAD.
--- Documentation/DocBook/kernel-hacking.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/DocBook/kernel-hacking.tmpl +2 -2
@@ -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", &ipaddress); </programlisting> <para>
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
From: Randy Dunlap <[email protected]>
Date: Thu, 30 Jul 2009 12:37:46 -0700
Quoted 6 lines
From: Tobias Klauser <[email protected]>
Use the %pI4 format string instead of %d.%d.%d.%d and NIPQUAD.
Signed-off-by Tobias Klauser <[email protected]>Signed-off-by Randy Dunlap <[email protected]>
Applied, thanks.