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/z80 | |
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/z80')
-rw-r--r-- | nuttx/arch/z80/src/ez80/ez80_spi.c | 3 | ||||
-rw-r--r-- | nuttx/arch/z80/src/ez80/ez80_timerisr.c | 13 | ||||
-rw-r--r-- | nuttx/arch/z80/src/z180/z180_scc.c | 2 | ||||
-rw-r--r-- | nuttx/arch/z80/src/z180/z180_timerisr.c | 8 | ||||
-rw-r--r-- | nuttx/arch/z80/src/z8/z8_lowuart.c | 3 |
5 files changed, 12 insertions, 17 deletions
diff --git a/nuttx/arch/z80/src/ez80/ez80_spi.c b/nuttx/arch/z80/src/ez80/ez80_spi.c index 8a6eab663..5757f4ed6 100644 --- a/nuttx/arch/z80/src/ez80/ez80_spi.c +++ b/nuttx/arch/z80/src/ez80/ez80_spi.c @@ -359,13 +359,12 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t buflen) { FAR const uint8_t *ptr = (FAR const uint8_t*)buffer; - uint8_t response; /* Loop while there are bytes remaining to be sent */ while (buflen-- > 0) { - response = spi_transfer(*ptr++); + (void)spi_transfer(*ptr++); } } diff --git a/nuttx/arch/z80/src/ez80/ez80_timerisr.c b/nuttx/arch/z80/src/ez80/ez80_timerisr.c index 4fbc49c0d..3980d98f8 100644 --- a/nuttx/arch/z80/src/ez80/ez80_timerisr.c +++ b/nuttx/arch/z80/src/ez80/ez80_timerisr.c @@ -76,16 +76,14 @@ int up_timerisr(int irq, chipreg_t *regs) { - volatile uint8_t reg; - - /* Read the appropropriate timer0 registr to clear the interrupt */ + /* Read the appropriate timer0 register to clear the interrupt */ #ifdef _EZ80F91 - reg = inp(EZ80_TMR0_IIR); + (void)inp(EZ80_TMR0_IIR); #else /* _EZ80190, _EZ80L92, _EZ80F92, _EZ80F93 */ - reg = inp(EZ80_TMR0_CTL); + (void)inp(EZ80_TMR0_CTL); #endif /* Process timer interrupt */ @@ -113,7 +111,6 @@ int up_timerisr(int irq, chipreg_t *regs) void up_timer_initialize(void) { uint16_t reload; - uint8_t reg; /* Disable the timer */ @@ -149,9 +146,9 @@ void up_timer_initialize(void) /* Clear any pending timer interrupts */ #if defined(_EZ80F91) - reg = inp(EZ80_TMR0_IIR); + (void)inp(EZ80_TMR0_IIR); #elif defined(_EZ80L92) || defined(_EZ80F92) ||defined(_EZ80F93) - reg = inp(EZ80_TMR0_CTL); + (void)inp(EZ80_TMR0_CTL); #endif /* Configure and enable the timer */ diff --git a/nuttx/arch/z80/src/z180/z180_scc.c b/nuttx/arch/z80/src/z180/z180_scc.c index 8655d907c..b8f156503 100644 --- a/nuttx/arch/z80/src/z180/z180_scc.c +++ b/nuttx/arch/z80/src/z180/z180_scc.c @@ -575,8 +575,6 @@ static bool z180_txempty(struct uart_dev_s *dev) void up_serialinit(void) { - uint8_t regval; - /* Make sure that all UART interrupts are disabled */ #warning "Missing logic" diff --git a/nuttx/arch/z80/src/z180/z180_timerisr.c b/nuttx/arch/z80/src/z180/z180_timerisr.c index 35d21c5a0..253fd4327 100644 --- a/nuttx/arch/z80/src/z180/z180_timerisr.c +++ b/nuttx/arch/z80/src/z180/z180_timerisr.c @@ -94,16 +94,14 @@ int up_timerisr(int irq, chipreg_t *regs) { - volatile uint8_t regval; - /* "When TMDR0 decrements to 0, TIF0 is set to 1. This generates an interrupt * request if enabled by TIE0 = 1. TIF0 is reset to 0 when TCR is read and * the higher or lower byte of TMDR0 is read." */ - regval = inp(Z180_PRT_TCR); - regval = inp(Z180_PRT0_DRL); - regval = inp(Z180_PRT0_DRH); + (void)inp(Z180_PRT_TCR); + (void)inp(Z180_PRT0_DRL); + (void)inp(Z180_PRT0_DRH); /* Process timer interrupt */ diff --git a/nuttx/arch/z80/src/z8/z8_lowuart.c b/nuttx/arch/z80/src/z8/z8_lowuart.c index ad4acb6e9..580b0e784 100644 --- a/nuttx/arch/z80/src/z8/z8_lowuart.c +++ b/nuttx/arch/z80/src/z8/z8_lowuart.c @@ -75,9 +75,12 @@ extern uint32_t get_freq(void); void up_lowserialinit(void) { +#if defined(CONFIG_UART0_SERIAL_CONSOLE) || \ + (defined(EZ8_UART1) && defined(CONFIG_UART1_SERIAL_CONSOLE)) uint32_t freq = get_freq(); uint16_t brg; uint8_t val; +#endif #ifdef CONFIG_UART0_SERIAL_CONSOLE /* Set the baudrate */ |