From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 2 Jul 2015 07:54:11 +0200 Subject: [U-Boot] [PATCH 8/8] tftp.c: fix CONFIG_TFTP_TSIZE for small files In-Reply-To: <4c4c29ae74120a1829e496ec03a27a7220d74c9d.1435791392.git.marcel.ziswiler@toradex.com> References: <4c4c29ae74120a1829e496ec03a27a7220d74c9d.1435791392.git.marcel.ziswiler@toradex.com> Message-ID: <201507020754.11676.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thursday, July 02, 2015 at 01:04:53 AM, Marcel Ziswiler wrote: > From: Max Krummenacher > > CONFIG_TFTP_TSIZE should limit a tftp downloads progress to 50 '#' > chars. Make this work also for small files. > > If the file size is small, i.e. smaller than 2 tftp block sizes the > number of '#' can get much larger. i.e. with a 1 byte file 65000 > characters are printed, with a 512 byte file around 500. > > When using CONFIG TFTP BLOCKSIZE together with CONFIG_IP_DEFRAG the > issue is more notable. > > Signed-off-by: Max Krummenacher > Signed-off-by: Marcel Ziswiler > --- > net/tftp.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/net/tftp.c b/net/tftp.c > index 3e99e73..1853fe7 100644 > --- a/net/tftp.c > +++ b/net/tftp.c > @@ -249,6 +249,8 @@ static void show_block_marker(void) > if (tftp_tsize) { > ulong pos = tftp_cur_block * tftp_block_size + > tftp_block_wrap_offset; > + if(pos > tftp_tsize) Nitpick: if[SPACE](... Reviewed-by: Marek Vasut Best regards, Marek Vasut