[U-Boot] [PATCH 2/3] Add sendnbc tool to broadcast NBC magic packet

Mike Frysinger vapier at gentoo.org
Wed Nov 17 11:56:47 CET 2010


On Tuesday, November 16, 2010 13:04:32 tristan.lelong at blunderer.org wrote:
> --- /dev/null
> +++ b/tools/sendnbc.c
> @@ -0,0 +1,219 @@
> +#include <stdio.h>

missing licensing & copyright header

> +static void usage (char *argv0)

style problems throughout this file too

> +	printf
> +	    ("SENDNBC: sends a magic packet to u-boot board to interrupt the
> autoboot\n"); +	printf ("         and reconfigure u-boot in netconsole
> mode.\n"); +	printf
> +	    ("         Use in combination with netconsole to connect and
> control\n"); +	printf ("	 your u-boot device\n");
> +	printf
> +	    ("	 Ex: BOARD_IP=192.168.0.2 ./sendnbc -i $BOARD_IP -d eth0 &&
> ./netconsole $BOARD_IP\n"); +	printf ("\nusage: %s [options]\n", argv0);
> +	printf (" -i <ip addr>: the ip addr to assign to u-boot board\n");
> +	printf (" -m <mac addr>: the targeted board mac addr \n");
> +	printf (" -n <hostname>: the targeted board hostname \n");
> +	printf
> +	    (" -d <device>: the net interface to use for broadcasting (ex: eth0).
> Must be root to use this option\n"); +	printf (" -h: display this
> help\n");

multiple calls to printf() is such a waste.  combine all the strings into one 
and call printf() just once.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101117/1e6cc770/attachment.pgp 


More information about the U-Boot mailing list