diff --git a/arch/arm/src/stm32/stm32_rng.c b/arch/arm/src/stm32/stm32_rng.c index 6588814d6c..6d198341e3 100644 --- a/arch/arm/src/stm32/stm32_rng.c +++ b/arch/arm/src/stm32/stm32_rng.c @@ -246,9 +246,11 @@ static int stm32_interrupt(int irq, void *context, FAR void *arg) static ssize_t stm32_read(struct file *filep, char *buffer, size_t buflen) { - if (sem_wait(&g_rngdev.rd_devsem) != OK) + int ret; + + if (sem_wait(&g_rngdev.rd_devsem) < 0) { - return -errno; + return -get_errno(); } else { @@ -272,13 +274,17 @@ static ssize_t stm32_read(struct file *filep, char *buffer, size_t buflen) /* Wait until the buffer is filled */ - sem_wait(&g_rngdev.rd_readsem); + ret = sem_wait(&g_rngdev.rd_readsem); + if (ret < 0) + { + ret = -get_errno(); + } /* Free RNG for next use */ sem_post(&g_rngdev.rd_devsem); - return buflen; + return ret < 0 ? ret : buflen; } } diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index dac4787a8c..8c0eddd847 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -3369,6 +3369,8 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv) default: nerr("ERROR: Unrecognized PHY status setting\n"); + /* Falls through */ + case CONFIG_STM32F7_PHYSR_10HD: priv->fduplex = 0; priv->mbps100 = 0; diff --git a/arch/arm/src/stm32f7/stm32_rng.c b/arch/arm/src/stm32f7/stm32_rng.c index 8fb0f46685..7b746dc522 100644 --- a/arch/arm/src/stm32f7/stm32_rng.c +++ b/arch/arm/src/stm32f7/stm32_rng.c @@ -267,9 +267,11 @@ static int stm32_rnginterrupt(int irq, void *context, FAR void *arg) static ssize_t stm32_rngread(struct file *filep, char *buffer, size_t buflen) { - if (sem_wait(&g_rngdev.rd_devsem) != OK) + int ret; + + if (sem_wait(&g_rngdev.rd_devsem) < 0) { - return -errno; + return -get_errno(); } else { @@ -293,7 +295,11 @@ static ssize_t stm32_rngread(struct file *filep, char *buffer, size_t buflen) /* Wait until the buffer is filled */ - sem_wait(&g_rngdev.rd_readsem); + ret = sem_wait(&g_rngdev.rd_readsem); + if (ret < 0) + { + ret = -get_errno(); + } /* Done with the operation semaphore */ @@ -303,7 +309,7 @@ static ssize_t stm32_rngread(struct file *filep, char *buffer, size_t buflen) sem_post(&g_rngdev.rd_devsem); - return buflen; + return ret < 0 ? ret : buflen; } }