diff --git a/arch/arm/src/calypso/calypso_irq.c b/arch/arm/src/calypso/calypso_irq.c index e307dd38c2..6b1af5623d 100644 --- a/arch/arm/src/calypso/calypso_irq.c +++ b/arch/arm/src/calypso/calypso_irq.c @@ -252,7 +252,7 @@ void up_disable_irq(int irq) void up_enable_irq(int irq) { - if((unsigned)irq < NR_IRQS) + if ((unsigned)irq < NR_IRQS) { _irq_enable(irq, 1); } diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index 3e0a367798..eb277f1627 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -619,7 +619,7 @@ static void kinetis_txdone(FAR struct kinetis_driver_s *priv) * Three interrupt sources will vector this this function: * 1. Ethernet MAC transmit interrupt handler * 2. Ethernet MAC receive interrupt handler - * 3. + * 3. * * Parameters: * irq - Number of the IRQ that generated the interrupt @@ -677,7 +677,7 @@ static int kinetis_interrupt(int irq, FAR void *context) /* Reinitialize all buffers. */ kinetis_initbuffers(priv); - + /* Indicate that there have been empty receive buffers produced */ putreg32(ENET_RDAR, KINETIS_ENET_RDAR); @@ -771,7 +771,7 @@ static void kinetis_polltimer(int argc, uint32_t arg, ...) * * Description: * NuttX Callback: Bring up the Ethernet interface when an IP address is - * provided + * provided * * Parameters: * dev - Reference to the NuttX driver state structure @@ -933,7 +933,7 @@ static int kinetis_ifdown(struct uip_driver_s *dev) * Function: kinetis_txavail * * Description: - * Driver callback invoked when new TX data is available. This is a + * Driver callback invoked when new TX data is available. This is a * stimulus perform an out-of-cycle poll and, thereby, reduce the TX * latency. * @@ -990,7 +990,7 @@ static int kinetis_txavail(struct uip_driver_s *dev) * * Parameters: * dev - Reference to the NuttX driver state structure - * mac - The MAC address to be added + * mac - The MAC address to be added * * Returned Value: * None @@ -1019,7 +1019,7 @@ static int kinetis_addmac(struct uip_driver_s *dev, FAR const uint8_t *mac) * * Parameters: * dev - Reference to the NuttX driver state structure - * mac - The MAC address to be removed + * mac - The MAC address to be removed * * Returned Value: * None @@ -1070,7 +1070,7 @@ static void kinetis_initmii(struct kinetis_driver_s *priv) * Function: kinetis_writemii * * Description: - * Write a 16-bit value to a PHY register. + * Write a 16-bit value to a PHY register. * * Parameters: * priv - Reference to the private ENET driver state structure @@ -1114,7 +1114,7 @@ static int kinetis_writemii(struct kinetis_driver_s *priv, uint8_t phyaddr, /* Check for a timeout */ - if(timeout == MII_MAXPOLLS) + if (timeout == MII_MAXPOLLS) { return -ETIMEDOUT; } @@ -1129,7 +1129,7 @@ static int kinetis_writemii(struct kinetis_driver_s *priv, uint8_t phyaddr, * Function: kinetis_writemii * * Description: - * Read a 16-bit value from a PHY register. + * Read a 16-bit value from a PHY register. * * Parameters: * priv - Reference to the private ENET driver state structure @@ -1152,7 +1152,7 @@ static int kinetis_readmii(struct kinetis_driver_s *priv, uint8_t phyaddr, putreg32(ENET_INT_MII, KINETIS_ENET_EIR); /* Initiatate the MII Management read */ - + putreg32(2 << ENET_MMFR_TA_SHIFT | (uint32_t)regaddr << ENET_MMFR_PA_SHIFT | (uint32_t)phyaddr << ENET_MMFR_PA_SHIFT | @@ -1172,7 +1172,7 @@ static int kinetis_readmii(struct kinetis_driver_s *priv, uint8_t phyaddr, /* Check for a timeout */ - if (timeout >= MII_MAXPOLLS) + if (timeout >= MII_MAXPOLLS) { return -ETIMEDOUT; } @@ -1241,7 +1241,7 @@ static inline void kinetis_initphy(struct kinetis_driver_s *priv) phydata = 0; kinetis_readmii(priv, CONFIG_ENET_PHYADDR, PHY_STATUS, &phydata); - /* Set up the transmit and receive contrel registers based on the + /* Set up the transmit and receive contrel registers based on the * configuration and the auto negotiation results. */ @@ -1256,7 +1256,7 @@ static inline void kinetis_initphy(struct kinetis_driver_s *priv) putreg32(rcr, KINETIS_ENET_RCR); putreg32(tcr, KINETIS_ENET_TCR); - + /* Setup half or full duplex */ if ((phydata & PHY_DUPLEX_STATUS) != 0) @@ -1271,7 +1271,7 @@ static inline void kinetis_initphy(struct kinetis_driver_s *priv) rcr |= ENET_RCR_DRT; } - + if ((phydata & PHY_SPEED_STATUS) != 0) { /* 10Mbps */ @@ -1463,7 +1463,7 @@ int kinetis_netinitialize(int intf) kinetis_pinconfig(PIN_RMII0_TXD0); kinetis_pinconfig(PIN_RMII0_TXD1); kinetis_pinconfig(PIN_RMII0_TXEN); -#endif +#endif /* Set interrupt priority levels */ diff --git a/arch/arm/src/lpc2378/lpc23xx_i2c.c b/arch/arm/src/lpc2378/lpc23xx_i2c.c index 7d401a9fd3..33c66a8a21 100644 --- a/arch/arm/src/lpc2378/lpc23xx_i2c.c +++ b/arch/arm/src/lpc2378/lpc23xx_i2c.c @@ -289,11 +289,11 @@ static int i2c_start (struct lpc23xx_i2cdev_s *priv) wd_cancel(priv->timeout); sem_post(&priv->mutex); - if( priv-> state == 0x18 || priv->state == 0x28) + if (priv-> state == 0x18 || priv->state == 0x28) { ret=priv->wrcnt; } - else if( priv-> state == 0x50 || priv->state == 0x58) + else if (priv-> state == 0x50 || priv->state == 0x58) { ret=priv->rdcnt; } @@ -404,7 +404,7 @@ static int i2c_interrupt (int irq, FAR void *context) case 0x28: priv->wrcnt++; - if(priv->wrcntmsg.length) + if (priv->wrcntmsg.length) { putreg32(priv->msg.buffer[priv->wrcnt],priv->base+I2C_DAT_OFFSET); } diff --git a/arch/arm/src/lpc43xx/lpc43_adc.c b/arch/arm/src/lpc43xx/lpc43_adc.c index d9165ba75f..d03abb1621 100644 --- a/arch/arm/src/lpc43xx/lpc43_adc.c +++ b/arch/arm/src/lpc43xx/lpc43_adc.c @@ -165,21 +165,21 @@ static void adc_reset(FAR struct adc_dev_s *dev) clkdiv&=0xff00; putreg32(ADC_CR_PDN|ADC_CR_BURST|clkdiv|priv->mask,LPC43_ADC_CR); - if(priv->mask&0x01) + if (priv->mask&0x01) lpc43_configgpio(GPIO_AD0p0); - else if(priv->mask&0x02) + else if (priv->mask&0x02) lpc43_configgpio(GPIO_AD0p1); - else if(priv->mask&0x04) + else if (priv->mask&0x04) lpc43_configgpio(GPIO_AD0p2); - else if(priv->mask&0x08) + else if (priv->mask&0x08) lpc43_configgpio(GPIO_AD0p3); - else if(priv->mask&0x10) + else if (priv->mask&0x10) lpc43_configgpio(GPIO_AD0p4); - else if(priv->mask&0x20) + else if (priv->mask&0x20) lpc43_configgpio(GPIO_AD0p5); - else if(priv->mask&0x40) + else if (priv->mask&0x40) lpc43_configgpio(GPIO_AD0p6); - else if(priv->mask&0x80) + else if (priv->mask&0x80) lpc43_configgpio(GPIO_AD0p7); irqrestore(flags); diff --git a/arch/arm/src/stm32/stm32_can.c b/arch/arm/src/stm32/stm32_can.c index 809b50ddf7..6c88c6b333 100644 --- a/arch/arm/src/stm32/stm32_can.c +++ b/arch/arm/src/stm32/stm32_can.c @@ -1626,7 +1626,7 @@ FAR struct can_dev_s *stm32_caninitialize(int port) */ #ifdef CONFIG_STM32_CAN1 - if( port == 1 ) + if (port == 1) { /* Select the CAN1 device structure */ @@ -1642,7 +1642,7 @@ FAR struct can_dev_s *stm32_caninitialize(int port) else #endif #ifdef CONFIG_STM32_CAN2 - if ( port ==2 ) + if (port == 2) { /* Select the CAN2 device structure */ diff --git a/arch/sim/src/up_tapdev.c b/arch/sim/src/up_tapdev.c index 197049a34c..253c9744d5 100644 --- a/arch/sim/src/up_tapdev.c +++ b/arch/sim/src/up_tapdev.c @@ -227,7 +227,7 @@ unsigned int tapdev_read(unsigned char *buf, unsigned int buflen) FD_SET(gtapdevfd, &fdset); ret = select(gtapdevfd + 1, &fdset, NULL, NULL, &tv); - if(ret == 0) + if (ret == 0) { return 0; } @@ -250,7 +250,7 @@ void tapdev_send(unsigned char *buf, unsigned int buflen) syslog("tapdev_send: sending %d bytes\n", buflen); gdrop++; - if(gdrop % 8 == 7) + if (gdrop % 8 == 7) { syslog("Dropped a packet!\n"); return; diff --git a/arch/x86/src/qemu/qemu_vga.c b/arch/x86/src/qemu/qemu_vga.c index f7b459bc14..fe34382fb7 100644 --- a/arch/x86/src/qemu/qemu_vga.c +++ b/arch/x86/src/qemu/qemu_vga.c @@ -287,7 +287,7 @@ static int init_graph_vga(int width, int height,int chain4) /* chain4 not available if mode takes over 64k */ - /* if(chain4 && (long)width*(long)height>65536L) return -3; */ + /* if (chain4 && (long)width*(long)height>65536L) return -3; */ /* here goes the actual modeswitch */ @@ -306,7 +306,7 @@ static int init_graph_vga(int width, int height,int chain4) outw(0x0008, 0x3d4); /* vert.panning = 0 */ - if(chain4) + if (chain4) { outw(0x4014, 0x3d4); outw(0xa317, 0x3d4);