[U-Boot] [PATCH v2] net: eth_common: Don't use %pM when USE_TINY_PRINTF is enabled

Wolfgang Denk wd at denx.de
Mon Apr 3 06:33:07 UTC 2017


Dear Vignesh,

In message <20170403054659.32553-1-vigneshr at ti.com> you wrote:
> Tiny printf doesn't support %pM, so when CONFIG_USE_TINY_PRINTF is
> enabled use %x to manually print MAC address.
...

>  net/eth_common.c | 7 +++++++
>  1 file changed, 7 insertions(+)

I wonder if this is sufficient.  There is a ton of other files which
use the %pM format:

	arch/arm/mach-davinci/misc.c
	board/BuR/common/common.c
	board/bct-brettl2/bct-brettl2.c
	board/keymile/common/ivm.c
	board/pdm360ng/pdm360ng.c
	board/spear/common/spr_misc.c
	drivers/net/dm9000x.c
	drivers/net/fec_mxc.c
	drivers/net/lan91c96.c
	drivers/net/ne2000_base.c
	drivers/net/sandbox.c
	drivers/net/smc91111.c
	drivers/net/smc911x.c
	drivers/usb/eth/asix.c
	drivers/usb/eth/asix88179.c
	drivers/usb/eth/mcs7830.c
	drivers/usb/eth/r8152.c
	drivers/usb/eth/smsc95xx.c
	drivers/usb/gadget/ether.c
	net/arp.c
	net/eth-uclass.c
	net/eth_common.c
	net/eth_legacy.c
	net/link_local.c
	net/net.c

Adding similar #ifdef's to all of these seems to be a really bad
idea to me.

Also, it would result in a lot of code duplication which is exactly
what the introduction of the %p? formats intends to avoid.

So hat we need here is a way to determin if the code for a given
configuration uses a specific %p? format, and then enable this even
with CONFIG_USE_TINY_PRINTF.

OTOH - what is the use case for CONFIG_USE_TINY_PRINTF in
combination with network related code?  I would expect to 
see this config option in memory restricted environments like SPL,
but there you don't include support for networking - or do you?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The X11 source code style is ATROCIOUS and should not be used  as  a
model."                                                   - Doug Gwyn


More information about the U-Boot mailing list