Various issues/bugs detected by cppcheck

This commit is contained in:
Gregory Nutt 2014-11-24 12:59:52 -06:00
parent 7dfb945979
commit 8becf3c18c
6 changed files with 10 additions and 8 deletions

View File

@ -1600,6 +1600,7 @@ static int c5471_ifup(struct net_driver_s *dev)
/* Clear pending interrupts by reading the EIM status register */
clearbits = getreg32(EIM_STATUS);
UNUSED(clearbits);
/* Enable interrupts going from EIM Module to Interrupt Module. */

View File

@ -334,7 +334,7 @@ retry:
* posts keypad semaphore
****************************************************************************/
inline int calypso_kbd_irq(int irq, uint32_t * regs)
int calypso_kbd_irq(int irq, uint32_t * regs)
{
register uint16_t reg;

View File

@ -99,7 +99,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer,
for (i = 0; i < nwords; i++)
{
spi_xfer(0, priv->nbits, txbuffer+i, rxbuffer+i);
spi_xfer(0, priv->nbits, txbuffer + i, rxbuffer + i);
}
}

View File

@ -71,7 +71,7 @@ void hwtimer_enable(int num, int on)
uint8_t ctl;
if (num < 1 || num > 2) {
printf("Unknown timer %u\n", num);
printf("Unknown timer %d\n", num);
return;
}

View File

@ -1881,6 +1881,7 @@ static int dm320_epconfigure(FAR struct usbdev_ep_s *ep,
/* Retain what we need from the descriptor */
usbtrace(TRACE_EPCONFIGURE, privep->epphy);
UNUSED(privep);
DEBUGASSERT(desc->addr == ep->eplog);
return OK;
}
@ -2227,6 +2228,7 @@ static void dm320_freeep(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep)
{
FAR struct dm320_ep_s *privep = (FAR struct dm320_ep_s *)ep;
usbtrace(TRACE_DEVFREEEP, (uint16_t)privep->epphy);
UNUSED(privep);
/* Nothing needs to be done */
}

View File

@ -689,7 +689,7 @@ void efm32_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg)
flags = irqsave();
regval = getreg32(EFM32_DMA_IEN);
regval |= bit;
putreg32(bit, EFM32_DMA_IEN);
putreg32(regval, EFM32_DMA_IEN);
/* Enable the channel */
@ -729,7 +729,7 @@ void efm32_dmastop(DMA_HANDLE handle)
regval = getreg32(EFM32_DMA_IEN);
regval |= bit;
putreg32(bit, EFM32_DMA_IEN);
putreg32(regval, EFM32_DMA_IEN);
irqrestore(flags);
}
@ -747,7 +747,7 @@ void efm32_dmastop(DMA_HANDLE handle)
#ifdef CONFIG_DEBUG_DMA
void efm32_dmasample(DMA_HANDLE handle, struct efm32_dmaregs_s *regs)
{
struct sam_dmach_s *dmach = (struct sam_dmach_s *)handle;
struct dma_channel_s *dmach = (struct dma_channel_s *)handle;
uintptr_t regaddr;
irqstate_t flags;
@ -801,8 +801,7 @@ void efm32_dmasample(DMA_HANDLE handle, struct efm32_dmaregs_s *regs)
void efm32_dmadump(DMA_HANDLE handle, const struct efm32_dmaregs_s *regs,
const char *msg)
{
struct sam_xdmach_s *xdmach = (struct sam_xdmach_s *)handle;
struct sam_xdmac_s *xdmac = sam_controller(xdmach);
struct dma_channel_s *dmach = (struct dma_channel_s *)handle;
dmadbg("%s\n", msg);
dmadbg(" DMA Registers:\n");