From 2211a27f53d762ead9e1386eec25d8127d89ca38 Mon Sep 17 00:00:00 2001 From: Paul Thompson Date: Fri, 13 Apr 2018 00:27:00 -0700 Subject: [PATCH] Drop usage of ilen, just use len and cast it to int32_t as appropriate --- .../TARGET_STM32F7/device/stm32f7xx_hal_pcd.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_pcd.c b/targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_pcd.c index d9ca6ee67d..cf942dc7a1 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_pcd.c +++ b/targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_pcd.c @@ -1301,15 +1301,13 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t USB_OTG_GlobalTypeDef *USBx = hpcd->Instance; USB_OTG_EPTypeDef *ep; uint32_t len; - int32_t ilen; uint32_t len32b; uint32_t fifoemptymsk = 0; ep = &hpcd->IN_ep[epnum]; - ilen = ep->xfer_len - ep->xfer_count; - len = ilen; + len = ep->xfer_len - ep->xfer_count; - if ((ilen > 0) && (len > ep->maxpacket)) + if (((int32_t)len > 0) && (len > ep->maxpacket)) { len = ep->maxpacket; } @@ -1322,10 +1320,9 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t ep->xfer_len != 0) { /* Write the FIFO */ - ilen = ep->xfer_len - ep->xfer_count; - len = ilen; + len = ep->xfer_len - ep->xfer_count; - if ((ilen > 0) && (len > ep->maxpacket)) + if (((int32_t)len > 0) && (len > ep->maxpacket)) { len = ep->maxpacket; } @@ -1337,7 +1334,7 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t ep->xfer_count += len; } - if(ilen <= 0) + if ((int32_t)len <= 0) { fifoemptymsk = 0x1 << epnum; atomic_clr_u32(&USBx_DEVICE->DIEPEMPMSK, fifoemptymsk); // MBED: changed