From 5d99549aca261d40abf3e0d7180c2bddca3522b3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 12 Apr 2014 13:09:48 -0600 Subject: Make sure that there is one space between while and condition --- apps/examples/cc3000/cc3000basic.c | 2 +- apps/examples/mm/mm_main.c | 2 +- apps/examples/tcpecho/tcpecho_main.c | 2 +- apps/examples/uip/uip_main.c | 7 ++++++- apps/netutils/dnsclient/dns_socket.c | 6 +++--- apps/netutils/ftpc/ftpc_transfer.c | 1 - apps/netutils/uiplib/uiplib.c | 5 +++-- apps/nshlib/nsh_codeccmd.c | 2 +- apps/system/install/install.c | 4 ++-- nuttx/arch/arm/src/common/up_lowputs.c | 2 +- nuttx/arch/arm/src/sama5/sam_nand.c | 2 +- nuttx/arch/arm/src/stm32/stm32_flash.c | 4 ++-- nuttx/arch/arm/src/stm32/stm32_pwr.c | 4 ++-- nuttx/arch/arm/src/stm32/stm32f10xxx_rcc.c | 2 +- nuttx/arch/arm/src/stm32/stm32f30xxx_rcc.c | 2 +- nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c | 4 ++-- nuttx/arch/arm/src/tiva/tiva_flash.c | 2 +- nuttx/arch/avr/src/common/up_lowputs.c | 2 +- nuttx/arch/avr/src/common/up_puts.c | 2 +- nuttx/arch/hc/src/common/up_puts.c | 2 +- nuttx/arch/mips/src/common/up_lowputs.c | 2 +- nuttx/arch/mips/src/common/up_puts.c | 2 +- nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c | 3 ++- nuttx/arch/rgmp/src/rgmp.c | 7 ++++--- nuttx/arch/sh/src/common/up_lowputs.c | 2 +- nuttx/arch/sh/src/common/up_puts.c | 2 +- nuttx/arch/x86/src/common/up_lowputs.c | 2 +- nuttx/arch/x86/src/common/up_puts.c | 2 +- nuttx/configs/compal_e99/src/ssd1783.c | 2 +- nuttx/configs/skp16c26/src/up_lcd.c | 2 +- nuttx/configs/us7032evb1/shterm/shterm.c | 6 +++--- nuttx/configs/vsn/src/sif.c | 7 ++++--- nuttx/configs/vsn/src/spi.c | 8 +++++--- nuttx/drivers/mmcsd/mmcsd_sdio.c | 2 +- nuttx/drivers/mtd/mtd_onfi.c | 2 +- nuttx/drivers/wireless/cc3000/cc3000.c | 4 ++-- nuttx/drivers/wireless/cc3000/cc3000drv.c | 2 +- nuttx/drivers/wireless/cc3000/evnt_handler.c | 4 ++-- nuttx/drivers/wireless/nrf24l01.c | 4 ++-- nuttx/fs/fs_inodereserve.c | 4 ++-- nuttx/include/nuttx/net/uip/uip-tcp.h | 2 +- nuttx/include/nuttx/net/uip/uip.h | 10 +++++----- nuttx/net/uip/uip_chksum.c | 2 +- nuttx/sched/wd_cancel.c | 2 +- 44 files changed, 77 insertions(+), 67 deletions(-) diff --git a/apps/examples/cc3000/cc3000basic.c b/apps/examples/cc3000/cc3000basic.c index 2e5fcd7cf..2530680b6 100644 --- a/apps/examples/cc3000/cc3000basic.c +++ b/apps/examples/cc3000/cc3000basic.c @@ -969,7 +969,7 @@ int c3b_main(int argc, char *argv[]) ch = getchar(); } - while(execute(ch) == 0); + while (execute(ch) == 0); return 0; } diff --git a/apps/examples/mm/mm_main.c b/apps/examples/mm/mm_main.c index 0c8532d70..c15004a34 100644 --- a/apps/examples/mm/mm_main.c +++ b/apps/examples/mm/mm_main.c @@ -47,7 +47,7 @@ #define NTEST_ALLOCS 32 -/* #define STOP_ON_ERRORS do{}while(0) */ +/* #define STOP_ON_ERRORS do {} while (0) */ #define STOP_ON_ERRORS exit(1) /* All other definitions derive from these two */ diff --git a/apps/examples/tcpecho/tcpecho_main.c b/apps/examples/tcpecho/tcpecho_main.c index a8a86a7b2..8b26656f4 100644 --- a/apps/examples/tcpecho/tcpecho_main.c +++ b/apps/examples/tcpecho/tcpecho_main.c @@ -246,7 +246,7 @@ static int tcpecho_server(void) maxi = 0; /* max index into client[] array */ - while(!stop) + while (!stop) { nready = poll(client, maxi+1, TCPECHO_POLLTIMEOUT); diff --git a/apps/examples/uip/uip_main.c b/apps/examples/uip/uip_main.c index 9d2fcf9b2..3dbf0eb82 100644 --- a/apps/examples/uip/uip_main.c +++ b/apps/examples/uip/uip_main.c @@ -174,18 +174,22 @@ int uip_main(int argc, char *argv[]) struct dhcpc_state ds; (void)dhcpc_request(handle, &ds); uip_sethostaddr("eth1", &ds.ipaddr); + if (ds.netmask.s_addr != 0) { uip_setnetmask("eth0", &ds.netmask); } + if (ds.default_router.s_addr != 0) { uip_setdraddr("eth0", &ds.default_router); } + if (ds.dnsaddr.s_addr != 0) { dns_setserver(&ds.dnsaddr); } + dhcpc_close(handle); printf("IP: %s\n", inet_ntoa(ds.ipaddr)); } @@ -198,7 +202,7 @@ int uip_main(int argc, char *argv[]) httpd_listen(); #endif - while(1) + while (1) { sleep(3); printf("uip_main: Still running\n"); @@ -206,5 +210,6 @@ int uip_main(int argc, char *argv[]) fflush(stdout); #endif } + return 0; } diff --git a/apps/netutils/dnsclient/dns_socket.c b/apps/netutils/dnsclient/dns_socket.c index c61032685..002d48674 100644 --- a/apps/netutils/dnsclient/dns_socket.c +++ b/apps/netutils/dnsclient/dns_socket.c @@ -188,13 +188,13 @@ static FAR unsigned char *dns_parse_name(FAR unsigned char *query) { n = *query++; - while(n > 0) + while (n > 0) { ++query; --n; } } - while(*query != 0); + while (*query != 0); return query + 1; } @@ -247,7 +247,7 @@ static int dns_send_query(int sockfd, FAR const char *name, *nptr = n; } - while(*nameptr != 0); + while (*nameptr != 0); memcpy(query, endquery, 5); diff --git a/apps/netutils/ftpc/ftpc_transfer.c b/apps/netutils/ftpc/ftpc_transfer.c index 0eb9130f3..46ec88ec9 100644 --- a/apps/netutils/ftpc/ftpc_transfer.c +++ b/apps/netutils/ftpc/ftpc_transfer.c @@ -426,7 +426,6 @@ int ftpc_xfrabort(FAR struct ftpc_session_s *session, FAR FILE *stream) /* Read remaining bytes from connection */ while (stream && fread(session->buffer, 1, CONFIG_FTP_BUFSIZE, stream) > 0); - while(stream && fread(session->buffer, 1, CONFIG_FTP_BUFSIZE, stream) > 0) /* Get the ABORt reply */ diff --git a/apps/netutils/uiplib/uiplib.c b/apps/netutils/uiplib/uiplib.c index 8106789c7..c8051233e 100644 --- a/apps/netutils/uiplib/uiplib.c +++ b/apps/netutils/uiplib/uiplib.c @@ -92,8 +92,9 @@ bool uiplib_ipaddrconv(const char *addrstr, uint8_t *ipaddr) } ++addrstr; } - while(c != '.' && c != 0); + while (c != '.' && c != 0); } + return true; } @@ -149,7 +150,7 @@ bool uiplib_hwmacconv(const char *hwstr, uint8_t *hw) ++hwstr; } - while(c != ':' && c != 0); + while (c != ':' && c != 0); } return true; diff --git a/apps/nshlib/nsh_codeccmd.c b/apps/nshlib/nsh_codeccmd.c index 8947edd67..3576f8c84 100644 --- a/apps/nshlib/nsh_codeccmd.c +++ b/apps/nshlib/nsh_codeccmd.c @@ -338,7 +338,7 @@ static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv, buff_len = calc_codec_buffsize(src_buff_len+2, mode); buffer = malloc(buff_len); - while(true) + while (true) { memset(src_buffer, 0, src_buff_len+2); ret=read(fd, src_buffer, src_buff_len); diff --git a/apps/system/install/install.c b/apps/system/install/install.c index cc60df7c3..807744a7d 100644 --- a/apps/system/install/install.c +++ b/apps/system/install/install.c @@ -174,7 +174,7 @@ static int install_programflash(int startaddr, const char *source) startaddr += count; totalsize += count; } - while(count); + while (count); } else { @@ -308,7 +308,7 @@ static int install_remove(const char *scriptname) progsize -= up_progmem_pagesize(page); } - while(progsize > 0); + while (progsize > 0); if (status < 0) { diff --git a/nuttx/arch/arm/src/common/up_lowputs.c b/nuttx/arch/arm/src/common/up_lowputs.c index 890167e0e..b3234637f 100644 --- a/nuttx/arch/arm/src/common/up_lowputs.c +++ b/nuttx/arch/arm/src/common/up_lowputs.c @@ -67,7 +67,7 @@ void up_lowputs(const char *str) { - while(*str) + while (*str) { up_lowputc(*str++); } diff --git a/nuttx/arch/arm/src/sama5/sam_nand.c b/nuttx/arch/arm/src/sama5/sam_nand.c index 3f1a041ef..9e4bf0e8b 100644 --- a/nuttx/arch/arm/src/sama5/sam_nand.c +++ b/nuttx/arch/arm/src/sama5/sam_nand.c @@ -1738,7 +1738,7 @@ static int nand_read_pmecc(struct sam_nandcs_s *priv, off_t block, /* Wait until the kernel of the PMECC is not busy */ - while((nand_getreg(SAM_HSMC_PMECCSR) & HSMC_PMECCSR_BUSY) != 0); + while ((nand_getreg(SAM_HSMC_PMECCSR) & HSMC_PMECCSR_BUSY) != 0); return OK; } #endif diff --git a/nuttx/arch/arm/src/stm32/stm32_flash.c b/nuttx/arch/arm/src/stm32/stm32_flash.c index 20b0cfe10..f725fb7f7 100644 --- a/nuttx/arch/arm/src/stm32/stm32_flash.c +++ b/nuttx/arch/arm/src/stm32/stm32_flash.c @@ -148,7 +148,7 @@ int up_progmem_erasepage(uint16_t page) putreg32(page * STM32_FLASH_PAGESIZE, STM32_FLASH_AR); modifyreg32(STM32_FLASH_CR, 0, FLASH_CR_STRT); - while(getreg32(STM32_FLASH_SR) & FLASH_SR_BSY) up_waste(); + while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY) up_waste(); modifyreg32(STM32_FLASH_CR, FLASH_CR_PER, 0); @@ -232,7 +232,7 @@ int up_progmem_write(uint32_t addr, const void *buf, size_t count) putreg16(*hword, addr); - while(getreg32(STM32_FLASH_SR) & FLASH_SR_BSY) up_waste(); + while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY) up_waste(); /* Verify */ diff --git a/nuttx/arch/arm/src/stm32/stm32_pwr.c b/nuttx/arch/arm/src/stm32/stm32_pwr.c index 1c9513541..21a397599 100644 --- a/nuttx/arch/arm/src/stm32/stm32_pwr.c +++ b/nuttx/arch/arm/src/stm32/stm32_pwr.c @@ -129,14 +129,14 @@ void stm32_pwr_setvos(uint16_t vos) * 4. Poll VOSF bit of in PWR_CSR register. Wait until it is reset to 0. */ - while((stm32_pwr_getreg(STM32_PWR_CSR_OFFSET) & PWR_CSR_VOSF) != 0); + while ((stm32_pwr_getreg(STM32_PWR_CSR_OFFSET) & PWR_CSR_VOSF) != 0); regval = stm32_pwr_getreg(STM32_PWR_CR_OFFSET); regval &= ~PWR_CR_VOS_MASK; regval |= (vos & PWR_CR_VOS_MASK); stm32_pwr_putreg(STM32_PWR_CR_OFFSET, regval); - while((stm32_pwr_getreg(STM32_PWR_CSR_OFFSET) & PWR_CSR_VOSF) != 0); + while ((stm32_pwr_getreg(STM32_PWR_CSR_OFFSET) & PWR_CSR_VOSF) != 0); } #endif diff --git a/nuttx/arch/arm/src/stm32/stm32f10xxx_rcc.c b/nuttx/arch/arm/src/stm32/stm32f10xxx_rcc.c index f887f8995..f46f0d104 100644 --- a/nuttx/arch/arm/src/stm32/stm32f10xxx_rcc.c +++ b/nuttx/arch/arm/src/stm32/stm32f10xxx_rcc.c @@ -548,7 +548,7 @@ static void stm32_stdclockconfig(void) /* Wait for PLL2 ready */ - while((getreg32(STM32_RCC_CR) & RCC_CR_PLL2RDY) == 0); + while ((getreg32(STM32_RCC_CR) & RCC_CR_PLL2RDY) == 0); /* Setup PLL3 for MII/RMII clock on MCO */ diff --git a/nuttx/arch/arm/src/stm32/stm32f30xxx_rcc.c b/nuttx/arch/arm/src/stm32/stm32f30xxx_rcc.c index c18f1de3e..1209013d8 100644 --- a/nuttx/arch/arm/src/stm32/stm32f30xxx_rcc.c +++ b/nuttx/arch/arm/src/stm32/stm32f30xxx_rcc.c @@ -457,7 +457,7 @@ static void stm32_stdclockconfig(void) /* Wait for PLL2 ready */ - while((getreg32(STM32_RCC_CR) & RCC_CR_PLL2RDY) == 0); + while ((getreg32(STM32_RCC_CR) & RCC_CR_PLL2RDY) == 0); /* Setup PLL3 for MII/RMII clock on MCO */ diff --git a/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c b/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c index bba3c2142..4c74fa912 100644 --- a/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c +++ b/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c @@ -686,14 +686,14 @@ static void stm32_stdclockconfig(void) regval = getreg32(STM32_PWR_CR); regval |= PWR_CR_ODEN; putreg32(regval, STM32_PWR_CR); - while((getreg32(STM32_PWR_CSR) & PWR_CSR_ODRDY) == 0) + while ((getreg32(STM32_PWR_CSR) & PWR_CSR_ODRDY) == 0) { } regval = getreg32(STM32_PWR_CR); regval |= PWR_CR_ODSWEN; putreg32(regval, STM32_PWR_CR); - while((getreg32(STM32_PWR_CSR) & PWR_CSR_ODSWRDY) == 0) + while ((getreg32(STM32_PWR_CSR) & PWR_CSR_ODSWRDY) == 0) { } diff --git a/nuttx/arch/arm/src/tiva/tiva_flash.c b/nuttx/arch/arm/src/tiva/tiva_flash.c index 154617fd6..fe463222c 100644 --- a/nuttx/arch/arm/src/tiva/tiva_flash.c +++ b/nuttx/arch/arm/src/tiva/tiva_flash.c @@ -217,7 +217,7 @@ static ssize_t tiva_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t n /* wait until write has finished */ - while(getreg32(TIVA_FLASH_FMC) & FLASH_FMC_WRITE); + while (getreg32(TIVA_FLASH_FMC) & FLASH_FMC_WRITE); } return nblocks; diff --git a/nuttx/arch/avr/src/common/up_lowputs.c b/nuttx/arch/avr/src/common/up_lowputs.c index 5e57ac726..de4b4ff16 100644 --- a/nuttx/arch/avr/src/common/up_lowputs.c +++ b/nuttx/arch/avr/src/common/up_lowputs.c @@ -67,7 +67,7 @@ void up_lowputs(const char *str) { - while(*str) + while (*str) { up_lowputc(*str++); } diff --git a/nuttx/arch/avr/src/common/up_puts.c b/nuttx/arch/avr/src/common/up_puts.c index c7cde66a2..e9b4171b9 100644 --- a/nuttx/arch/avr/src/common/up_puts.c +++ b/nuttx/arch/avr/src/common/up_puts.c @@ -68,7 +68,7 @@ void up_puts(const char *str) { - while(*str) + while (*str) { up_putc(*str++); } diff --git a/nuttx/arch/hc/src/common/up_puts.c b/nuttx/arch/hc/src/common/up_puts.c index 68ad38670..5c888ef16 100644 --- a/nuttx/arch/hc/src/common/up_puts.c +++ b/nuttx/arch/hc/src/common/up_puts.c @@ -69,7 +69,7 @@ void up_puts(const char *str) { - while(*str) + while (*str) { up_putc(*str++); } diff --git a/nuttx/arch/mips/src/common/up_lowputs.c b/nuttx/arch/mips/src/common/up_lowputs.c index 314e239b1..396edeb1b 100644 --- a/nuttx/arch/mips/src/common/up_lowputs.c +++ b/nuttx/arch/mips/src/common/up_lowputs.c @@ -67,7 +67,7 @@ void up_lowputs(const char *str) { - while(*str) + while (*str) { up_lowputc(*str++); } diff --git a/nuttx/arch/mips/src/common/up_puts.c b/nuttx/arch/mips/src/common/up_puts.c index 2394343f9..1b9f31f84 100644 --- a/nuttx/arch/mips/src/common/up_puts.c +++ b/nuttx/arch/mips/src/common/up_puts.c @@ -68,7 +68,7 @@ void up_puts(const char *str) { - while(*str) + while (*str) { up_putc(*str++); } diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c b/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c index d6bc6a812..0eb34d0c9 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c @@ -125,11 +125,12 @@ static inline void pic32mx_waitstates(void) residual = BOARD_CPU_CLOCK; nwaits = 0; - while(residual > MAX_FLASH_HZ) + while (residual > MAX_FLASH_HZ) { nwaits++; residual -= MAX_FLASH_HZ; } + DEBUGASSERT(nwaits < 8); /* Set the FLASH wait states -- clearing all other bits! */ diff --git a/nuttx/arch/rgmp/src/rgmp.c b/nuttx/arch/rgmp/src/rgmp.c index db5dd955e..e71782112 100644 --- a/nuttx/arch/rgmp/src/rgmp.c +++ b/nuttx/arch/rgmp/src/rgmp.c @@ -151,9 +151,10 @@ void rtos_stop_running(void) nuttx_arch_exit(); - while(1) { - arch_hlt(); - } + while (1) + { + arch_hlt(); + } } int rtos_vnet_init(struct rgmp_vnet *vnet) diff --git a/nuttx/arch/sh/src/common/up_lowputs.c b/nuttx/arch/sh/src/common/up_lowputs.c index 88cc24068..627b22e0c 100644 --- a/nuttx/arch/sh/src/common/up_lowputs.c +++ b/nuttx/arch/sh/src/common/up_lowputs.c @@ -67,7 +67,7 @@ void up_lowputs(const char *str) { - while(*str) + while (*str) { up_lowputc(*str++); } diff --git a/nuttx/arch/sh/src/common/up_puts.c b/nuttx/arch/sh/src/common/up_puts.c index e17338039..968e216d2 100644 --- a/nuttx/arch/sh/src/common/up_puts.c +++ b/nuttx/arch/sh/src/common/up_puts.c @@ -68,7 +68,7 @@ void up_puts(const char *str) { - while(*str) + while (*str) { up_putc(*str++); } diff --git a/nuttx/arch/x86/src/common/up_lowputs.c b/nuttx/arch/x86/src/common/up_lowputs.c index b6ea96cc2..7a6313526 100644 --- a/nuttx/arch/x86/src/common/up_lowputs.c +++ b/nuttx/arch/x86/src/common/up_lowputs.c @@ -67,7 +67,7 @@ void up_lowputs(const char *str) { - while(*str) + while (*str) { up_lowputc(*str++); } diff --git a/nuttx/arch/x86/src/common/up_puts.c b/nuttx/arch/x86/src/common/up_puts.c index c4df9ad71..047802b6a 100644 --- a/nuttx/arch/x86/src/common/up_puts.c +++ b/nuttx/arch/x86/src/common/up_puts.c @@ -68,7 +68,7 @@ void up_puts(const char *str) { - while(*str) + while (*str) { up_putc(*str++); } diff --git a/nuttx/configs/compal_e99/src/ssd1783.c b/nuttx/configs/compal_e99/src/ssd1783.c index 70155ce24..ac7f8b13c 100644 --- a/nuttx/configs/compal_e99/src/ssd1783.c +++ b/nuttx/configs/compal_e99/src/ssd1783.c @@ -203,7 +203,7 @@ static void fb_ssd1783_send_cmdlist(const struct ssd1783_cmdlist *p) { int i=0; - while(p->is_cmd != END) + while (p->is_cmd != END) { uint16_t sendcmd = p->data; if (p->is_cmd == DATA) diff --git a/nuttx/configs/skp16c26/src/up_lcd.c b/nuttx/configs/skp16c26/src/up_lcd.c index 11b176ee4..440be0d59 100644 --- a/nuttx/configs/skp16c26/src/up_lcd.c +++ b/nuttx/configs/skp16c26/src/up_lcd.c @@ -93,7 +93,7 @@ static uint8_t g_line[LCD_NCHARS]; /* The content of lines 2 */ static void up_lcddelay(uint16_t count) { uint32_t counter = (uint16_t)count << 8; - while(counter--) + while (counter--) { asm("\tnop\n\tnop\n\tnop\n" : :); /* 3 NOPs */ } diff --git a/nuttx/configs/us7032evb1/shterm/shterm.c b/nuttx/configs/us7032evb1/shterm/shterm.c index 9eaa88c34..38840bab6 100644 --- a/nuttx/configs/us7032evb1/shterm/shterm.c +++ b/nuttx/configs/us7032evb1/shterm/shterm.c @@ -357,11 +357,11 @@ static void getfilename(int fd, char *name) { ret = readbyte(fd, &ch); } - while(ch == ' ' && ret == 1); + while (ch == ' ' && ret == 1); /* Concatenate the filename */ - while(ret == 1 && ch > ' ') + while (ret == 1 && ch > ' ') { *name++ = ch; ret = readbyte(fd, &ch); @@ -484,7 +484,7 @@ int main(int argc, char **argv, char **envp) int oflags; int ret; - while((opt = getopt(argc, argv, ":dt:b:hl:")) != -1) + while ((opt = getopt(argc, argv, ":dt:b:hl:")) != -1) { switch(opt) { diff --git a/nuttx/configs/vsn/src/sif.c b/nuttx/configs/vsn/src/sif.c index 6fa0be5a2..971c5ca86 100644 --- a/nuttx/configs/vsn/src/sif.c +++ b/nuttx/configs/vsn/src/sif.c @@ -204,9 +204,10 @@ struct vsn_sif_s vsn_sif; void sif_sem_wait(void) { - while( sem_wait( &vsn_sif.exclusive_access ) != 0 ) { + while (sem_wait( &vsn_sif.exclusive_access ) != 0) + { ASSERT(errno == EINTR); - } + } } @@ -688,7 +689,7 @@ int sif_main(int argc, char *argv[]) cc1101_setchannel(cc, 0); /* AV Test Hex, receive on that channel */ cc1101_receive(cc); /* Enter RX mode */ - while(1) + while (1) { fflush(stdout); sta = cc1101_read(cc, buf, 64); diff --git a/nuttx/configs/vsn/src/spi.c b/nuttx/configs/vsn/src/spi.c index c0363063f..173857948 100644 --- a/nuttx/configs/vsn/src/spi.c +++ b/nuttx/configs/vsn/src/spi.c @@ -157,9 +157,11 @@ void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sele stm32_gpiowrite(GPIO_CC1101_CS, !selected); /* Wait for MISO to go low, indicates that Quart has stabilized */ - if (selected) { - while( stm32_gpioread(GPIO_SPI2_MISO) ) up_waste(); - } + + if (selected) + { + while (stm32_gpioread(GPIO_SPI2_MISO) ) up_waste(); + } } } diff --git a/nuttx/drivers/mmcsd/mmcsd_sdio.c b/nuttx/drivers/mmcsd/mmcsd_sdio.c index b0968cdd7..e4462c749 100644 --- a/nuttx/drivers/mmcsd/mmcsd_sdio.c +++ b/nuttx/drivers/mmcsd/mmcsd_sdio.c @@ -2909,7 +2909,7 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv) elapsed = clock_systimer() - start; } - while( elapsed < TICK_PER_SEC ); /* On successful reception while 'breaks', see above. */ + while (elapsed < TICK_PER_SEC); /* On successful reception while 'breaks', see above. */ /* We get here when the above loop completes, either (1) we could not * communicate properly with the card due to errors (and the loop times diff --git a/nuttx/drivers/mtd/mtd_onfi.c b/nuttx/drivers/mtd/mtd_onfi.c index c5df8c3b6..5f9781b29 100644 --- a/nuttx/drivers/mtd/mtd_onfi.c +++ b/nuttx/drivers/mtd/mtd_onfi.c @@ -111,7 +111,7 @@ #define WRITE_NAND(d,a) \ do { \ *(volatile uint8_t *)((uintptr_t)a) = (uint8_t)d; \ - } while(0) + } while (0) /**************************************************************************** * Private Types diff --git a/nuttx/drivers/wireless/cc3000/cc3000.c b/nuttx/drivers/wireless/cc3000/cc3000.c index 674be5c28..86ac378ab 100644 --- a/nuttx/drivers/wireless/cc3000/cc3000.c +++ b/nuttx/drivers/wireless/cc3000/cc3000.c @@ -626,7 +626,7 @@ static void * cc3000_worker(FAR void *arg) /* We have started release our creator*/ sem_post(&priv->readysem); - while(1) + while (1) { PROBE(0,1); CHECK_GUARD(priv); @@ -741,7 +741,7 @@ static void * cc3000_worker(FAR void *arg) } /* end if */ cc3000_devgive(priv); - } /* while(1) */ + } /* while (1) */ return OK; } diff --git a/nuttx/drivers/wireless/cc3000/cc3000drv.c b/nuttx/drivers/wireless/cc3000/cc3000drv.c index b98dc0261..f0ade37d1 100644 --- a/nuttx/drivers/wireless/cc3000/cc3000drv.c +++ b/nuttx/drivers/wireless/cc3000/cc3000drv.c @@ -209,7 +209,7 @@ static void *unsoliced_thread_func(void *parameter) spiconf.done = sem_open(buff,O_RDONLY); DEBUGASSERT(spiconf.done != (sem_t *)-1); - while(spiconf.run) + while (spiconf.run) { memset(&spiconf.rx_buffer,0,sizeof(spiconf.rx_buffer)); nbytes = mq_receive(spiconf.queue, &spiconf.rx_buffer, diff --git a/nuttx/drivers/wireless/cc3000/evnt_handler.c b/nuttx/drivers/wireless/cc3000/evnt_handler.c index 14f926c46..82c2f85d3 100644 --- a/nuttx/drivers/wireless/cc3000/evnt_handler.c +++ b/nuttx/drivers/wireless/cc3000/evnt_handler.c @@ -938,7 +938,7 @@ void SimpleLinkWaitEvent(uint16_t usOpcode, void *pRetParams) hci_event_handler(pRetParams, 0, 0); } } - while(tSLInformation.usRxEventOpcode != 0); + while (tSLInformation.usRxEventOpcode != 0); nllvdbg("Done for usOpcode 0x%x\n",usOpcode); } @@ -996,7 +996,7 @@ void SimpleLinkWaitData(uint8_t *pBuf, uint8_t *from, uint8_t *fromlen) } } } - while(*tSLInformation.pucReceivedData == HCI_TYPE_EVNT); + while (*tSLInformation.pucReceivedData == HCI_TYPE_EVNT); nllvdbg("Done for Data 0x%x\n",usOpcode); } diff --git a/nuttx/drivers/wireless/nrf24l01.c b/nuttx/drivers/wireless/nrf24l01.c index abb71e725..71c3cb5ab 100644 --- a/nuttx/drivers/wireless/nrf24l01.c +++ b/nuttx/drivers/wireless/nrf24l01.c @@ -82,7 +82,7 @@ #endif #ifdef CONFIG_WL_NRF24L01_CHECK_PARAMS -# define CHECK_ARGS(cond) do { if (!(cond)) return -EINVAL; } while(0) +# define CHECK_ARGS(cond) do { if (!(cond)) return -EINVAL; } while (0) #else # define CHECK_ARGS(cond) #endif @@ -1719,7 +1719,7 @@ ssize_t nrf24l01_recv(struct nrf24l01_dev_s *dev, uint8_t *buffer, static void binarycvt(char *deststr, const uint8_t *srcbin, size_t srclen) { int i = 0; - while(i < srclen) + while (i < srclen) { sprintf(deststr + i*2, "%02x", srcbin[i]); ++i; diff --git a/nuttx/fs/fs_inodereserve.c b/nuttx/fs/fs_inodereserve.c index ad3a8107e..82d3e6f2d 100644 --- a/nuttx/fs/fs_inodereserve.c +++ b/nuttx/fs/fs_inodereserve.c @@ -70,7 +70,7 @@ static int inode_namelen(FAR const char *name) { const char *tmp = name; - while(*tmp && *tmp != '/') tmp++; + while (*tmp && *tmp != '/') tmp++; return tmp - name; } @@ -80,7 +80,7 @@ static int inode_namelen(FAR const char *name) static void inode_namecpy(char *dest, const char *src) { - while(*src && *src != '/') *dest++ = *src++; + while (*src && *src != '/') *dest++ = *src++; *dest='\0'; } diff --git a/nuttx/include/nuttx/net/uip/uip-tcp.h b/nuttx/include/nuttx/net/uip/uip-tcp.h index 001ae088e..fd07e333b 100644 --- a/nuttx/include/nuttx/net/uip/uip-tcp.h +++ b/nuttx/include/nuttx/net/uip/uip-tcp.h @@ -495,7 +495,7 @@ int uip_backlogdelete(FAR struct uip_conn *conn, FAR struct uip_conn *blconn); do { \ (f) |= UIP_NEWDATA; \ (conn)->tcpstateflags &= ~UIP_STOPPED; \ - } while(0) + } while (0) /* Get the current maximum segment size that can be sent on the current * connection. diff --git a/nuttx/include/nuttx/net/uip/uip.h b/nuttx/include/nuttx/net/uip/uip.h index 624bfae4a..c9078fd9e 100644 --- a/nuttx/include/nuttx/net/uip/uip.h +++ b/nuttx/include/nuttx/net/uip/uip.h @@ -411,7 +411,7 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len); do { \ addr = HTONL((uint32_t)(addr0) << 24 | (uint32_t)(addr1) << 16 | \ (uint32_t)(addr2) << 8 | (uint32_t)(addr3)); \ - } while(0) + } while (0) /* Convert an IPv4 address of the form uint16_t[2] to an in_addr_t */ @@ -454,7 +454,7 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len); ((uint16_t*)(addr))[5] = HTONS((addr5)); \ ((uint16_t*)(addr))[6] = HTONS((addr6)); \ ((uint16_t*)(addr))[7] = HTONS((addr7)); \ - } while(0) + } while (0) /* Copy an IP address to another IP address. * @@ -475,12 +475,12 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len); # define uip_ipaddr_copy(dest, src) \ do { \ (dest) = (in_addr_t)(src); \ - } while(0) + } while (0) # define uiphdr_ipaddr_copy(dest, src) \ do { \ ((uint16_t*)(dest))[0] = ((uint16_t*)(src))[0]; \ ((uint16_t*)(dest))[1] = ((uint16_t*)(src))[1]; \ - } while(0) + } while (0) #else /* !CONFIG_NET_IPv6 */ # define uip_ipaddr_copy(dest, src) memcpy(&dest, &src, sizeof(uip_ip6addr_t)) # define uiphdr_ipaddr_copy(dest, src) uip_ipaddr_copy(dest, src) @@ -565,6 +565,6 @@ extern bool uip_ipaddr_maskcmp(uip_ipaddr_t addr1, uip_ipaddr_t addr2, #define uip_ipaddr_mask(dest, src, mask) \ do { \ (in_addr_t)(dest) = (in_addr_t)(src) & (in_addr_t)(mask); \ - } while(0) + } while (0) #endif /* __INCLUDE_NUTTX_NET_UIP_UIP_H */ diff --git a/nuttx/net/uip/uip_chksum.c b/nuttx/net/uip/uip_chksum.c index edea6db65..9f4a89866 100644 --- a/nuttx/net/uip/uip_chksum.c +++ b/nuttx/net/uip/uip_chksum.c @@ -74,7 +74,7 @@ static uint16_t chksum(uint16_t sum, const uint8_t *data, uint16_t len) dataptr = data; last_byte = data + len - 1; - while(dataptr < last_byte) + while (dataptr < last_byte) { /* At least two more bytes */ diff --git a/nuttx/sched/wd_cancel.c b/nuttx/sched/wd_cancel.c index a1c220873..3a6e67eef 100644 --- a/nuttx/sched/wd_cancel.c +++ b/nuttx/sched/wd_cancel.c @@ -113,7 +113,7 @@ int wd_cancel (WDOG_ID wdid) prev = NULL; curr = (wdog_t*)g_wdactivelist.head; - while((curr) && (curr != wdid)) + while ((curr) && (curr != wdid)) { prev = curr; curr = curr->next; -- cgit v1.2.3