diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index 92daf09f5d..28c80a43ef 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -1898,7 +1898,6 @@ static void stm32_receive(struct stm32_ethmac_s *priv) static void stm32_freeframe(struct stm32_ethmac_s *priv) { struct eth_txdesc_s *txdesc; - int i; ninfo("txhead: %p txtail: %p inflight: %d\n", priv->txhead, priv->txtail, priv->inflight); @@ -1915,7 +1914,7 @@ static void stm32_freeframe(struct stm32_ethmac_s *priv) up_invalidate_dcache((uintptr_t)txdesc, (uintptr_t)txdesc + sizeof(struct eth_txdesc_s)); - for (i = 0; (txdesc->tdes0 & ETH_TDES0_OWN) == 0; i++) + while ((txdesc->tdes0 & ETH_TDES0_OWN) == 0) { /* There should be a buffer assigned to all in-flight * TX descriptors. diff --git a/arch/arm/src/stm32h7/stm32_ethernet.c b/arch/arm/src/stm32h7/stm32_ethernet.c index 3a0314578e..c2719303b4 100644 --- a/arch/arm/src/stm32h7/stm32_ethernet.c +++ b/arch/arm/src/stm32h7/stm32_ethernet.c @@ -2011,7 +2011,6 @@ static void stm32_freeframe(struct stm32_ethmac_s *priv) { struct eth_desc_s *txdesc; uint32_t des3_tmp; - int i; ninfo("txhead: %p txtail: %p inflight: %d\n", priv->txhead, priv->txtail, priv->inflight); @@ -2028,7 +2027,7 @@ static void stm32_freeframe(struct stm32_ethmac_s *priv) up_invalidate_dcache((uintptr_t)txdesc, (uintptr_t)txdesc + sizeof(struct eth_desc_s)); - for (i = 0; (txdesc->des3 & ETH_TDES3_RD_OWN) == 0; i++) + while ((txdesc->des3 & ETH_TDES3_RD_OWN) == 0) { /* There should be a buffer assigned to all in-flight * TX descriptors.