diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-25 13:15:09 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-25 13:15:09 -0600 |
commit | 3b3fcf2bfa6015d890d42b5a528f7fe7476632f7 (patch) | |
tree | cccc4fca1d7d91915ad679577b484c5c6a110e6d /nuttx/arch/arm/src | |
parent | c9b18b049b09580260188349bb32e91b59f74965 (diff) | |
download | px4-nuttx-3b3fcf2bfa6015d890d42b5a528f7fe7476632f7.tar.gz px4-nuttx-3b3fcf2bfa6015d890d42b5a528f7fe7476632f7.tar.bz2 px4-nuttx-3b3fcf2bfa6015d890d42b5a528f7fe7476632f7.zip |
More fixes to problems noted by cppcheck. Some are kind of risky; some are real bugs.
Diffstat (limited to 'nuttx/arch/arm/src')
-rw-r--r-- | nuttx/arch/arm/src/c5471/c5471_serial.c | 24 | ||||
-rw-r--r-- | nuttx/arch/arm/src/calypso/calypso_serial.c | 26 | ||||
-rw-r--r-- | nuttx/arch/arm/src/efm32/efm32_dma.c | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/str71x/str71x_serial.c | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/tiva/tiva_ssi.c | 3 |
5 files changed, 28 insertions, 29 deletions
diff --git a/nuttx/arch/arm/src/c5471/c5471_serial.c b/nuttx/arch/arm/src/c5471/c5471_serial.c index 81cb08467..4aa51ff6a 100644 --- a/nuttx/arch/arm/src/c5471/c5471_serial.c +++ b/nuttx/arch/arm/src/c5471/c5471_serial.c @@ -84,20 +84,20 @@ struct uart_regs_s struct up_dev_s { - unsigned int uartbase; /* Base address of UART registers */ - unsigned int baud_base; /* Base baud for conversions */ - unsigned int baud; /* Configured baud */ - uint8_t xmit_fifo_size; /* Size of transmit FIFO */ - uint8_t irq; /* IRQ associated with this UART */ - uint8_t parity; /* 0=none, 1=odd, 2=even */ - uint8_t bits; /* Number of bits (7 or 8) */ + unsigned int uartbase; /* Base address of UART registers */ + unsigned int baud_base; /* Base baud for conversions */ + unsigned int baud; /* Configured baud */ + uint8_t xmit_fifo_size; /* Size of transmit FIFO */ + uint8_t irq; /* IRQ associated with this UART */ + uint8_t parity; /* 0=none, 1=odd, 2=even */ + uint8_t bits; /* Number of bits (7 or 8) */ #ifdef CONFIG_UART_HWFLOWCONTROL - bool flowcontrol; /* true: Hardware flow control - * is enabled. */ + bool flowcontrol; /* true: Hardware flow control + * is enabled. */ #endif - bool stopbits2; /* true: Configure with 2 - * stop bits instead of 1 */ - struct uart_regs_s regs; /* Shadow copy of readonly regs */ + bool stopbits2; /* true: Configure with 2 + * stop bits instead of 1 */ + struct uart_regs_s regs; /* Shadow copy of readonly regs */ }; /**************************************************************************** diff --git a/nuttx/arch/arm/src/calypso/calypso_serial.c b/nuttx/arch/arm/src/calypso/calypso_serial.c index 0fceb344d..c19ac2858 100644 --- a/nuttx/arch/arm/src/calypso/calypso_serial.c +++ b/nuttx/arch/arm/src/calypso/calypso_serial.c @@ -94,23 +94,23 @@ struct uart_regs_s struct up_dev_s { - unsigned int uartbase; /* Base address of UART registers */ - unsigned int baud_base; /* Base baud for conversions */ - unsigned int baud; /* Configured baud */ - uint8_t xmit_fifo_size; /* Size of transmit FIFO */ - uint8_t irq; /* IRQ associated with this UART */ - uint8_t parity; /* 0=none, 1=odd, 2=even */ - uint8_t bits; /* Number of bits (7 or 8) */ + unsigned int uartbase; /* Base address of UART registers */ + unsigned int baud_base; /* Base baud for conversions */ + unsigned int baud; /* Configured baud */ + uint8_t xmit_fifo_size; /* Size of transmit FIFO */ + uint8_t irq; /* IRQ associated with this UART */ + uint8_t parity; /* 0=none, 1=odd, 2=even */ + uint8_t bits; /* Number of bits (7 or 8) */ #ifdef CONFIG_UART_HWFLOWCONTROL - bool flowcontrol; /* true: Hardware flow control - * is enabled. */ + bool flowcontrol; /* true: Hardware flow control + * is enabled. */ #endif - bool stopbits2; /* true: Configure with 2 - * stop bits instead of 1 */ - struct uart_regs_s regs; /* Shadow copy of readonly regs */ + bool stopbits2; /* true: Configure with 2 + * stop bits instead of 1 */ + struct uart_regs_s regs; /* Shadow copy of readonly regs */ #ifdef CONFIG_SERCOMM_CONSOLE - bool sercomm; /* Call sercomm in interrupt if true */ + bool sercomm; /* Call sercomm in interrupt if true */ #endif }; diff --git a/nuttx/arch/arm/src/efm32/efm32_dma.c b/nuttx/arch/arm/src/efm32/efm32_dma.c index f27929c0e..8f32168fb 100644 --- a/nuttx/arch/arm/src/efm32/efm32_dma.c +++ b/nuttx/arch/arm/src/efm32/efm32_dma.c @@ -717,7 +717,7 @@ void efm32_dmastop(DMA_HANDLE handle) uint32_t regval; uint32_t bit; - DEBUGASSERT(dmach && dmach); + DEBUGASSERT(dmach); bit = 1 << dmach->chan; /* Disable the channel */ diff --git a/nuttx/arch/arm/src/str71x/str71x_serial.c b/nuttx/arch/arm/src/str71x/str71x_serial.c index bfa11b559..27dfd6976 100644 --- a/nuttx/arch/arm/src/str71x/str71x_serial.c +++ b/nuttx/arch/arm/src/str71x/str71x_serial.c @@ -631,8 +631,8 @@ static int up_attach(struct uart_dev_s *dev) /* Set the uart interrupt priority (the default value is one) */ up_prioritize_irq(priv->irq, CONFIG_UART_PRI); - } #endif + } return ret; } diff --git a/nuttx/arch/arm/src/tiva/tiva_ssi.c b/nuttx/arch/arm/src/tiva/tiva_ssi.c index 8f1c0c79d..dfe1d737a 100644 --- a/nuttx/arch/arm/src/tiva/tiva_ssi.c +++ b/nuttx/arch/arm/src/tiva/tiva_ssi.c @@ -951,7 +951,6 @@ static int ssi_interrupt(int irq, void *context) { struct tiva_ssidev_s *priv = ssi_mapirq(irq); uint32_t regval; - int ntxd; DEBUGASSERT(priv != NULL); @@ -975,7 +974,7 @@ static int ssi_interrupt(int irq, void *context) /* Handle outgoing Tx FIFO transfers */ - ntxd = ssi_performtx(priv); + (void)ssi_performtx(priv); /* Handle incoming Rx FIFO transfers */ |