summaryrefslogtreecommitdiff
path: root/net/bootp.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-05-23 07:59:18 +0000
committerJoe Hershberger <joe.hershberger@ni.com>2012-05-23 17:53:05 -0500
commit1752f0fdc7a3b914f6b651f68cb59dde102c9c92 (patch)
tree97f8275cebffb66e6621d4b3a41704055ed29ede /net/bootp.c
parenta3e1a727fe8a8b0294fe3ffbc8dcd2f14a4e5a4e (diff)
downloadu-boot-imx-1752f0fdc7a3b914f6b651f68cb59dde102c9c92.zip
u-boot-imx-1752f0fdc7a3b914f6b651f68cb59dde102c9c92.tar.gz
u-boot-imx-1752f0fdc7a3b914f6b651f68cb59dde102c9c92.tar.bz2
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: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'net/bootp.c')
-rw-r--r--net/bootp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/bootp.c b/net/bootp.c
index b36abac..7e24b66 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -18,7 +18,6 @@
#ifdef CONFIG_STATUS_LED
#include <status_led.h>
#endif
-#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);
#if !defined(CONFIG_BOOTP_SERVERIP)
+ 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);
#endif
+ NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
if (strlen(bp->bp_file) > 0)
copy_filename(BootFile, bp->bp_file, sizeof(BootFile));