diff mbox

[U-Boot,20/28] net: Fix compile warning if CONFIG_BOOTP_SERVERIP is not defined

Message ID 1327020811-1538-21-git-send-email-joe.hershberger@ni.com
State Superseded
Delegated to: Joe Hershberger
Headers show

Commit Message

Joe Hershberger Jan. 20, 2012, 12:53 a.m. UTC
There is no reason to use compiler magic to fix this
Actually move the definition inside the #ifdef

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
---
 net/bootp.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

Comments

Mike Frysinger Feb. 3, 2012, 12:28 p.m. UTC | #1
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
diff mbox

Patch

diff --git a/net/bootp.c b/net/bootp.c
index 9d709f1..187b3a8 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -20,7 +20,6 @@ 
 #ifdef CONFIG_STATUS_LED
 #include <status_led.h>
 #endif
-#include <linux/compiler.h>
 
 #define BOOTP_VENDOR_MAGIC	0x63825363	/* RFC1048 Magic Cookie */
 
@@ -98,15 +97,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_t *)NetRxPacket)->et_src, 6);
 #endif
+	NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
 	if (strlen(bp->bp_file) > 0)
 		copy_filename(BootFile, bp->bp_file, sizeof(BootFile));