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>
This commit is contained in:
Simon Glass
2021-12-18 11:27:52 -07:00
committed by Tom Rini
parent d3877fba31
commit 434075393d
3 changed files with 16 additions and 17 deletions

View File

@@ -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);