* [PATCH] arch/powerpc/boot/devtree.c: use %pM to show MAC address
@ 2009-12-30 19:30 H Hartley Sweeten
2009-12-31 4:49 ` Paul Mackerras
0 siblings, 1 reply; 3+ messages in thread
From: H Hartley Sweeten @ 2009-12-30 19:30 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev
Use the %pM kernel extension to display the MAC address.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index a7e21a3..a2f07a5 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -93,10 +93,7 @@ void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr)
void *devp = find_node_by_alias(alias);
if (devp) {
- printf("%s: local-mac-address <-"
- " %02x:%02x:%02x:%02x:%02x:%02x\n\r", alias,
- addr[0], addr[1], addr[2],
- addr[3], addr[4], addr[5]);
+ printf("%s: local-mac-address <- %pM\n\r", alias, addr);
setprop(devp, "local-mac-address", addr, 6);
}
@@ -108,10 +105,7 @@ void dt_fixup_mac_address(u32 index, const u8 *addr)
(void*)&index, sizeof(index));
if (devp) {
- printf("ENET%d: local-mac-address <-"
- " %02x:%02x:%02x:%02x:%02x:%02x\n\r", index,
- addr[0], addr[1], addr[2],
- addr[3], addr[4], addr[5]);
+ printf("ENET%d: local-mac-address <- %pM\n\r", index, addr);
setprop(devp, "local-mac-address", addr, 6);
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] arch/powerpc/boot/devtree.c: use %pM to show MAC address
2009-12-30 19:30 [PATCH] arch/powerpc/boot/devtree.c: use %pM to show MAC address H Hartley Sweeten
@ 2009-12-31 4:49 ` Paul Mackerras
2009-12-31 14:33 ` H Hartley Sweeten
0 siblings, 1 reply; 3+ messages in thread
From: Paul Mackerras @ 2009-12-31 4:49 UTC (permalink / raw)
To: H Hartley Sweeten; +Cc: linux-kernel, linuxppc-dev
On Wed, Dec 30, 2009 at 02:30:39PM -0500, H Hartley Sweeten wrote:
> Use the %pM kernel extension to display the MAC address.
>
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>
> ---
>
> diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
> index a7e21a3..a2f07a5 100644
> --- a/arch/powerpc/boot/devtree.c
> +++ b/arch/powerpc/boot/devtree.c
> @@ -93,10 +93,7 @@ void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr)
> void *devp = find_node_by_alias(alias);
>
> if (devp) {
> - printf("%s: local-mac-address <-"
> - " %02x:%02x:%02x:%02x:%02x:%02x\n\r", alias,
> - addr[0], addr[1], addr[2],
> - addr[3], addr[4], addr[5]);
> + printf("%s: local-mac-address <- %pM\n\r", alias, addr);
Nak - this isn't the kernel, this is a separate program, namely the
bootwrapper that decompresses the kernel image, and it has its own
printf (not printk) implementation in arch/powerpc/boot/stdio.c, which
doesn't understand the %pX extensions (and I don't see any good reason
to make it do so).
Paul.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] arch/powerpc/boot/devtree.c: use %pM to show MAC address
2009-12-31 4:49 ` Paul Mackerras
@ 2009-12-31 14:33 ` H Hartley Sweeten
0 siblings, 0 replies; 3+ messages in thread
From: H Hartley Sweeten @ 2009-12-31 14:33 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linux-kernel, linuxppc-dev
On Wednesday, December 30, 2009 9:49 PM, Paul Mackerras wrote:
> On Wed, Dec 30, 2009 at 02:30:39PM -0500, H Hartley Sweeten wrote:
>
>> Use the %pM kernel extension to display the MAC address.
>>
>> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>>
>> ---
>
> Nak - this isn't the kernel, this is a separate program, namely the
> bootwrapper that decompresses the kernel image, and it has its own
> printf (not printk) implementation in arch/powerpc/boot/stdio.c, which
> doesn't understand the %pX extensions (and I don't see any good reason
> to make it do so).
OK. Sorry for the noise.
Regards,
Hartley
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-12-31 14:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-30 19:30 [PATCH] arch/powerpc/boot/devtree.c: use %pM to show MAC address H Hartley Sweeten
2009-12-31 4:49 ` Paul Mackerras
2009-12-31 14:33 ` H Hartley Sweeten
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).