Commit 1752f0fd authored by Joe Hershberger's avatar Joe Hershberger

net: Fix unused variable compile warning

If CONFIG_BOOTP_SERVERIP is not defined, unused variable warning is
reported.  This was fixed upstream using a compiler feature instead
of a simple reorder of the statements.
Signed-off-by: default avatarJoe Hershberger <>
Acked-by: default avatarSimon Glass <>
Acked-by: default avatarMike Frysinger <>
parent a3e1a727
......@@ -18,7 +18,6 @@
#include <status_led.h>
#include <linux/compiler.h>
#define BOOTP_VENDOR_MAGIC 0x63825363 /* RFC1048 Magic Cookie */
......@@ -96,15 +95,15 @@ static int BootpCheckPkt(uchar *pkt, unsigned dest, unsigned src, unsigned len)
static void BootpCopyNetParams(struct Bootp_t *bp)
__maybe_unused IPaddr_t tmp_ip;
NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
IPaddr_t tmp_ip;
NetCopyIP(&tmp_ip, &bp->bp_siaddr);
if (tmp_ip != 0)
NetCopyIP(&NetServerIP, &bp->bp_siaddr);
memcpy(NetServerEther, ((struct ethernet_hdr *)NetRxPacket)->et_src, 6);
NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
if (strlen(bp->bp_file) > 0)
copy_filename(BootFile, bp->bp_file, sizeof(BootFile));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment