From c00e3e55dce748be1d2d01ae326c86376c08e620 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 11 May 2016 17:42:59 -0600 Subject: [PATCH] Fix several places in DMA logic where a spurious semicolon causes bad conditional logic --- arch/arm/src/stm32/stm32_tim.c | 17 ++++++++++++----- arch/sh/src/m16c/m16c_serial.c | 2 +- fs/unionfs/fs_unionfs.c | 2 +- sched/group/group_signal.c | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/arch/arm/src/stm32/stm32_tim.c b/arch/arm/src/stm32/stm32_tim.c index c7d3b8350c..14359625f8 100644 --- a/arch/arm/src/stm32/stm32_tim.c +++ b/arch/arm/src/stm32/stm32_tim.c @@ -516,7 +516,8 @@ static int stm32_tim_setmode(FAR struct stm32_tim_dev_s *dev, stm32_tim_mode_t m val |= ATIM_CR1_OPM; break; - default: return ERROR; + default: + return ERROR; } stm32_tim_reload_counter(dev); @@ -548,7 +549,10 @@ static int stm32_tim_setchannel(FAR struct stm32_tim_dev_s *dev, uint8_t channel /* Further we use range as 0..3; if channel=0 it will also overflow here */ - if (--channel > 4) return ERROR; + if (--channel > 4) + { + return ERROR; + } /* Assume that channel is disabled and polarity is active high */ @@ -699,7 +703,8 @@ static int stm32_tim_setchannel(FAR struct stm32_tim_dev_s *dev, uint8_t channel stm32_tim_gpioconfig(GPIO_TIM4_CH4OUT, mode); break; #endif - default: return ERROR; + default: + return ERROR; } break; #endif @@ -727,7 +732,8 @@ static int stm32_tim_setchannel(FAR struct stm32_tim_dev_s *dev, uint8_t channel stm32_tim_gpioconfig(GPIO_TIM5_CH4OUT, mode); break; #endif - default: return ERROR; + default: + return ERROR; } break; #endif @@ -753,7 +759,8 @@ static int stm32_tim_setchannel(FAR struct stm32_tim_dev_s *dev, uint8_t channel case 3: stm32_tim_gpioconfig(GPIO_TIM1_CH4OUT, mode); break; #endif - default: return ERROR; + default: + return ERROR; } break; #endif diff --git a/arch/sh/src/m16c/m16c_serial.c b/arch/sh/src/m16c/m16c_serial.c index 6aeb973f75..a366e3b57d 100644 --- a/arch/sh/src/m16c/m16c_serial.c +++ b/arch/sh/src/m16c/m16c_serial.c @@ -492,7 +492,7 @@ static inline void up_waittxready(struct up_dev_s *priv) { /* Check the TI bit in the CI register. 1=Transmit buffer empty */ - if ((up_serialin(priv, M16C_UART_C1) & UART_C1_TI) != 0); + if ((up_serialin(priv, M16C_UART_C1) & UART_C1_TI) != 0) { /* The transmit buffer is empty... return */ break; diff --git a/fs/unionfs/fs_unionfs.c b/fs/unionfs/fs_unionfs.c index 3ebc6d2fdb..b0a0920e83 100644 --- a/fs/unionfs/fs_unionfs.c +++ b/fs/unionfs/fs_unionfs.c @@ -1506,7 +1506,7 @@ static int unionfs_closedir(FAR struct inode *mountpt, { /* Was this file system opened? */ - if (fu->fu_lower[i] != NULL); + if (fu->fu_lower[i] != NULL) { um = &ui->ui_fs[i]; diff --git a/sched/group/group_signal.c b/sched/group/group_signal.c index 1f681928d9..ac8afca3e5 100644 --- a/sched/group/group_signal.c +++ b/sched/group/group_signal.c @@ -131,7 +131,7 @@ static int group_signal_handler(pid_t pid, FAR void *arg) /* Limit to one thread */ info->atcb = tcb; - if (info->ptcb != NULL); + if (info->ptcb != NULL) { return 1; /* Terminate the search */ }