From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Mon, 16 Feb 2009 19:20:38 -0500 Subject: [U-Boot] [PATCH 01/27] net: new utility functions for working with enetaddr's In-Reply-To: <20090217001331.64ABF832E893@gemini.denx.de> References: <1234596190-524-1-git-send-email-vapier@gentoo.org> <200902161900.49096.vapier@gentoo.org> <20090217001331.64ABF832E893@gemini.denx.de> Message-ID: <200902161920.39745.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Monday 16 February 2009 19:13:31 Wolfgang Denk wrote: > Dear Mike, > > In message <200902161900.49096.vapier@gentoo.org> you wrote: > > > Hm... Linux has a printk() format specifier for MAC addresses. Sounds > > > like a clever idea to me. Maybe we should borrow that code? > > > > it does eh ? that certainly sounds a lot better than str_enetaddr() as > > every place i changed to use it was in a printf() string. where in the > > kernel is that code ? i looked in lib/vsprintf.c but couldnt find it. > > But it is in lib/vsprintf.c: apparently it's new to 2.6.29 ... i'm actively working/looking at 2.6.28.x which doesnt have 'M'. > ... > 644 /* > 645 * Show a '%p' thing. A kernel extension is that the '%p' is followed > 646 * by an extra set of alphanumeric characters that are extended format > 647 * specifiers. > 648 * > 649 * Right now we handle: > 650 * > 651 * - 'F' For symbolic function descriptor pointers > 652 * - 'S' For symbolic direct pointers > 653 * - 'R' For a struct resource pointer, it prints the range of > 654 * addresses (not the name nor the flags) > 655 * - 'M' For a 6-byte MAC address, it prints the address in the > 656 * usual colon-separated hex notation > 657 * - 'I' [46] for IPv4/IPv6 addresses printed in the usual way > (dot-separated 658 * decimal for v4 and colon separated > network-order 16 bit hex for v6) 659 * - 'i' [46] for 'raw' IPv4/IPv6 > addresses, IPv6 omits the colons, IPv4 is 660 * currently the same > ... > > So it's actually printk("%pM", ...); so do you want to go the %pM route (to make u-boot/linux code sharing easier) or move over only %M ? -mike