[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1188335521.6062.56.camel@localhost>
Date: Tue, 28 Aug 2007 14:12:00 -0700
From: Joe Perches <joe@...ches.com>
To: David Miller <davem@...emloft.net>
Cc: johannes@...solutions.net, netdev@...r.kernel.org
Subject: Re: [PATCH net-2.6.24] introduce MAC_FMT/MAC_ARG
On Mon, 2007-08-27 at 14:37 -0700, David Miller wrote:
> From: Joe Perches <joe@...ches.com>
> > My original patch had the equivalent of
> > char* print_mac(char* buf, const char* addr) {
> > sprintf(buf,"%02x:...", addr[0]...)
> > return buf;
> > }
> > and used:
> > DECLARE_MAC_BUF(var); //same as char var[18];
> > printk(MAC_FMT, MAC_ARG(var, addr));
> > which didn't require splitting printk()s
> > I've still got the original patch.
> > It's just substituting EUI48 for MAC and forward porting.
> > Want something like that?
> That sounds OK. Let's give Johannes a chance to give some
> feedback first.
I've forward ported what I had.
Option 1:
DECLARE_MAC_BUF(var);
printk(MAC_FMT, MAC_ARG(var, dev->dev_addr));
perhaps it looks nicer to remove the MAC_FMT and defines.
Option 2:
DECLARE_MAC_BUF(mac);
printk("%s", print_mac(mac, dev->dev_addr));
Option 3:
char mac[PRINT_MAC_SIZE];
printk("%s", print_mac(mac, dev->dev_addr));
Option 4:
char mac[18];
printk("%s", print_mac(mac, dev->dev_addr));
Preferences?
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists