summaryrefslogtreecommitdiff
path: root/cmd/net.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-12-18 11:27:52 -0700
committerTom Rini <trini@konsulko.com>2022-01-21 14:01:35 -0500
commit434075393d7c41457662d996418e5acd0f3da0cb (patch)
treed77ccb4bb319c372ddf350f1d299f68231e0c5f4 /cmd/net.c
parentd3877fba3172486245f02f1b027f3069de891ca7 (diff)
net: Drop #ifdefs with CONFIG_BOOTP_SERVERIP
Use IS_ENABLED() instead, to reduce the number of build paths. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'cmd/net.c')
-rw-r--r--cmd/net.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/cmd/net.c b/cmd/net.c
index 651c1411f4..3619c843d8 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -152,16 +152,14 @@ static void netboot_update_env(void)
ip_to_string(net_ip, tmp);
env_set("ipaddr", tmp);
}
-#if !defined(CONFIG_BOOTP_SERVERIP)
/*
* Only attempt to change serverip if net/bootp.c:store_net_params()
* could have set it
*/
- if (net_server_ip.s_addr) {
+ if (!IS_ENABLED(CONFIG_BOOTP_SERVERIP) && net_server_ip.s_addr) {
ip_to_string(net_server_ip, tmp);
env_set("serverip", tmp);
}
-#endif
if (net_dns_server.s_addr) {
ip_to_string(net_dns_server, tmp);
env_set("dnsip", tmp);