mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-11 05:02:26 -04:00
net: Add more #ifdefs for tftpput to reduce code size
If CONFIG_CMD_TFTPPUT is not enabled, we want minimal code size impact on the tftp code. This introduces a few more #ifdefs. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
165099e753
commit
8c6914f10f
11
net/tftp.c
11
net/tftp.c
@ -332,8 +332,12 @@ TftpSend(void)
|
|||||||
case STATE_SEND_WRQ:
|
case STATE_SEND_WRQ:
|
||||||
xp = pkt;
|
xp = pkt;
|
||||||
s = (ushort *)pkt;
|
s = (ushort *)pkt;
|
||||||
|
#ifdef CONFIG_CMD_TFTPPUT
|
||||||
*s++ = htons(TftpState == STATE_SEND_RRQ ? TFTP_RRQ :
|
*s++ = htons(TftpState == STATE_SEND_RRQ ? TFTP_RRQ :
|
||||||
TFTP_WRQ);
|
TFTP_WRQ);
|
||||||
|
#else
|
||||||
|
*s++ = htons(TFTP_RRQ);
|
||||||
|
#endif
|
||||||
pkt = (uchar *)s;
|
pkt = (uchar *)s;
|
||||||
strcpy((char *)pkt, tftp_filename);
|
strcpy((char *)pkt, tftp_filename);
|
||||||
pkt += strlen(tftp_filename) + 1;
|
pkt += strlen(tftp_filename) + 1;
|
||||||
@ -730,7 +734,12 @@ void TftpStart(enum proto_t protocol)
|
|||||||
|
|
||||||
printf("Using %s device\n", eth_get_name());
|
printf("Using %s device\n", eth_get_name());
|
||||||
printf("TFTP %s server %pI4; our IP address is %pI4",
|
printf("TFTP %s server %pI4; our IP address is %pI4",
|
||||||
protocol == TFTPPUT ? "to" : "from", &TftpRemoteIP, &NetOurIP);
|
#ifdef CONFIG_CMD_TFTPPUT
|
||||||
|
protocol == TFTPPUT ? "to" : "from",
|
||||||
|
#else
|
||||||
|
"from",
|
||||||
|
#endif
|
||||||
|
&TftpRemoteIP, &NetOurIP);
|
||||||
|
|
||||||
/* Check if we need to send across this subnet */
|
/* Check if we need to send across this subnet */
|
||||||
if (NetOurGatewayIP && NetOurSubnetMask) {
|
if (NetOurGatewayIP && NetOurSubnetMask) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user