Subject: Re: [PATCH] add %pM printf format specifier

From: Harvey Harrison <[email-masked]>
Date: Sun, 26 Oct 2008 12:38:49 -0700

On Sun, 2008-10-26 at 20:33 +0100, Johannes Berg wrote:
> On Sun, 2008-10-26 at 12:01 -0700, Harvey Harrison wrote:
> > On Sun, 2008-10-26 at 09:30 +0100, Johannes Berg wrote:
> > > static char *ip6_string(char *buf, char *end, be16 *addr, int field_width, int precision, int flags)
> > > {
> > > 	char ip6[8*5];
> > > 	char *p = ip6;
> > > 	int i;
> > > 	u16 tmp;
> > > 
> > > 	for (i=0; i<7; i++) {
> > > 		tmp = cpu_to_le16(addr[i]);
> > 
> > 		tmp = be16_to_cpup(addr + i);
> > 
> > > 		p = pack_hex_byte(p, tmp >> 8);
> > > 		p = pack_hex_byte(p, tmp & 0xFF);
> > > 		if (!(flags & SPECIAL))
> > > 			*p++ = ':';
> > > 	}
> > > 	tmp = cpu_to_le16(addr[7]);
> > 
> > 	tmp = be16_to_cpup(addr + 7);
> > 
> > Or maybe just cast addr to char * and avoid the byteswapping altogether.
> 
> Yeah, this was obviously not tested. Want to build it? I don't have
> access to a fast build machine right now.
> 

Could you send me whatever you've got currently and I'll have a go at
it.

Cheers,

Harvey