[U-Boot] [PATCH v2 5/6] TFTP: net/tftp.c: add server mode receive

Detlev Zundel
2011-05-17T09:41:34Z

Hi Luca,

[...]

>> Hm, I have to admit that I do not really like adding so many ifdefs into
>> the tftp code and even into the state machine code. Can you give me a
>> number on how much larger u-boot gets on your platform with and without
>> the server support? If this is not too much, maybe we should include
>> support always. If it is too much, maybe we can at least keep the state
>> machine without ifdefs - if I see it correctly, this will only add at
>> maximum a few bytes and STATE_RECW_WRQ will simply never be entered,
>> correct?
> Here are my measurements for the dig297 board (ARMV7 OMAP3):
>
> text data bss dec hex
> 357085 8684 214264 580033 8d9c1 TFTPSRV on
> 356327 8660 214264 579251 8d6b3 TFTPSRV off, without #ifs
> 356355 8660 214268 579283 8d6d3 TFTPSRV off, with #ifs (as in PATCH v2)
>
> The TFTP server adds 730 bytes to the text, so I guess it's worth to
> keep it optional.

Ok, thanks for the number.

> To my big surprise, removing most bad-looking #ifs (all of those that
> save just one line) I got a *smaller* U-Boot! I repeated the test
> three times to be extra sure, the figures are correct: without the
> #ifs we save a few bytes.
>
> Obvious enough, I'm going to remove the #ifs.

:) Another instance of the difficulty to predict modern compilers.

Cheers
Detlev

--
But in terms of creative information, information that people can use
or enjoy, and that will be used and enjoyed more the more people who
have it, always we should encourage the copying.
-- Richard M. Stallman
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de