net: lwip: simplify net_lwip_eth_start
PATCH 1/1 net: lwip: simplify net_lwip_eth_start
For NET_LWIP eth_is_on_demand_init() is always 1 so remove the check and simplify the code.
Suggested-by Jerome Forissier <[email protected]>
Signed-off-by Tim Harvey <[email protected]>
--- net/lwip/net-lwip.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
net/lwip/net-lwip.c +5 -9
@@ -184,16 +184,12 @@ int net_lwip_eth_start(void)int ret;net_init (); -if (eth_is_on_demand_init ()) { +eth_halt (); +eth_set_current (); + ret =eth_init (); +if (ret <0 ) {eth_halt (); -eth_set_current (); - ret =eth_init (); -if (ret <0 ) { -eth_halt (); -return ret; - } - }else { -eth_init_state_only (); +return ret; }return 0 ;
Signature · 1 line
2.25.1
Quoted 25 lines · Tim Harvey
For
NET_LWIPeth_is_on_demand_init()is always 1 so remove the check and simplify the code.Suggested-by Jerome Forissier <[email protected]>Signed-off-by Tim Harvey <[email protected]>--- net/lwip/net-lwip.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)net/lwip/net-lwip.c +4
-3@@ -184,16 +184,12 @@ int net_lwip_eth_start(void)int ret;net_init (); -if (eth_is_on_demand_init ()) { +eth_halt (); +eth_set_current (); + ret =eth_init (); +if (ret <0 ) {eth_halt (); -eth_set_current (); - ret =eth_init ();
net/lwip/net-lwip.c int net_lwip_eth_start(void) · line 195
Quoted 10 lines
net/lwip/net-lwip.c +1
-6-if (ret <0 ) { -eth_halt (); -return ret; - } - }else { -eth_init_state_only (); +return ret; }return 0 ;
Reviewed-by Jerome Forissier <[email protected]>
Thanks,
Signature · 1 line
Jerome