diff mbox series

arm: stm32mp: cleanup test on eth_env_set_enetaddr result

Message ID 20200407160742.1.Iff22fd0c4f1e9a7fd23f632f06e6f13bef768c53@changeid
State Accepted
Commit cf8df34015fcbd6b85a8ebadd22382d68c57f4e5
Headers show
Series arm: stm32mp: cleanup test on eth_env_set_enetaddr result | expand

Commit Message

Patrick Delaunay April 7, 2020, 2:07 p.m. UTC
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.

Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
---

 arch/arm/mach-stm32mp/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Marek Vasut April 7, 2020, 2:09 p.m. UTC | #1
On 4/7/20 4:07 PM, Patrick Delaunay wrote:
> 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.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>

Reviewed-by: Marek Vasut <marex at denx.de>
Patrice CHOTARD April 14, 2020, 9:12 a.m. UTC | #2
Hi

On 4/7/20 4:09 PM, Marek Vasut wrote:
> On 4/7/20 4:07 PM, Patrick Delaunay wrote:
>> 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.
>>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
> Reviewed-by: Marek Vasut <marex at denx.de>

Applied to u-boot-stm/next

Thanks

Patrice
diff mbox series

Patch

diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c
index ea0bd94605..2a9b7c1987 100644
--- a/arch/arm/mach-stm32mp/cpu.c
+++ b/arch/arm/mach-stm32mp/cpu.c
@@ -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