From ba29bd9315c28faa50999e7e21c7f1216eeed357 Mon Sep 17 00:00:00 2001 From: Brendan McDonnell Date: Mon, 30 Apr 2018 17:49:37 -0400 Subject: [PATCH 1/2] use separate variable to resolve compiler warning --- .../lwip-eth/arch/TARGET_NXP/TARGET_LPCTarget/lpc17_emac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_NXP/TARGET_LPCTarget/lpc17_emac.c b/features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_NXP/TARGET_LPCTarget/lpc17_emac.c index 5b3b326435a..4d21c324067 100644 --- a/features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_NXP/TARGET_LPCTarget/lpc17_emac.c +++ b/features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_NXP/TARGET_LPCTarget/lpc17_emac.c @@ -557,7 +557,7 @@ static err_t lpc_low_level_output(struct netif *netif, struct pbuf *p) u8_t *dst; u32_t idx, notdmasafe = 0; struct pbuf *np; - s32_t dn; + s32_t count, dn; /* Zero-copy TX buffers may be fragmented across mutliple payload chains. Determine the number of descriptors needed for the @@ -611,7 +611,7 @@ static err_t lpc_low_level_output(struct netif *netif, struct pbuf *p) /* Wait until enough descriptors are available for the transfer. */ /* THIS WILL BLOCK UNTIL THERE ARE ENOUGH DESCRIPTORS AVAILABLE */ #if NO_SYS == 0 - for (idx = 0; idx < dn; idx++) { + for (count = 0; count < dn; count++) { osSemaphoreAcquire(lpc_enetif->xTXDCountSem.id, osWaitForever); } MBED_ASSERT(dn <= lpc_tx_ready(netif)); From 33a21160428526b5d0a48fa9752a8f27a7530a7d Mon Sep 17 00:00:00 2001 From: Brendan McDonnell Date: Wed, 2 May 2018 11:16:58 -0400 Subject: [PATCH 2/2] reduce variable scope --- .../lwip-eth/arch/TARGET_NXP/TARGET_LPCTarget/lpc17_emac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_NXP/TARGET_LPCTarget/lpc17_emac.c b/features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_NXP/TARGET_LPCTarget/lpc17_emac.c index 4d21c324067..c79083c9433 100644 --- a/features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_NXP/TARGET_LPCTarget/lpc17_emac.c +++ b/features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_NXP/TARGET_LPCTarget/lpc17_emac.c @@ -557,7 +557,7 @@ static err_t lpc_low_level_output(struct netif *netif, struct pbuf *p) u8_t *dst; u32_t idx, notdmasafe = 0; struct pbuf *np; - s32_t count, dn; + s32_t dn; /* Zero-copy TX buffers may be fragmented across mutliple payload chains. Determine the number of descriptors needed for the @@ -611,7 +611,7 @@ static err_t lpc_low_level_output(struct netif *netif, struct pbuf *p) /* Wait until enough descriptors are available for the transfer. */ /* THIS WILL BLOCK UNTIL THERE ARE ENOUGH DESCRIPTORS AVAILABLE */ #if NO_SYS == 0 - for (count = 0; count < dn; count++) { + for (s32_t count = 0; count < dn; count++) { osSemaphoreAcquire(lpc_enetif->xTXDCountSem.id, osWaitForever); } MBED_ASSERT(dn <= lpc_tx_ready(netif));