Many changes to reduce complaints from CppCheck. Several latent bugs fixes, but probably some new typos introduced

This commit is contained in:
Gregory Nutt 2014-02-10 18:08:49 -06:00
parent 959d79be17
commit 1d6c14e742
13 changed files with 19 additions and 21 deletions

View File

@ -103,7 +103,7 @@ static int nsh_spifi_initialize(void)
return ret;
}
#else
/* Initialize to provide NXFFS on the MTD interface */1G
/* Initialize to provide NXFFS on the MTD interface */
ret = nxffs_initialize(mtd);
if (ret < 0)

View File

@ -109,7 +109,7 @@ void stm32_board_clockconfig(void)
regval |= STM32_RCC_CFGR_PPRE1;
putreg32(regval, STM32_RCC_CFGR);
/* Set the PLL dividers and multiplers to configure the main PLL */
/* Set the PLL dividers and multipliers to configure the main PLL */
regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP |
RCC_PLLCFG_PLLSRC_HSI | STM32_PLLCFG_PLLQ);

View File

@ -181,9 +181,6 @@
int nsh_archinitialize(void)
{
#if defined(HAVE_USBHOST) || defined(HAVE_USBMONITOR)
int ret;
#endif
#ifdef CONFIG_STM32_SPI3
FAR struct spi_dev_s *spi;
FAR struct mtd_dev_s *mtd;

View File

@ -81,7 +81,7 @@ void imx_boardinitialize(void)
(IMX_CSCR_USBDIV << PLL_CSCR_USBDIV_SHIFT) | /* USB divider */
CSCR_SDCNT_4thEDGE | /* Shutdown on 4th edge */
(IMX_CSCR_BCLKDIV << PLL_CSCR_BCLKDIV_SHIFT) | /* Bclock divider */
PLL_CSCR_SPEN | PLL_CSCR_MPEN); /* Enable MUC and System PLL */
PLL_CSCR_SPEN | PLL_CSCR_MPEN); /* Enable MUC and System PLL */
putreg32(regval, IMX_PLL_CSCR);
/* Use these new frequencies now */

View File

@ -125,11 +125,10 @@
int nsh_archinitialize(void)
{
#ifdef NSH_HAVEMMCSD
FAR struct spi_dev_s *spi;
int ret;
#ifdef NSH_HAVEMMCSD
/* Get the SPI port */
message("nsh_archinitialize: Initializing SPI port %d\n",

View File

@ -1365,9 +1365,6 @@ int arch_tcinitialize(int minor)
{
FAR struct tc_dev_s *priv;
char devname[DEV_NAMELEN];
#ifdef CONFIG_TOUCHSCREEN_MULTIPLE
irqstate_t flags;
#endif
int ret;
ivdbg("minor: %d\n", minor);

View File

@ -195,7 +195,9 @@ void stm32_boardinitialize(void)
int nsh_archinitialize(void)
{
#ifdef CONFIG_MMCSD
int ret;
#endif
/* Configure ADC pins */

View File

@ -147,6 +147,7 @@ xcpt_t board_button_irq(int id, xcpt_t irqhandler)
sam_gpioirq(IRQ_SW0);
(void)irq_attach(IRQ_SW0, irqhandler);
sam_gpioirqenable(IRQ_SW0);
irqrestore(flags);
}
/* Return the old button handler (so that it can be restored) */

View File

@ -145,6 +145,7 @@ xcpt_t board_button_irq(int id, xcpt_t irqhandler)
sam_gpioirq(IRQ_BP2);
(void)irq_attach(IRQ_BP2, irqhandler);
sam_gpioirqenable(IRQ_BP2);
irqrestore(flags);
}
/* Return the old button handler (so that it can be restored) */

View File

@ -116,6 +116,7 @@ static inline void up_setrs(bool data)
{
regval &= ~(1 << 0); /* Low = control */
}
putreg8(regval, M16C_P6);
}
@ -128,7 +129,7 @@ static inline void up_seten(void)
/* Set bit 1 of port 6 */
register uint8_t regval = getreg8(M16C_P6);
regval = (1 << 1);
regval |= (1 << 1);
putreg8(regval, M16C_P6);
}

View File

@ -82,13 +82,11 @@
int nsh_archinitialize(void)
{
int ret = OK;
#ifdef CONFIG_STM32_LCD
/* Initialize the SLCD and register the SLCD device as /dev/slcd */
#ifdef CONFIG_STM32_LCD
ret = stm32_slcd_initialize();
return stm32_slcd_initialize();
#else
return OK;
#endif
return ret;
}

View File

@ -135,7 +135,7 @@ uint8_t board_buttons(void)
#ifdef CONFIG_ARCH_IRQBUTTONS
xcpt_t board_button_irq(int id, xcpt_t irqhandler)
{
xcpt_t oldhandler = NULL;
xcpt_t oldhandler;
uint32_t pinset;
/* Map the button id to the GPIO bit set. */

View File

@ -110,6 +110,7 @@ static void putconsole(char ch)
{
(void)putc(ch, g_logstream);
}
(void)putchar(ch);
}
@ -139,6 +140,7 @@ static void printconsole(const char *fmt, ...)
{
(void)vfprintf(g_logstream, fmt, ap);
}
(void)vprintf(fmt, ap);
va_end(ap);
}
@ -435,7 +437,7 @@ static void close_tty(void)
(void)close(g_fd);
}
if (g_logstream >= 0)
if (g_logstream)
{
(void)fclose(g_logstream);
}
@ -717,7 +719,7 @@ int main(int argc, char **argv, char **envp)
{
sendfile(g_fd, filename, 0);
}
else if (ch1 == 'v' || ch1 == 'v')
else if (ch1 == 'v' || ch1 == 'V')
{
sendfile(g_fd, filename, 1);
}