[U-Boot] [PATCH] Make TFTP Quiet

Mike Frysinger vapier at gentoo.org
Thu Aug 13 06:01:29 CEST 2009


On Monday 10 August 2009 16:26:20 Robin Getz wrote:
> From bca49fb5e3045bc175e924999a4015804c39c5c6 Mon Sep 17 00:00:00 2001
> From: Robin Getz <rgetz at blackfin.uclinux.org>
>
> I was using this when I was looking at some other recent tftp performance,
> and thought I would share. I really don't think it belongs, as it is
> (a) trivial and (b) mostly debug... (but I'm trying out some more things
> with git).
>
> This adds the ability to make tftp a little quieter, which saves some
> time printing hash marks on the console. It also has the ability to
> print some download stats for debugging network issues.
>
> Signed-off-by: Robin Getz <rgetz at blackfin.uclinux.org>
>
> ---
>  net/tftp.c |   29 ++++++++++++++++++++++++-----
>  1 files changed, 24 insertions(+), 5 deletions(-)
>
> diff --git a/net/tftp.c b/net/tftp.c
> index 0fa7033..9544691 100644
> --- a/net/tftp.c
> +++ b/net/tftp.c
> @@ -22,6 +22,16 @@
>  					/* (for checking the image size)	*/
>  #define HASHES_PER_LINE	65		/* Number of "loading" hashes per line	*/
>
> +#ifdef CONFIG_TFTP_QUIET
> +#define puts_quiet(fmt)
> +#else
> +#define puts_quiet(fmt)		puts(fmt);

macros shouldnt insert semi-colons for you

> -				putc ('#');
> +				puts_quiet("#");

you might as well fix the style while you're here (no spaces before the open 
paren)

> +			printf("Time to download == %ld ms\n", end_time - start_time);
> +			printf("Download rate = %lld bytes/second\n", (long
> long)(NetBootFileXferSize) * 1000 / (end_time - start_time));

shouldnt they both be = or == ?  do you really need 64bit math ?
-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/20090813/1d4969b4/attachment.pgp 


More information about the U-Boot mailing list