Skip to contentSkip to conversation

arm: stm32mp: cleanup test on eth_env_set_enetaddr result

PATCH New Patrick Delaunay 3 participants 3 messages Apr 7, 2020 – Apr 14, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: stm32mp: cleanup test on eth_env_set_enetaddr result

Remove the unnecessary inversion on the eth_env_set_enetaddr() result which only make complex the code of setup_mac_address() and display an invalid value in the associated pr_err.

---

 arch/arm/mach-stm32mp/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-stm32mp/cpu.c +2 -2
index ea0bd94605..2a9b7c1987 100644
@@ -491,8 +491,8 @@ __weak int setup_mac_address(void)
 		return -EINVAL;
 	}
 	pr_debug("OTP MAC address = %pM\n", enetaddr);
-	ret = !eth_env_set_enetaddr("ethaddr", enetaddr);
-	if (!ret)
+	ret = eth_env_set_enetaddr("ethaddr", enetaddr);
+	if (ret)
 		pr_err("Failed to set mac address %pM from OTP: %d\n",
 		       enetaddr, ret);
 #endif
Signature · 1 line
2.17.1
#2 lore raw

PATCH 1/1 arm: stm32mp: cleanup test on eth_env_set_enetaddr result

Hi

Quoted 7 lines · Marek Vasut
Quoted 5 lines · Patrick Delaunay

Remove the unnecessary inversion on the eth_env_set_enetaddr() result which only make complex the code of setup_mac_address() and display an invalid value in the associated pr_err.

Applied to u-boot-stm/next

Thanks

Patrice