From 76a0cccbb157676bf2f3aba5fe777eae04f34d34 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 13 Jul 2016 07:04:19 -0600 Subject: [PATCH] K6x Ethernet: Fix some conditional logic --- arch/arm/src/kinetis/kinetis_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index 6c30bac415..dc0be25e16 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -1840,7 +1840,7 @@ static inline int kinetis_initphy(struct kinetis_driver_s *priv) phydata = 0xffff; ret = kinetis_readmii(priv, phyaddr, MII_PHYID1, &phydata); } - while (ret >= 0 && phydata == 0xffff && ++retries < 3); + while ((ret < 0 || phydata == 0xffff) && ++retries < 3); /* If we successfully read anything then break out, using this PHY address */