diff --git a/arch/arm/src/a1x/a1x_irq.c b/arch/arm/src/a1x/a1x_irq.c index 21c074d83c..800036d369 100644 --- a/arch/arm/src/a1x/a1x_irq.c +++ b/arch/arm/src/a1x/a1x_irq.c @@ -156,7 +156,7 @@ void up_irqinitialize(void) { putreg32(0x00000000, A1X_INTC_EN(i)); /* 0 disables corresponding interrupt */ putreg32(0xffffffff, A1X_INTC_MASK(i)); /* 1 masks corresponding interrupt */ - (void)getreg32(A1X_INTC_IRQ_PEND(i)); /* Reading status clears pending interrupts */ + getreg32(A1X_INTC_IRQ_PEND(i)); /* Reading status clears pending interrupts */ } /* Set the interrupt base address to zero. We do not use the vectored @@ -178,7 +178,7 @@ void up_irqinitialize(void) /* And finally, enable interrupts */ - (void)up_irq_enable(); + up_irq_enable(); #endif a1x_dumpintc("initial", 0); diff --git a/arch/arm/src/a1x/a1x_pio.c b/arch/arm/src/a1x/a1x_pio.c index 5c5ba699d2..1f0585cba1 100644 --- a/arch/arm/src/a1x/a1x_pio.c +++ b/arch/arm/src/a1x/a1x_pio.c @@ -163,7 +163,7 @@ static int a1x_pio_interrupt(int irq, void *context) { /* Yes.. dispatch the interrupt */ - (void)arm_doirq(irq, regs); + arm_doirq(irq, regs); } irq++; diff --git a/arch/arm/src/a1x/a1x_serial.c b/arch/arm/src/a1x/a1x_serial.c index a77786604e..3fc7455366 100644 --- a/arch/arm/src/a1x/a1x_serial.c +++ b/arch/arm/src/a1x/a1x_serial.c @@ -1528,31 +1528,31 @@ void up_earlyserialinit(void) void up_serialinit(void) { #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #endif #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif #ifdef TTYS6_DEV - (void)uart_register("/dev/ttyS6", &TTYS6_DEV); + uart_register("/dev/ttyS6", &TTYS6_DEV); #endif #ifdef TTYS7_DEV - (void)uart_register("/dev/ttyS7", &TTYS7_DEV); + uart_register("/dev/ttyS7", &TTYS7_DEV); #endif } diff --git a/arch/arm/src/a1x/a1x_timerisr.c b/arch/arm/src/a1x/a1x_timerisr.c index 071389eede..0d62644f3e 100644 --- a/arch/arm/src/a1x/a1x_timerisr.c +++ b/arch/arm/src/a1x/a1x_timerisr.c @@ -138,7 +138,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(A1X_IRQ_TIMER0, (xcpt_t)a1x_timerisr, NULL); + irq_attach(A1X_IRQ_TIMER0, (xcpt_t)a1x_timerisr, NULL); /* Enable interrupts from the TIMER 0 port */ diff --git a/arch/arm/src/am335x/am335x_gpioirq.c b/arch/arm/src/am335x/am335x_gpioirq.c index 17f539f906..b241c006c9 100644 --- a/arch/arm/src/am335x/am335x_gpioirq.c +++ b/arch/arm/src/am335x/am335x_gpioirq.c @@ -259,7 +259,7 @@ void am335x_gpio_irqinitialize(void) /* Attach and enable the GPIO0 IRQ */ - (void)irq_attach(AM335X_IRQ_GPIO0A, am335x_gpio0_interrupt, NULL); + irq_attach(AM335X_IRQ_GPIO0A, am335x_gpio0_interrupt, NULL); up_enable_irq(AM335X_IRQ_GPIO0A); #endif @@ -284,7 +284,7 @@ void am335x_gpio_irqinitialize(void) /* Attach and enable the GPIO1 IRQ */ - (void)irq_attach(AM335X_IRQ_GPIO1A, am335x_gpio1_interrupt, NULL); + irq_attach(AM335X_IRQ_GPIO1A, am335x_gpio1_interrupt, NULL); up_enable_irq(AM335X_IRQ_GPIO1A); #endif @@ -309,7 +309,7 @@ void am335x_gpio_irqinitialize(void) /* Attach and enable the GPIO2 IRQ */ - (void)irq_attach(AM335X_IRQ_GPIO2A, am335x_gpio2_interrupt, NULL); + irq_attach(AM335X_IRQ_GPIO2A, am335x_gpio2_interrupt, NULL); up_enable_irq(AM335X_IRQ_GPIO2A); #endif @@ -334,7 +334,7 @@ void am335x_gpio_irqinitialize(void) /* Attach and enable the GPIO3 IRQ */ - (void)irq_attach(AM335X_IRQ_GPIO3A, am335x_gpio3_interrupt, NULL); + irq_attach(AM335X_IRQ_GPIO3A, am335x_gpio3_interrupt, NULL); up_enable_irq(AM335X_IRQ_GPIO3A); #endif } diff --git a/arch/arm/src/am335x/am335x_irq.c b/arch/arm/src/am335x/am335x_irq.c index f80ba48195..d6f20b89a0 100644 --- a/arch/arm/src/am335x/am335x_irq.c +++ b/arch/arm/src/am335x/am335x_irq.c @@ -131,8 +131,8 @@ void up_irqinitialize(void) for (i = 0; i < AM335X_IRQ_NINT; i += 32) { putreg32(0xffffffff, AM335X_INTC_MIR_SET(i)); /* 1 masks corresponding interrupt */ - (void)getreg32(AM335X_INTC_PEND_IRQ(i)); /* Reading status clears pending interrupts */ - (void)getreg32(AM335X_INTC_PEND_FIQ(i)); /* Reading status clears pending interrupts */ + getreg32(AM335X_INTC_PEND_IRQ(i)); /* Reading status clears pending interrupts */ + getreg32(AM335X_INTC_PEND_FIQ(i)); /* Reading status clears pending interrupts */ } /* currents_regs is non-NULL only while processing an interrupt */ @@ -150,7 +150,7 @@ void up_irqinitialize(void) /* And finally, enable interrupts */ - (void)up_irq_enable(); + up_irq_enable(); #endif } diff --git a/arch/arm/src/am335x/am335x_lcdc.c b/arch/arm/src/am335x/am335x_lcdc.c index a6a60f85bf..b3cd35cb4f 100644 --- a/arch/arm/src/am335x/am335x_lcdc.c +++ b/arch/arm/src/am335x/am335x_lcdc.c @@ -585,7 +585,7 @@ int am335x_lcd_initialize(FAR const struct am335x_panel_info_s *panel) /* Initialize the device state singleton */ - sem_init(&priv->exclsem, 0, 1); + nxsem_init(&priv->exclsem, 0, 1); memcpy(&priv->panel, panel, sizeof(struct am335x_panel_info_s)); /* Save framebuffer information */ diff --git a/arch/arm/src/am335x/am335x_serial.c b/arch/arm/src/am335x/am335x_serial.c index 6cc3383084..3260cb7748 100644 --- a/arch/arm/src/am335x/am335x_serial.c +++ b/arch/arm/src/am335x/am335x_serial.c @@ -1347,25 +1347,25 @@ void up_earlyserialinit(void) void up_serialinit(void) { #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #endif #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif } diff --git a/arch/arm/src/am335x/am335x_timerisr.c b/arch/arm/src/am335x/am335x_timerisr.c index 8db26df114..7cddf0eeae 100644 --- a/arch/arm/src/am335x/am335x_timerisr.c +++ b/arch/arm/src/am335x/am335x_timerisr.c @@ -154,7 +154,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(AM335X_IRQ_TIMER1_1MS, (xcpt_t)am335x_timerisr, NULL); + irq_attach(AM335X_IRQ_TIMER1_1MS, (xcpt_t)am335x_timerisr, NULL); /* Clear interrupt status */ @@ -193,7 +193,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(AM335X_IRQ_TIMER2, (xcpt_t)am335x_timerisr, NULL); + irq_attach(AM335X_IRQ_TIMER2, (xcpt_t)am335x_timerisr, NULL); /* Enable overflow interrupt */ diff --git a/arch/arm/src/arm/up_assert.c b/arch/arm/src/arm/up_assert.c index 3dc165b60d..03d12f1124 100644 --- a/arch/arm/src/arm/up_assert.c +++ b/arch/arm/src/arm/up_assert.c @@ -290,7 +290,7 @@ static void up_dumpstate(void) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif } #else @@ -306,13 +306,13 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ if (CURRENT_REGS || running_task()->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (; ; ) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -353,7 +353,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", @@ -367,7 +367,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); diff --git a/arch/arm/src/arm/up_blocktask.c b/arch/arm/src/arm/up_blocktask.c index 3d0664aadb..e309c57bbe 100644 --- a/arch/arm/src/arm/up_blocktask.c +++ b/arch/arm/src/arm/up_blocktask.c @@ -161,7 +161,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Reset scheduler parameters */ diff --git a/arch/arm/src/arm/up_doirq.c b/arch/arm/src/arm/up_doirq.c index d13b04c19f..38512a39d6 100644 --- a/arch/arm/src/arm/up_doirq.c +++ b/arch/arm/src/arm/up_doirq.c @@ -119,7 +119,7 @@ void up_doirq(int irq, uint32_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/arm/src/arm/up_releasepending.c b/arch/arm/src/arm/up_releasepending.c index c0ee7e6e72..9b402a7d70 100644 --- a/arch/arm/src/arm/up_releasepending.c +++ b/arch/arm/src/arm/up_releasepending.c @@ -130,7 +130,7 @@ void up_release_pending(void) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/arm/src/arm/up_reprioritizertr.c b/arch/arm/src/arm/up_reprioritizertr.c index 693db73039..1c577f0c43 100644 --- a/arch/arm/src/arm/up_reprioritizertr.c +++ b/arch/arm/src/arm/up_reprioritizertr.c @@ -183,7 +183,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/arm/src/arm/up_sigdeliver.c b/arch/arm/src/arm/up_sigdeliver.c index 19419e1224..8c3ecbb0ff 100644 --- a/arch/arm/src/arm/up_sigdeliver.c +++ b/arch/arm/src/arm/up_sigdeliver.c @@ -107,7 +107,7 @@ void up_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/arm/src/arm/up_unblocktask.c b/arch/arm/src/arm/up_unblocktask.c index 6203fc94f5..66b1b588d0 100644 --- a/arch/arm/src/arm/up_unblocktask.c +++ b/arch/arm/src/arm/up_unblocktask.c @@ -145,7 +145,7 @@ void up_unblock_task(struct tcb_s *tcb) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/arm/src/armv6-m/up_assert.c b/arch/arm/src/armv6-m/up_assert.c index bbce7dad6d..a33555576b 100644 --- a/arch/arm/src/armv6-m/up_assert.c +++ b/arch/arm/src/armv6-m/up_assert.c @@ -347,7 +347,7 @@ static void up_dumpstate(void) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif } #else @@ -363,13 +363,13 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ if (CURRENT_REGS || running_task()->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (; ; ) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -410,7 +410,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", @@ -424,7 +424,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); diff --git a/arch/arm/src/armv6-m/up_hardfault.c b/arch/arm/src/armv6-m/up_hardfault.c index db092e98bd..ffe7e09a69 100644 --- a/arch/arm/src/armv6-m/up_hardfault.c +++ b/arch/arm/src/armv6-m/up_hardfault.c @@ -134,7 +134,7 @@ int up_hardfault(int irq, FAR void *context, FAR void *arg) getprimask(), getipsr()); #endif - (void)up_irq_save(); + up_irq_save(); hfalert("PANIC!!! Hard fault\n"); PANIC(); return OK; /* Won't get here */ diff --git a/arch/arm/src/armv6-m/up_sigdeliver.c b/arch/arm/src/armv6-m/up_sigdeliver.c index 834c16348c..0194f249e7 100644 --- a/arch/arm/src/armv6-m/up_sigdeliver.c +++ b/arch/arm/src/armv6-m/up_sigdeliver.c @@ -111,7 +111,7 @@ void up_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/arm/src/armv6-m/up_signal_dispatch.c b/arch/arm/src/armv6-m/up_signal_dispatch.c index f69702f953..e010875c03 100644 --- a/arch/arm/src/armv6-m/up_signal_dispatch.c +++ b/arch/arm/src/armv6-m/up_signal_dispatch.c @@ -84,8 +84,8 @@ void up_signal_dispatch(_sa_sigaction_t sighand, int signo, { /* Let sys_call4() do all of the work */ - (void)sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo, - (uintptr_t)info, (uintptr_t)ucontext); + sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo, + (uintptr_t)info, (uintptr_t)ucontext); } #endif /* (CONFIG_BUILD_PROTECTED || CONFIG_BUILD_KERNEL) && !CONFIG_DISABLE_PTHREAD */ diff --git a/arch/arm/src/armv7-a/arm_assert.c b/arch/arm/src/armv7-a/arm_assert.c index ef079dd081..5f8f73344f 100644 --- a/arch/arm/src/armv7-a/arm_assert.c +++ b/arch/arm/src/armv7-a/arm_assert.c @@ -375,7 +375,7 @@ static void up_dumpstate(void) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif } #else @@ -391,7 +391,7 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ @@ -399,14 +399,14 @@ static void _up_assert(int errorcode) { /* Disable interrupts on this CPU */ - (void)up_irq_save(); + up_irq_save(); for (; ; ) { #ifdef CONFIG_SMP /* Try (again) to stop activity on other CPUs */ - (void)spin_trylock(&g_cpu_irqlock); + spin_trylock(&g_cpu_irqlock); #endif #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -449,7 +449,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_SMP #if CONFIG_TASK_NAME_SIZE > 0 @@ -473,7 +473,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); diff --git a/arch/arm/src/armv7-a/arm_blocktask.c b/arch/arm/src/armv7-a/arm_blocktask.c index 97d0ca28c8..ec0339a16c 100644 --- a/arch/arm/src/armv7-a/arm_blocktask.c +++ b/arch/arm/src/armv7-a/arm_blocktask.c @@ -182,7 +182,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Reset scheduler parameters */ diff --git a/arch/arm/src/armv7-a/arm_doirq.c b/arch/arm/src/armv7-a/arm_doirq.c index 689e3fc553..a5cd87d117 100644 --- a/arch/arm/src/armv7-a/arm_doirq.c +++ b/arch/arm/src/armv7-a/arm_doirq.c @@ -118,7 +118,7 @@ static inline uint32_t *_arm_doirq(int irq, uint32_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/arm/src/armv7-a/arm_pgalloc.c b/arch/arm/src/armv7-a/arm_pgalloc.c index 8f94529f45..73de6ebf4f 100644 --- a/arch/arm/src/armv7-a/arm_pgalloc.c +++ b/arch/arm/src/armv7-a/arm_pgalloc.c @@ -163,7 +163,7 @@ static int get_pgtable(FAR group_addrenv_t *addrenv, uintptr_t vaddr) /* And instantiate the modified environment */ - (void)up_addrenv_select(addrenv, NULL); + up_addrenv_select(addrenv, NULL); } } diff --git a/arch/arm/src/armv7-a/arm_releasepending.c b/arch/arm/src/armv7-a/arm_releasepending.c index b4a811f7d2..6a3638a099 100644 --- a/arch/arm/src/armv7-a/arm_releasepending.c +++ b/arch/arm/src/armv7-a/arm_releasepending.c @@ -150,7 +150,7 @@ void up_release_pending(void) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/arm/src/armv7-a/arm_reprioritizertr.c b/arch/arm/src/armv7-a/arm_reprioritizertr.c index 07582c0925..2a2b83768e 100644 --- a/arch/arm/src/armv7-a/arm_reprioritizertr.c +++ b/arch/arm/src/armv7-a/arm_reprioritizertr.c @@ -204,7 +204,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/arm/src/armv7-a/arm_sigdeliver.c b/arch/arm/src/armv7-a/arm_sigdeliver.c index 8ee5f4f1f5..dff2f7f948 100644 --- a/arch/arm/src/armv7-a/arm_sigdeliver.c +++ b/arch/arm/src/armv7-a/arm_sigdeliver.c @@ -152,9 +152,9 @@ void up_sigdeliver(void) */ #ifdef CONFIG_SMP - (void)enter_critical_section(); + enter_critical_section(); #else - (void)up_irq_save(); + up_irq_save(); #endif /* Restore the saved errno value */ @@ -187,7 +187,7 @@ void up_sigdeliver(void) DEBUGASSERT(rtcb->irqcount == 1); while (rtcb->irqcount < saved_irqcount) { - (void)enter_critical_section(); + enter_critical_section(); } #endif diff --git a/arch/arm/src/armv7-a/arm_signal_dispatch.c b/arch/arm/src/armv7-a/arm_signal_dispatch.c index ec1eb56485..deff3c4007 100644 --- a/arch/arm/src/armv7-a/arm_signal_dispatch.c +++ b/arch/arm/src/armv7-a/arm_signal_dispatch.c @@ -93,8 +93,8 @@ void up_signal_dispatch(_sa_sigaction_t sighand, int signo, { /* Yes.. Let sys_call4() do all of the work to get us into user space */ - (void)sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo, - (uintptr_t)info, (uintptr_t)ucontext); + sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo, + (uintptr_t)info, (uintptr_t)ucontext); } else { diff --git a/arch/arm/src/armv7-a/arm_unblocktask.c b/arch/arm/src/armv7-a/arm_unblocktask.c index f932989061..c2133aa38a 100644 --- a/arch/arm/src/armv7-a/arm_unblocktask.c +++ b/arch/arm/src/armv7-a/arm_unblocktask.c @@ -166,7 +166,7 @@ void up_unblock_task(struct tcb_s *tcb) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/arm/src/armv7-m/up_assert.c b/arch/arm/src/armv7-m/up_assert.c index 573ea3b19f..ee2a96ba9a 100644 --- a/arch/arm/src/armv7-m/up_assert.c +++ b/arch/arm/src/armv7-m/up_assert.c @@ -369,7 +369,7 @@ static void up_dumpstate(void) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif } #else @@ -385,19 +385,19 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ if (CURRENT_REGS || (running_task())->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (; ; ) { #ifdef CONFIG_SMP /* Try (again) to stop activity on other CPUs */ - (void)spin_trylock(&g_cpu_irqlock); + spin_trylock(&g_cpu_irqlock); #endif #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -438,7 +438,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_SMP #if CONFIG_TASK_NAME_SIZE > 0 @@ -462,7 +462,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); diff --git a/arch/arm/src/armv7-m/up_hardfault.c b/arch/arm/src/armv7-m/up_hardfault.c index e50f916f4f..af6209fd65 100644 --- a/arch/arm/src/armv7-m/up_hardfault.c +++ b/arch/arm/src/armv7-m/up_hardfault.c @@ -143,7 +143,7 @@ int up_hardfault(int irq, FAR void *context, FAR void *arg) getreg32(NVIC_DFAULTS), getreg32(NVIC_BFAULT_ADDR), getreg32(NVIC_AFAULTS)); - (void)up_irq_save(); + up_irq_save(); _alert("PANIC!!! Hard fault: %08x\n", getreg32(NVIC_HFAULTS)); PANIC(); return OK; diff --git a/arch/arm/src/armv7-m/up_itm_syslog.c b/arch/arm/src/armv7-m/up_itm_syslog.c index dc1258ba60..6d81d1927e 100644 --- a/arch/arm/src/armv7-m/up_itm_syslog.c +++ b/arch/arm/src/armv7-m/up_itm_syslog.c @@ -186,7 +186,7 @@ void itm_syslog_initialize(void) /* Setup the SYSLOG channel */ - (void)syslog_channel(&g_itm_channel); + syslog_channel(&g_itm_channel); } #endif /* CONFIG_ARMV7M_ITMSYSLOG */ diff --git a/arch/arm/src/armv7-m/up_memfault.c b/arch/arm/src/armv7-m/up_memfault.c index 702ebda204..928922f272 100644 --- a/arch/arm/src/armv7-m/up_memfault.c +++ b/arch/arm/src/armv7-m/up_memfault.c @@ -79,7 +79,7 @@ int up_memfault(int irq, FAR void *context, FAR void *arg) { /* Dump some memory management fault info */ - (void)up_irq_save(); + up_irq_save(); _alert("PANIC!!! Memory Management Fault:\n"); mfinfo(" IRQ: %d context: %p\n", irq, context); _alert(" CFAULTS: %08x MMFAR: %08x\n", diff --git a/arch/arm/src/armv7-m/up_sigdeliver.c b/arch/arm/src/armv7-m/up_sigdeliver.c index 3ed0bbd85f..30c1c4cecf 100644 --- a/arch/arm/src/armv7-m/up_sigdeliver.c +++ b/arch/arm/src/armv7-m/up_sigdeliver.c @@ -156,9 +156,9 @@ void up_sigdeliver(void) */ #ifdef CONFIG_SMP - (void)enter_critical_section(); + enter_critical_section(); #else - (void)up_irq_save(); + up_irq_save(); #endif /* Restore the saved errno value */ @@ -199,7 +199,7 @@ void up_sigdeliver(void) DEBUGASSERT(rtcb->irqcount == 1); while (rtcb->irqcount < saved_irqcount) { - (void)enter_critical_section(); + enter_critical_section(); } #endif diff --git a/arch/arm/src/armv7-m/up_signal_dispatch.c b/arch/arm/src/armv7-m/up_signal_dispatch.c index 54bc8e5cd5..77f3303f50 100644 --- a/arch/arm/src/armv7-m/up_signal_dispatch.c +++ b/arch/arm/src/armv7-m/up_signal_dispatch.c @@ -84,8 +84,8 @@ void up_signal_dispatch(_sa_sigaction_t sighand, int signo, { /* Let sys_call4() do all of the work */ - (void)sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo, - (uintptr_t)info, (uintptr_t)ucontext); + sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo, + (uintptr_t)info, (uintptr_t)ucontext); } #endif /* (CONFIG_BUILD_PROTECTED || CONFIG_BUILD_KERNEL) && !CONFIG_DISABLE_PTHREAD */ diff --git a/arch/arm/src/armv7-r/arm_assert.c b/arch/arm/src/armv7-r/arm_assert.c index 843f362ca5..7dbb045c84 100644 --- a/arch/arm/src/armv7-r/arm_assert.c +++ b/arch/arm/src/armv7-r/arm_assert.c @@ -354,7 +354,7 @@ static void up_dumpstate(void) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif } #else @@ -370,13 +370,13 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ if (CURRENT_REGS || (running_task())->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (; ; ) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -417,7 +417,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", @@ -431,7 +431,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); diff --git a/arch/arm/src/armv7-r/arm_sigdeliver.c b/arch/arm/src/armv7-r/arm_sigdeliver.c index e6002fe116..9b97901811 100644 --- a/arch/arm/src/armv7-r/arm_sigdeliver.c +++ b/arch/arm/src/armv7-r/arm_sigdeliver.c @@ -106,7 +106,7 @@ void up_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/arm/src/armv7-r/arm_signal_dispatch.c b/arch/arm/src/armv7-r/arm_signal_dispatch.c index 2b4ed03869..4f24c8a6e9 100644 --- a/arch/arm/src/armv7-r/arm_signal_dispatch.c +++ b/arch/arm/src/armv7-r/arm_signal_dispatch.c @@ -93,8 +93,8 @@ void up_signal_dispatch(_sa_sigaction_t sighand, int signo, { /* Yes.. Let sys_call4() do all of the work to get us into user space */ - (void)sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo, - (uintptr_t)info, (uintptr_t)ucontext); + sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo, + (uintptr_t)info, (uintptr_t)ucontext); } else { diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c index d7d686866e..73ccaa6735 100644 --- a/arch/arm/src/c5471/c5471_ethernet.c +++ b/arch/arm/src/c5471/c5471_ethernet.c @@ -989,8 +989,8 @@ static int c5471_transmit(struct c5471_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->c_txtimeout, C5471_TXTIMEOUT, - c5471_txtimeout_expiry, 1, (wdparm_t)priv); + wd_start(priv->c_txtimeout, C5471_TXTIMEOUT, + c5471_txtimeout_expiry, 1, (wdparm_t)priv); return OK; } @@ -1539,7 +1539,7 @@ static void c5471_txdone(struct c5471_driver_s *priv) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->c_dev, c5471_txpoll); + devif_poll(&priv->c_dev, c5471_txpoll); } /**************************************************************************** @@ -1707,7 +1707,7 @@ static void c5471_txtimeout_work(FAR void *arg) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->c_dev, c5471_txpoll); + devif_poll(&priv->c_dev, c5471_txpoll); net_unlock(); } @@ -1778,13 +1778,13 @@ static void c5471_poll_work(FAR void *arg) { /* If so, update TCP timing states and poll the network for new XMIT data */ - (void)devif_timer(&priv->c_dev, C5471_WDDELAY, c5471_txpoll); + devif_timer(&priv->c_dev, C5471_WDDELAY, c5471_txpoll); } /* Setup the watchdog poll timer again */ - (void)wd_start(priv->c_txpoll, C5471_WDDELAY, c5471_poll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->c_txpoll, C5471_WDDELAY, c5471_poll_expiry, 1, + (wdparm_t)priv); net_unlock(); } @@ -1870,8 +1870,8 @@ static int c5471_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->c_txpoll, C5471_WDDELAY, c5471_poll_expiry, - 1, (wdparm_t)priv); + wd_start(priv->c_txpoll, C5471_WDDELAY, c5471_poll_expiry, + 1, (wdparm_t)priv); /* Enable the Ethernet interrupt */ @@ -1969,7 +1969,7 @@ static void c5471_txavail_work(FAR void *arg) { /* If so, then poll the network for new XMIT data */ - (void)devif_poll(&priv->c_dev, c5471_txpoll); + devif_poll(&priv->c_dev, c5471_txpoll); } } @@ -2458,7 +2458,7 @@ void up_netinitialize(void) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&g_c5471[0].c_dev, NET_LL_ETHERNET); + netdev_register(&g_c5471[0].c_dev, NET_LL_ETHERNET); } #endif /* CONFIG_NET */ diff --git a/arch/arm/src/c5471/c5471_serial.c b/arch/arm/src/c5471/c5471_serial.c index 76baa882f2..66ce7b7efb 100644 --- a/arch/arm/src/c5471/c5471_serial.c +++ b/arch/arm/src/c5471/c5471_serial.c @@ -823,9 +823,9 @@ void up_earlyserialinit(void) void up_serialinit(void) { - (void)uart_register("/dev/console", &CONSOLE_DEV); - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); } /**************************************************************************** diff --git a/arch/arm/src/common/up_exit.c b/arch/arm/src/common/up_exit.c index a9d288860b..0e7be57832 100644 --- a/arch/arm/src/common/up_exit.c +++ b/arch/arm/src/common/up_exit.c @@ -148,7 +148,7 @@ void _exit(int status) * The IRQ state will be restored when the next task is started. */ - (void)enter_critical_section(); + enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); @@ -163,7 +163,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. @@ -178,7 +178,7 @@ void _exit(int status) * the ready-to-run list. */ - (void)group_addrenv(tcb); + group_addrenv(tcb); #endif /* Reset scheduler parameters */ diff --git a/arch/arm/src/common/up_initialize.c b/arch/arm/src/common/up_initialize.c index 7d354d1c1e..14a287a5ed 100644 --- a/arch/arm/src/common/up_initialize.c +++ b/arch/arm/src/common/up_initialize.c @@ -221,7 +221,7 @@ void up_initialize(void) #ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ - (void)ptmx_register(); + ptmx_register(); #endif /* Early initialization of the system logging device. Some SYSLOG channel @@ -250,19 +250,19 @@ void up_initialize(void) #ifdef CONFIG_NETDEV_LOOPBACK /* Initialize the local loopback device */ - (void)localhost_initialize(); + localhost_initialize(); #endif #ifdef CONFIG_NET_TUN /* Initialize the TUN device */ - (void)tun_initialize(); + tun_initialize(); #endif #ifdef CONFIG_NETDEV_TELNET /* Initialize the Telnet session factory */ - (void)telnet_initialize(); + telnet_initialize(); #endif #if defined(CONFIG_USBDEV) || defined(CONFIG_USBHOST) diff --git a/arch/arm/src/common/up_lwl_console.c b/arch/arm/src/common/up_lwl_console.c index a915a3879f..609f458212 100644 --- a/arch/arm/src/common/up_lwl_console.c +++ b/arch/arm/src/common/up_lwl_console.c @@ -323,5 +323,5 @@ static ssize_t lwlconsole_write(struct file *filep, const char *buffer, void lwlconsole_init(void) { g_d.upword = 0; - (void)register_driver("/dev/console", &g_consoleops, 0666, NULL); + register_driver("/dev/console", &g_consoleops, 0666, NULL); } diff --git a/arch/arm/src/cxd56xx/cxd56_adc.c b/arch/arm/src/cxd56xx/cxd56_adc.c index 85cff79df7..418a2a1937 100644 --- a/arch/arm/src/cxd56xx/cxd56_adc.c +++ b/arch/arm/src/cxd56xx/cxd56_adc.c @@ -585,7 +585,7 @@ static int adc_stop(adc_ch_t ch, FAR struct seq_s *seq) return OK; } - (void) seq_ioctl(seq, 0, SCUIOC_STOP, 0); + seq_ioctl(seq, 0, SCUIOC_STOP, 0); if (ch <= CH3) { @@ -1006,11 +1006,7 @@ void cxd56_adc_getinterval(int adctype, uint32_t *interval, uint16_t *adjust) int cxd56_adcinitialize(void) { - int ret; - - /* Avoid warnings when no ADC options enabled */ - - (void) ret; + int ret = OK; #if defined (CONFIG_CXD56_LPADC0) || defined (CONFIG_CXD56_LPADC0_1) || defined (CONFIG_CXD56_LPADC_ALL) ret = register_driver("/dev/lpadc0", &g_adcops, 0666, &g_lpadc0priv); @@ -1061,5 +1057,5 @@ int cxd56_adcinitialize(void) } #endif - return OK; + return ret; } diff --git a/arch/arm/src/cxd56xx/cxd56_charger.c b/arch/arm/src/cxd56xx/cxd56_charger.c index 3a53cef845..6163411cf5 100644 --- a/arch/arm/src/cxd56xx/cxd56_charger.c +++ b/arch/arm/src/cxd56xx/cxd56_charger.c @@ -477,7 +477,7 @@ static int charger_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR struct charger_dev_s *priv = inode->i_private; int ret = -ENOTTY; - sem_wait(&priv->batsem); + nxsem_wait(&priv->batsem); switch (cmd) { @@ -621,7 +621,7 @@ static int charger_ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; } - sem_post(&priv->batsem); + nxsem_post(&priv->batsem); return ret; } @@ -650,7 +650,7 @@ int cxd56_charger_initialize(FAR const char *devpath) /* Initialize the CXD5247 device structure */ - sem_init(&priv->batsem, 0, 1); + nxsem_init(&priv->batsem, 0, 1); /* Register battery driver */ @@ -680,8 +680,7 @@ int cxd56_charger_initialize(FAR const char *devpath) int cxd56_charger_uninitialize(FAR const char *devpath) { - (void) unregister_driver(devpath); - + unregister_driver(devpath); return OK; } diff --git a/arch/arm/src/cxd56xx/cxd56_clock.c b/arch/arm/src/cxd56xx/cxd56_clock.c index 796f6fcd92..b88f99503d 100644 --- a/arch/arm/src/cxd56xx/cxd56_clock.c +++ b/arch/arm/src/cxd56xx/cxd56_clock.c @@ -235,7 +235,7 @@ static void clock_semtake(sem_t *id) { if (!up_interrupt_context()) { - sem_wait(id); + nxsem_wait(id); } } @@ -243,7 +243,7 @@ static void clock_semgive(sem_t *id) { if (!up_interrupt_context()) { - sem_post(id); + nxsem_post(id); } } diff --git a/arch/arm/src/cxd56xx/cxd56_cpuidlestack.c b/arch/arm/src/cxd56xx/cxd56_cpuidlestack.c index b081e56dd8..2f8f7511d2 100644 --- a/arch/arm/src/cxd56xx/cxd56_cpuidlestack.c +++ b/arch/arm/src/cxd56xx/cxd56_cpuidlestack.c @@ -98,7 +98,7 @@ int up_cpu_idlestack(int cpu, FAR struct tcb_s *tcb, size_t stack_size) { #if CONFIG_SMP_NCPUS > 1 - (void)up_create_stack(tcb, stack_size, TCB_FLAG_TTYPE_KERNEL); + up_create_stack(tcb, stack_size, TCB_FLAG_TTYPE_KERNEL); #endif return OK; } diff --git a/arch/arm/src/cxd56xx/cxd56_cpustart.c b/arch/arm/src/cxd56xx/cxd56_cpustart.c index f1b48cf427..ed27019e1b 100644 --- a/arch/arm/src/cxd56xx/cxd56_cpustart.c +++ b/arch/arm/src/cxd56xx/cxd56_cpustart.c @@ -137,7 +137,7 @@ static void appdsp_boot(void) /* Then transfer control to the IDLE task */ - (void)nx_idle_task(0, NULL); + nx_idle_task(0, NULL); } /**************************************************************************** diff --git a/arch/arm/src/cxd56xx/cxd56_dmac.c b/arch/arm/src/cxd56xx/cxd56_dmac.c index 5f1126a7fe..b40d35defe 100644 --- a/arch/arm/src/cxd56xx/cxd56_dmac.c +++ b/arch/arm/src/cxd56xx/cxd56_dmac.c @@ -677,7 +677,7 @@ void weak_function up_dma_initialize(void) g_dmach[i].chan = i; } - sem_init(&g_dmaexc, 0, 1); + nxsem_init(&g_dmaexc, 0, 1); } /**************************************************************************** @@ -711,7 +711,7 @@ DMA_HANDLE cxd56_dmachannel(int ch, ssize_t maxsize) /* Get exclusive access to allocate channel */ - sem_wait(&g_dmaexc); + nxsem_wait(&g_dmaexc); if (ch < 0 || ch >= NCHANNELS) { @@ -754,12 +754,12 @@ DMA_HANDLE cxd56_dmachannel(int ch, ssize_t maxsize) dmach->inuse = true; - sem_post(&g_dmaexc); + nxsem_post(&g_dmaexc); return (DMA_HANDLE)dmach; err: - sem_post(&g_dmaexc); + nxsem_post(&g_dmaexc); return NULL; } @@ -793,7 +793,7 @@ void cxd56_dmafree(DMA_HANDLE handle) return; } - sem_wait(&g_dmaexc); + nxsem_wait(&g_dmaexc); if (!dmach->inuse) { @@ -811,7 +811,7 @@ void cxd56_dmafree(DMA_HANDLE handle) dmach->inuse = false; err: - sem_post(&g_dmaexc); + nxsem_post(&g_dmaexc); } /**************************************************************************** diff --git a/arch/arm/src/cxd56xx/cxd56_emmc.c b/arch/arm/src/cxd56xx/cxd56_emmc.c index 22db97918c..494649c283 100644 --- a/arch/arm/src/cxd56xx/cxd56_emmc.c +++ b/arch/arm/src/cxd56xx/cxd56_emmc.c @@ -132,15 +132,12 @@ struct cxd56_emmc_state_s g_emmcdev; static void emmc_takesem(FAR sem_t *sem) { - while (sem_wait(sem) != 0) - { - ASSERT(errno == EINTR); - } + nxsem_wait_uninterruptible(sem); } static void emmc_givesem(FAR sem_t *sem) { - sem_post(sem); + nxsem_post(sem); } static void emmc_cmdstarted(void) @@ -908,8 +905,8 @@ int cxd56_emmcinitialize(void) priv = &g_emmcdev; memset(priv, 0, sizeof(struct cxd56_emmc_state_s)); - sem_init(&priv->excsem, 0, 1); - sem_init(&g_waitsem, 0, 0); + nxsem_init(&priv->excsem, 0, 1); + nxsem_init(&g_waitsem, 0, 0); ret = emmc_hwinitialize(); if (ret != OK) diff --git a/arch/arm/src/cxd56xx/cxd56_farapi.c b/arch/arm/src/cxd56xx/cxd56_farapi.c index db0cd8a7fd..f9b2d344fd 100644 --- a/arch/arm/src/cxd56xx/cxd56_farapi.c +++ b/arch/arm/src/cxd56xx/cxd56_farapi.c @@ -139,11 +139,7 @@ static struct pm_cpu_wakelock_s g_wlock = { static int farapi_semtake(sem_t *id) { - while (sem_wait(id) != 0) - { - ASSERT(errno == EINTR); - } - return OK; + return nxsem_wait_uninterruptible(id); } #ifdef CONFIG_CXD56_FARAPI_DEBUG @@ -188,7 +184,7 @@ static int cxd56_farapidonehandler(int cpuid, int protoid, /* Send event flag response */ cxd56_sendmsg(cpuid, CXD56_PROTO_FLG, 5, pdata & 0xff00, 0); - sem_post(&g_farwait); + nxsem_post(&g_farwait); } return OK; @@ -258,7 +254,7 @@ void farapi_main(int id, void *arg, struct modulelist_s *mlist) dump_farapi_message(&msg); err: - sem_post(&g_farlock); + nxsem_post(&g_farlock); } void cxd56_farapiinitialize(void) @@ -274,8 +270,8 @@ void cxd56_farapiinitialize(void) # endif } #endif - sem_init(&g_farlock, 0, 1); - sem_init(&g_farwait, 0, 0); + nxsem_init(&g_farlock, 0, 1); + nxsem_init(&g_farwait, 0, 0); cxd56_iccinit(CXD56_PROTO_MBX); cxd56_iccinit(CXD56_PROTO_FLG); diff --git a/arch/arm/src/cxd56xx/cxd56_gauge.c b/arch/arm/src/cxd56xx/cxd56_gauge.c index 6ddda2bc24..91ba738917 100644 --- a/arch/arm/src/cxd56xx/cxd56_gauge.c +++ b/arch/arm/src/cxd56xx/cxd56_gauge.c @@ -334,7 +334,7 @@ static int gauge_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR struct bat_gauge_dev_s *priv = inode->i_private; int ret = -ENOTTY; - sem_wait(&priv->batsem); + nxsem_wait(&priv->batsem); switch (cmd) { @@ -372,7 +372,7 @@ static int gauge_ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; } - sem_post(&priv->batsem); + nxsem_post(&priv->batsem); return ret; } @@ -402,7 +402,7 @@ int cxd56_gauge_initialize(FAR const char *devpath) /* Initialize the CXD5247 device structure */ - sem_init(&priv->batsem, 0, 1); + nxsem_init(&priv->batsem, 0, 1); /* Register battery driver */ @@ -432,8 +432,7 @@ int cxd56_gauge_initialize(FAR const char *devpath) int cxd56_gauge_uninitialize(FAR const char *devpath) { - (void) unregister_driver(devpath); - + unregister_driver(devpath); return OK; } diff --git a/arch/arm/src/cxd56xx/cxd56_ge2d.c b/arch/arm/src/cxd56xx/cxd56_ge2d.c index 86ae1cc19c..b5e6e7f349 100644 --- a/arch/arm/src/cxd56xx/cxd56_ge2d.c +++ b/arch/arm/src/cxd56xx/cxd56_ge2d.c @@ -98,11 +98,7 @@ static sem_t g_lock; static int ge2d_semtake(sem_t *id) { - while (sem_wait(id) != 0) - { - ASSERT(errno == EINTR); - } - return OK; + return nxsem_wait_uninterruptible(id); } /**************************************************************************** @@ -111,7 +107,7 @@ static int ge2d_semtake(sem_t *id) static void ge2d_semgive(sem_t *id) { - sem_post(id); + nxsem_post(id); } /**************************************************************************** @@ -243,9 +239,9 @@ int cxd56_ge2dinitialize(FAR const char *devname) { int ret; - sem_init(&g_lock, 0, 1); - sem_init(&g_wait, 0, 0); - sem_setprotocol(&g_wait, SEM_PRIO_NONE); + nxsem_init(&g_lock, 0, 1); + nxsem_init(&g_wait, 0, 0); + nxsem_setprotocol(&g_wait, SEM_PRIO_NONE); ret = register_driver(devname, &g_ge2dfops, 0666, NULL); if (ret != 0) @@ -276,8 +272,8 @@ void cxd56_ge2duninitialize(FAR const char *devname) cxd56_img_ge2d_clock_disable(); - sem_destroy(&g_lock); - sem_destroy(&g_wait); + nxsem_destroy(&g_lock); + nxsem_destroy(&g_wait); unregister_driver(devname); } diff --git a/arch/arm/src/cxd56xx/cxd56_geofence.c b/arch/arm/src/cxd56xx/cxd56_geofence.c index 8454bf02f9..f41a107c5b 100644 --- a/arch/arm/src/cxd56xx/cxd56_geofence.c +++ b/arch/arm/src/cxd56xx/cxd56_geofence.c @@ -445,7 +445,7 @@ static void cxd56_geofence_sighandler(uint32_t data, FAR void *userdata) int i; int ret; - ret = sem_wait(&priv->devsem); + ret = nxsem_wait(&priv->devsem); if (ret < 0) { return; @@ -458,11 +458,11 @@ static void cxd56_geofence_sighandler(uint32_t data, FAR void *userdata) { fds->revents |= POLLIN; gnssinfo("Report events: %02x\n", fds->revents); - sem_post(fds->sem); + nxsem_post(fds->sem); } } - sem_post(&priv->devsem); + nxsem_post(&priv->devsem); } /**************************************************************************** @@ -624,7 +624,7 @@ static int cxd56_geofence_poll(FAR struct file *filep, FAR struct pollfd *fds, inode = filep->f_inode; priv = (FAR struct cxd56_geofence_dev_s *)inode->i_private; - ret = sem_wait(&priv->devsem); + ret = nxsem_wait(&priv->devsem); if (ret < 0) { return ret; @@ -675,7 +675,7 @@ static int cxd56_geofence_poll(FAR struct file *filep, FAR struct pollfd *fds, } errout: - sem_post(&priv->devsem); + nxsem_post(&priv->devsem); return ret; } #endif @@ -708,7 +708,7 @@ static int cxd56_geofence_register(FAR const char *devpath) } memset(priv, 0, sizeof(struct cxd56_geofence_dev_s)); - sem_init(&priv->devsem, 0, 1); + nxsem_init(&priv->devsem, 0, 1); ret = cxd56_geofence_initialize(priv); if (ret < 0) diff --git a/arch/arm/src/cxd56xx/cxd56_gnss.c b/arch/arm/src/cxd56xx/cxd56_gnss.c index dba45bcb4f..c16aef7c4f 100644 --- a/arch/arm/src/cxd56xx/cxd56_gnss.c +++ b/arch/arm/src/cxd56xx/cxd56_gnss.c @@ -1443,7 +1443,7 @@ static int cxd56_gnss_set_signal(FAR struct file *filep, unsigned long arg) inode = filep->f_inode; priv = (FAR struct cxd56_gnss_dev_s *)inode->i_private; - ret = sem_wait(&priv->devsem); + ret = nxsem_wait(&priv->devsem); if (ret < 0) { return ret; @@ -1491,7 +1491,7 @@ static int cxd56_gnss_set_signal(FAR struct file *filep, unsigned long arg) _success: _err: - sem_post(&priv->devsem); + nxsem_post(&priv->devsem); #endif /* if !defined(CONFIG_DISABLE_SIGNAL) && \ (CONFIG_CXD56_GNSS_NSIGNALRECEIVERS != 0) */ return ret; @@ -1949,7 +1949,7 @@ static int cxd56_gnss_wait_notify(FAR sem_t *sem, time_t waitsec) timeout.tv_sec += waitsec; /* seconds timeout for wait */ - return sem_timedwait(sem, &timeout); + return nxsem_timedwait(sem, &timeout); } /**************************************************************************** @@ -2110,7 +2110,7 @@ static void cxd56_gnss_common_signalhandler(uint32_t data, FAR void *userdata) int i; int ret; - ret = sem_wait(&priv->devsem); + ret = nxsem_wait(&priv->devsem); if (ret < 0) { return; @@ -2124,9 +2124,9 @@ static void cxd56_gnss_common_signalhandler(uint32_t data, FAR void *userdata) #ifdef CONFIG_CAN_PASS_STRUCTS union sigval value; value.sival_ptr = &sig->info; - (void)sigqueue(sig->pid, sig->info.signo, value); + sigqueue(sig->pid, sig->info.signo, value); #else - (void)sigqueue(sig->pid, sig->info.signo, &sig->info); + sigqueue(sig->pid, sig->info.signo, &sig->info); #endif issetmask = 1; } @@ -2137,7 +2137,7 @@ static void cxd56_gnss_common_signalhandler(uint32_t data, FAR void *userdata) GD_SetNotifyMask(sigtype, FALSE); } - sem_post(&priv->devsem); + nxsem_post(&priv->devsem); } #endif /* if !defined(CONFIG_DISABLE_SIGNAL) && \ @@ -2192,7 +2192,7 @@ static void cxd56_gnss_default_sighandler(uint32_t data, FAR void *userdata) */ priv->notify_data = dtype; - sem_post(&priv->syncsem); + nxsem_post(&priv->syncsem); } return; @@ -2220,7 +2220,7 @@ static void cxd56_gnss_default_sighandler(uint32_t data, FAR void *userdata) break; } - ret = sem_wait(&priv->devsem); + ret = nxsem_wait(&priv->devsem); if (ret < 0) { return; @@ -2233,11 +2233,11 @@ static void cxd56_gnss_default_sighandler(uint32_t data, FAR void *userdata) { fds->revents |= POLLIN; gnssinfo("Report events: %02x\n", fds->revents); - sem_post(fds->sem); + nxsem_post(fds->sem); } } - sem_post(&priv->devsem); + nxsem_post(&priv->devsem); #if !defined(CONFIG_DISABLE_SIGNAL) && \ (CONFIG_CXD56_GNSS_NSIGNALRECEIVERS != 0) @@ -2267,7 +2267,7 @@ static void cxd56_gnss_cpufifoapi_signalhandler(uint32_t data, FAR struct cxd56_gnss_dev_s *priv = (FAR struct cxd56_gnss_dev_s *)userdata; priv->apiret = CXD56_CPU1_GET_DATA((int)data); - sem_post(&priv->apiwait); + nxsem_post(&priv->apiwait); return; } @@ -2302,15 +2302,14 @@ static int cxd56_gnss_cpufifo_api(FAR struct file *filep, unsigned int api, type = CXD56_GNSS_CPUFIFOAPI_SET_DATA(api, data); cxd56_cpu1sigsend(CXD56_CPU1_DATA_TYPE_CPUFIFOAPI, type); - ret = sem_wait(&priv->apiwait); + ret = nxsem_wait(&priv->apiwait); if (ret < 0) { - /* If sem_wait returns -EINTR, there is a possibility that the signal + /* If nxsem_wait returns -EINTR, there is a possibility that the signal * for GNSS set with CXD56_GNSS_IOCTL_SIGNAL_SET is unmasked * by SIG_UNMASK in the signal mask. */ - ret = -errno; _warn("Cannot wait GNSS semaphore %d\n", ret); goto _err; } @@ -2438,7 +2437,7 @@ static int cxd56_gnss_open(FAR struct file *filep) inode = filep->f_inode; priv = (FAR struct cxd56_gnss_dev_s *)inode->i_private; - ret = sem_wait(&priv->devsem); + ret = nxsem_wait(&priv->devsem); if (ret < 0) { return ret; @@ -2446,7 +2445,7 @@ static int cxd56_gnss_open(FAR struct file *filep) if (priv->num_open == 0) { - ret = sem_init(&priv->syncsem, 0, 0); + ret = nxsem_init(&priv->syncsem, 0, 0); if (ret < 0) { goto _err0; @@ -2485,7 +2484,7 @@ static int cxd56_gnss_open(FAR struct file *filep) goto _err2; } - sem_destroy(&priv->syncsem); + nxsem_destroy(&priv->syncsem); } priv->num_open++; @@ -2497,10 +2496,10 @@ _err2: #endif PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD); _err1: - sem_destroy(&priv->syncsem); + nxsem_destroy(&priv->syncsem); _err0: _success: - sem_post(&priv->devsem); + nxsem_post(&priv->devsem); return ret; } @@ -2527,7 +2526,7 @@ static int cxd56_gnss_close(FAR struct file *filep) inode = filep->f_inode; priv = (FAR struct cxd56_gnss_dev_s *)inode->i_private; - ret = sem_wait(&priv->devsem); + ret = nxsem_wait(&priv->devsem); if (ret < 0) { return ret; @@ -2548,7 +2547,7 @@ static int cxd56_gnss_close(FAR struct file *filep) } errout: - sem_post(&priv->devsem); + nxsem_post(&priv->devsem); return ret; } @@ -2674,7 +2673,7 @@ static int cxd56_gnss_ioctl(FAR struct file *filep, int cmd, return -EINVAL; } - ret = sem_wait(&priv->ioctllock); + ret = nxsem_wait(&priv->ioctllock); if (ret < 0) { return ret; @@ -2682,7 +2681,7 @@ static int cxd56_gnss_ioctl(FAR struct file *filep, int cmd, ret = g_cmdlist[cmd](filep, arg); - sem_post(&priv->ioctllock); + nxsem_post(&priv->ioctllock); return ret; } @@ -2715,7 +2714,7 @@ static int cxd56_gnss_poll(FAR struct file *filep, FAR struct pollfd *fds, inode = filep->f_inode; priv = (FAR struct cxd56_gnss_dev_s *)inode->i_private; - ret = sem_wait(&priv->devsem); + ret = nxsem_wait(&priv->devsem); if (ret < 0) { return ret; @@ -2766,7 +2765,7 @@ static int cxd56_gnss_poll(FAR struct file *filep, FAR struct pollfd *fds, } errout: - sem_post(&priv->devsem); + nxsem_post(&priv->devsem); return ret; } #endif @@ -2848,21 +2847,21 @@ static int cxd56_gnss_register(FAR const char *devpath) memset(priv, 0, sizeof(struct cxd56_gnss_dev_s)); - ret = sem_init(&priv->devsem, 0, 1); + ret = nxsem_init(&priv->devsem, 0, 1); if (ret < 0) { gnsserr("Failed to initialize gnss devsem!\n"); goto _err0; } - ret = sem_init(&priv->apiwait, 0, 0); + ret = nxsem_init(&priv->apiwait, 0, 0); if (ret < 0) { gnsserr("Failed to initialize gnss apiwait!\n"); goto _err0; } - ret = sem_init(&priv->ioctllock, 0, 1); + ret = nxsem_init(&priv->ioctllock, 0, 1); if (ret < 0) { gnsserr("Failed to initialize gnss ioctllock!\n"); diff --git a/arch/arm/src/cxd56xx/cxd56_i2c.c b/arch/arm/src/cxd56xx/cxd56_i2c.c index 16e67b3d10..da4b05b9fb 100644 --- a/arch/arm/src/cxd56xx/cxd56_i2c.c +++ b/arch/arm/src/cxd56xx/cxd56_i2c.c @@ -365,7 +365,7 @@ static void cxd56_i2c_timeout(int argc, uint32_t arg, ...) irqstate_t flags = enter_critical_section(); priv->error = -ENODEV; - sem_post(&priv->wait); + nxsem_post(&priv->wait); leave_critical_section(flags); } @@ -465,14 +465,14 @@ static int cxd56_i2c_interrupt(int irq, FAR void *context, FAR void *arg) if ((priv->error) || (state & INTR_TX_EMPTY) || (state & INTR_RX_FULL)) { /* Failure of wd_cancel() means that the timer expired. - * In this case, sem_post() has already been called. - * Therefore, call sem_post() only when wd_cancel() succeeds. + * In this case, nxsem_post() has already been called. + * Therefore, call nxsem_post() only when wd_cancel() succeeds. */ ret = wd_cancel(priv->timeout); if (ret == OK) { - sem_post(&priv->wait); + nxsem_post(&priv->wait); } } @@ -535,7 +535,7 @@ static int cxd56_i2c_receive(struct cxd56_i2cdev_s *priv, int last) i2c_reg_rmw(priv, CXD56_IC_INTR_MASK, INTR_RX_FULL, INTR_RX_FULL); leave_critical_section(flags); - sem_wait(&priv->wait); + nxsem_wait(&priv->wait); if (priv->error != OK) { @@ -581,7 +581,7 @@ static int cxd56_i2c_send(struct cxd56_i2cdev_s *priv, int last) i2c_reg_rmw(priv, CXD56_IC_INTR_MASK, INTR_TX_EMPTY, INTR_TX_EMPTY); leave_critical_section(flags); - sem_wait(&priv->wait); + nxsem_wait(&priv->wait); return 0; } @@ -610,13 +610,13 @@ static int cxd56_i2c_transfer(FAR struct i2c_master_s *dev, /* Get exclusive access to the I2C bus */ - sem_wait(&priv->mutex); + nxsem_wait(&priv->mutex); /* Check wait semaphore value. If the value is not 0, the transfer can not * be performed normally. */ - ret = sem_getvalue(&priv->wait, &semval); + ret = nxsem_getvalue(&priv->wait, &semval); DEBUGASSERT(ret == OK && semval == 0); /* Disable clock gating (clock enable) */ @@ -688,7 +688,7 @@ static int cxd56_i2c_transfer(FAR struct i2c_master_s *dev, cxd56_i2c_clock_gate_enable(priv->port); - sem_post(&priv->mutex); + nxsem_post(&priv->mutex); return ret; } @@ -828,7 +828,7 @@ static int cxd56_i2c_transfer_scu(FAR struct i2c_master_s *dev, /* Get exclusive access to the I2C bus */ - sem_wait(&priv->mutex); + nxsem_wait(&priv->mutex); /* Apply frequency for request msgs */ @@ -865,7 +865,7 @@ static int cxd56_i2c_transfer_scu(FAR struct i2c_master_s *dev, } } - sem_post(&priv->mutex); + nxsem_post(&priv->mutex); return ret; } @@ -1028,8 +1028,8 @@ struct i2c_master_s *cxd56_i2cbus_initialize(int port) cxd56_i2c_pincontrol(port, true); - sem_init(&priv->mutex, 0, 1); - sem_init(&priv->wait, 0, 0); + nxsem_init(&priv->mutex, 0, 1); + nxsem_init(&priv->wait, 0, 0); priv->timeout = wd_create(); @@ -1096,8 +1096,8 @@ int cxd56_i2cbus_uninitialize(FAR struct i2c_master_s *dev) wd_delete(priv->timeout); priv->timeout = NULL; - sem_destroy(&priv->mutex); - sem_destroy(&priv->wait); + nxsem_destroy(&priv->mutex); + nxsem_destroy(&priv->wait); return OK; } diff --git a/arch/arm/src/cxd56xx/cxd56_icc.c b/arch/arm/src/cxd56xx/cxd56_icc.c index ac1bf27aa5..802297a9d3 100644 --- a/arch/arm/src/cxd56xx/cxd56_icc.c +++ b/arch/arm/src/cxd56xx/cxd56_icc.c @@ -159,15 +159,12 @@ static struct iccdev_s *g_cpumsg[NCPUS]; static void icc_semtake(sem_t *semid) { - while (sem_wait(semid) != 0) - { - ASSERT(errno == EINTR); - } + nxsem_wait_uninterruptible(semid); } static void icc_semgive(sem_t *semid) { - sem_post(semid); + nxsem_post(semid); } static FAR struct iccdev_s *icc_getprotocol(int protoid) @@ -254,9 +251,9 @@ static int icc_irqhandler(int cpuid, uint32_t word[2]) # ifdef CONFIG_CAN_PASS_STRUCTS union sigval value; value.sival_ptr = priv->sigdata; - (void)sigqueue(priv->pid, priv->signo, value); + sigqueue(priv->pid, priv->signo, value); # else - (void)sigqueue(priv->pid, priv->signo, priv->sigdata); + sigqueue(priv->pid, priv->signo, priv->sigdata); # endif } #endif @@ -362,7 +359,7 @@ static FAR struct iccdev_s *icc_devnew(void) priv->rxtimeout = wd_create(); - sem_init(&priv->rxwait, 0, 0); + nxsem_init(&priv->rxwait, 0, 0); /* Initialize receive queue and free list */ diff --git a/arch/arm/src/cxd56xx/cxd56_idle.c b/arch/arm/src/cxd56xx/cxd56_idle.c index b0655d025a..ec55a811c9 100644 --- a/arch/arm/src/cxd56xx/cxd56_idle.c +++ b/arch/arm/src/cxd56xx/cxd56_idle.c @@ -111,7 +111,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { @@ -135,7 +135,7 @@ static void up_idlepm(void) break; case PM_SLEEP: - (void)cxd56_pmsleep(); + cxd56_pmsleep(); break; default: diff --git a/arch/arm/src/cxd56xx/cxd56_irq.c b/arch/arm/src/cxd56xx/cxd56_irq.c index 111d455c30..7ffabb9e9f 100644 --- a/arch/arm/src/cxd56xx/cxd56_irq.c +++ b/arch/arm/src/cxd56xx/cxd56_irq.c @@ -173,7 +173,7 @@ static void cxd56_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int cxd56_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -181,7 +181,7 @@ static int cxd56_nmi(int irq, FAR void *context, FAR void *arg) static int cxd56_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received\n"); PANIC(); return 0; @@ -189,7 +189,7 @@ static int cxd56_busfault(int irq, FAR void *context, FAR void *arg) static int cxd56_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -197,7 +197,7 @@ static int cxd56_usagefault(int irq, FAR void *context, FAR void *arg) static int cxd56_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -205,7 +205,7 @@ static int cxd56_pendsv(int irq, FAR void *context, FAR void *arg) static int cxd56_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -213,7 +213,7 @@ static int cxd56_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int cxd56_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/cxd56xx/cxd56_powermgr.c b/arch/arm/src/cxd56xx/cxd56_powermgr.c index dace666049..5e6f8198f0 100644 --- a/arch/arm/src/cxd56xx/cxd56_powermgr.c +++ b/arch/arm/src/cxd56xx/cxd56_powermgr.c @@ -177,15 +177,7 @@ static struct pm_cpu_wakelock_s g_wlock = static int cxd56_pm_semtake(FAR sem_t *id) { - while (sem_wait(id) != 0) - { - if (errno != EINTR) - { - pmerr("ERR:sem_wait\n"); - return errno; - } - } - return OK; + return nxsem_wait_uninterruptible(id); } static int cxd56_pm_needcallback(uint32_t target, @@ -315,7 +307,7 @@ static void cxd56_pm_clkchange(struct cxd56_pm_message_s *message) cxd56_pmsendmsg(mid, ret); - sem_post(&g_regcblock); + nxsem_post(&g_regcblock); } static void cxd56_pm_checkfreqlock(void) @@ -463,7 +455,7 @@ FAR void *cxd56_pm_register_callback(uint32_t target, entry = (struct pm_cbentry_s *)kmm_malloc(sizeof(struct pm_cbentry_s)); if (entry == NULL) { - sem_post(&g_regcblock); + nxsem_post(&g_regcblock); return NULL; } @@ -471,7 +463,7 @@ FAR void *cxd56_pm_register_callback(uint32_t target, entry->callback = callback; dq_addlast((FAR dq_entry_t *)entry, &g_cbqueue); - sem_post(&g_regcblock); + nxsem_post(&g_regcblock); return (void *)entry; } @@ -483,7 +475,7 @@ void cxd56_pm_unregister_callback(FAR void *handle) dq_rem((FAR dq_entry_t *)handle, &g_cbqueue); kmm_free(handle); - sem_post(&g_regcblock); + nxsem_post(&g_regcblock); } static int cxd56_pmmsghandler(int cpuid, int protoid, uint32_t pdata, @@ -517,7 +509,7 @@ static int cxd56_pmmsghandler(int cpuid, int protoid, uint32_t pdata, } else if (msgid == MSGID_FREQLOCK) { - sem_post(&g_freqlockwait); + nxsem_post(&g_freqlockwait); } else { @@ -573,7 +565,7 @@ void up_pm_acquire_freqlock(struct pm_cpu_freqlock_s *lock) lock->count++; - sem_post(&g_freqlock); + nxsem_post(&g_freqlock); up_pm_release_wakelock(&g_wlock); } @@ -614,7 +606,7 @@ void up_pm_release_freqlock(struct pm_cpu_freqlock_s *lock) } } - sem_post(&g_freqlock); + nxsem_post(&g_freqlock); up_pm_release_wakelock(&g_wlock); } @@ -651,7 +643,7 @@ int up_pm_get_freqlock_count(struct pm_cpu_freqlock_s *lock) } } - sem_post(&g_freqlock); + nxsem_post(&g_freqlock); return count; } @@ -795,22 +787,22 @@ int cxd56_pm_initialize(void) sq_init(&g_freqlockqueue); sq_init(&g_wakelockqueue); - ret = sem_init(&g_regcblock, 0, 1); + ret = nxsem_init(&g_regcblock, 0, 1); if (ret < 0) { - return -EPERM; + return ret; } - ret = sem_init(&g_freqlock, 0, 1); + ret = nxsem_init(&g_freqlock, 0, 1); if (ret < 0) { - return -EPERM; + return ret; } - ret = sem_init(&g_freqlockwait, 0, 0); + ret = nxsem_init(&g_freqlockwait, 0, 0); if (ret < 0) { - return -EPERM; + return ret; } attr.mq_maxmsg = 8; diff --git a/arch/arm/src/cxd56xx/cxd56_rtc.c b/arch/arm/src/cxd56xx/cxd56_rtc.c index 1f04215430..3339d57ddb 100644 --- a/arch/arm/src/cxd56xx/cxd56_rtc.c +++ b/arch/arm/src/cxd56xx/cxd56_rtc.c @@ -160,7 +160,7 @@ static void rtc_dumptime(FAR const struct timespec *tp, FAR const char *msg) { FAR struct tm tm; - (void)gmtime_r(&tp->tv_sec, &tm); + gmtime_r(&tp->tv_sec, &tm); rtcinfo("%s:\n", msg); rtcinfo("RTC %u.%09u\n", tp->tv_sec, tp->tv_nsec); diff --git a/arch/arm/src/cxd56xx/cxd56_rtc_lowerhalf.c b/arch/arm/src/cxd56xx/cxd56_rtc_lowerhalf.c index 2cd73d7a5d..11b783b0d3 100644 --- a/arch/arm/src/cxd56xx/cxd56_rtc_lowerhalf.c +++ b/arch/arm/src/cxd56xx/cxd56_rtc_lowerhalf.c @@ -417,7 +417,7 @@ static int cxd56_setrelative(FAR struct rtc_lowerhalf_s *lower, seconds = ts.tv_sec + (alarminfo->reltime + 1); - (void)gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); + gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); /* The set the alarm using this absolute time */ diff --git a/arch/arm/src/cxd56xx/cxd56_scu.c b/arch/arm/src/cxd56xx/cxd56_scu.c index 6a1b60cb8e..9c14a141be 100644 --- a/arch/arm/src/cxd56xx/cxd56_scu.c +++ b/arch/arm/src/cxd56xx/cxd56_scu.c @@ -374,11 +374,7 @@ static const struct coeff_addr_s g_caddrs[3][2] = static int seq_semtake(sem_t *id) { - while (sem_wait(id) != 0) - { - ASSERT(errno == EINTR); - } - return OK; + return nxsem_wait_uninterruptible(id); } /**************************************************************************** @@ -387,7 +383,7 @@ static int seq_semtake(sem_t *id) static void seq_semgive(sem_t *id) { - sem_post(id); + nxsem_post(id); } /**************************************************************************** @@ -1514,9 +1510,9 @@ static void seq_handlefifointr(FAR struct cxd56_scudev_s *priv, uint32_t intr) # ifdef CONFIG_CAN_PASS_STRUCTS value.sival_ptr = notify->ts; - (void)sigqueue(notify->pid, notify->signo, value); + sigqueue(notify->pid, notify->signo, value); # else - (void)sigqueue(notify->pid, notify->signo, (FAR void *)notify->ts); + sigqueue(notify->pid, notify->signo, (FAR void *)notify->ts); # endif #endif } @@ -1606,9 +1602,9 @@ static void seq_handlemathfintr(FAR struct cxd56_scudev_s *priv, # ifdef CONFIG_CAN_PASS_STRUCTS union sigval value; value.sival_ptr = notify->arg; - (void)sigqueue(notify->pid, notify->signo, value); + sigqueue(notify->pid, notify->signo, value); # else - (void)sigqueue(notify->pid, notify->signo, (FAR void *)notify->arg); + sigqueue(notify->pid, notify->signo, (FAR void *)notify->arg); # endif detected = 0; } @@ -1999,7 +1995,7 @@ static int seq_fifoinit(FAR struct seq_s *seq, int fifoid, uint16_t fsize) /* Initialize DMA done wait semaphore */ - sem_init(&fifo->dmawait, 0, 0); + nxsem_init(&fifo->dmawait, 0, 0); fifo->dmaresult = -1; #endif @@ -2085,7 +2081,7 @@ static void seq_fifofree(FAR struct scufifo_s *fifo) scufifo_memfree(fifo->start); #ifdef CONFIG_CXD56_UDMAC - sem_destroy(&fifo->dmawait); + nxsem_destroy(&fifo->dmawait); #endif kmm_free(fifo); @@ -3422,12 +3418,12 @@ void scu_initialize(void) memset(priv, 0, sizeof(struct cxd56_scudev_s)); - sem_init(&priv->syncwait, 0, 0); - sem_init(&priv->syncexc, 0, 1); + nxsem_init(&priv->syncwait, 0, 0); + nxsem_init(&priv->syncexc, 0, 1); for (i = 0; i < 3; i++) { - sem_init(&priv->oneshotwait[i], 0, 0); + nxsem_init(&priv->oneshotwait[i], 0, 0); } scufifo_initialize(); @@ -3489,11 +3485,11 @@ void scu_uninitialize(void) cxd56_scuseq_clock_disable(); - sem_destroy(&priv->syncwait); - sem_destroy(&priv->syncexc); + nxsem_destroy(&priv->syncwait); + nxsem_destroy(&priv->syncexc); for (i = 0; i < 3; i++) { - sem_destroy(&priv->oneshotwait[i]); + nxsem_destroy(&priv->oneshotwait[i]); } } diff --git a/arch/arm/src/cxd56xx/cxd56_sdhci.c b/arch/arm/src/cxd56xx/cxd56_sdhci.c index d991b96ce6..d48fa630c8 100644 --- a/arch/arm/src/cxd56xx/cxd56_sdhci.c +++ b/arch/arm/src/cxd56xx/cxd56_sdhci.c @@ -356,7 +356,7 @@ struct cxd56_sdhcregs_s /* Low-level helpers ********************************************************/ static void cxd56_takesem(struct cxd56_sdiodev_s *priv); -#define cxd56_givesem(priv) (sem_post(&(priv)->waitsem)) +#define cxd56_givesem(priv) (nxsem_post(&(priv)->waitsem)) static void cxd56_configwaitints(struct cxd56_sdiodev_s *priv, uint32_t waitints, sdio_eventset_t waitevents, sdio_eventset_t wkupevents); @@ -570,16 +570,7 @@ static FAR uint32_t cxd56_sdhci_adma_dscr[CXD56_SDIO_MAX_LEN_ADMA_DSCR * 2]; static void cxd56_takesem(struct cxd56_sdiodev_s *priv) { - /* Take the semaphore (perhaps waiting) */ - - while (sem_wait(&priv->waitsem) != 0) - { - /* The only case that an error should occr here is if the wait was - * awakened by a signal. - */ - - ASSERT(errno == EINTR); - } + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -1075,7 +1066,7 @@ static void cxd56_endwait(struct cxd56_sdiodev_s *priv, { /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Disable event-related interrupts */ @@ -1279,8 +1270,8 @@ static int cxd56_interrupt(int irq, FAR void *context, FAR void *arg) putreg32(getreg32(CXD56_SDHCI_IRQSTATEN) & (~SDHCI_INT_CINT), CXD56_SDHCI_IRQSTATEN); work_cancel(HPWORK, &priv->cbwork); - (void)work_queue(HPWORK, &priv->cbwork, - (worker_t)cxd56_sdhci_irq_handler, &priv->dev, 0); + work_queue(HPWORK, &priv->cbwork, + (worker_t)cxd56_sdhci_irq_handler, &priv->dev, 0); } #endif /* CONFIG_CXD56_SDIO_ENABLE_MULTIFUNCTION */ @@ -1429,13 +1420,13 @@ static void cxd56_sdio_sdhci_reset(FAR struct sdio_dev_s *dev) /* Initialize the SDHC slot structure data structure */ /* Initialize semaphores */ - sem_init(&priv->waitsem, 0, 0); + nxsem_init(&priv->waitsem, 0, 0); /* The waitsem semaphore is used for signaling and, hence, should not have * priority inheritance enabled. */ - sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE); + nxsem_setprotocol(&priv->waitsem, SEM_PRIO_NONE); /* Create a watchdog timer */ @@ -2147,7 +2138,7 @@ static int cxd56_sdio_cancel(FAR struct sdio_dev_s *dev) /* Cancel any watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* If this was a DMA transfer, make sure that DMA is stopped */ @@ -3216,8 +3207,8 @@ static void cxd56_sdio_callback(void *arg) work_cancel(HPWORK, &priv->cbwork); mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); - (void)work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, - priv->cbarg, delay); + work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, + priv->cbarg, delay); } else { @@ -3233,18 +3224,7 @@ static void cxd56_sdio_callback(void *arg) #ifdef CONFIG_CXD56_SDIO_ENABLE_MULTIFUNCTION static void cxd56_sdio_takesem(FAR struct cxd56_sdiodev_s *priv) { - /* Take the semaphore, giving exclusive access to the driver (perhaps - * waiting) - */ - - while (sem_wait(&priv->sc.sem) != 0) - { - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - ASSERT(errno == EINTR); - } + nxsem_wait_uninterruptible(&priv->sc.sem); } /**************************************************************************** @@ -3737,13 +3717,13 @@ static int cxd56_sdio_register_irq(FAR struct sdio_dev_s *dev, int func_num, cxd56_sdio_writeb_internal(sf0, SDIO_CCCR_INTEN, regorg, NULL); goto REG_IRQ_FAIL; } - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return ret; REG_IRQ_FAIL: sf->irq_callback = NULL; mcerr("ERROR: Ret: %d\n", ret); - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return ret; } @@ -3844,11 +3824,11 @@ static int cxd56_sdio_function_disable(FAR struct sdio_dev_s *dev, { goto FUNC_DIS_ERR; } - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return 0; FUNC_DIS_ERR: mcerr("ERROR: Io fail ret %u\n", ret); - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return ret; } @@ -3908,12 +3888,12 @@ static int cxd56_sdio_function_enable(FAR struct sdio_dev_s *dev, if (0 == ret) { - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return 0; } FUNC_EN_ERR: mcerr("ERROR: Io fail ret %u\n", ret); - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return -EIO; } @@ -3941,7 +3921,7 @@ static int cxd56_sdio_readb(FAR struct sdio_dev_s *dev, int func_num, cxd56_sdio_takesem(priv); ret = cxd56_sdio_readb_internal(priv->sc.fn[func_num], addr, rdata); - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return ret; } @@ -3969,7 +3949,7 @@ static int cxd56_sdio_writeb(FAR struct sdio_dev_s *dev, int func_num, cxd56_sdio_takesem(priv); ret = cxd56_sdio_writeb_internal(priv->sc.fn[func_num], addr, data, rdata); - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return ret; } @@ -4093,13 +4073,13 @@ static int cxd56_sdio_write(FAR struct sdio_dev_s *dev, int func_num, data += size; addr += size; } - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return 0; WRITE_TIME_OUT: - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return wkupevent & SDIOWAIT_TIMEOUT ? -ETIMEDOUT : -EIO; WRITE_ERR: - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return ret; } @@ -4223,13 +4203,13 @@ static int cxd56_sdio_read(FAR struct sdio_dev_s *dev, int func_num, data += size; addr += size; } - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return 0; READ_TIME_OUT: - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return wkupevent & SDIOWAIT_TIMEOUT ? -ETIMEDOUT : -EIO; READ_ERR: - sem_post(&priv->sc.sem); + nxsem_post(&priv->sc.sem); return ret; } @@ -4273,7 +4253,7 @@ static int cxd56_sdio_initialize(struct cxd56_sdiodev_s *priv) priv->sc.full_speed = false; priv->blocksize = SDIO_BLOCK_SIZE; - sem_init(&priv->sc.sem, 0, 1); + nxsem_init(&priv->sc.sem, 0, 1); #ifdef CONFIG_SDIO_DMA priv->sc.dma = true; #endif diff --git a/arch/arm/src/cxd56xx/cxd56_serial.c b/arch/arm/src/cxd56xx/cxd56_serial.c index 8c3811c3f9..2a318118f6 100644 --- a/arch/arm/src/cxd56xx/cxd56_serial.c +++ b/arch/arm/src/cxd56xx/cxd56_serial.c @@ -543,10 +543,7 @@ static void up_detach(FAR struct uart_dev_s *dev) static bool up_rxflowcontrol(FAR struct uart_dev_s *dev, unsigned int nbuffered, bool upper) { - (void)nbuffered; - up_rxint(dev, !upper); - return true; } #endif /* CONFIG_SERIAL_IFLOWCONTROL */ @@ -924,13 +921,13 @@ void up_earlyserialinit(void) void up_serialinit(void) { #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif } diff --git a/arch/arm/src/cxd56xx/cxd56_sph.c b/arch/arm/src/cxd56xx/cxd56_sph.c index 5ee5376d86..c08a317192 100644 --- a/arch/arm/src/cxd56xx/cxd56_sph.c +++ b/arch/arm/src/cxd56xx/cxd56_sph.c @@ -167,16 +167,12 @@ static int sph_ioctl(FAR struct file *filep, int cmd, unsigned long arg) static int sph_semtake(sem_t *id) { - while (sem_wait(id) != 0) - { - ASSERT(errno == EINTR); - } - return OK; + return nxsem_wait_uninterruptible(id); } static void sph_semgive(sem_t *id) { - sem_post(id); + nxsem_post(id); } static int sph_lock(FAR struct sph_dev_s *priv) @@ -263,7 +259,7 @@ static inline int cxd56_sphdevinit(FAR const char *devname, int num) return ERROR; } - sem_init(&priv->wait, 0, 0); + nxsem_init(&priv->wait, 0, 0); priv->id = num; irq_attach(CXD56_IRQ_SPH0 + num, cxd56_sphirqhandler, NULL); diff --git a/arch/arm/src/cxd56xx/cxd56_spi.c b/arch/arm/src/cxd56xx/cxd56_spi.c index fc9b52b76b..98a85c8939 100644 --- a/arch/arm/src/cxd56xx/cxd56_spi.c +++ b/arch/arm/src/cxd56xx/cxd56_spi.c @@ -428,21 +428,12 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) { /* Take the semaphore (perhaps waiting) */ - while (sem_wait(&priv->exclsem) != 0) - { - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - ASSERT(errno == EINTR); - } + return nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)sem_post(&priv->exclsem); + return nxsem_post(&priv->exclsem); } - - return OK; } /**************************************************************************** @@ -1174,7 +1165,7 @@ FAR struct spi_dev_s *cxd56_spibus_initialize(int port) return NULL; } #endif - sem_init(&priv->dmasem, 0, 0); + nxsem_init(&priv->dmasem, 0, 0); } #endif @@ -1199,7 +1190,7 @@ FAR struct spi_dev_s *cxd56_spibus_initialize(int port) return NULL; } #endif - sem_init(&priv->dmasem, 0, 0); + nxsem_init(&priv->dmasem, 0, 0); } #endif @@ -1240,7 +1231,7 @@ FAR struct spi_dev_s *cxd56_spibus_initialize(int port) /* Initialize the SPI semaphore that enforces mutually exclusive access */ - sem_init(&priv->exclsem, 0, 1); + nxsem_init(&priv->exclsem, 0, 1); #ifdef CONFIG_CXD56_SPI3_SCUSEQ /* Enable the SPI, but not enable port 3 when SCU support enabled. @@ -1258,7 +1249,7 @@ FAR struct spi_dev_s *cxd56_spibus_initialize(int port) for (i = 0; i < CXD56_SPI_FIFOSZ; i++) { - (void)spi_getreg(priv, CXD56_SPI_DR_OFFSET); + spi_getreg(priv, CXD56_SPI_DR_OFFSET); } /* Enable clock gating (clock disable) */ @@ -1321,7 +1312,7 @@ void spi_flush(FAR struct spi_dev_s *dev) do { - (void)spi_getreg(priv, CXD56_SPI_DR_OFFSET); + spi_getreg(priv, CXD56_SPI_DR_OFFSET); } while (spi_getreg(priv, CXD56_SPI_SR_OFFSET) & SPI_SR_RNE); @@ -1471,7 +1462,7 @@ static void spi_dmatxcallback(DMA_HANDLE handle, uint8_t status, void *data) spierr("dma error\n"); } - (void)sem_post(&priv->dmasem); + nxsem_post(&priv->dmasem); } /**************************************************************************** @@ -1493,7 +1484,7 @@ static void spi_dmarxcallback(DMA_HANDLE handle, uint8_t status, void *data) spierr("dma error\n"); } - (void)sem_post(&priv->dmasem); + nxsem_post(&priv->dmasem); } /**************************************************************************** @@ -1554,7 +1545,7 @@ static void spi_dmatxwait(FAR struct cxd56_spidev_s *priv) { uint32_t val; - if (sem_wait(&priv->dmasem) != OK) + if (nxsem_wait(&priv->dmasem) != OK) { spierr("dma error\n"); } @@ -1578,7 +1569,7 @@ static void spi_dmarxwait(FAR struct cxd56_spidev_s *priv) { uint32_t val; - if (sem_wait(&priv->dmasem) != OK) + if (nxsem_wait(&priv->dmasem) != OK) { spierr("dma error\n"); } @@ -1602,12 +1593,12 @@ static void spi_dmatrxwait(FAR struct cxd56_spidev_s *priv) { uint32_t val; - if (sem_wait(&priv->dmasem) != OK) + if (nxsem_wait(&priv->dmasem) != OK) { spierr("dma error\n"); } - if (sem_wait(&priv->dmasem) != OK) + if (nxsem_wait(&priv->dmasem) != OK) { spierr("dma error\n"); } diff --git a/arch/arm/src/cxd56xx/cxd56_sysctl.c b/arch/arm/src/cxd56xx/cxd56_sysctl.c index 01c9e335b2..def7d5cc41 100644 --- a/arch/arm/src/cxd56xx/cxd56_sysctl.c +++ b/arch/arm/src/cxd56xx/cxd56_sysctl.c @@ -86,15 +86,12 @@ static int sysctl_ioctl(FAR struct file *filep, int cmd, unsigned long arg) static void sysctl_semtake(sem_t *semid) { - while (sem_wait(semid) != 0) - { - ASSERT(errno == EINTR); - } + nxsem_wait_uninterruptible(semid); } static void sysctl_semgive(sem_t *semid) { - sem_post(semid); + nxsem_post(semid); } static int sysctl_rxhandler(int cpuid, int protoid, @@ -150,10 +147,10 @@ void cxd56_sysctlinitialize(void) { cxd56_iccinit(CXD56_PROTO_SYSCTL); - sem_init(&g_exc, 0, 1); - sem_init(&g_sync, 0, 0); + nxsem_init(&g_exc, 0, 1); + nxsem_init(&g_sync, 0, 0); cxd56_iccregisterhandler(CXD56_PROTO_SYSCTL, sysctl_rxhandler, NULL); - (void)register_driver("/dev/sysctl", &g_sysctlfops, 0666, NULL); + register_driver("/dev/sysctl", &g_sysctlfops, 0666, NULL); } diff --git a/arch/arm/src/cxd56xx/cxd56_timer.c b/arch/arm/src/cxd56xx/cxd56_timer.c index 9bd80da154..405d81e0ff 100644 --- a/arch/arm/src/cxd56xx/cxd56_timer.c +++ b/arch/arm/src/cxd56xx/cxd56_timer.c @@ -569,7 +569,7 @@ void cxd56_timer_initialize(FAR const char *devpath, int timer) priv->ops = &g_tmrops; - (void)irq_attach(irq, cxd56_timer_interrupt, priv); + irq_attach(irq, cxd56_timer_interrupt, priv); /* Enable NVIC interrupt. */ @@ -577,7 +577,7 @@ void cxd56_timer_initialize(FAR const char *devpath, int timer) /* Register the timer driver as /dev/timerX */ - (void)timer_register(devpath, (FAR struct timer_lowerhalf_s *)priv); + timer_register(devpath, (FAR struct timer_lowerhalf_s *)priv); } #endif /* CONFIG_TIMER */ diff --git a/arch/arm/src/cxd56xx/cxd56_timerisr.c b/arch/arm/src/cxd56xx/cxd56_timerisr.c index d9312eada3..41cf274538 100644 --- a/arch/arm/src/cxd56xx/cxd56_timerisr.c +++ b/arch/arm/src/cxd56xx/cxd56_timerisr.c @@ -184,7 +184,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(CXD56_IRQ_SYSTICK, (xcpt_t)cxd56_timerisr, NULL); + irq_attach(CXD56_IRQ_SYSTICK, (xcpt_t)cxd56_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/cxd56xx/cxd56_uart0.c b/arch/arm/src/cxd56xx/cxd56_uart0.c index de7275b92a..3ca4943c7a 100644 --- a/arch/arm/src/cxd56xx/cxd56_uart0.c +++ b/arch/arm/src/cxd56xx/cxd56_uart0.c @@ -128,11 +128,7 @@ static sem_t g_lock; static int uart0_semtake(sem_t *id) { - while (sem_wait(id) != 0) - { - ASSERT(errno == EINTR); - } - return OK; + return nxsem_wait_uninterruptible(id); } /**************************************************************************** @@ -141,7 +137,7 @@ static int uart0_semtake(sem_t *id) static void uart0_semgive(sem_t *id) { - sem_post(id); + nxsem_post(id); } /**************************************************************************** @@ -301,7 +297,7 @@ int cxd56_uart0initialize(FAR const char *devname) { int ret; - sem_init(&g_lock, 0, 1); + nxsem_init(&g_lock, 0, 1); ret = register_driver(devname, &g_uart0fops, 0666, NULL); if (ret != 0) @@ -319,7 +315,7 @@ int cxd56_uart0initialize(FAR const char *devname) void cxd56_uart0uninitialize(FAR const char *devname) { unregister_driver(devname); - sem_destroy(&g_lock); + nxsem_destroy(&g_lock); } #endif /* CONFIG_CXD56_UART0 */ diff --git a/arch/arm/src/cxd56xx/cxd56_udmac.c b/arch/arm/src/cxd56xx/cxd56_udmac.c index 2cc4023290..67f0f534a1 100644 --- a/arch/arm/src/cxd56xx/cxd56_udmac.c +++ b/arch/arm/src/cxd56xx/cxd56_udmac.c @@ -252,8 +252,8 @@ void cxd56_udmainitialize(void) /* Initialize the channel list */ - sem_init(&g_dmac.exclsem, 0, 1); - sem_init(&g_dmac.chansem, 0, CXD56_DMA_NCHANNELS); + nxsem_init(&g_dmac.exclsem, 0, 1); + nxsem_init(&g_dmac.chansem, 0, CXD56_DMA_NCHANNELS); for (i = 0; i < CXD56_DMA_NCHANNELS; i++) { @@ -311,21 +311,11 @@ DMA_HANDLE cxd56_udmachannel(void) * reserved for us. */ - while (sem_wait(&g_dmac.chansem) < 0) - { - /* sem_wait should fail only if it is awakened by a a signal */ - - DEBUGASSERT(errno == EINTR); - } + nxsem_wait_uninterruptible(&g_dmac.chansem); /* Get exclusive access to the DMA channel list */ - while (sem_wait(&g_dmac.exclsem) < 0) - { - /* sem_wait should fail only if it is awakened by a a signal */ - - DEBUGASSERT(errno == EINTR); - } + nxsem_wait_uninterruptible(&g_dmac.exclsem); /* Search for an available DMA channel */ @@ -346,11 +336,11 @@ DMA_HANDLE cxd56_udmachannel(void) } } - sem_post(&g_dmac.exclsem); + nxsem_post(&g_dmac.exclsem); /* Attach DMA interrupt vector */ - (void)irq_attach(CXD56_IRQ_DMA_A_0 + ch, cxd56_dmac_interrupt, NULL); + irq_attach(CXD56_IRQ_DMA_A_0 + ch, cxd56_dmac_interrupt, NULL); /* Enable the IRQ at the AIC (still disabled at the DMA controller) */ @@ -405,7 +395,7 @@ void cxd56_udmafree(DMA_HANDLE handle) * thread that may be waiting for a channel. */ - sem_post(&g_dmac.chansem); + nxsem_post(&g_dmac.chansem); } /**************************************************************************** diff --git a/arch/arm/src/cxd56xx/cxd56_usbdev.c b/arch/arm/src/cxd56xx/cxd56_usbdev.c index 78b19bfaf4..06b9eaec6c 100644 --- a/arch/arm/src/cxd56xx/cxd56_usbdev.c +++ b/arch/arm/src/cxd56xx/cxd56_usbdev.c @@ -3348,9 +3348,9 @@ static void cxd56_notify_signal(uint16_t state, uint16_t power) #ifdef CONFIG_CAN_PASS_STRUCTS union sigval value; value.sival_int = state << 16 | power; - (void)sigqueue(priv->pid, priv->signo, value); + sigqueue(priv->pid, priv->signo, value); #else - (void)sigqueue(priv->pid, priv->signo, state << 16 | power); + sigqueue(priv->pid, priv->signo, state << 16 | power); #endif } } diff --git a/arch/arm/src/cxd56xx/cxd56_wdt.c b/arch/arm/src/cxd56xx/cxd56_wdt.c index c655029586..6d53ded2c1 100644 --- a/arch/arm/src/cxd56xx/cxd56_wdt.c +++ b/arch/arm/src/cxd56xx/cxd56_wdt.c @@ -673,12 +673,12 @@ int cxd56_wdt_initialize(void) #ifdef CONFIG_CXD56_WDT_INTERRUPT /* Attach our WDT interrupt handler (But don't enable it yet) */ - (void)irq_attach(CXD56_IRQ_WDT_INT, cxd56_wdtinterrupt, priv); + irq_attach(CXD56_IRQ_WDT_INT, cxd56_wdtinterrupt, priv); #endif /* Register the watchdog driver as /dev/watchdog0 */ - (void)watchdog_register(DEVPATH, (FAR struct watchdog_lowerhalf_s *)priv); + watchdog_register(DEVPATH, (FAR struct watchdog_lowerhalf_s *)priv); /* Register pm event callback */ diff --git a/arch/arm/src/dm320/dm320_decodeirq.c b/arch/arm/src/dm320/dm320_decodeirq.c index 5d7e709588..c621cf96f0 100644 --- a/arch/arm/src/dm320/dm320_decodeirq.c +++ b/arch/arm/src/dm320/dm320_decodeirq.c @@ -118,7 +118,7 @@ void up_decodeirq(uint32_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/arm/src/dm320/dm320_serial.c b/arch/arm/src/dm320/dm320_serial.c index 10a2d15fa8..a5d74e7a65 100644 --- a/arch/arm/src/dm320/dm320_serial.c +++ b/arch/arm/src/dm320/dm320_serial.c @@ -737,9 +737,9 @@ void up_earlyserialinit(void) void up_serialinit(void) { - (void)uart_register("/dev/console", &CONSOLE_DEV); - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); } /**************************************************************************** diff --git a/arch/arm/src/dm320/dm320_usbdev.c b/arch/arm/src/dm320/dm320_usbdev.c index 18dce86dbf..8a931246e9 100644 --- a/arch/arm/src/dm320/dm320_usbdev.c +++ b/arch/arm/src/dm320/dm320_usbdev.c @@ -1304,7 +1304,7 @@ static inline void dm320_ep0setup(struct dm320_usbdev_s *priv) /* Restart the write queue */ - (void)dm320_wrrequest(privep); + dm320_wrrequest(privep); } else { @@ -1581,7 +1581,7 @@ static int dm320_ctlrinterrupt(int irq, FAR void *context, FAR void *arg) if ((csr0 & USB_PERCSR0_RXPKTRDY) != 0) { usbtrace(TRACE_INTENTRY(DM320_TRACEINTID_RXPKTRDY), csr0); - (void)dm320_getreg8(DM320_USB_COUNT0); + dm320_getreg8(DM320_USB_COUNT0); dm320_ep0setup(priv); } else if ((csr0 & USB_PERCSR0_SENTST) != 0) @@ -1643,7 +1643,7 @@ static int dm320_ctlrinterrupt(int irq, FAR void *context, FAR void *arg) if (!dm320_rqempty(privep)) { - (void)dm320_wrrequest(privep); + dm320_wrrequest(privep); } } break; diff --git a/arch/arm/src/efm32/efm32_dma.c b/arch/arm/src/efm32/efm32_dma.c index ddb2e23fd0..7afe854a0c 100644 --- a/arch/arm/src/efm32/efm32_dma.c +++ b/arch/arm/src/efm32/efm32_dma.c @@ -297,7 +297,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vector */ - (void)irq_attach(EFM32_IRQ_DMA, efm32_dmac_interrupt, NULL); + irq_attach(EFM32_IRQ_DMA, efm32_dmac_interrupt, NULL); /* Enable the DMA controller */ @@ -336,7 +336,6 @@ DMA_HANDLE efm32_dmachannel(void) struct dma_channel_s *dmach; unsigned int chndx; uint32_t bit; - int ret; /* Take a count from from the channel counting semaphore. We may block * if there are no free channels. When we get the count, then we can @@ -344,35 +343,11 @@ DMA_HANDLE efm32_dmachannel(void) * reserved for us. */ - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_dmac.chansem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_dmac.chansem); /* Get exclusive access to the DMA channel list */ - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_dmac.exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_dmac.exclsem); /* Search for an available DMA channel */ diff --git a/arch/arm/src/efm32/efm32_i2c.c b/arch/arm/src/efm32/efm32_i2c.c index 8f2e0e98cf..74f6c37d3d 100644 --- a/arch/arm/src/efm32/efm32_i2c.c +++ b/arch/arm/src/efm32/efm32_i2c.c @@ -480,21 +480,7 @@ static const char *efm32_i2c_state_str(int i2c_state) static inline void efm32_i2c_sem_wait(FAR struct efm32_i2c_priv_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sem_excl); } /**************************************************************************** @@ -544,7 +530,7 @@ static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv) { /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -578,17 +564,16 @@ static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv) /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->sem_isr, &abstime); + ret = nxsem_timedwait_uninterruptible(&priv->sem_isr, &abstime); /* Disable I2C interrupts */ efm32_i2c_putreg(priv, EFM32_I2C_IEN_OFFSET, 0); - if (ret < 0 && ret != -EINTR) + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would include - * timeouts and mystery errors reported by nxsem_timedwait. NOTE that - * we try again if we are awakened by a signal (EINTR). + * timeouts and mystery errors reported by nxsem_timedwait. */ break; @@ -1495,7 +1480,7 @@ static int efm32_i2c_transfer(FAR struct i2c_master_s *dev, I2C_CMD_CLEARPC | I2C_CMD_CLEARTX); if (efm32_i2c_getreg(priv, EFM32_I2C_IF_OFFSET) & I2C_IF_RXDATAV) { - (void)efm32_i2c_getreg(priv, EFM32_I2C_RXDATA_OFFSET); + efm32_i2c_getreg(priv, EFM32_I2C_RXDATA_OFFSET); } /* Clear all pending interrupts prior to starting transfer. */ diff --git a/arch/arm/src/efm32/efm32_idle.c b/arch/arm/src/efm32/efm32_idle.c index 9a6d9f7e15..4764a024c7 100644 --- a/arch/arm/src/efm32/efm32_idle.c +++ b/arch/arm/src/efm32/efm32_idle.c @@ -119,7 +119,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { @@ -143,7 +143,7 @@ static void up_idlepm(void) break; case PM_SLEEP: - (void)efm32_pmstandby(); + efm32_pmstandby(); break; default: diff --git a/arch/arm/src/efm32/efm32_irq.c b/arch/arm/src/efm32/efm32_irq.c index a2b25d800d..d46722a94b 100644 --- a/arch/arm/src/efm32/efm32_irq.c +++ b/arch/arm/src/efm32/efm32_irq.c @@ -166,7 +166,7 @@ static void efm32_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int efm32_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -174,7 +174,7 @@ static int efm32_nmi(int irq, FAR void *context, FAR void *arg) static int efm32_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -182,7 +182,7 @@ static int efm32_busfault(int irq, FAR void *context, FAR void *arg) static int efm32_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -190,7 +190,7 @@ static int efm32_usagefault(int irq, FAR void *context, FAR void *arg) static int efm32_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -198,7 +198,7 @@ static int efm32_pendsv(int irq, FAR void *context, FAR void *arg) static int efm32_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -206,7 +206,7 @@ static int efm32_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int efm32_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/efm32/efm32_leserial.c b/arch/arm/src/efm32/efm32_leserial.c index dee04cef0d..3c48b5c3de 100644 --- a/arch/arm/src/efm32/efm32_leserial.c +++ b/arch/arm/src/efm32/efm32_leserial.c @@ -794,14 +794,14 @@ void up_serialinit(void) /* Register the console */ #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyLE0", &TTYLE0_DEV); + uart_register("/dev/ttyLE0", &TTYLE0_DEV); #ifdef TTYLE1_DEV - (void)uart_register("/dev/ttyLE1", &TTYLE1_DEV); + uart_register("/dev/ttyLE1", &TTYLE1_DEV); #endif } diff --git a/arch/arm/src/efm32/efm32_pwm.c b/arch/arm/src/efm32/efm32_pwm.c index 09f6dd7ae3..251c1443e5 100644 --- a/arch/arm/src/efm32/efm32_pwm.c +++ b/arch/arm/src/efm32/efm32_pwm.c @@ -481,7 +481,7 @@ static int pwm_interrupt(int irq, void *context, FAR void *arg) /* Disable first interrupts, stop and reset the timer */ - (void)pwm_stop((FAR struct pwm_lowerhalf_s *)priv); + pwm_stop((FAR struct pwm_lowerhalf_s *)priv); /* Then perform the callback into the upper half driver */ diff --git a/arch/arm/src/efm32/efm32_serial.c b/arch/arm/src/efm32/efm32_serial.c index 80eb14c3fd..db5c48a78c 100644 --- a/arch/arm/src/efm32/efm32_serial.c +++ b/arch/arm/src/efm32/efm32_serial.c @@ -1168,23 +1168,23 @@ void up_serialinit(void) /* Register the console */ #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif } diff --git a/arch/arm/src/efm32/efm32_spi.c b/arch/arm/src/efm32/efm32_spi.c index 00564cd6d1..929c84a1fc 100644 --- a/arch/arm/src/efm32/efm32_spi.c +++ b/arch/arm/src/efm32/efm32_spi.c @@ -377,7 +377,7 @@ static void spi_rxflush(const struct efm32_spiconfig_s *config) { /* Read and discard the data */ - (void)spi_getreg(config, EFM32_USART_RXDATA_OFFSET); + spi_getreg(config, EFM32_USART_RXDATA_OFFSET); } } @@ -437,24 +437,11 @@ static void spi_dma_timeout(int argc, uint32_t arg1, ...) static void spi_dmarxwait(struct efm32_spidev_s *priv) { irqstate_t flags; - int ret; /* Take the semaphore (perhaps waiting). */ flags = enter_critical_section(); - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->rxdmasem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->rxdmasem); /* Cancel the timeout only if both the RX and TX transfers have completed */ @@ -480,24 +467,11 @@ static void spi_dmarxwait(struct efm32_spidev_s *priv) static void spi_dmatxwait(struct efm32_spidev_s *priv) { irqstate_t flags; - int ret; /* Take the semaphore (perhaps waiting). */ flags = enter_critical_section(); - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->txdmasem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->txdmasem); /* Cancel the timeout only if both the RX and TX transfers have completed */ @@ -522,7 +496,7 @@ static void spi_dmatxwait(struct efm32_spidev_s *priv) #ifdef CONFIG_EFM32_SPI_DMA static inline void spi_dmarxwakeup(struct efm32_spidev_s *priv) { - (void)nxsem_post(&priv->rxdmasem); + nxsem_post(&priv->rxdmasem); } #endif @@ -537,7 +511,7 @@ static inline void spi_dmarxwakeup(struct efm32_spidev_s *priv) #ifdef CONFIG_EFM32_SPI_DMA static inline void spi_dmatxwakeup(struct efm32_spidev_s *priv) { - (void)nxsem_post(&priv->txdmasem); + nxsem_post(&priv->txdmasem); } #endif @@ -755,27 +729,15 @@ static inline void spi_dmatxstart(FAR struct efm32_spidev_s *priv) static int spi_lock(struct spi_dev_s *dev, bool lock) { struct efm32_spidev_s *priv = (struct efm32_spidev_s *)dev; + int ret; if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -1655,8 +1617,8 @@ static int spi_portinitialize(struct efm32_spidev_s *priv) /* Initialized semaphores used to wait for DMA completion */ - (void)nxsem_init(&priv->rxdmasem, 0, 0); - (void)nxsem_init(&priv->txdmasem, 0, 0); + nxsem_init(&priv->rxdmasem, 0, 0); + nxsem_init(&priv->txdmasem, 0, 0); /* These semaphores are used for signaling and, hence, should not have * priority inheritance enabled. diff --git a/arch/arm/src/efm32/efm32_timerisr.c b/arch/arm/src/efm32/efm32_timerisr.c index a4728df4d5..6fcea93f8a 100644 --- a/arch/arm/src/efm32/efm32_timerisr.c +++ b/arch/arm/src/efm32/efm32_timerisr.c @@ -125,7 +125,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(EFM32_IRQ_SYSTICK, (xcpt_t)efm32_timerisr, NULL); + irq_attach(EFM32_IRQ_SYSTICK, (xcpt_t)efm32_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/efm32/efm32_usbdev.c b/arch/arm/src/efm32/efm32_usbdev.c index e0de5b08fa..f9febfd938 100644 --- a/arch/arm/src/efm32/efm32_usbdev.c +++ b/arch/arm/src/efm32/efm32_usbdev.c @@ -1452,7 +1452,7 @@ static void efm32_rxfifo_discard(FAR struct efm32_ep_s *privep, int len) for (i = 0; i < len; i += 4) { volatile uint32_t data = efm32_getreg(regaddr); - (void)data; + UNUSED(data); } } } @@ -2223,7 +2223,7 @@ static inline void efm32_ep0out_stdrequest(struct efm32_usbdev_s *priv, { /* Actually, I think we could just stall here. */ - (void)efm32_req_dispatch(priv, &priv->ctrlreq); + efm32_req_dispatch(priv, &priv->ctrlreq); } } else @@ -2269,7 +2269,7 @@ static inline void efm32_ep0out_stdrequest(struct efm32_usbdev_s *priv, { /* Actually, I think we could just stall here. */ - (void)efm32_req_dispatch(priv, &priv->ctrlreq); + efm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2333,7 +2333,7 @@ static inline void efm32_ep0out_stdrequest(struct efm32_usbdev_s *priv, usbtrace(TRACE_INTDECODE(EFM32_TRACEINTID_GETSETDESC), 0); if ((ctrlreq->type & USB_REQ_RECIPIENT_MASK) == USB_REQ_RECIPIENT_DEVICE) { - (void)efm32_req_dispatch(priv, &priv->ctrlreq); + efm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2358,7 +2358,7 @@ static inline void efm32_ep0out_stdrequest(struct efm32_usbdev_s *priv, ctrlreq->index == 0 && ctrlreq->len == 1) { - (void)efm32_req_dispatch(priv, &priv->ctrlreq); + efm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2430,7 +2430,7 @@ static inline void efm32_ep0out_stdrequest(struct efm32_usbdev_s *priv, { usbtrace(TRACE_INTDECODE(EFM32_TRACEINTID_GETSETIF), 0); - (void)efm32_req_dispatch(priv, &priv->ctrlreq); + efm32_req_dispatch(priv, &priv->ctrlreq); } break; @@ -2508,7 +2508,7 @@ static inline void efm32_ep0out_setup(struct efm32_usbdev_s *priv) { /* Dispatch any non-standard requests */ - (void)efm32_req_dispatch(priv, &priv->ctrlreq); + efm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -4007,10 +4007,10 @@ static void efm32_ep0_configure(FAR struct efm32_usbdev_s *priv) { /* Enable EP0 IN and OUT */ - (void)efm32_epin_configure(&priv->epin[EP0], USB_EP_ATTR_XFER_CONTROL, - CONFIG_USBDEV_EP0_MAXSIZE); - (void)efm32_epout_configure(&priv->epout[EP0], USB_EP_ATTR_XFER_CONTROL, - CONFIG_USBDEV_EP0_MAXSIZE); + efm32_epin_configure(&priv->epin[EP0], USB_EP_ATTR_XFER_CONTROL, + CONFIG_USBDEV_EP0_MAXSIZE); + efm32_epout_configure(&priv->epout[EP0], USB_EP_ATTR_XFER_CONTROL, + CONFIG_USBDEV_EP0_MAXSIZE); } /**************************************************************************** diff --git a/arch/arm/src/efm32/efm32_usbhost.c b/arch/arm/src/efm32/efm32_usbhost.c index 03ce5361b0..0dbe111c60 100644 --- a/arch/arm/src/efm32/efm32_usbhost.c +++ b/arch/arm/src/efm32/efm32_usbhost.c @@ -723,21 +723,7 @@ static inline void efm32_modifyreg(uint32_t addr, uint32_t clrbits, uint32_t set static void efm32_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -1193,13 +1179,7 @@ static int efm32_chan_wait(FAR struct efm32_usbhost_s *priv, * wait here. */ - ret = nxsem_wait(&chan->waitsem); - - /* nxsem_wait should succeed. But it is possible that we could be - * awakened by a signal too. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&chan->waitsem); } while (chan->waiter); diff --git a/arch/arm/src/imx1/imx_decodeirq.c b/arch/arm/src/imx1/imx_decodeirq.c index 48164d9099..d41e34947e 100644 --- a/arch/arm/src/imx1/imx_decodeirq.c +++ b/arch/arm/src/imx1/imx_decodeirq.c @@ -137,7 +137,7 @@ void up_decodeirq(uint32_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/arm/src/imx1/imx_serial.c b/arch/arm/src/imx1/imx_serial.c index de0af5b025..94b7ef3073 100644 --- a/arch/arm/src/imx1/imx_serial.c +++ b/arch/arm/src/imx1/imx_serial.c @@ -1141,15 +1141,15 @@ void up_earlyserialinit(void) void up_serialinit(void) { #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); # ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); # ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); # endif # endif #endif diff --git a/arch/arm/src/imx1/imx_spi.c b/arch/arm/src/imx1/imx_spi.c index c9af7513c8..13747991e6 100644 --- a/arch/arm/src/imx1/imx_spi.c +++ b/arch/arm/src/imx1/imx_spi.c @@ -340,7 +340,7 @@ static void spi_txuint8(struct imx_spidev_s *priv) static void spi_rxnull(struct imx_spidev_s *priv) { - (void)spi_getreg(priv, CSPI_RXD_OFFSET); + spi_getreg(priv, CSPI_RXD_OFFSET); } static void spi_rxuint16(struct imx_spidev_s *priv) @@ -504,7 +504,6 @@ static int spi_transfer(struct imx_spidev_s *priv, const void *txbuffer, #ifndef CONFIG_SPI_POLLWAIT irqstate_t flags; uint32_t regval; - int ret; #endif int ntxd; @@ -558,13 +557,9 @@ static int spi_transfer(struct imx_spidev_s *priv, const void *txbuffer, * with the transfer, so it should be safe with no timeout. */ - do - { - /* Wait to be signaled from the interrupt handler */ + /* Wait to be signaled from the interrupt handler */ - ret = nxsem_wait(&priv->waitsem); - } - while (ret < 0 && ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); #else /* Perform the transfer using polling logic. This will totally @@ -713,19 +708,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->exclsem); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -919,7 +906,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; uint16_t response = 0; - (void)spi_transfer(priv, &wd, &response, 1); + spi_transfer(priv, &wd, &response, 1); return response; } @@ -948,7 +935,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, FAR void *rxbuffer, size_t nwords) { struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; - (void)spi_transfer(priv, txbuffer, rxbuffer, nwords); + spi_transfer(priv, txbuffer, rxbuffer, nwords); } #endif @@ -975,7 +962,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords) { struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; - (void)spi_transfer(priv, buffer, NULL, nwords); + spi_transfer(priv, buffer, NULL, nwords); } #endif @@ -1002,7 +989,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords) { struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; - (void)spi_transfer(priv, NULL, buffer, nwords); + spi_transfer(priv, NULL, buffer, nwords); } #endif diff --git a/arch/arm/src/imx6/imx_cpuboot.c b/arch/arm/src/imx6/imx_cpuboot.c index b92c3b19d5..42e5d4a4e1 100644 --- a/arch/arm/src/imx6/imx_cpuboot.c +++ b/arch/arm/src/imx6/imx_cpuboot.c @@ -298,7 +298,7 @@ void arm_cpu_boot(int cpu) #ifndef CONFIG_SUPPRESS_INTERRUPTS /* And finally, enable interrupts */ - (void)up_irq_enable(); + up_irq_enable(); #endif /* The next thing that we expect to happen is for logic running on CPU0 diff --git a/arch/arm/src/imx6/imx_ecspi.c b/arch/arm/src/imx6/imx_ecspi.c index a679b4a3f3..a1631e345d 100644 --- a/arch/arm/src/imx6/imx_ecspi.c +++ b/arch/arm/src/imx6/imx_ecspi.c @@ -465,7 +465,7 @@ static void spi_txuint8(struct imx_spidev_s *priv) static void spi_rxnull(struct imx_spidev_s *priv) { - (void)spi_getreg(priv, ECSPI_RXDATA_OFFSET); + spi_getreg(priv, ECSPI_RXDATA_OFFSET); } static void spi_rxuint16(struct imx_spidev_s *priv) @@ -629,7 +629,6 @@ static int spi_transfer(struct imx_spidev_s *priv, const void *txbuffer, #ifndef CONFIG_SPI_POLLWAIT irqstate_t flags; uint32_t regval; - int ret; #endif int ntxd; @@ -683,13 +682,9 @@ static int spi_transfer(struct imx_spidev_s *priv, const void *txbuffer, * with the transfer, so it should be safe with no timeout. */ - do - { - /* Wait to be signaled from the interrupt handler */ + /* Wait to be signaled from the interrupt handler */ - ret = nxsem_wait(&priv->waitsem); - } - while (ret < 0 && ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); #else /* Perform the transfer using polling logic. This will totally @@ -798,19 +793,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->exclsem); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -1032,7 +1019,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; uint16_t response = 0; - (void)spi_transfer(priv, &wd, &response, 1); + spi_transfer(priv, &wd, &response, 1); return response; } @@ -1133,7 +1120,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, FAR void *rxbuffer, size_t nwords) { struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; - (void)spi_transfer(priv, txbuffer, rxbuffer, nwords); + spi_transfer(priv, txbuffer, rxbuffer, nwords); } #endif @@ -1160,7 +1147,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords) { struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; - (void)spi_transfer(priv, buffer, NULL, nwords); + spi_transfer(priv, buffer, NULL, nwords); } #endif @@ -1187,7 +1174,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords) { struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; - (void)spi_transfer(priv, NULL, buffer, nwords); + spi_transfer(priv, NULL, buffer, nwords); } #endif diff --git a/arch/arm/src/imx6/imx_irq.c b/arch/arm/src/imx6/imx_irq.c index 4b172aa566..5006a1f053 100644 --- a/arch/arm/src/imx6/imx_irq.c +++ b/arch/arm/src/imx6/imx_irq.c @@ -183,6 +183,6 @@ void up_irqinitialize(void) /* And finally, enable interrupts */ - (void)up_irq_enable(); + up_irq_enable(); #endif } diff --git a/arch/arm/src/imx6/imx_lowputc.c b/arch/arm/src/imx6/imx_lowputc.c index 782861ce68..c3c3225f4b 100644 --- a/arch/arm/src/imx6/imx_lowputc.c +++ b/arch/arm/src/imx6/imx_lowputc.c @@ -188,13 +188,13 @@ void imx_lowsetup(void) * control is enabled. REVISIT: DTR, DCD, RI, and DSR -- not configured. */ - (void)imx_config_gpio(GPIO_UART1_RX_DATA); - (void)imx_config_gpio(GPIO_UART1_TX_DATA); + imx_config_gpio(GPIO_UART1_RX_DATA); + imx_config_gpio(GPIO_UART1_TX_DATA); #ifdef CONFIG_UART1_OFLOWCONTROL - (void)imx_config_gpio(GPIO_UART1_CTS); + imx_config_gpio(GPIO_UART1_CTS); #endif #ifdef CONFIG_UART1_IFLOWCONTROL - (void)imx_config_gpio(GPIO_UART1_RTS); + imx_config_gpio(GPIO_UART1_RTS); #endif #endif @@ -210,13 +210,13 @@ void imx_lowsetup(void) * control is enabled. */ - (void)imx_config_gpio(GPIO_UART2_RX_DATA); - (void)imx_config_gpio(GPIO_UART2_TX_DATA); + imx_config_gpio(GPIO_UART2_RX_DATA); + imx_config_gpio(GPIO_UART2_TX_DATA); #ifdef CONFIG_UART1_OFLOWCONTROL - (void)imx_config_gpio(GPIO_UART2_CTS); + imx_config_gpio(GPIO_UART2_CTS); #endif #ifdef CONFIG_UART1_IFLOWCONTROL - (void)imx_config_gpio(GPIO_UART2_RTS); + imx_config_gpio(GPIO_UART2_RTS); #endif #endif @@ -232,13 +232,13 @@ void imx_lowsetup(void) * control is enabled. */ - (void)imx_config_gpio(GPIO_UART3_RX_DATA); - (void)imx_config_gpio(GPIO_UART3_TX_DATA); + imx_config_gpio(GPIO_UART3_RX_DATA); + imx_config_gpio(GPIO_UART3_TX_DATA); #ifdef CONFIG_UART1_OFLOWCONTROL - (void)imx_config_gpio(GPIO_UART3_CTS); + imx_config_gpio(GPIO_UART3_CTS); #endif #ifdef CONFIG_UART1_IFLOWCONTROL - (void)imx_config_gpio(GPIO_UART3_RTS); + imx_config_gpio(GPIO_UART3_RTS); #endif #endif @@ -254,13 +254,13 @@ void imx_lowsetup(void) * control is enabled. */ - (void)imx_config_gpio(GPIO_UART4_RX_DATA); - (void)imx_config_gpio(GPIO_UART4_TX_DATA); + imx_config_gpio(GPIO_UART4_RX_DATA); + imx_config_gpio(GPIO_UART4_TX_DATA); #ifdef CONFIG_UART1_OFLOWCONTROL - (void)imx_config_gpio(GPIO_UART4_CTS); + imx_config_gpio(GPIO_UART4_CTS); #endif #ifdef CONFIG_UART1_IFLOWCONTROL - (void)imx_config_gpio(GPIO_UART4_RTS); + imx_config_gpio(GPIO_UART4_RTS); #endif #endif @@ -276,20 +276,20 @@ void imx_lowsetup(void) * control is enabled. */ - (void)imx_config_gpio(GPIO_UART5_RX_DATA); - (void)imx_config_gpio(GPIO_UART5_TX_DATA); + imx_config_gpio(GPIO_UART5_RX_DATA); + imx_config_gpio(GPIO_UART5_TX_DATA); #ifdef CONFIG_UART1_OFLOWCONTROL - (void)imx_config_gpio(GPIO_UART5_CTS); + imx_config_gpio(GPIO_UART5_CTS); #endif #ifdef CONFIG_UART1_IFLOWCONTROL - (void)imx_config_gpio(GPIO_UART5_RTS); + imx_config_gpio(GPIO_UART5_RTS); #endif #endif #ifdef IMX_HAVE_UART_CONSOLE /* Configure the serial console for initial, non-interrupt driver mode */ - (void)imx_uart_configure(IMX_CONSOLE_VBASE, &g_console_config); + imx_uart_configure(IMX_CONSOLE_VBASE, &g_console_config); #endif #endif /* IMX_HAVE_UART */ #endif /* CONFIG_SUPPRESS_UART_CONFIG */ diff --git a/arch/arm/src/imx6/imx_serial.c b/arch/arm/src/imx6/imx_serial.c index 21557688f3..41bae86cc8 100644 --- a/arch/arm/src/imx6/imx_serial.c +++ b/arch/arm/src/imx6/imx_serial.c @@ -601,7 +601,7 @@ static int imx_attach(struct uart_dev_s *dev) { /* Configure as a (high) level interrupt */ - (void)arm_gic_irq_trigger(priv->irq, false); + arm_gic_irq_trigger(priv->irq, false); /* Enable the interrupt (RX and TX interrupts are still disabled * in the UART @@ -922,19 +922,19 @@ void imx_earlyserialinit(void) void up_serialinit(void) { #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); # ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); # ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); # ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS2_DEV); + uart_register("/dev/ttyS3", &TTYS2_DEV); # ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS2_DEV); + uart_register("/dev/ttyS4", &TTYS2_DEV); # endif # endif # endif diff --git a/arch/arm/src/imx6/imx_timerisr.c b/arch/arm/src/imx6/imx_timerisr.c index c9ee3ce5be..2f48358a67 100644 --- a/arch/arm/src/imx6/imx_timerisr.c +++ b/arch/arm/src/imx6/imx_timerisr.c @@ -256,11 +256,11 @@ void arm_timer_initialize(void) /* Configure as a (rising) edge-triggered interrupt */ - (void)arm_gic_irq_trigger(IMX_IRQ_GPT, true); + arm_gic_irq_trigger(IMX_IRQ_GPT, true); /* Attach the timer interrupt vector */ - (void)irq_attach(IMX_IRQ_GPT, (xcpt_t)imx_timerisr, NULL); + irq_attach(IMX_IRQ_GPT, (xcpt_t)imx_timerisr, NULL); /* Enable all three GPT output compare interrupts */ diff --git a/arch/arm/src/imxrt/imxrt_edma.c b/arch/arm/src/imxrt/imxrt_edma.c index 18c79019d6..932c1e7db6 100644 --- a/arch/arm/src/imxrt/imxrt_edma.c +++ b/arch/arm/src/imxrt/imxrt_edma.c @@ -185,26 +185,12 @@ static struct imxrt_edmatcd_s g_tcd_pool[CONFIG_IMXRT_EDMA_NTCD] static void imxrt_takechsem(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_edma.chsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR || ret == -ECANCELED); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_edma.chsem); } static inline void imxrt_givechsem(void) { - (void)nxsem_post(&g_edma.chsem); + nxsem_post(&g_edma.chsem); } /**************************************************************************** @@ -218,26 +204,12 @@ static inline void imxrt_givechsem(void) #if CONFIG_IMXRT_EDMA_NTCD > 0 static void imxrt_takedsem(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_edma.dsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR || ret == -ECANCELED); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_edma.dsem); } static inline void imxrt_givedsem(void) { - (void)nxsem_post(&g_edma.dsem); + nxsem_post(&g_edma.dsem); } #endif @@ -296,7 +268,7 @@ static void imxrt_tcd_free(struct imxrt_edmatcd_s *tcd) flags = spin_lock_irqsave(); sq_addlast((sq_entry_t *)tcd, &g_tcd_free); - (void)imxrt_givedsem(); + imxrt_givedsem(); spin_unlock_irqrestore(flags); } #endif @@ -811,26 +783,26 @@ void weak_function up_dma_initialize(void) * NOTE that there are only 16 vectors for 32 DMA channels. */ - (void)irq_attach(IMXRT_IRQ_EDMA0_16, imxrt_edma_interrupt, &g_edma.dmach[0]); - (void)irq_attach(IMXRT_IRQ_EDMA1_17, imxrt_edma_interrupt, &g_edma.dmach[1]); - (void)irq_attach(IMXRT_IRQ_EDMA2_18, imxrt_edma_interrupt, &g_edma.dmach[2]); - (void)irq_attach(IMXRT_IRQ_EDMA3_19, imxrt_edma_interrupt, &g_edma.dmach[3]); - (void)irq_attach(IMXRT_IRQ_EDMA4_20, imxrt_edma_interrupt, &g_edma.dmach[4]); - (void)irq_attach(IMXRT_IRQ_EDMA5_21, imxrt_edma_interrupt, &g_edma.dmach[5]); - (void)irq_attach(IMXRT_IRQ_EDMA6_22, imxrt_edma_interrupt, &g_edma.dmach[6]); - (void)irq_attach(IMXRT_IRQ_EDMA7_23, imxrt_edma_interrupt, &g_edma.dmach[7]); - (void)irq_attach(IMXRT_IRQ_EDMA8_24, imxrt_edma_interrupt, &g_edma.dmach[8]); - (void)irq_attach(IMXRT_IRQ_EDMA9_25, imxrt_edma_interrupt, &g_edma.dmach[9]); - (void)irq_attach(IMXRT_IRQ_EDMA10_26, imxrt_edma_interrupt, &g_edma.dmach[10]); - (void)irq_attach(IMXRT_IRQ_EDMA11_27, imxrt_edma_interrupt, &g_edma.dmach[11]); - (void)irq_attach(IMXRT_IRQ_EDMA12_28, imxrt_edma_interrupt, &g_edma.dmach[12]); - (void)irq_attach(IMXRT_IRQ_EDMA13_29, imxrt_edma_interrupt, &g_edma.dmach[13]); - (void)irq_attach(IMXRT_IRQ_EDMA14_30, imxrt_edma_interrupt, &g_edma.dmach[14]); - (void)irq_attach(IMXRT_IRQ_EDMA15_31, imxrt_edma_interrupt, &g_edma.dmach[15]); + irq_attach(IMXRT_IRQ_EDMA0_16, imxrt_edma_interrupt, &g_edma.dmach[0]); + irq_attach(IMXRT_IRQ_EDMA1_17, imxrt_edma_interrupt, &g_edma.dmach[1]); + irq_attach(IMXRT_IRQ_EDMA2_18, imxrt_edma_interrupt, &g_edma.dmach[2]); + irq_attach(IMXRT_IRQ_EDMA3_19, imxrt_edma_interrupt, &g_edma.dmach[3]); + irq_attach(IMXRT_IRQ_EDMA4_20, imxrt_edma_interrupt, &g_edma.dmach[4]); + irq_attach(IMXRT_IRQ_EDMA5_21, imxrt_edma_interrupt, &g_edma.dmach[5]); + irq_attach(IMXRT_IRQ_EDMA6_22, imxrt_edma_interrupt, &g_edma.dmach[6]); + irq_attach(IMXRT_IRQ_EDMA7_23, imxrt_edma_interrupt, &g_edma.dmach[7]); + irq_attach(IMXRT_IRQ_EDMA8_24, imxrt_edma_interrupt, &g_edma.dmach[8]); + irq_attach(IMXRT_IRQ_EDMA9_25, imxrt_edma_interrupt, &g_edma.dmach[9]); + irq_attach(IMXRT_IRQ_EDMA10_26, imxrt_edma_interrupt, &g_edma.dmach[10]); + irq_attach(IMXRT_IRQ_EDMA11_27, imxrt_edma_interrupt, &g_edma.dmach[11]); + irq_attach(IMXRT_IRQ_EDMA12_28, imxrt_edma_interrupt, &g_edma.dmach[12]); + irq_attach(IMXRT_IRQ_EDMA13_29, imxrt_edma_interrupt, &g_edma.dmach[13]); + irq_attach(IMXRT_IRQ_EDMA14_30, imxrt_edma_interrupt, &g_edma.dmach[14]); + irq_attach(IMXRT_IRQ_EDMA15_31, imxrt_edma_interrupt, &g_edma.dmach[15]); /* Attach the DMA error interrupt vector */ - (void)irq_attach(IMXRT_IRQ_EDMA_ERROR, imxrt_error_interrupt, NULL); + irq_attach(IMXRT_IRQ_EDMA_ERROR, imxrt_error_interrupt, NULL); /* Disable and clear all error interrupts */ diff --git a/arch/arm/src/imxrt/imxrt_ehci.c b/arch/arm/src/imxrt/imxrt_ehci.c index be5e7bef97..2a98806bdf 100644 --- a/arch/arm/src/imxrt/imxrt_ehci.c +++ b/arch/arm/src/imxrt/imxrt_ehci.c @@ -1022,21 +1022,7 @@ static int ehci_wait_usbsts(uint32_t maskbits, uint32_t donebits, static void imxrt_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -1652,7 +1638,7 @@ static void imxrt_qh_enqueue(struct imxrt_qh_s *qhead, struct imxrt_qh_s *qh) */ qh->fqp = qh->hw.overlay.nqp; - (void)imxrt_qh_dump(qh, NULL, NULL); + imxrt_qh_dump(qh, NULL, NULL); /* Add the new QH to the head of the asynchronous queue list. * diff --git a/arch/arm/src/imxrt/imxrt_enc.c b/arch/arm/src/imxrt/imxrt_enc.c index 0b39c9b485..b8463c1ca9 100644 --- a/arch/arm/src/imxrt/imxrt_enc.c +++ b/arch/arm/src/imxrt/imxrt_enc.c @@ -560,21 +560,7 @@ void imxrt_enc_clock_disable (uint32_t base) static inline void imxrt_enc_sem_wait(FAR struct imxrt_enc_lowerhalf_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sem_excl); } /************************************************************************************ diff --git a/arch/arm/src/imxrt/imxrt_enet.c b/arch/arm/src/imxrt/imxrt_enet.c index 423080f5b2..c2c3a0f077 100644 --- a/arch/arm/src/imxrt/imxrt_enet.c +++ b/arch/arm/src/imxrt/imxrt_enet.c @@ -563,8 +563,8 @@ static int imxrt_transmit(FAR struct imxrt_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, IMXRT_TXTIMEOUT, imxrt_txtimeout_expiry, 1, - (wdparm_t)priv); + wd_start(priv->txtimeout, IMXRT_TXTIMEOUT, imxrt_txtimeout_expiry, 1, + (wdparm_t)priv); /* Start the TX transfer (if it was not already waiting for buffers) */ @@ -964,7 +964,7 @@ static void imxrt_txdone(FAR struct imxrt_driver_s *priv) * new XMIT data */ - (void)devif_poll(&priv->dev, imxrt_txpoll); + devif_poll(&priv->dev, imxrt_txpoll); } /**************************************************************************** @@ -1034,8 +1034,8 @@ static void imxrt_enet_interrupt_work(FAR void *arg) galrstore = getreg32(IMXRT_ENET_GALR); #endif - (void)imxrt_ifdown(&priv->dev); - (void)imxrt_ifup_action(&priv->dev, false); + imxrt_ifdown(&priv->dev); + imxrt_ifup_action(&priv->dev, false); #ifdef CONFIG_NET_MCASTGROUP /* Now write the multicast table back */ @@ -1046,7 +1046,7 @@ static void imxrt_enet_interrupt_work(FAR void *arg) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->dev, imxrt_txpoll); + devif_poll(&priv->dev, imxrt_txpoll); } else { @@ -1152,12 +1152,12 @@ static void imxrt_txtimeout_work(FAR void *arg) * aggressive hardware reset. */ - (void)imxrt_ifdown(&priv->dev); - (void)imxrt_ifup_action(&priv->dev, false); + imxrt_ifdown(&priv->dev); + imxrt_ifup_action(&priv->dev, false); /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->dev, imxrt_txpoll); + devif_poll(&priv->dev, imxrt_txpoll); net_unlock(); } @@ -1231,13 +1231,13 @@ static void imxrt_poll_work(FAR void *arg) * transmit in progress, we will missing TCP time state updates? */ - (void)devif_timer(&priv->dev, IMXRT_WDDELAY, imxrt_txpoll); + devif_timer(&priv->dev, IMXRT_WDDELAY, imxrt_txpoll); } /* Setup the watchdog poll timer again in any case */ - (void)wd_start(priv->txpoll, IMXRT_WDDELAY, imxrt_polltimer_expiry, - 1, (wdparm_t)priv); + wd_start(priv->txpoll, IMXRT_WDDELAY, imxrt_polltimer_expiry, + 1, (wdparm_t)priv); net_unlock(); } @@ -1368,8 +1368,8 @@ static int imxrt_ifup_action(struct net_driver_s *dev, bool resetphy) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, IMXRT_WDDELAY, imxrt_polltimer_expiry, 1, - (wdparm_t)priv); + wd_start(priv->txpoll, IMXRT_WDDELAY, imxrt_polltimer_expiry, 1, + (wdparm_t)priv); /* Clear all pending ENET interrupt */ @@ -1506,7 +1506,7 @@ static void imxrt_txavail_work(FAR void *arg) * new XMIT data. */ - (void)devif_poll(&priv->dev, imxrt_txpoll); + devif_poll(&priv->dev, imxrt_txpoll); } } @@ -2568,11 +2568,11 @@ int imxrt_netinitialize(int intf) * the device and/or calling imxrt_ifdown(). */ - (void)imxrt_ifdown(&priv->dev); + imxrt_ifdown(&priv->dev); /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->dev, NET_LL_ETHERNET); + netdev_register(&priv->dev, NET_LL_ETHERNET); UNUSED(ret); return OK; @@ -2592,7 +2592,7 @@ int imxrt_netinitialize(int intf) #if CONFIG_IMXRT_ENET_NETHIFS == 1 && !defined(CONFIG_NETDEV_LATEINIT) void up_netinitialize(void) { - (void)imxrt_netinitialize(0); + imxrt_netinitialize(0); } #endif diff --git a/arch/arm/src/imxrt/imxrt_idle.c b/arch/arm/src/imxrt/imxrt_idle.c index 38620f72c5..0028633f75 100644 --- a/arch/arm/src/imxrt/imxrt_idle.c +++ b/arch/arm/src/imxrt/imxrt_idle.c @@ -108,7 +108,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { @@ -132,7 +132,7 @@ static void up_idlepm(void) break; case PM_SLEEP: - (void)imxrt_pmstandby(); + imxrt_pmstandby(); break; default: diff --git a/arch/arm/src/imxrt/imxrt_irq.c b/arch/arm/src/imxrt/imxrt_irq.c index 60475b3e96..b3879b8b2d 100644 --- a/arch/arm/src/imxrt/imxrt_irq.c +++ b/arch/arm/src/imxrt/imxrt_irq.c @@ -208,7 +208,7 @@ static void imxrt_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int imxrt_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -216,7 +216,7 @@ static int imxrt_nmi(int irq, FAR void *context, FAR void *arg) static int imxrt_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -224,7 +224,7 @@ static int imxrt_busfault(int irq, FAR void *context, FAR void *arg) static int imxrt_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -232,7 +232,7 @@ static int imxrt_usagefault(int irq, FAR void *context, FAR void *arg) static int imxrt_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -240,7 +240,7 @@ static int imxrt_pendsv(int irq, FAR void *context, FAR void *arg) static int imxrt_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -248,7 +248,7 @@ static int imxrt_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int imxrt_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/imxrt/imxrt_lowputc.c b/arch/arm/src/imxrt/imxrt_lowputc.c index 7d88351ef0..f49310b56e 100644 --- a/arch/arm/src/imxrt/imxrt_lowputc.c +++ b/arch/arm/src/imxrt/imxrt_lowputc.c @@ -230,14 +230,14 @@ void imxrt_lowsetup(void) * control is enabled. */ - (void)imxrt_config_gpio(GPIO_LPUART1_RX); - (void)imxrt_config_gpio(GPIO_LPUART1_TX); + imxrt_config_gpio(GPIO_LPUART1_RX); + imxrt_config_gpio(GPIO_LPUART1_TX); #ifdef CONFIG_LPUART1_OFLOWCONTROL - (void)imxrt_config_gpio(GPIO_LPUART1_CTS); + imxrt_config_gpio(GPIO_LPUART1_CTS); #endif #if ((defined(CONFIG_SERIAL_RS485CONTROL) && defined(CONFIG_LPUART1_RS485RTSCONTROL)) || \ (defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_LPUART1_IFLOWCONTROL))) - (void)imxrt_config_gpio(GPIO_LPUART1_RTS); + imxrt_config_gpio(GPIO_LPUART1_RTS); #endif #endif @@ -247,14 +247,14 @@ void imxrt_lowsetup(void) * control is enabled. */ - (void)imxrt_config_gpio(GPIO_LPUART2_RX); - (void)imxrt_config_gpio(GPIO_LPUART2_TX); + imxrt_config_gpio(GPIO_LPUART2_RX); + imxrt_config_gpio(GPIO_LPUART2_TX); #ifdef CONFIG_LPUART2_OFLOWCONTROL - (void)imxrt_config_gpio(GPIO_LPUART2_CTS); + imxrt_config_gpio(GPIO_LPUART2_CTS); #endif #if ((defined(CONFIG_SERIAL_RS485CONTROL) && defined(CONFIG_LPUART2_RS485RTSCONTROL)) || \ (defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_LPUART2_IFLOWCONTROL))) - (void)imxrt_config_gpio(GPIO_LPUART2_RTS); + imxrt_config_gpio(GPIO_LPUART2_RTS); #endif #endif @@ -264,14 +264,14 @@ void imxrt_lowsetup(void) * control is enabled. */ - (void)imxrt_config_gpio(GPIO_LPUART3_RX); - (void)imxrt_config_gpio(GPIO_LPUART3_TX); + imxrt_config_gpio(GPIO_LPUART3_RX); + imxrt_config_gpio(GPIO_LPUART3_TX); #ifdef CONFIG_LPUART3_OFLOWCONTROL - (void)imxrt_config_gpio(GPIO_LPUART3_CTS); + imxrt_config_gpio(GPIO_LPUART3_CTS); #endif #if ((defined(CONFIG_SERIAL_RS485CONTROL) && defined(CONFIG_LPUART3_RS485RTSCONTROL)) || \ (defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_LPUART3_IFLOWCONTROL))) - (void)imxrt_config_gpio(GPIO_LPUART3_RTS); + imxrt_config_gpio(GPIO_LPUART3_RTS); #endif #endif @@ -281,14 +281,14 @@ void imxrt_lowsetup(void) * control is enabled. */ - (void)imxrt_config_gpio(GPIO_LPUART4_RX); - (void)imxrt_config_gpio(GPIO_LPUART4_TX); + imxrt_config_gpio(GPIO_LPUART4_RX); + imxrt_config_gpio(GPIO_LPUART4_TX); #ifdef CONFIG_LPUART4_OFLOWCONTROL - (void)imxrt_config_gpio(GPIO_LPUART4_CTS); + imxrt_config_gpio(GPIO_LPUART4_CTS); #endif #if ((defined(CONFIG_SERIAL_RS485CONTROL) && defined(CONFIG_LPUART4_RS485RTSCONTROL)) || \ (defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_LPUART4_IFLOWCONTROL))) - (void)imxrt_config_gpio(GPIO_LPUART4_RTS); + imxrt_config_gpio(GPIO_LPUART4_RTS); #endif #endif @@ -298,14 +298,14 @@ void imxrt_lowsetup(void) * control is enabled. */ - (void)imxrt_config_gpio(GPIO_LPUART5_RX); - (void)imxrt_config_gpio(GPIO_LPUART5_TX); + imxrt_config_gpio(GPIO_LPUART5_RX); + imxrt_config_gpio(GPIO_LPUART5_TX); #ifdef CONFIG_LPUART5_OFLOWCONTROL - (void)imxrt_config_gpio(GPIO_LPUART5_CTS); + imxrt_config_gpio(GPIO_LPUART5_CTS); #endif #if ((defined(CONFIG_SERIAL_RS485CONTROL) && defined(CONFIG_LPUART5_RS485RTSCONTROL)) || \ (defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_LPUART5_IFLOWCONTROL))) - (void)imxrt_config_gpio(GPIO_LPUART5_RTS); + imxrt_config_gpio(GPIO_LPUART5_RTS); #endif #endif @@ -315,14 +315,14 @@ void imxrt_lowsetup(void) * control is enabled. */ - (void)imxrt_config_gpio(GPIO_LPUART6_RX); - (void)imxrt_config_gpio(GPIO_LPUART6_TX); + imxrt_config_gpio(GPIO_LPUART6_RX); + imxrt_config_gpio(GPIO_LPUART6_TX); #ifdef CONFIG_LPUART6_OFLOWCONTROL - (void)imxrt_config_gpio(GPIO_LPUART6_CTS); + imxrt_config_gpio(GPIO_LPUART6_CTS); #endif #if ((defined(CONFIG_SERIAL_RS485CONTROL) && defined(CONFIG_LPUART6_RS485RTSCONTROL)) || \ (defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_LPUART6_IFLOWCONTROL))) - (void)imxrt_config_gpio(GPIO_LPUART6_RTS); + imxrt_config_gpio(GPIO_LPUART6_RTS); #endif #endif @@ -332,14 +332,14 @@ void imxrt_lowsetup(void) * control is enabled. */ - (void)imxrt_config_gpio(GPIO_LPUART7_RX); - (void)imxrt_config_gpio(GPIO_LPUART7_TX); + imxrt_config_gpio(GPIO_LPUART7_RX); + imxrt_config_gpio(GPIO_LPUART7_TX); #ifdef CONFIG_LPUART7_OFLOWCONTROL - (void)imxrt_config_gpio(GPIO_LPUART7_CTS); + imxrt_config_gpio(GPIO_LPUART7_CTS); #endif #if ((defined(CONFIG_SERIAL_RS485CONTROL) && defined(CONFIG_LPUART7_RS485RTSCONTROL)) || \ (defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_LPUART7_IFLOWCONTROL))) - (void)imxrt_config_gpio(GPIO_LPUART7_RTS); + imxrt_config_gpio(GPIO_LPUART7_RTS); #endif #endif @@ -349,21 +349,21 @@ void imxrt_lowsetup(void) * control is enabled. */ - (void)imxrt_config_gpio(GPIO_LPUART8_RX); - (void)imxrt_config_gpio(GPIO_LPUART8_TX); + imxrt_config_gpio(GPIO_LPUART8_RX); + imxrt_config_gpio(GPIO_LPUART8_TX); #ifdef CONFIG_LPUART8_OFLOWCONTROL - (void)imxrt_config_gpio(GPIO_LPUART8_CTS); + imxrt_config_gpio(GPIO_LPUART8_CTS); #endif #if ((defined(CONFIG_SERIAL_RS485CONTROL) && defined(CONFIG_LPUART8_RS485RTSCONTROL)) || \ (defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_LPUART8_IFLOWCONTROL))) - (void)imxrt_config_gpio(GPIO_LPUART8_RTS); + imxrt_config_gpio(GPIO_LPUART8_RTS); #endif #endif #ifdef HAVE_LPUART_CONSOLE /* Configure the serial console for initial, non-interrupt driver mode */ - (void)imxrt_lpuart_configure(IMXRT_CONSOLE_BASE, &g_console_config); + imxrt_lpuart_configure(IMXRT_CONSOLE_BASE, &g_console_config); #endif #endif /* HAVE_LPUART_DEVICE */ #endif /* CONFIG_SUPPRESS_LPUART_CONFIG */ diff --git a/arch/arm/src/imxrt/imxrt_lpi2c.c b/arch/arm/src/imxrt/imxrt_lpi2c.c index 20c0f8032f..2209f82deb 100644 --- a/arch/arm/src/imxrt/imxrt_lpi2c.c +++ b/arch/arm/src/imxrt/imxrt_lpi2c.c @@ -518,21 +518,7 @@ static inline void imxrt_lpi2c_modifyreg(FAR struct imxrt_lpi2c_priv_s *priv, static inline void imxrt_lpi2c_sem_wait(FAR struct imxrt_lpi2c_priv_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sem_excl); } /**************************************************************************** @@ -618,7 +604,7 @@ static inline int imxrt_lpi2c_sem_waitdone(FAR struct imxrt_lpi2c_priv_s *priv) { /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -647,12 +633,11 @@ static inline int imxrt_lpi2c_sem_waitdone(FAR struct imxrt_lpi2c_priv_s *priv) /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->sem_isr, &abstime); - if (ret < 0 && ret != -EINTR) + ret = nxsem_timedwait_uninterruptible(&priv->sem_isr, &abstime); + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would * include timeouts and mystery errors reported by nxsem_timedwait. - * NOTE that we try again if we are awakened by a signal (EINTR). */ break; @@ -1378,7 +1363,7 @@ static int imxrt_lpi2c_isr_process(struct imxrt_lpi2c_priv_s *priv) * and wake it up */ - sem_post(&priv->sem_isr); + nxsem_post(&priv->sem_isr); priv->intstate = INTSTATE_DONE; } #else @@ -1431,7 +1416,7 @@ static int imxrt_lpi2c_isr_process(struct imxrt_lpi2c_priv_s *priv) * and wake it up */ - sem_post(&priv->sem_isr); + nxsem_post(&priv->sem_isr); priv->intstate = INTSTATE_DONE; } #else @@ -1531,8 +1516,8 @@ static int imxrt_lpi2c_init(FAR struct imxrt_lpi2c_priv_s *priv) /* Configure pins */ - (void)imxrt_config_gpio(priv->config->scl_pin); - (void)imxrt_config_gpio(priv->config->sda_pin); + imxrt_config_gpio(priv->config->scl_pin); + imxrt_config_gpio(priv->config->sda_pin); /* Enable power and reset the peripheral */ diff --git a/arch/arm/src/imxrt/imxrt_lpspi.c b/arch/arm/src/imxrt/imxrt_lpspi.c index 341dd4fc80..b9e801d673 100644 --- a/arch/arm/src/imxrt/imxrt_lpspi.c +++ b/arch/arm/src/imxrt/imxrt_lpspi.c @@ -857,24 +857,11 @@ static int imxrt_lpspi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -1577,9 +1564,9 @@ FAR struct spi_dev_s *imxrt_lpspibus_initialize(int bus) { /* Configure SPI1 pins: SCK, MISO, and MOSI */ - (void)imxrt_config_gpio(GPIO_LPSPI1_SCK); - (void)imxrt_config_gpio(GPIO_LPSPI1_MISO); - (void)imxrt_config_gpio(GPIO_LPSPI1_MOSI); + imxrt_config_gpio(GPIO_LPSPI1_SCK); + imxrt_config_gpio(GPIO_LPSPI1_MISO); + imxrt_config_gpio(GPIO_LPSPI1_MOSI); /* Set up default configuration: Master, 8-bit, etc. */ @@ -1601,9 +1588,9 @@ FAR struct spi_dev_s *imxrt_lpspibus_initialize(int bus) { /* Configure SPI2 pins: SCK, MISO, and MOSI */ - (void)imxrt_config_gpio(GPIO_LPSPI2_SCK); - (void)imxrt_config_gpio(GPIO_LPSPI2_MISO); - (void)imxrt_config_gpio(GPIO_LPSPI2_MOSI); + imxrt_config_gpio(GPIO_LPSPI2_SCK); + imxrt_config_gpio(GPIO_LPSPI2_MISO); + imxrt_config_gpio(GPIO_LPSPI2_MOSI); /* Set up default configuration: Master, 8-bit, etc. */ @@ -1625,9 +1612,9 @@ FAR struct spi_dev_s *imxrt_lpspibus_initialize(int bus) { /* Configure SPI3 pins: SCK, MISO, and MOSI */ - (void)imxrt_config_gpio(GPIO_LPSPI3_SCK); - (void)imxrt_config_gpio(GPIO_LPSPI3_MISO); - (void)imxrt_config_gpio(GPIO_LPSPI3_MOSI); + imxrt_config_gpio(GPIO_LPSPI3_SCK); + imxrt_config_gpio(GPIO_LPSPI3_MISO); + imxrt_config_gpio(GPIO_LPSPI3_MOSI); /* Set up default configuration: Master, 8-bit, etc. */ @@ -1649,9 +1636,9 @@ FAR struct spi_dev_s *imxrt_lpspibus_initialize(int bus) { /* Configure SPI4 pins: SCK, MISO, and MOSI */ - (void)imxrt_config_gpio(GPIO_LPSPI4_SCK); - (void)imxrt_config_gpio(GPIO_LPSPI4_MISO); - (void)imxrt_config_gpio(GPIO_LPSPI4_MOSI); + imxrt_config_gpio(GPIO_LPSPI4_SCK); + imxrt_config_gpio(GPIO_LPSPI4_MISO); + imxrt_config_gpio(GPIO_LPSPI4_MOSI); /* Set up default configuration: Master, 8-bit, etc. */ diff --git a/arch/arm/src/imxrt/imxrt_serial.c b/arch/arm/src/imxrt/imxrt_serial.c index aa2443d7ce..9a5ed10d6f 100644 --- a/arch/arm/src/imxrt/imxrt_serial.c +++ b/arch/arm/src/imxrt/imxrt_serial.c @@ -1682,32 +1682,32 @@ void up_serialinit(void) #endif #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif #ifdef TTYS6_DEV - (void)uart_register("/dev/ttyS6", &TTYS6_DEV); + uart_register("/dev/ttyS6", &TTYS6_DEV); #endif #ifdef TTYS7_DEV - (void)uart_register("/dev/ttyS7", &TTYS7_DEV); + uart_register("/dev/ttyS7", &TTYS7_DEV); #endif } diff --git a/arch/arm/src/imxrt/imxrt_timerisr.c b/arch/arm/src/imxrt/imxrt_timerisr.c index 616ca519cb..a62ded618c 100644 --- a/arch/arm/src/imxrt/imxrt_timerisr.c +++ b/arch/arm/src/imxrt/imxrt_timerisr.c @@ -220,7 +220,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(IMXRT_IRQ_SYSTICK, (xcpt_t)imxrt_timerisr, NULL); + irq_attach(IMXRT_IRQ_SYSTICK, (xcpt_t)imxrt_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/imxrt/imxrt_usdhc.c b/arch/arm/src/imxrt/imxrt_usdhc.c index 211635add1..76e3bf88a7 100644 --- a/arch/arm/src/imxrt/imxrt_usdhc.c +++ b/arch/arm/src/imxrt/imxrt_usdhc.c @@ -517,21 +517,7 @@ static struct imxrt_sdhcregs_s g_sampleregs[DEBUG_NSAMPLES]; static void imxrt_takesem(struct imxrt_dev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->waitsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -1070,7 +1056,7 @@ static void imxrt_endwait(struct imxrt_dev_s *priv, sdio_eventset_t wkupevent) { /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Disable event-related interrupts */ @@ -2255,7 +2241,7 @@ static int imxrt_cancel(FAR struct sdio_dev_s *dev) /* Cancel any watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* If this was a DMA transfer, make sure that DMA is stopped */ @@ -2981,8 +2967,8 @@ static void imxrt_callback(void *arg) /* Yes.. queue it */ mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); - (void)work_queue(HPWORK, &priv->cbwork, (worker_t) priv->callback, - priv->cbarg, 0); + work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, + priv->cbarg, 0); } else { @@ -3088,24 +3074,24 @@ FAR struct sdio_dev_s *imxrt_usdhc_initialize(int slotno) #ifndef CONFIG_SDIO_MUXBUS #if defined(CONFIG_IMXRT_USDHC1_WIDTH_D1_D4) - (void)imxrt_config_gpio(PIN_USDHC1_D1); - (void)imxrt_config_gpio(PIN_USDHC1_D2); - (void)imxrt_config_gpio(PIN_USDHC1_D3); + imxrt_config_gpio(PIN_USDHC1_D1); + imxrt_config_gpio(PIN_USDHC1_D2); + imxrt_config_gpio(PIN_USDHC1_D3); #endif /* Clocking and CMD pins (all data widths) */ - (void)imxrt_config_gpio(PIN_USDHC1_D0); - (void)imxrt_config_gpio(PIN_USDHC1_DCLK); - (void)imxrt_config_gpio(PIN_USDHC1_CMD); + imxrt_config_gpio(PIN_USDHC1_D0); + imxrt_config_gpio(PIN_USDHC1_DCLK); + imxrt_config_gpio(PIN_USDHC1_CMD); #endif #if defined(CONFIG_MMCSD_HAVE_CARDDETECT) # if defined(PIN_USDHC1_CD) - (void)imxrt_config_gpio(PIN_USDHC1_CD); + imxrt_config_gpio(PIN_USDHC1_CD); # else if (priv->sw_cd_gpio != 0) { - (void)imxrt_config_gpio(priv->sw_cd_gpio); + imxrt_config_gpio(priv->sw_cd_gpio); } # endif #endif @@ -3115,30 +3101,30 @@ FAR struct sdio_dev_s *imxrt_usdhc_initialize(int slotno) #if defined(CONFIG_IMXRT_USDHC2) case IMXRT_USDHC2_BASE: - (void)imxrt_config_gpio(PIN_USDHC2_D0); - (void)imxrt_config_gpio(PIN_USDHC2_DCLK); - (void)imxrt_config_gpio(PIN_USDHC2_CMD); + imxrt_config_gpio(PIN_USDHC2_D0); + imxrt_config_gpio(PIN_USDHC2_DCLK); + imxrt_config_gpio(PIN_USDHC2_CMD); # if defined(CONFIG_IMXRT_USDHC2_WIDTH_D1_D4) || defined(CONFIG_IMXRT_USDHC2_WIDTH_D1_D8) - (void)imxrt_config_gpio(PIN_USDHC2_D1); - (void)imxrt_config_gpio(PIN_USDHC2_D2); - (void)imxrt_config_gpio(PIN_USDHC2_D3); + imxrt_config_gpio(PIN_USDHC2_D1); + imxrt_config_gpio(PIN_USDHC2_D2); + imxrt_config_gpio(PIN_USDHC2_D3); # endif # if defined(CONFIG_IMXRT_USDHC2_WIDTH_D1_D8) - (void)imxrt_config_gpio(PIN_USDHC2_D4); - (void)imxrt_config_gpio(PIN_USDHC2_D5); - (void)imxrt_config_gpio(PIN_USDHC2_D6); - (void)imxrt_config_gpio(PIN_USDHC2_D7); + imxrt_config_gpio(PIN_USDHC2_D4); + imxrt_config_gpio(PIN_USDHC2_D5); + imxrt_config_gpio(PIN_USDHC2_D6); + imxrt_config_gpio(PIN_USDHC2_D7); # endif # if defined(CONFIG_MMCSD_HAVE_CARDDETECT) # if defined(PIN_USDHC2_CD) - (void)imxrt_config_gpio(PIN_USDHC2_CD); + imxrt_config_gpio(PIN_USDHC2_CD); # else if (priv->sw_cd_gpio != 0) { - (void)imxrt_config_gpio(priv->sw_cd_gpio); + imxrt_config_gpio(priv->sw_cd_gpio); } # endif # endif diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index f90ac64ae6..7f7d722d2f 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -518,8 +518,8 @@ static int kinetis_transmit(FAR struct kinetis_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, KINETIS_TXTIMEOUT, kinetis_txtimeout_expiry, - 1, (wdparm_t)priv); + wd_start(priv->txtimeout, KINETIS_TXTIMEOUT, kinetis_txtimeout_expiry, + 1, (wdparm_t)priv); return OK; } @@ -831,7 +831,7 @@ static void kinetis_txdone(FAR struct kinetis_driver_s *priv) * new XMIT data */ - (void)devif_poll(&priv->dev, kinetis_txpoll); + devif_poll(&priv->dev, kinetis_txpoll); } /**************************************************************************** @@ -1001,12 +1001,12 @@ static void kinetis_txtimeout_work(FAR void *arg) * hardware reset. */ - (void)kinetis_ifdown(&priv->dev); - (void)kinetis_ifup(&priv->dev); + kinetis_ifdown(&priv->dev); + kinetis_ifup(&priv->dev); /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->dev, kinetis_txpoll); + devif_poll(&priv->dev, kinetis_txpoll); net_unlock(); } @@ -1083,13 +1083,13 @@ static void kinetis_poll_work(FAR void *arg) * in progress, we will missing TCP time state updates? */ - (void)devif_timer(&priv->dev, KINETIS_WDDELAY, kinetis_txpoll); + devif_timer(&priv->dev, KINETIS_WDDELAY, kinetis_txpoll); } /* Setup the watchdog poll timer again in any case */ - (void)wd_start(priv->txpoll, KINETIS_WDDELAY, kinetis_polltimer_expiry, - 1, (wdparm_t)priv); + wd_start(priv->txpoll, KINETIS_WDDELAY, kinetis_polltimer_expiry, + 1, (wdparm_t)priv); net_unlock(); } @@ -1231,8 +1231,8 @@ static int kinetis_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, KINETIS_WDDELAY, kinetis_polltimer_expiry, 1, - (wdparm_t)priv); + wd_start(priv->txpoll, KINETIS_WDDELAY, kinetis_polltimer_expiry, 1, + (wdparm_t)priv); /* Clear all pending ENET interrupt */ @@ -1347,7 +1347,7 @@ static void kinetis_txavail_work(FAR void *arg) * XMIT data. */ - (void)devif_poll(&priv->dev, kinetis_txpoll); + devif_poll(&priv->dev, kinetis_txpoll); } } @@ -2240,11 +2240,11 @@ int kinetis_netinitialize(int intf) * the device and/or calling kinetis_ifdown(). */ - (void)kinetis_ifdown(&priv->dev); + kinetis_ifdown(&priv->dev); /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->dev, NET_LL_ETHERNET); + netdev_register(&priv->dev, NET_LL_ETHERNET); return OK; } @@ -2262,7 +2262,7 @@ int kinetis_netinitialize(int intf) #if CONFIG_KINETIS_ENETNETHIFS == 1 && !defined(CONFIG_NETDEV_LATEINIT) void up_netinitialize(void) { - (void)kinetis_netinitialize(0); + kinetis_netinitialize(0); } #endif diff --git a/arch/arm/src/kinetis/kinetis_i2c.c b/arch/arm/src/kinetis/kinetis_i2c.c index 1e80fad5b4..11ca2ebe60 100644 --- a/arch/arm/src/kinetis/kinetis_i2c.c +++ b/arch/arm/src/kinetis/kinetis_i2c.c @@ -350,21 +350,7 @@ static inline void kinetis_i2c_sem_destroy(FAR struct kinetis_i2cdev_s *priv) static inline void kinetis_i2c_sem_wait(FAR struct kinetis_i2cdev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->mutex); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->mutex); } /**************************************************************************** @@ -390,7 +376,7 @@ static inline void kinetis_i2c_sem_post(struct kinetis_i2cdev_s *priv) static inline void kinetis_i2c_wait(struct kinetis_i2cdev_s *priv) { - (void)nxsem_wait(&priv->wait); + nxsem_wait(&priv->wait); } /**************************************************************************** @@ -1207,8 +1193,8 @@ static int kinetis_i2c_transfer(struct i2c_master_s *dev, /* Wait for transfer complete */ - (void)wd_start(priv->timeout, I2C_TIMEOUT, kinetis_i2c_timeout, 1, - (uint32_t)priv); + wd_start(priv->timeout, I2C_TIMEOUT, kinetis_i2c_timeout, 1, + (uint32_t)priv); kinetis_i2c_wait(priv); wd_cancel(priv->timeout); diff --git a/arch/arm/src/kinetis/kinetis_irq.c b/arch/arm/src/kinetis/kinetis_irq.c index c1f3e30aa9..3693dd8e8d 100644 --- a/arch/arm/src/kinetis/kinetis_irq.c +++ b/arch/arm/src/kinetis/kinetis_irq.c @@ -173,7 +173,7 @@ static void kinetis_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int kinetis_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -181,7 +181,7 @@ static int kinetis_nmi(int irq, FAR void *context, FAR void *arg) static int kinetis_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received\n"); PANIC(); return 0; @@ -189,7 +189,7 @@ static int kinetis_busfault(int irq, FAR void *context, FAR void *arg) static int kinetis_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -197,7 +197,7 @@ static int kinetis_usagefault(int irq, FAR void *context, FAR void *arg) static int kinetis_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -205,7 +205,7 @@ static int kinetis_pendsv(int irq, FAR void *context, FAR void *arg) static int kinetis_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -213,7 +213,7 @@ static int kinetis_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int kinetis_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/kinetis/kinetis_lpserial.c b/arch/arm/src/kinetis/kinetis_lpserial.c index 4690802229..9c4d9dc956 100644 --- a/arch/arm/src/kinetis/kinetis_lpserial.c +++ b/arch/arm/src/kinetis/kinetis_lpserial.c @@ -746,7 +746,7 @@ static int kinetis_interrupt(int irq, void *context, void *arg) if ((stat & LPUART_STAT_OR) != LPUART_STAT_OR) { - (void) kinetis_serialin(priv, KINETIS_LPUART_DATA_OFFSET); + kinetis_serialin(priv, KINETIS_LPUART_DATA_OFFSET); } /* Reset any Errors */ @@ -1367,44 +1367,44 @@ unsigned int kinetis_lpuart_serialinit(unsigned int first) /* Register the console */ #ifdef HAVE_LPUART_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif #if !defined(CONFIG_KINETIS_MERGE_TTY) /* Register all LPUARTs as LPn devices */ - (void)uart_register("/dev/ttyLP0", &TTYS0_DEV); + uart_register("/dev/ttyLP0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyLP1", &TTYS1_DEV); + uart_register("/dev/ttyLP1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyLP2", &TTYS2_DEV); + uart_register("/dev/ttyLP2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyLP3", &TTYS3_DEV); + uart_register("/dev/ttyLP3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyLP4", &TTYS4_DEV); + uart_register("/dev/ttyLP4", &TTYS4_DEV); #endif #else devname[(sizeof(devname)/sizeof(devname[0]))-2] = '0' + first++; - (void)uart_register(devname, &TTYS0_DEV); + uart_register(devname, &TTYS0_DEV); #ifdef TTYS1_DEV devname[(sizeof(devname)/sizeof(devname[0]))-2] = '0' + first++; - (void)uart_register(devname, &TTYS1_DEV); + uart_register(devname, &TTYS1_DEV); #endif #ifdef TTYS2_DEV devname[(sizeof(devname)/sizeof(devname[0]))-2] = '0' + first++; - (void)uart_register(devname, &TTYS2_DEV); + uart_register(devname, &TTYS2_DEV); #endif #ifdef TTYS3_DEV devname[(sizeof(devname)/sizeof(devname[0]))-2] = '0' + first++; - (void)uart_register(devname, &TTYS3_DEV); + uart_register(devname, &TTYS3_DEV); #endif #ifdef TTYS4_DEV devname[(sizeof(devname)/sizeof(devname[0]))-2] = '0' + first++; - (void)uart_register(devname, &TTYS4_DEV); + uart_register(devname, &TTYS4_DEV); #endif #endif diff --git a/arch/arm/src/kinetis/kinetis_pinirq.c b/arch/arm/src/kinetis/kinetis_pinirq.c index 5eed82fe59..e22840e9d9 100644 --- a/arch/arm/src/kinetis/kinetis_pinirq.c +++ b/arch/arm/src/kinetis/kinetis_pinirq.c @@ -150,7 +150,7 @@ static int kinetis_portinterrupt(int irq, FAR void *context, /* There is a registered interrupt handler... invoke it */ - (void)handler(irq, context, arg); + handler(irq, context, arg); } /* Writing a one to the ISFR register will clear the pending @@ -225,27 +225,27 @@ static int kinetis_porteinterrupt(int irq, FAR void *context, FAR void *arg) void kinetis_pinirqinitialize(void) { #ifdef CONFIG_KINETIS_PORTAINTS - (void)irq_attach(KINETIS_IRQ_PORTA, kinetis_portainterrupt, NULL); + irq_attach(KINETIS_IRQ_PORTA, kinetis_portainterrupt, NULL); putreg32(0xffffffff, KINETIS_PORTA_ISFR); up_enable_irq(KINETIS_IRQ_PORTA); #endif #ifdef CONFIG_KINETIS_PORTBINTS - (void)irq_attach(KINETIS_IRQ_PORTB, kinetis_portbinterrupt, NULL); + irq_attach(KINETIS_IRQ_PORTB, kinetis_portbinterrupt, NULL); putreg32(0xffffffff, KINETIS_PORTB_ISFR); up_enable_irq(KINETIS_IRQ_PORTB); #endif #ifdef CONFIG_KINETIS_PORTCINTS - (void)irq_attach(KINETIS_IRQ_PORTC, kinetis_portcinterrupt, NULL); + irq_attach(KINETIS_IRQ_PORTC, kinetis_portcinterrupt, NULL); putreg32(0xffffffff, KINETIS_PORTC_ISFR); up_enable_irq(KINETIS_IRQ_PORTC); #endif #ifdef CONFIG_KINETIS_PORTDINTS - (void)irq_attach(KINETIS_IRQ_PORTD, kinetis_portdinterrupt, NULL); + irq_attach(KINETIS_IRQ_PORTD, kinetis_portdinterrupt, NULL); putreg32(0xffffffff, KINETIS_PORTD_ISFR); up_enable_irq(KINETIS_IRQ_PORTD); #endif #ifdef CONFIG_KINETIS_PORTEINTS - (void)irq_attach(KINETIS_IRQ_PORTE, kinetis_porteinterrupt, NULL); + irq_attach(KINETIS_IRQ_PORTE, kinetis_porteinterrupt, NULL); putreg32(0xffffffff, KINETIS_PORTE_ISFR); up_enable_irq(KINETIS_IRQ_PORTE); #endif diff --git a/arch/arm/src/kinetis/kinetis_rtc_lowerhalf.c b/arch/arm/src/kinetis/kinetis_rtc_lowerhalf.c index ae42bc5536..9fe1a9061f 100644 --- a/arch/arm/src/kinetis/kinetis_rtc_lowerhalf.c +++ b/arch/arm/src/kinetis/kinetis_rtc_lowerhalf.c @@ -431,7 +431,7 @@ static int kinetis_setrelative(FAR struct rtc_lowerhalf_s *lower, /* And convert the time back to Julian/broken out format */ - (void)gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); + gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); /* The set the alarm using this absolute time */ @@ -532,11 +532,11 @@ static int kinetis_rdalarm(FAR struct rtc_lowerhalf_s *lower, ret = kinetis_rtc_rdalarm(&ts); #ifdef CONFIG_LIBC_LOCALTIME - (void)localtime_r((FAR const time_t *)&ts.tv_sec, - (FAR struct tm *)alarminfo->time); + localtime_r((FAR const time_t *)&ts.tv_sec, + (FAR struct tm *)alarminfo->time); #else - (void)gmtime_r((FAR const time_t *)&ts.tv_sec, - (FAR struct tm *)alarminfo->time); + gmtime_r((FAR const time_t *)&ts.tv_sec, + (FAR struct tm *)alarminfo->time); #endif sched_unlock(); } diff --git a/arch/arm/src/kinetis/kinetis_sdhc.c b/arch/arm/src/kinetis/kinetis_sdhc.c index 9820513274..4ebcd4d7a2 100644 --- a/arch/arm/src/kinetis/kinetis_sdhc.c +++ b/arch/arm/src/kinetis/kinetis_sdhc.c @@ -430,21 +430,7 @@ static struct kinetis_sdhcregs_s g_sampleregs[DEBUG_NSAMPLES]; static void kinetis_takesem(struct kinetis_dev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->waitsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -989,7 +975,7 @@ static void kinetis_endwait(struct kinetis_dev_s *priv, sdio_eventset_t wkupeven { /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Disable event-related interrupts */ @@ -2026,7 +2012,7 @@ static int kinetis_cancel(FAR struct sdio_dev_s *dev) /* Cancel any watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* If this was a DMA transfer, make sure that DMA is stopped */ @@ -2768,7 +2754,7 @@ static void kinetis_callback(void *arg) /* Yes.. queue it */ mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); - (void)work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, priv->cbarg, 0); + work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, priv->cbarg, 0); } else { diff --git a/arch/arm/src/kinetis/kinetis_serial.c b/arch/arm/src/kinetis/kinetis_serial.c index c9f4d944fb..b26eee2cac 100644 --- a/arch/arm/src/kinetis/kinetis_serial.c +++ b/arch/arm/src/kinetis/kinetis_serial.c @@ -881,7 +881,7 @@ static uint8_t get_and_clear_uart_status(struct up_dev_s *priv) * discarding the data. */ - (void)up_serialin(priv, KINETIS_UART_D_OFFSET); + up_serialin(priv, KINETIS_UART_D_OFFSET); } return regval; @@ -2032,7 +2032,7 @@ unsigned int kinetis_uart_serialinit(unsigned int first) /* Register the console */ #ifdef HAVE_UART_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); # ifdef SERIAL_HAVE_CONSOLE_DMA /* If we need to re-initialise the console to enable DMA do that here. */ @@ -2044,26 +2044,26 @@ unsigned int kinetis_uart_serialinit(unsigned int first) /* Register all UARTs */ devname[(sizeof(devname)/sizeof(devname[0]))-2] = '0' + first++; - (void)uart_register(devname, &TTYS0_DEV); + uart_register(devname, &TTYS0_DEV); #ifdef TTYS1_DEV devname[(sizeof(devname)/sizeof(devname[0]))-2] = '0' + first++; - (void)uart_register(devname, &TTYS1_DEV); + uart_register(devname, &TTYS1_DEV); #endif #ifdef TTYS2_DEV devname[(sizeof(devname)/sizeof(devname[0]))-2] = '0' + first++; - (void)uart_register(devname, &TTYS2_DEV); + uart_register(devname, &TTYS2_DEV); #endif #ifdef TTYS3_DEV devname[(sizeof(devname)/sizeof(devname[0]))-2] = '0' + first++; - (void)uart_register(devname, &TTYS3_DEV); + uart_register(devname, &TTYS3_DEV); #endif #ifdef TTYS4_DEV devname[(sizeof(devname)/sizeof(devname[0]))-2] = '0' + first++; - (void)uart_register(devname, &TTYS4_DEV); + uart_register(devname, &TTYS4_DEV); #endif #ifdef TTYS5_DEV devname[(sizeof(devname)/sizeof(devname[0]))-2] = '0' + first++; - (void)uart_register(devname, &TTYS5_DEV); + uart_register(devname, &TTYS5_DEV); #endif return first; } diff --git a/arch/arm/src/kinetis/kinetis_spi.c b/arch/arm/src/kinetis/kinetis_spi.c index 0768a31ce7..4b0a75e2f6 100644 --- a/arch/arm/src/kinetis/kinetis_spi.c +++ b/arch/arm/src/kinetis/kinetis_spi.c @@ -588,24 +588,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; diff --git a/arch/arm/src/kinetis/kinetis_timerisr.c b/arch/arm/src/kinetis/kinetis_timerisr.c index 38cc8656a1..41631acbf2 100644 --- a/arch/arm/src/kinetis/kinetis_timerisr.c +++ b/arch/arm/src/kinetis/kinetis_timerisr.c @@ -139,7 +139,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(KINETIS_IRQ_SYSTICK, (xcpt_t)kinetis_timerisr, NULL); + irq_attach(KINETIS_IRQ_SYSTICK, (xcpt_t)kinetis_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/kinetis/kinetis_usbdev.c b/arch/arm/src/kinetis/kinetis_usbdev.c index 5ef6570a71..a6f7a49da4 100644 --- a/arch/arm/src/kinetis/kinetis_usbdev.c +++ b/arch/arm/src/kinetis/kinetis_usbdev.c @@ -1096,7 +1096,7 @@ static void khci_rqrestart(int argc, uint32_t arg1, ...) #ifndef CONFIG_USBDEV_NOWRITEAHEAD privreq->inflight[1] = 0; #endif - (void)khci_wrrequest(priv, privep); + khci_wrrequest(priv, privep); } } } @@ -1114,8 +1114,8 @@ static void khci_delayedrestart(struct khci_usbdev_s *priv, uint8_t epno) /* And start (or re-start) the watchdog timer */ - (void)wd_start(priv->wdog, RESTART_DELAY, khci_rqrestart, 1, - (uint32_t)priv); + wd_start(priv->wdog, RESTART_DELAY, khci_rqrestart, 1, + (uint32_t)priv); } /**************************************************************************** @@ -1366,7 +1366,7 @@ static int khci_wrrequest(struct khci_usbdev_s *priv, struct khci_ep_s *privep) * queued */ - (void)khci_wrstart(priv, privep); + khci_wrstart(priv, privep); } #else UNUSED(ret); @@ -1840,7 +1840,7 @@ static void khci_eptransfer(struct khci_usbdev_s *priv, uint8_t epno, { /* If that succeeds, then try to set up another OUT transfer. */ - (void)khci_rdrequest(priv, privep); + khci_rdrequest(priv, privep); } #else UNUSED(ret); @@ -1860,7 +1860,7 @@ static void khci_eptransfer(struct khci_usbdev_s *priv, uint8_t epno, /* Handle additional queued write requests */ - (void)khci_wrrequest(priv, privep); + khci_wrrequest(priv, privep); } } @@ -2718,7 +2718,7 @@ static void khci_ep0transfer(struct khci_usbdev_s *priv, uint16_t ustat) /* Stall EP0 */ usbtrace(TRACE_DEVERROR(KHCI_TRACEERR_EP0SETUPSTALLED), priv->ctrlstate); - (void)khci_epstall(&priv->eplist[EP0].ep, false); + khci_epstall(&priv->eplist[EP0].ep, false); } } @@ -3519,7 +3519,7 @@ static int khci_epsubmit(struct usbdev_ep_s *ep, struct usbdev_req_s *req) if (!privep->stalled) { - (void)khci_wrrequest(priv, privep); + khci_wrrequest(priv, privep); } } @@ -3538,7 +3538,7 @@ static int khci_epsubmit(struct usbdev_ep_s *ep, struct usbdev_req_s *req) if (!privep->stalled) { - (void)khci_rdrequest(priv, privep); + khci_rdrequest(priv, privep); } } @@ -3876,7 +3876,7 @@ static void khci_freeep(struct usbdev_s *dev, struct usbdev_ep_s *ep) /* Disable the endpoint */ - (void)khci_epdisable(ep); + khci_epdisable(ep); /* Mark the endpoint as available */ diff --git a/arch/arm/src/kl/kl_gpioirq.c b/arch/arm/src/kl/kl_gpioirq.c index 6261065e26..38b105a728 100644 --- a/arch/arm/src/kl/kl_gpioirq.c +++ b/arch/arm/src/kl/kl_gpioirq.c @@ -144,7 +144,7 @@ static int kl_portinterrupt(int irq, FAR void *context, /* There is a registered interrupt handler... invoke it */ - (void)handler(irq, context, arg); + handler(irq, context, arg); } /* Writing a one to the ISFR register will clear the pending @@ -202,13 +202,13 @@ static int kl_portdinterrupt(int irq, FAR void *context, FAR void *arg) void kl_gpioirqinitialize(void) { #ifdef CONFIG_KL_PORTAINTS - (void)irq_attach(KL_IRQ_PORTA, kl_portainterrupt, NULL); + irq_attach(KL_IRQ_PORTA, kl_portainterrupt, NULL); putreg32(0xffffffff, KL_PORTA_ISFR); up_enable_irq(KL_IRQ_PORTA); #endif #ifdef CONFIG_KL_PORTDINTS - (void)irq_attach(KL_IRQ_PORTD, kl_portdinterrupt, NULL); + irq_attach(KL_IRQ_PORTD, kl_portdinterrupt, NULL); putreg32(0xffffffff, KL_PORTD_ISFR); up_enable_irq(KL_IRQ_PORTD); #endif diff --git a/arch/arm/src/kl/kl_idle.c b/arch/arm/src/kl/kl_idle.c index 7e83e47a2d..01d21712e0 100644 --- a/arch/arm/src/kl/kl_idle.c +++ b/arch/arm/src/kl/kl_idle.c @@ -112,7 +112,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { @@ -136,7 +136,7 @@ static void up_idlepm(void) break; case PM_SLEEP: - (void)kl_pmstandby(); + kl_pmstandby(); break; default: diff --git a/arch/arm/src/kl/kl_irq.c b/arch/arm/src/kl/kl_irq.c index f8466ac4f5..c27f41a925 100644 --- a/arch/arm/src/kl/kl_irq.c +++ b/arch/arm/src/kl/kl_irq.c @@ -140,7 +140,7 @@ static void kl_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int kl_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -148,7 +148,7 @@ static int kl_nmi(int irq, FAR void *context, FAR void *arg) static int kl_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -156,7 +156,7 @@ static int kl_pendsv(int irq, FAR void *context, FAR void *arg) static int kl_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/kl/kl_serial.c b/arch/arm/src/kl/kl_serial.c index 0b7d67df0f..7fa7afe126 100644 --- a/arch/arm/src/kl/kl_serial.c +++ b/arch/arm/src/kl/kl_serial.c @@ -852,26 +852,26 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif } diff --git a/arch/arm/src/kl/kl_spi.c b/arch/arm/src/kl/kl_spi.c index 09fd032096..33baeff40e 100644 --- a/arch/arm/src/kl/kl_spi.c +++ b/arch/arm/src/kl/kl_spi.c @@ -241,24 +241,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; diff --git a/arch/arm/src/kl/kl_timerisr.c b/arch/arm/src/kl/kl_timerisr.c index 09cd51d661..11b282584a 100644 --- a/arch/arm/src/kl/kl_timerisr.c +++ b/arch/arm/src/kl/kl_timerisr.c @@ -143,7 +143,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(KL_IRQ_SYSTICK, (xcpt_t)kl_timerisr, NULL); + irq_attach(KL_IRQ_SYSTICK, (xcpt_t)kl_timerisr, NULL); /* Enable SysTick interrupts. "The CLKSOURCE bit in SysTick Control and * Status register selects either the core clock (when CLKSOURCE = 1) or diff --git a/arch/arm/src/lc823450/lc823450_adc.c b/arch/arm/src/lc823450/lc823450_adc.c index 888bea22cb..518651d2fb 100644 --- a/arch/arm/src/lc823450/lc823450_adc.c +++ b/arch/arm/src/lc823450/lc823450_adc.c @@ -226,9 +226,7 @@ static void lc823450_adc_start(FAR struct lc823450_adc_inst_s *inst) uint8_t i; uint32_t div; -#ifndef CONFIG_ADC_POLLED - int ret; -#else +#ifdef CONFIG_ADC_POLLED irqstate_t flags; flags = enter_critical_section(); @@ -263,19 +261,7 @@ static void lc823450_adc_start(FAR struct lc823450_adc_inst_s *inst) while ((getreg32(rADCSTS) & rADCSTS_fADCMPL) == 0) ; #else - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&inst->sem_isr); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&inst->sem_isr); #endif #ifdef CONFIG_ADC_POLLED @@ -293,21 +279,7 @@ static void lc823450_adc_start(FAR struct lc823450_adc_inst_s *inst) static inline void lc823450_adc_sem_wait(FAR struct lc823450_adc_inst_s *inst) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&inst->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&inst->sem_excl); } /**************************************************************************** diff --git a/arch/arm/src/lc823450/lc823450_cpuidlestack.c b/arch/arm/src/lc823450/lc823450_cpuidlestack.c index 334b2c17d5..a75eb04819 100644 --- a/arch/arm/src/lc823450/lc823450_cpuidlestack.c +++ b/arch/arm/src/lc823450/lc823450_cpuidlestack.c @@ -95,7 +95,7 @@ int up_cpu_idlestack(int cpu, FAR struct tcb_s *tcb, size_t stack_size) { #if CONFIG_SMP_NCPUS > 1 - (void)up_create_stack(tcb, stack_size, TCB_FLAG_TTYPE_KERNEL); + up_create_stack(tcb, stack_size, TCB_FLAG_TTYPE_KERNEL); #endif return OK; } diff --git a/arch/arm/src/lc823450/lc823450_cpustart.c b/arch/arm/src/lc823450/lc823450_cpustart.c index e196ce09d0..4414f456e0 100644 --- a/arch/arm/src/lc823450/lc823450_cpustart.c +++ b/arch/arm/src/lc823450/lc823450_cpustart.c @@ -138,7 +138,7 @@ static void cpu1_boot(void) /* Then transfer control to the IDLE task */ - (void)nx_idle_task(0, NULL); + nx_idle_task(0, NULL); } diff --git a/arch/arm/src/lc823450/lc823450_i2c.c b/arch/arm/src/lc823450/lc823450_i2c.c index bf179e16e4..8d898d9b57 100644 --- a/arch/arm/src/lc823450/lc823450_i2c.c +++ b/arch/arm/src/lc823450/lc823450_i2c.c @@ -262,21 +262,7 @@ static struct lc823450_i2c_priv_s lc823450_i2c1_priv = static inline void lc823450_i2c_sem_wait(FAR struct lc823450_i2c_priv_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sem_excl); } /**************************************************************************** @@ -310,7 +296,7 @@ static inline int lc823450_i2c_sem_waitdone(FAR struct lc823450_i2c_priv_s *priv { /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -329,13 +315,12 @@ static inline int lc823450_i2c_sem_waitdone(FAR struct lc823450_i2c_priv_s *priv /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->sem_isr, &abstime); - if (ret < 0 && errno != -EINTR) + ret = nxsem_timedwait_uninterruptible(&priv->sem_isr, &abstime); + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would * include timeouts and mystery errors reported by nxsem_timedwait. - * NOTE that we try again if we are awakened by a signal (EINTR). */ break; } @@ -1123,7 +1108,7 @@ FAR struct i2c_master_s *lc823450_i2cbus_initialize(int port) #ifndef CONFIG_I2C_POLLED nxsem_init(&priv->sem_isr, 0, 0); #endif - (void)lc823450_i2c_init(priv, port); + lc823450_i2c_init(priv, port); } leave_critical_section(flags); diff --git a/arch/arm/src/lc823450/lc823450_i2s.c b/arch/arm/src/lc823450/lc823450_i2s.c index bfa63d8dde..d55a61d6ac 100644 --- a/arch/arm/src/lc823450/lc823450_i2s.c +++ b/arch/arm/src/lc823450/lc823450_i2s.c @@ -322,21 +322,7 @@ static void _setup_audio_pll(uint32_t freq) static void _i2s_semtake(FAR sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -1010,7 +996,7 @@ FAR struct i2s_dev_s *lc823450_i2sdev_initialize(void) priv->dev.ops = &g_i2sops; - (void)lc823450_i2s_configure(); + lc823450_i2s_configure(); #ifdef BEEP_TEST lc823450_i2s_beeptest(); @@ -1039,11 +1025,11 @@ FAR struct i2s_dev_s *lc823450_i2sdev_initialize(void) /* Backup the current affinity */ - (void)nxsched_getaffinity(getpid(), sizeof(cpuset0), &cpuset0); + nxsched_getaffinity(getpid(), sizeof(cpuset0), &cpuset0); /* Set the new affinity which assigns to CPU0 */ - (void)nxsched_setaffinity(getpid(), sizeof(cpuset1), &cpuset1); + nxsched_setaffinity(getpid(), sizeof(cpuset1), &cpuset1); nxsig_usleep(10 * 1000); #endif @@ -1056,7 +1042,7 @@ FAR struct i2s_dev_s *lc823450_i2sdev_initialize(void) #ifdef CONFIG_SMP /* Restore the original affinity */ - (void)nxsched_setaffinity(getpid(), sizeof(cpuset0), &cpuset0); + nxsched_setaffinity(getpid(), sizeof(cpuset0), &cpuset0); nxsig_usleep(10 * 1000); #endif diff --git a/arch/arm/src/lc823450/lc823450_ipl2.c b/arch/arm/src/lc823450/lc823450_ipl2.c index 8d528b973c..715cee3744 100644 --- a/arch/arm/src/lc823450/lc823450_ipl2.c +++ b/arch/arm/src/lc823450/lc823450_ipl2.c @@ -284,7 +284,7 @@ static void load_kernel(const char *name, const char *devname) tmp = (void *)0x02040000; - (void)blk_read(tmp, 512 * 1024, devname, 0); + blk_read(tmp, 512 * 1024, devname, 0); /* disable all IRQ */ @@ -655,11 +655,11 @@ void check_lastkmsg(void) /* log rotate */ - (void)unlink(LASTMSG_LOGPATH ".4"); - (void)rename(LASTMSG_LOGPATH ".3", LASTMSG_LOGPATH ".4"); - (void)rename(LASTMSG_LOGPATH ".2", LASTMSG_LOGPATH ".3"); - (void)rename(LASTMSG_LOGPATH ".1", LASTMSG_LOGPATH ".2"); - (void)rename(LASTMSG_LOGPATH ".0", LASTMSG_LOGPATH ".1"); + unlink(LASTMSG_LOGPATH ".4"); + rename(LASTMSG_LOGPATH ".3", LASTMSG_LOGPATH ".4"); + rename(LASTMSG_LOGPATH ".2", LASTMSG_LOGPATH ".3"); + rename(LASTMSG_LOGPATH ".1", LASTMSG_LOGPATH ".2"); + rename(LASTMSG_LOGPATH ".0", LASTMSG_LOGPATH ".1"); fp = fopen(LASTMSG_LOGPATH ".0", "w"); diff --git a/arch/arm/src/lc823450/lc823450_irq.c b/arch/arm/src/lc823450/lc823450_irq.c index 33438d8f3b..78a43a28ca 100644 --- a/arch/arm/src/lc823450/lc823450_irq.c +++ b/arch/arm/src/lc823450/lc823450_irq.c @@ -199,7 +199,7 @@ static void lc823450_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG static int lc823450_nmi(int irq, FAR void *context, FAR void *arg) { - (void)enter_critical_section(); + enter_critical_section(); irqinfo("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -207,7 +207,7 @@ static int lc823450_nmi(int irq, FAR void *context, FAR void *arg) static int lc823450_busfault(int irq, FAR void *context, FAR void *arg) { - (void)enter_critical_section(); + enter_critical_section(); irqinfo("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -215,7 +215,7 @@ static int lc823450_busfault(int irq, FAR void *context, FAR void *arg) static int lc823450_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)enter_critical_section(); + enter_critical_section(); irqinfo("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -223,7 +223,7 @@ static int lc823450_usagefault(int irq, FAR void *context, FAR void *arg) static int lc823450_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)enter_critical_section(); + enter_critical_section(); irqinfo("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -231,7 +231,7 @@ static int lc823450_pendsv(int irq, FAR void *context, FAR void *arg) static int lc823450_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)enter_critical_section(); + enter_critical_section(); irqinfo("PANIC!!! Debug Monitor receieved\n"); PANIC(); return 0; @@ -239,7 +239,7 @@ static int lc823450_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int lc823450_reserved(int irq, FAR void *context, FAR void *arg) { - (void)enter_critical_section(); + enter_critical_section(); irqinfo("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/lc823450/lc823450_mtd.c b/arch/arm/src/lc823450/lc823450_mtd.c index f53448e8f9..db4b4999d2 100644 --- a/arch/arm/src/lc823450/lc823450_mtd.c +++ b/arch/arm/src/lc823450/lc823450_mtd.c @@ -140,21 +140,7 @@ static struct lc823450_partinfo_s partinfo[LC823450_NPARTS] = static void mtd_semtake(FAR sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -490,7 +476,7 @@ get_card_size: { /* cache on */ - (void)lc823450_sdc_cachectl(dev->channel, 1); + lc823450_sdc_cachectl(dev->channel, 1); } finfo("ch=%d size=%lld \n", dev->channel, (uint64_t)blocksize * (uint64_t)nblocks); diff --git a/arch/arm/src/lc823450/lc823450_procfs_dvfs.c b/arch/arm/src/lc823450/lc823450_procfs_dvfs.c index e248c1ac7b..9df85db0d5 100644 --- a/arch/arm/src/lc823450/lc823450_procfs_dvfs.c +++ b/arch/arm/src/lc823450/lc823450_procfs_dvfs.c @@ -308,7 +308,7 @@ static ssize_t dvfs_write(FAR struct file *filep, FAR const char *buffer, if (0 == strcmp(cmd, "cur_freq")) { tmp = atoi(line + (n + 1)); - (void)lc823450_dvfs_set_freq(tmp); + lc823450_dvfs_set_freq(tmp); } else if (0 == strcmp(cmd, "enable")) { diff --git a/arch/arm/src/lc823450/lc823450_rtc.c b/arch/arm/src/lc823450/lc823450_rtc.c index 987615201d..1ad62e9bd9 100644 --- a/arch/arm/src/lc823450/lc823450_rtc.c +++ b/arch/arm/src/lc823450/lc823450_rtc.c @@ -216,7 +216,7 @@ static void rtc_pmnotify(struct pm_callback_s *cb, enum pm_state_e pmstate) break; } - (void)up_rtc_getdatetime(&tm); + up_rtc_getdatetime(&tm); up_rtc_set_default_datetime(&tm); break; @@ -728,8 +728,8 @@ void up_rtc_set_default_datetime(struct tm *tp) return; } - (void)bchlib_write(handle, (void *)&rtc_def, - CONFIG_RTC_SAVE_SECTOR_OFFSET * 512, sizeof(rtc_def)); + bchlib_write(handle, (void *)&rtc_def, + CONFIG_RTC_SAVE_SECTOR_OFFSET * 512, sizeof(rtc_def)); bchlib_teardown(handle); } @@ -750,8 +750,8 @@ int up_rtc_get_default_datetime(struct tm *tp) return -1; } - (void)bchlib_read(handle, (void *)&rtc_def, - CONFIG_RTC_SAVE_SECTOR_OFFSET * 512, sizeof(rtc_def)); + bchlib_read(handle, (void *)&rtc_def, + CONFIG_RTC_SAVE_SECTOR_OFFSET * 512, sizeof(rtc_def)); bchlib_teardown(handle); if (rtc_def.sig != RTC_DEFAULT_SIGNATURE) { @@ -780,8 +780,8 @@ void up_rtc_clear_default(void) } memset(&rtc_def, 0, sizeof(rtc_def)); - (void)bchlib_write(handle, (void *)&rtc_def, - CONFIG_RTC_SAVE_SECTOR_OFFSET * 512, sizeof(rtc_def)); + bchlib_write(handle, (void *)&rtc_def, + CONFIG_RTC_SAVE_SECTOR_OFFSET * 512, sizeof(rtc_def)); bchlib_teardown(handle); return; } diff --git a/arch/arm/src/lc823450/lc823450_sdc.c b/arch/arm/src/lc823450/lc823450_sdc.c index e1b727775a..4fa812a6ae 100644 --- a/arch/arm/src/lc823450/lc823450_sdc.c +++ b/arch/arm/src/lc823450/lc823450_sdc.c @@ -138,21 +138,7 @@ extern SINT_T sddep_write(void *src, void *dst, UI_32 size, SINT_T type, static void _sdc_semtake(FAR sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -189,12 +175,12 @@ static void lc823450_sdc_access_led(uint32_t ch, unsigned long sector) { if (sector >= CONFIG_MTD_CP_STARTBLOCK) { - (void)led_start_accled(false); + led_start_accled(false); } } else { - (void)led_start_accled(false); + led_start_accled(false); } } #else @@ -657,7 +643,7 @@ int lc823450_sdc_locked(void) for (i = 0; i < 2; i++) { - (void)nxsem_getvalue(&_sdc_sem[i], &val); + nxsem_getvalue(&_sdc_sem[i], &val); if (1 != val) { ret = 1; diff --git a/arch/arm/src/lc823450/lc823450_sddrv_dep.c b/arch/arm/src/lc823450/lc823450_sddrv_dep.c index 7ead22cb8d..06b27b3572 100644 --- a/arch/arm/src/lc823450/lc823450_sddrv_dep.c +++ b/arch/arm/src/lc823450/lc823450_sddrv_dep.c @@ -134,21 +134,7 @@ static void dma_callback(DMA_HANDLE hdma, void *arg, int result) static void _sddep_semtake(FAR sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -390,7 +376,7 @@ SINT_T sddep_wait_status(UI_32 req_status, UI_32 *status, ret = -100; break; } - (void)sched_yield(); + sched_yield(); } return ret; diff --git a/arch/arm/src/lc823450/lc823450_serial.c b/arch/arm/src/lc823450/lc823450_serial.c index 0277e40b86..a518ea7697 100644 --- a/arch/arm/src/lc823450/lc823450_serial.c +++ b/arch/arm/src/lc823450/lc823450_serial.c @@ -1312,13 +1312,13 @@ void up_serialinit(void) { /* Register the console */ - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #ifdef CONFIG_HSUART nxsem_init(&g_uart1priv.txdma_wait, 0, 1); g_uart1priv.htxdma = lc823450_dmachannel(DMA_CHANNEL_UART1TX); @@ -1330,11 +1330,11 @@ void up_serialinit(void) lc823450_dmarequest(g_uart1priv.hrxdma, DMA_REQUEST_UART1RX); up_serialout(&g_uart1priv, UART_UDMA, UART_UDMA_RREQ_EN | UART_UDMA_TREQ_EN); - (void)hsuart_register("/dev/ttyHS1", &TTYS1_DEV); + hsuart_register("/dev/ttyHS1", &TTYS1_DEV); #endif /* CONFIG_HSUART */ #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif } diff --git a/arch/arm/src/lc823450/lc823450_spi.c b/arch/arm/src/lc823450/lc823450_spi.c index bdbed7c21d..df0aff70ef 100644 --- a/arch/arm/src/lc823450/lc823450_spi.c +++ b/arch/arm/src/lc823450/lc823450_spi.c @@ -153,24 +153,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -444,14 +431,14 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, { for (i = 0; i < nwords; i++) { - (void)spi_send(dev, *buf16++); + spi_send(dev, *buf16++); } } else { for (i = 0; i < nwords; i++) { - (void)spi_send(dev, *buf++); + spi_send(dev, *buf++); } } #endif /* CONFIG_LC823450_SPI_DMA */ diff --git a/arch/arm/src/lc823450/lc823450_start.c b/arch/arm/src/lc823450/lc823450_start.c index eb7e8d4baa..bdf20427db 100644 --- a/arch/arm/src/lc823450/lc823450_start.c +++ b/arch/arm/src/lc823450/lc823450_start.c @@ -394,7 +394,7 @@ void __start(void) showprogress('\r'); showprogress('\n'); - (void)get_cpu_ver(); + get_cpu_ver(); /* run as interrupt context, before scheduler running */ diff --git a/arch/arm/src/lc823450/lc823450_timer.c b/arch/arm/src/lc823450/lc823450_timer.c index 577a66dde7..188c7663bd 100644 --- a/arch/arm/src/lc823450/lc823450_timer.c +++ b/arch/arm/src/lc823450/lc823450_timer.c @@ -500,7 +500,7 @@ void arm_timer_initialize(void) modifyreg32(MCLKCNTEXT1, MCLKCNTEXT1_MTM2C_CLKEN, 0); modifyreg32(MCLKCNTEXT1, MCLKCNTEXT1_MTM2_CLKEN, 0); - (void)irq_attach(LC823450_IRQ_MTIMER20, (xcpt_t)hrt_interrupt, NULL); + irq_attach(LC823450_IRQ_MTIMER20, (xcpt_t)hrt_interrupt, NULL); up_enable_irq(LC823450_IRQ_MTIMER20); #endif /* CONFIG_HRT_TIMER */ @@ -540,7 +540,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(LC823450_IRQ_MTIMER30, (xcpt_t)up_proftimerisr, NULL); + irq_attach(LC823450_IRQ_MTIMER30, (xcpt_t)up_proftimerisr, NULL); /* And enable the system timer interrupt */ @@ -584,7 +584,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(LC823450_IRQ_MTIMER00, (xcpt_t)up_timerisr, NULL); + irq_attach(LC823450_IRQ_MTIMER00, (xcpt_t)up_timerisr, NULL); /* And enable the system timer interrupt */ @@ -617,7 +617,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(LC823450_IRQ_SYSTICK, (xcpt_t)up_timerisr, NULL); + irq_attach(LC823450_IRQ_SYSTICK, (xcpt_t)up_timerisr, NULL); /* Enable SysTick interrupts */ @@ -634,7 +634,7 @@ void arm_timer_initialize(void) #ifdef CONFIG_DVFS /* attach timer interrupt handler */ - (void)irq_attach(LC823450_IRQ_MTIMER01, (xcpt_t)lc823450_dvfs_oneshot, NULL); + irq_attach(LC823450_IRQ_MTIMER01, (xcpt_t)lc823450_dvfs_oneshot, NULL); /* enable MTM0-ch1 */ diff --git a/arch/arm/src/lc823450/lc823450_usbdev.c b/arch/arm/src/lc823450/lc823450_usbdev.c index 2e5c7dc2d9..ef26dab675 100644 --- a/arch/arm/src/lc823450/lc823450_usbdev.c +++ b/arch/arm/src/lc823450/lc823450_usbdev.c @@ -1821,7 +1821,7 @@ int usbdev_msc_epwrite(void *buf, int len) USB_DMAC_START, USB_DMAC1); - (void)nxsem_wait(&dma_wait); + nxsem_wait(&dma_wait); return 0; } @@ -1925,7 +1925,7 @@ int usbdev_msc_epread(void *buf, int len) CONFIG_USBMSC_EPBULKOUT << USB_DMAC_DMAEP_SHIFT | USB_DMAC_START, USB_DMAC1); - (void)nxsem_wait(&dma_wait); + nxsem_wait(&dma_wait); return 0; } diff --git a/arch/arm/src/lc823450/lc823450_wdt.c b/arch/arm/src/lc823450/lc823450_wdt.c index c1ef03a806..05d813ee42 100644 --- a/arch/arm/src/lc823450/lc823450_wdt.c +++ b/arch/arm/src/lc823450/lc823450_wdt.c @@ -546,7 +546,7 @@ int lc823450_wdt_initialize(void) #ifdef CONFIG_LC823450_WDT_INTERRUPT /* Attach our WDT interrupt handler (But don't enable it yet) */ - (void)irq_attach(LC823450_IRQ_WDT0, lc823450_wdt_interrupt, NULL); + irq_attach(LC823450_IRQ_WDT0, lc823450_wdt_interrupt, NULL); #else if (getreg32(WDT_WT0RSTS) & (1 << WDT_WT0RSTS_RSTS)) { @@ -556,8 +556,8 @@ int lc823450_wdt_initialize(void) /* Register the watchdog driver as /dev/watchdog0 */ - (void)watchdog_register("/dev/watchdog0", - (FAR struct watchdog_lowerhalf_s *)priv); + watchdog_register("/dev/watchdog0", + (FAR struct watchdog_lowerhalf_s *)priv); return OK; } diff --git a/arch/arm/src/lpc17xx_40xx/lpc176x_gpio.c b/arch/arm/src/lpc17xx_40xx/lpc176x_gpio.c index 4cf6b4e2c2..f614f519a3 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc176x_gpio.c +++ b/arch/arm/src/lpc17xx_40xx/lpc176x_gpio.c @@ -448,7 +448,7 @@ static inline int lpc17_40_configinterrupt(lpc17_40_pinset_t cfgset, unsigned in * starting point and consistent behavior during the re-configuration. */ - (void)lpc17_40_configinput(cfgset, port, pin); + lpc17_40_configinput(cfgset, port, pin); /* Then just remember the rising/falling edge interrupt enabled */ @@ -477,7 +477,7 @@ static inline int lpc17_40_configoutput(lpc17_40_pinset_t cfgset, unsigned int p * starting point and consistent behavior during the re-configuration. */ - (void)lpc17_40_configinput(DEFAULT_INPUT, port, pin); + lpc17_40_configinput(DEFAULT_INPUT, port, pin); /* Check for open drain output */ @@ -525,7 +525,7 @@ static int lpc17_40_configalternate(lpc17_40_pinset_t cfgset, unsigned int port, * starting point and consistent behavior during the re-configuration. */ - (void)lpc17_40_configinput(DEFAULT_INPUT, port, pin); + lpc17_40_configinput(DEFAULT_INPUT, port, pin); /* Set up PINSEL registers */ /* Configure as GPIO */ diff --git a/arch/arm/src/lpc17xx_40xx/lpc176x_rtc.c b/arch/arm/src/lpc17xx_40xx/lpc176x_rtc.c index b56d73cb58..6a7282e768 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc176x_rtc.c +++ b/arch/arm/src/lpc17xx_40xx/lpc176x_rtc.c @@ -362,7 +362,7 @@ int up_rtc_settime(FAR const struct timespec *tp) /* Break out the time values (not that the time is set only to units of seconds) */ - (void)gmtime_r(&tp->tv_sec, &newtime); + gmtime_r(&tp->tv_sec, &newtime); rtc_dumptime(&newtime, "Setting time"); /* Then write the broken out values to the RTC */ diff --git a/arch/arm/src/lpc17xx_40xx/lpc178x_40xx_gpio.c b/arch/arm/src/lpc17xx_40xx/lpc178x_40xx_gpio.c index be114cac93..600b6f7a75 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc178x_40xx_gpio.c +++ b/arch/arm/src/lpc17xx_40xx/lpc178x_40xx_gpio.c @@ -651,7 +651,7 @@ static inline int lpc17_40_configinterrupt(lpc17_40_pinset_t cfgset, unsigned in * starting point and consistent behavior during the re-configuration. */ - (void)lpc17_40_configinput(cfgset, port, pin); + lpc17_40_configinput(cfgset, port, pin); /* Then just remember the rising/falling edge interrupt enabled */ @@ -680,7 +680,7 @@ static inline int lpc17_40_configoutput(lpc17_40_pinset_t cfgset, unsigned int p * starting point and consistent behavior during the re-configuration. */ - (void)lpc17_40_configinput(DEFAULT_INPUT, port, pin); + lpc17_40_configinput(DEFAULT_INPUT, port, pin); /* Now, reconfigure the pin as an output */ @@ -733,7 +733,7 @@ static int lpc17_40_configalternate(lpc17_40_pinset_t cfgset, unsigned int port, * starting point and consistent behavior during the re-configuration. */ - (void)lpc17_40_configinput(DEFAULT_INPUT, port, pin); + lpc17_40_configinput(DEFAULT_INPUT, port, pin); /* Set pull-up mode */ diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c index 6e8f02d3c0..91321dd26f 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c @@ -700,8 +700,8 @@ static int lpc17_40_transmit(struct lpc17_40_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->lp_txtimeout, LPC17_40_TXTIMEOUT, - lpc17_40_txtimeout_expiry, 1, (uint32_t)priv); + wd_start(priv->lp_txtimeout, LPC17_40_TXTIMEOUT, + lpc17_40_txtimeout_expiry, 1, (uint32_t)priv); return OK; } @@ -1152,7 +1152,7 @@ static void lpc17_40_txdone_work(FAR void *arg) else { - (void)devif_poll(&priv->lp_dev, lpc17_40_txpoll); + devif_poll(&priv->lp_dev, lpc17_40_txpoll); } net_unlock(); @@ -1234,7 +1234,7 @@ static int lpc17_40_interrupt(int irq, void *context, FAR void *arg) /* ifup() will reset the EMAC and bring it back up */ - (void)lpc17_40_ifup(&priv->lp_dev); + lpc17_40_ifup(&priv->lp_dev); } else { @@ -1393,11 +1393,11 @@ static void lpc17_40_txtimeout_work(FAR void *arg) * it back up. */ - (void)lpc17_40_ifup(&priv->lp_dev); + lpc17_40_ifup(&priv->lp_dev); /* Then poll the network layer for new XMIT data */ - (void)devif_poll(&priv->lp_dev, lpc17_40_txpoll); + devif_poll(&priv->lp_dev, lpc17_40_txpoll); } net_unlock(); @@ -1480,7 +1480,7 @@ static void lpc17_40_poll_work(FAR void *arg) * transmit in progress, we will missing TCP time state updates? */ - (void)devif_timer(&priv->lp_dev, LPC17_40_WDDELAY, lpc17_40_txpoll); + devif_timer(&priv->lp_dev, LPC17_40_WDDELAY, lpc17_40_txpoll); } /* Simulate a fake receive to relaunch the data exchanges when a receive @@ -1500,8 +1500,8 @@ static void lpc17_40_poll_work(FAR void *arg) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->lp_txpoll, LPC17_40_WDDELAY, lpc17_40_poll_expiry, - 1, priv); + wd_start(priv->lp_txpoll, LPC17_40_WDDELAY, lpc17_40_poll_expiry, + 1, priv); net_unlock(); } @@ -1584,7 +1584,7 @@ static void lpc17_40_ipv6multicast(FAR struct lpc17_40_driver_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)lpc17_40_addmac(dev, mac); + lpc17_40_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -1592,7 +1592,7 @@ static void lpc17_40_ipv6multicast(FAR struct lpc17_40_driver_s *priv) * packets. */ - (void)lpc17_40_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + lpc17_40_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -1601,7 +1601,7 @@ static void lpc17_40_ipv6multicast(FAR struct lpc17_40_driver_s *priv) * packets. */ - (void)lpc17_40_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + lpc17_40_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -1752,8 +1752,8 @@ static int lpc17_40_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->lp_txpoll, LPC17_40_WDDELAY, lpc17_40_poll_expiry, 1, - (uint32_t)priv); + wd_start(priv->lp_txpoll, LPC17_40_WDDELAY, lpc17_40_poll_expiry, 1, + (uint32_t)priv); /* Finally, make the interface up and enable the Ethernet interrupt at * the interrupt controller @@ -1839,7 +1839,7 @@ static void lpc17_40_txavail_work(FAR void *arg) { /* If so, then poll the network layer for new XMIT data */ - (void)devif_poll(&priv->lp_dev, lpc17_40_txpoll); + devif_poll(&priv->lp_dev, lpc17_40_txpoll); } } @@ -3258,7 +3258,7 @@ static inline int lpc17_40_ethinitialize(int intf) for (i = 0; i < GPIO_NENET_PINS; i++) { - (void)lpc17_40_configgpio(g_enetpins[i]); + lpc17_40_configgpio(g_enetpins[i]); } lpc17_40_showpins(); @@ -3317,7 +3317,7 @@ static inline int lpc17_40_ethinitialize(int intf) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->lp_dev, NET_LL_ETHERNET); + netdev_register(&priv->lp_dev, NET_LL_ETHERNET); return OK; } @@ -3335,7 +3335,7 @@ static inline int lpc17_40_ethinitialize(int intf) #if CONFIG_LPC17_40_NINTERFACES == 1 && !defined(CONFIG_NETDEV_LATEINIT) void up_netinitialize(void) { - (void)lpc17_40_ethinitialize(0); + lpc17_40_ethinitialize(0); } #endif #endif /* LPC17_40_NETHCONTROLLERS > 0 */ diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_gpdma.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_gpdma.c index 45b09804ec..0651bc6dc9 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_gpdma.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_gpdma.c @@ -389,17 +389,11 @@ void lpc17_40_dmaconfigure(uint8_t dmarequest, bool alternate) DMA_HANDLE lpc17_40_dmachannel(void) { struct lpc17_40_dmach_s *dmach = NULL; - int ret; int i; /* Get exclusive access to the GPDMA state structure */ - do - { - ret = nxsem_wait(&g_gpdma.exclsem); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_gpdma.exclsem); /* Find an available DMA channel */ diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_gpioint.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_gpioint.c index d621052ea8..0b51bd990c 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_gpioint.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_gpioint.c @@ -468,7 +468,7 @@ void lpc17_40_gpioirqinitialize(void) * position in the NVIC with External Interrupt 3 */ - (void)irq_attach(LPC17_40_IRQ_EINT3, lpc17_40_gpiointerrupt, NULL); + irq_attach(LPC17_40_IRQ_EINT3, lpc17_40_gpiointerrupt, NULL); up_enable_irq(LPC17_40_IRQ_EINT3); #elif defined(LPC178x_40xx) @@ -476,7 +476,7 @@ void lpc17_40_gpioirqinitialize(void) * GPIO2. */ - (void)irq_attach(LPC17_40_IRQ_GPIO, lpc17_40_gpiointerrupt, NULL); + irq_attach(LPC17_40_IRQ_GPIO, lpc17_40_gpiointerrupt, NULL); up_enable_irq(LPC17_40_IRQ_GPIO); #endif diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c index ba25a6a591..c59fda0cb9 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c @@ -238,8 +238,8 @@ static int lpc17_40_i2c_start(struct lpc17_40_i2cdev_s *priv) priv->state = 0x00; - (void)wd_start(priv->timeout, timeout, lpc17_40_i2c_timeout, 1, - (uint32_t)priv); + wd_start(priv->timeout, timeout, lpc17_40_i2c_timeout, 1, + (uint32_t)priv); nxsem_wait(&priv->wait); wd_cancel(priv->timeout); diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_irq.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_irq.c index a82cbcff64..474826de78 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_irq.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_irq.c @@ -152,7 +152,7 @@ static void lpc17_40_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int lpc17_40_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -160,7 +160,7 @@ static int lpc17_40_nmi(int irq, FAR void *context, FAR void *arg) static int lpc17_40_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received\n"); PANIC(); return 0; @@ -168,7 +168,7 @@ static int lpc17_40_busfault(int irq, FAR void *context, FAR void *arg) static int lpc17_40_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -176,7 +176,7 @@ static int lpc17_40_usagefault(int irq, FAR void *context, FAR void *arg) static int lpc17_40_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -184,7 +184,7 @@ static int lpc17_40_pendsv(int irq, FAR void *context, FAR void *arg) static int lpc17_40_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -192,7 +192,7 @@ static int lpc17_40_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int lpc17_40_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_sdcard.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_sdcard.c index 03e084ecdf..9bcd260e0d 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_sdcard.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_sdcard.c @@ -485,21 +485,7 @@ static struct lpc17_40_sampleregs_s g_sampleregs[DEBUG_NSAMPLES]; static void lpc17_40_takesem(struct lpc17_40_dev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->waitsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -1117,7 +1103,7 @@ static void lpc17_40_endwait(struct lpc17_40_dev_s *priv, sdio_eventset_t wkupev { /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Disable event-related interrupts */ @@ -1882,7 +1868,7 @@ static int lpc17_40_cancel(FAR struct sdio_dev_s *dev) /* Cancel any watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* If this was a DMA transfer, make sure that DMA is stopped */ @@ -2655,7 +2641,7 @@ static void lpc17_40_callback(void *arg) /* Yes.. queue it */ mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); - (void)work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, priv->cbarg, 0); + work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, priv->cbarg, 0); } else { diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_serial.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_serial.c index 7b3c920013..c0b6e0a0ab 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_serial.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_serial.c @@ -1487,19 +1487,19 @@ void up_earlyserialinit(void) void up_serialinit(void) { #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #endif #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif } diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_spi.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_spi.c index 992ebebe57..76f5cbb705 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_spi.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_spi.c @@ -187,24 +187,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -408,7 +395,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC17_40_SPI_SR); + getreg32(LPC17_40_SPI_SR); return (uint16_t)getreg32(LPC17_40_SPI_DR); } @@ -453,7 +440,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC17_40_SPI_SR); + getreg32(LPC17_40_SPI_SR); nwords--; } } @@ -499,7 +486,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC17_40_SPI_SR); + getreg32(LPC17_40_SPI_SR); /* Read the received data from the SPI Data Register */ diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_ssp.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_ssp.c index b0331c8ee4..f6ab07c16b 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_ssp.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_ssp.c @@ -334,24 +334,11 @@ static int ssp_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -670,7 +657,7 @@ static void ssp_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size { /* Yes.. Read and discard */ - (void)ssp_getreg(priv, LPC17_40_SSP_DR_OFFSET); + ssp_getreg(priv, LPC17_40_SSP_DR_OFFSET); } /* There is a race condition where TFE may go true just before @@ -996,7 +983,7 @@ FAR struct spi_dev_s *lpc17_40_sspbus_initialize(int port) ssp_putreg(priv, LPC17_40_SSP_CR1_OFFSET, regval | SSP_CR1_SSE); for (i = 0; i < LPC17_40_SSP_FIFOSZ; i++) { - (void)ssp_getreg(priv, LPC17_40_SSP_DR_OFFSET); + ssp_getreg(priv, LPC17_40_SSP_DR_OFFSET); } return &priv->spidev; @@ -1038,7 +1025,7 @@ void ssp_flush(FAR struct spi_dev_s *dev) do { - (void)ssp_getreg(priv, LPC17_40_SSP_DR_OFFSET); + ssp_getreg(priv, LPC17_40_SSP_DR_OFFSET); } while (ssp_getreg(priv, LPC17_40_SSP_SR_OFFSET) & SSP_SR_RNE); } diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_timerisr.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_timerisr.c index 9b1d9c34cd..ff9faa12aa 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_timerisr.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_timerisr.c @@ -135,7 +135,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(LPC17_40_IRQ_SYSTICK, (xcpt_t)lpc17_40_timerisr, NULL); + irq_attach(LPC17_40_IRQ_SYSTICK, (xcpt_t)lpc17_40_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_usbdev.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_usbdev.c index 9bd22b4ca6..fe7b6a4ac0 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_usbdev.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_usbdev.c @@ -896,8 +896,8 @@ static void lpc17_40_epwrite(uint8_t epphy, const uint8_t *data, uint32_t nbytes /* Done */ lpc17_40_putreg(0, LPC17_40_USBDEV_CTRL); - (void)lpc17_40_usbcmd(CMD_USBDEV_EPSELECT | epphy, 0); - (void)lpc17_40_usbcmd(CMD_USBDEV_EPVALIDATEBUFFER, 0); + lpc17_40_usbcmd(CMD_USBDEV_EPSELECT | epphy, 0); + lpc17_40_usbcmd(CMD_USBDEV_EPVALIDATEBUFFER, 0); } /**************************************************************************** @@ -969,7 +969,7 @@ static int lpc17_40_epread(uint8_t epphy, uint8_t *data, uint32_t nbytes) /* Done */ lpc17_40_putreg(0, LPC17_40_USBDEV_CTRL); - (void)lpc17_40_usbcmd(CMD_USBDEV_EPSELECT | epphy, 0); + lpc17_40_usbcmd(CMD_USBDEV_EPSELECT | epphy, 0); result = lpc17_40_usbcmd(CMD_USBDEV_EPCLRBUFFER, 0); /* The packet overrun bit in the clear buffer response is applicable only @@ -1719,7 +1719,7 @@ static inline void lpc17_40_ep0setup(struct lpc17_40_usbdev_s *priv) (privep = lpc17_40_epfindbyaddr(priv, index)) != NULL) { privep->halted = 0; - (void)lpc17_40_epstall(&privep->ep, true); + lpc17_40_epstall(&privep->ep, true); lpc17_40_epwrite(LPC17_40_EP0_IN, NULL, 0); priv->ep0state = LPC17_40_EP0STATUSIN; } @@ -2268,7 +2268,7 @@ static int lpc17_40_usbinterrupt(int irq, FAR void *context, FAR void *arg) /* Clear the endpoint interrupt */ usbtrace(TRACE_INTDECODE(LPC17_40_TRACEINTID_EP0IN), priv->ep0state); - (void)lpc17_40_epclrinterrupt(LPC17_40_CTRLEP_IN); + lpc17_40_epclrinterrupt(LPC17_40_CTRLEP_IN); lpc17_40_ep0dataininterrupt(priv); } pending >>= 2; @@ -2283,7 +2283,7 @@ static int lpc17_40_usbinterrupt(int irq, FAR void *context, FAR void *arg) { /* Yes.. clear the endpoint interrupt */ - (void)lpc17_40_epclrinterrupt(epphy); + lpc17_40_epclrinterrupt(epphy); /* Get the endpoint sructure corresponding to the physical * endpoint number. @@ -2926,7 +2926,7 @@ static int lpc17_40_epstall(FAR struct usbdev_ep_s *ep, bool resume) if (resume) { - (void)lpc17_40_wrrequest(privep); + lpc17_40_wrrequest(privep); } leave_critical_section(flags); return OK; diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_usbhost.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_usbhost.c index b2350d6307..682c170d9d 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_usbhost.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_usbhost.c @@ -584,21 +584,7 @@ static void lpc17_40_putreg(uint32_t val, uint32_t addr) static void lpc17_40_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -2058,7 +2044,7 @@ static int lpc17_40_rh_enumerate(struct usbhost_connection_s *conn, /* USB 2.0 spec says at least 50ms delay before port reset */ - (void)nxsig_usleep(100*1000); + nxsig_usleep(100*1000); /* Put RH port 1 in reset (the LPC176x supports only a single downstream port) */ @@ -2071,7 +2057,7 @@ static int lpc17_40_rh_enumerate(struct usbhost_connection_s *conn, /* Release RH port 1 from reset and wait a bit */ lpc17_40_putreg(OHCI_RHPORTST_PRSC, LPC17_40_USBHOST_RHPORTST1); - (void)nxsig_usleep(200*1000); + nxsig_usleep(200*1000); return OK; } diff --git a/arch/arm/src/lpc214x/lpc214x_serial.c b/arch/arm/src/lpc214x/lpc214x_serial.c index 719bc387c0..af2993865a 100644 --- a/arch/arm/src/lpc214x/lpc214x_serial.c +++ b/arch/arm/src/lpc214x/lpc214x_serial.c @@ -773,9 +773,9 @@ void up_earlyserialinit(void) void up_serialinit(void) { - (void)uart_register("/dev/console", &CONSOLE_DEV); - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); } /**************************************************************************** diff --git a/arch/arm/src/lpc214x/lpc214x_timerisr.c b/arch/arm/src/lpc214x/lpc214x_timerisr.c index a1293024dd..aa945f3ef7 100644 --- a/arch/arm/src/lpc214x/lpc214x_timerisr.c +++ b/arch/arm/src/lpc214x/lpc214x_timerisr.c @@ -157,7 +157,7 @@ void arm_timer_initialize(void) up_attach_vector(LPC214X_IRQ_SYSTIMER, LPC214X_SYSTIMER_VEC, (vic_vector_t)lpc214x_timerisr); #else - (void)irq_attach(LPC214X_IRQ_SYSTIMER, (xcpt_t)lpc214x_timerisr, NULL); + irq_attach(LPC214X_IRQ_SYSTIMER, (xcpt_t)lpc214x_timerisr, NULL); #endif /* And enable the timer interrupt */ diff --git a/arch/arm/src/lpc214x/lpc214x_usbdev.c b/arch/arm/src/lpc214x/lpc214x_usbdev.c index c39324dc5a..c34021a098 100644 --- a/arch/arm/src/lpc214x/lpc214x_usbdev.c +++ b/arch/arm/src/lpc214x/lpc214x_usbdev.c @@ -838,8 +838,8 @@ static void lpc214x_epwrite(uint8_t epphy, const uint8_t *data, uint32_t nbytes) /* Done */ lpc214x_putreg(0, LPC214X_USBDEV_CTRL); - (void)lpc214x_usbcmd(CMD_USB_EP_SELECT | epphy, 0); - (void)lpc214x_usbcmd(CMD_USB_EP_VALIDATEBUFFER, 0); + lpc214x_usbcmd(CMD_USB_EP_SELECT | epphy, 0); + lpc214x_usbcmd(CMD_USB_EP_VALIDATEBUFFER, 0); } /**************************************************************************** @@ -911,7 +911,7 @@ static int lpc214x_epread(uint8_t epphy, uint8_t *data, uint32_t nbytes) /* Done */ lpc214x_putreg(0, LPC214X_USBDEV_CTRL); - (void)lpc214x_usbcmd(CMD_USB_EP_SELECT | epphy, 0); + lpc214x_usbcmd(CMD_USB_EP_SELECT | epphy, 0); result = lpc214x_usbcmd(CMD_USB_EP_CLRBUFFER, 0); /* The packet overrun bit in the clear buffer response is applicable only @@ -1674,7 +1674,7 @@ static inline void lpc214x_ep0setup(struct lpc214x_usbdev_s *priv) (privep = lpc214x_epfindbyaddr(priv, index)) != NULL) { privep->halted = 0; - (void)lpc214x_epstall(&privep->ep, true); + lpc214x_epstall(&privep->ep, true); lpc214x_epwrite(LPC214X_EP0_IN, NULL, 0); priv->ep0state = LPC214X_EP0STATUSIN; } @@ -2231,7 +2231,7 @@ static int lpc214x_usbinterrupt(int irq, FAR void *context, FAR void *arg) /* Clear the endpoint interrupt */ usbtrace(TRACE_INTDECODE(LPC214X_TRACEINTID_EP0IN), priv->ep0state); - (void)lpc214x_epclrinterrupt(LPC214X_CTRLEP_IN); + lpc214x_epclrinterrupt(LPC214X_CTRLEP_IN); lpc214x_ep0dataininterrupt(priv); } pending >>= 2; @@ -2246,7 +2246,7 @@ static int lpc214x_usbinterrupt(int irq, FAR void *context, FAR void *arg) { /* Yes.. clear the endpoint interrupt */ - (void)lpc214x_epclrinterrupt(epphy); + lpc214x_epclrinterrupt(epphy); /* Get the endpoint sructure corresponding to the physical * endpoint number. @@ -2884,7 +2884,7 @@ static int lpc214x_epstall(FAR struct usbdev_ep_s *ep, bool resume) if (resume) { - (void)lpc214x_wrrequest(privep); + lpc214x_wrrequest(privep); } leave_critical_section(flags); return OK; diff --git a/arch/arm/src/lpc2378/lpc23xx_i2c.c b/arch/arm/src/lpc2378/lpc23xx_i2c.c index 5bb9b120b7..fc3a9b906e 100644 --- a/arch/arm/src/lpc2378/lpc23xx_i2c.c +++ b/arch/arm/src/lpc2378/lpc23xx_i2c.c @@ -220,8 +220,8 @@ static int lpc2378_i2c_start(struct lpc2378_i2cdev_s *priv) priv->base + I2C_CONCLR_OFFSET); putreg32(I2C_CONSET_STA, priv->base + I2C_CONSET_OFFSET); - (void)wd_start(priv->timeout, I2C_TIMEOUT, lpc2378_i2c_timeout, 1, - (uint32_t)priv); + wd_start(priv->timeout, I2C_TIMEOUT, lpc2378_i2c_timeout, 1, + (uint32_t)priv); nxsem_wait(&priv->wait); wd_cancel(priv->timeout); diff --git a/arch/arm/src/lpc2378/lpc23xx_serial.c b/arch/arm/src/lpc2378/lpc23xx_serial.c index 263400adfb..32c5c1630b 100644 --- a/arch/arm/src/lpc2378/lpc23xx_serial.c +++ b/arch/arm/src/lpc2378/lpc23xx_serial.c @@ -894,9 +894,9 @@ void up_earlyserialinit(void) void up_serialinit(void) { - (void)uart_register("/dev/console", &CONSOLE_DEV); - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); } /**************************************************************************** diff --git a/arch/arm/src/lpc2378/lpc23xx_spi.c b/arch/arm/src/lpc2378/lpc23xx_spi.c index 86021293fb..c1e3bfdb34 100644 --- a/arch/arm/src/lpc2378/lpc23xx_spi.c +++ b/arch/arm/src/lpc2378/lpc23xx_spi.c @@ -193,24 +193,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -415,7 +402,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(SPI_SR); + getreg32(SPI_SR); return (uint16_t)getreg32(SPI_DR); } @@ -460,7 +447,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(SPI_SR); + getreg32(SPI_SR); nwords--; } } @@ -506,7 +493,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(SPI_SR); + getreg32(SPI_SR); /* Read the received data from the SPI Data Register */ diff --git a/arch/arm/src/lpc2378/lpc23xx_timerisr.c b/arch/arm/src/lpc2378/lpc23xx_timerisr.c index 455fd53a6e..b4031191b2 100644 --- a/arch/arm/src/lpc2378/lpc23xx_timerisr.c +++ b/arch/arm/src/lpc2378/lpc23xx_timerisr.c @@ -189,7 +189,7 @@ void arm_timer_initialize(void) #ifdef CONFIG_VECTORED_INTERRUPTS up_attach_vector(IRQ_SYSTIMER, ???, (vic_vector_t) lpc23xx_timerisr); #else - (void)irq_attach(IRQ_SYSTIMER, (xcpt_t)lpc23xx_timerisr, NULL); + irq_attach(IRQ_SYSTIMER, (xcpt_t)lpc23xx_timerisr, NULL); #endif /* And enable the system timer interrupt */ diff --git a/arch/arm/src/lpc31xx/lpc31_decodeirq.c b/arch/arm/src/lpc31xx/lpc31_decodeirq.c index d091a35aaa..8464ffb497 100644 --- a/arch/arm/src/lpc31xx/lpc31_decodeirq.c +++ b/arch/arm/src/lpc31xx/lpc31_decodeirq.c @@ -126,7 +126,7 @@ void up_decodeirq(uint32_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/arm/src/lpc31xx/lpc31_ehci.c b/arch/arm/src/lpc31xx/lpc31_ehci.c index 2619f50e97..7e778e87b6 100644 --- a/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -1012,21 +1012,7 @@ static int ehci_wait_usbsts(uint32_t maskbits, uint32_t donebits, static void lpc31_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -1649,7 +1635,7 @@ static void lpc31_qh_enqueue(struct lpc31_qh_s *qhead, struct lpc31_qh_s *qh) */ qh->fqp = qh->hw.overlay.nqp; - (void)lpc31_qh_dump(qh, NULL, NULL); + lpc31_qh_dump(qh, NULL, NULL); /* Add the new QH to the head of the asynchronous queue list. * diff --git a/arch/arm/src/lpc31xx/lpc31_i2c.c b/arch/arm/src/lpc31xx/lpc31_i2c.c index b4ff05cd9d..c65d55c471 100644 --- a/arch/arm/src/lpc31xx/lpc31_i2c.c +++ b/arch/arm/src/lpc31xx/lpc31_i2c.c @@ -490,7 +490,7 @@ static int i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s *msgs /* Start a watchdog to timeout the transfer if the bus is locked up... */ - (void)wd_start(priv->timeout, I2C_TIMEOUT, i2c_timeout, 1, (uint32_t)priv); + wd_start(priv->timeout, I2C_TIMEOUT, i2c_timeout, 1, (uint32_t)priv); /* Wait for the transfer to complete */ diff --git a/arch/arm/src/lpc31xx/lpc31_resetclks.c b/arch/arm/src/lpc31xx/lpc31_resetclks.c index 4631f14748..13465f3348 100644 --- a/arch/arm/src/lpc31xx/lpc31_resetclks.c +++ b/arch/arm/src/lpc31xx/lpc31_resetclks.c @@ -137,7 +137,7 @@ void lpc31_resetclks(void) * upon if the clock is needed by the board logic or not */ - (void)lpc31_defclk((enum lpc31_clockid_e)i); + lpc31_defclk((enum lpc31_clockid_e)i); } /* Disable all fractional dividers */ diff --git a/arch/arm/src/lpc31xx/lpc31_serial.c b/arch/arm/src/lpc31xx/lpc31_serial.c index b3ba526524..a4f93d56fe 100644 --- a/arch/arm/src/lpc31xx/lpc31_serial.c +++ b/arch/arm/src/lpc31xx/lpc31_serial.c @@ -792,9 +792,9 @@ void up_earlyserialinit(void) void up_serialinit(void) { #if defined(CONFIG_UART_SERIAL_CONSOLE) - (void)uart_register("/dev/console", &g_uartport); + uart_register("/dev/console", &g_uartport); #endif - (void)uart_register("/dev/ttyS0", &g_uartport); + uart_register("/dev/ttyS0", &g_uartport); } /**************************************************************************** diff --git a/arch/arm/src/lpc31xx/lpc31_spi.c b/arch/arm/src/lpc31xx/lpc31_spi.c index 8190a05e35..e9b4906b30 100644 --- a/arch/arm/src/lpc31xx/lpc31_spi.c +++ b/arch/arm/src/lpc31xx/lpc31_spi.c @@ -447,24 +447,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; diff --git a/arch/arm/src/lpc31xx/lpc31_timerisr.c b/arch/arm/src/lpc31xx/lpc31_timerisr.c index 0120a67850..206c2512e8 100644 --- a/arch/arm/src/lpc31xx/lpc31_timerisr.c +++ b/arch/arm/src/lpc31xx/lpc31_timerisr.c @@ -135,7 +135,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(LPC31_IRQ_TMR0, (xcpt_t)lpc31_timerisr, NULL); + irq_attach(LPC31_IRQ_TMR0, (xcpt_t)lpc31_timerisr, NULL); /* Clear any latched timer interrupt (Writing any value to the CLEAR register * clears the latched interrupt generated by the counter timer) diff --git a/arch/arm/src/lpc43xx/lpc43_ehci.c b/arch/arm/src/lpc43xx/lpc43_ehci.c index d7fa789fa4..6999614987 100644 --- a/arch/arm/src/lpc43xx/lpc43_ehci.c +++ b/arch/arm/src/lpc43xx/lpc43_ehci.c @@ -1005,21 +1005,7 @@ static int ehci_wait_usbsts(uint32_t maskbits, uint32_t donebits, static void lpc43_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -1549,7 +1535,7 @@ static void lpc43_qh_enqueue(struct lpc43_qh_s *qhead, struct lpc43_qh_s *qh) */ qh->fqp = qh->hw.overlay.nqp; - (void)lpc43_qh_dump(qh, NULL, NULL); + lpc43_qh_dump(qh, NULL, NULL); /* Add the new QH to the head of the asynchronous queue list. * diff --git a/arch/arm/src/lpc43xx/lpc43_ethernet.c b/arch/arm/src/lpc43xx/lpc43_ethernet.c index 76ada7c430..e3f0b171da 100644 --- a/arch/arm/src/lpc43xx/lpc43_ethernet.c +++ b/arch/arm/src/lpc43xx/lpc43_ethernet.c @@ -1103,7 +1103,7 @@ static int lpc43_transmit(FAR struct lpc43_ethmac_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, LPC43_TXTIMEOUT, lpc43_txtimeout_expiry, 1, (uint32_t)priv); + wd_start(priv->txtimeout, LPC43_TXTIMEOUT, lpc43_txtimeout_expiry, 1, (uint32_t)priv); return OK; } @@ -1267,7 +1267,7 @@ static void lpc43_dopoll(FAR struct lpc43_ethmac_s *priv) if (dev->d_buf) { - (void)devif_poll(dev, lpc43_txpoll); + devif_poll(dev, lpc43_txpoll); /* We will, most likely end up with a buffer to be freed. But it * might not be the same one that we allocated above. @@ -2169,7 +2169,7 @@ static void lpc43_poll_work(FAR void *arg) /* Update TCP timing states and poll for new XMIT data. */ - (void)devif_timer(dev, LPC43_WDDELAY, lpc43_txpoll); + devif_timer(dev, LPC43_WDDELAY, lpc43_txpoll); /* We will, most likely end up with a buffer to be freed. But it * might not be the same one that we allocated above. @@ -2186,7 +2186,7 @@ static void lpc43_poll_work(FAR void *arg) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, LPC43_WDDELAY, lpc43_poll_expiry, 1, priv); + wd_start(priv->txpoll, LPC43_WDDELAY, lpc43_poll_expiry, 1, priv); net_unlock(); } @@ -2261,8 +2261,8 @@ static int lpc43_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, LPC43_WDDELAY, lpc43_poll_expiry, 1, - (uint32_t)priv); + wd_start(priv->txpoll, LPC43_WDDELAY, lpc43_poll_expiry, 1, + (uint32_t)priv); /* Enable the Ethernet interrupt */ @@ -3612,7 +3612,7 @@ static void lpc43_ipv6multicast(FAR struct lpc43_ethmac_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)lpc43_addmac(dev, mac); + lpc43_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -3620,7 +3620,7 @@ static void lpc43_ipv6multicast(FAR struct lpc43_ethmac_s *priv) * packets. */ - (void)lpc43_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + lpc43_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -3629,7 +3629,7 @@ static void lpc43_ipv6multicast(FAR struct lpc43_ethmac_s *priv) * packets. */ - (void)lpc43_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + lpc43_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -3857,7 +3857,7 @@ static inline int lpc43_ethinitialize(void) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->dev, NET_LL_ETHERNET); + netdev_register(&priv->dev, NET_LL_ETHERNET); return OK; } @@ -3881,7 +3881,7 @@ static inline int lpc43_ethinitialize(void) #ifndef CONFIG_NETDEV_LATEINIT void up_netinitialize(void) { - (void)lpc43_ethinitialize(); + lpc43_ethinitialize(); } #endif diff --git a/arch/arm/src/lpc43xx/lpc43_gpdma.c b/arch/arm/src/lpc43xx/lpc43_gpdma.c index 0e4668e96c..784dca3bdf 100644 --- a/arch/arm/src/lpc43xx/lpc43_gpdma.c +++ b/arch/arm/src/lpc43xx/lpc43_gpdma.c @@ -390,17 +390,11 @@ void lpc43_dmaconfigure(uint8_t dmarequest, uint8_t dmasrc) DMA_HANDLE lpc43_dmachannel(void) { struct lpc43_dmach_s *dmach = NULL; - int ret; int i; /* Get exclusive access to the GPDMA state structure */ - do - { - ret = nxsem_wait(&g_gpdma.exclsem); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret < 0); + nxsem_wait_uninterruptible(&g_gpdma.exclsem); /* Find an available DMA channel */ diff --git a/arch/arm/src/lpc43xx/lpc43_i2c.c b/arch/arm/src/lpc43xx/lpc43_i2c.c index 137a34f1f7..5f0cf332c6 100644 --- a/arch/arm/src/lpc43xx/lpc43_i2c.c +++ b/arch/arm/src/lpc43xx/lpc43_i2c.c @@ -202,8 +202,8 @@ static int lpc43_i2c_start(struct lpc43_i2cdev_s *priv) priv->base + LPC43_I2C_CONCLR_OFFSET); putreg32(I2C_CONSET_STA, priv->base + LPC43_I2C_CONSET_OFFSET); - (void)wd_start(priv->timeout, I2C_TIMEOUT, lpc43_i2c_timeout, 1, - (uint32_t)priv); + wd_start(priv->timeout, I2C_TIMEOUT, lpc43_i2c_timeout, 1, + (uint32_t)priv); nxsem_wait(&priv->wait); wd_cancel(priv->timeout); diff --git a/arch/arm/src/lpc43xx/lpc43_idle.c b/arch/arm/src/lpc43xx/lpc43_idle.c index 56e98d079b..6bf7811d5a 100644 --- a/arch/arm/src/lpc43xx/lpc43_idle.c +++ b/arch/arm/src/lpc43xx/lpc43_idle.c @@ -107,7 +107,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { @@ -131,7 +131,7 @@ static void up_idlepm(void) break; case PM_SLEEP: - (void)lpc43_pmsleep(); + lpc43_pmsleep(); break; default: diff --git a/arch/arm/src/lpc43xx/lpc43_irq.c b/arch/arm/src/lpc43xx/lpc43_irq.c index 94fbc945c0..6e041f2cd9 100644 --- a/arch/arm/src/lpc43xx/lpc43_irq.c +++ b/arch/arm/src/lpc43xx/lpc43_irq.c @@ -157,7 +157,7 @@ static void lpc43_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int lpc43_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -165,7 +165,7 @@ static int lpc43_nmi(int irq, FAR void *context, FAR void *arg) static int lpc43_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received\n"); PANIC(); return 0; @@ -173,7 +173,7 @@ static int lpc43_busfault(int irq, FAR void *context, FAR void *arg) static int lpc43_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -181,7 +181,7 @@ static int lpc43_usagefault(int irq, FAR void *context, FAR void *arg) static int lpc43_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -189,7 +189,7 @@ static int lpc43_pendsv(int irq, FAR void *context, FAR void *arg) static int lpc43_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -197,7 +197,7 @@ static int lpc43_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int lpc43_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/lpc43xx/lpc43_rtc.c b/arch/arm/src/lpc43xx/lpc43_rtc.c index 291ba8420e..7275dbb724 100644 --- a/arch/arm/src/lpc43xx/lpc43_rtc.c +++ b/arch/arm/src/lpc43xx/lpc43_rtc.c @@ -341,7 +341,7 @@ int up_rtc_settime(FAR const struct timespec *tp) /* Break out the time values (not that the time is set only to units of seconds) */ - (void)gmtime_r(&tp->tv_sec, &newtime); + gmtime_r(&tp->tv_sec, &newtime); rtc_dumptime(&newtime, "Setting time"); /* Then write the broken out values to the RTC */ diff --git a/arch/arm/src/lpc43xx/lpc43_sdmmc.c b/arch/arm/src/lpc43xx/lpc43_sdmmc.c index 017dd72846..ff5ce44ec0 100644 --- a/arch/arm/src/lpc43xx/lpc43_sdmmc.c +++ b/arch/arm/src/lpc43xx/lpc43_sdmmc.c @@ -270,7 +270,7 @@ static void lpc43_putreg(uint32_t val, uint32_t addr); /* Low-level helpers ********************************************************/ static void lpc43_takesem(struct lpc43_dev_s *priv); -#define lpc43_givesem(priv) (sem_post(&priv->waitsem)) +#define lpc43_givesem(priv) (nxsem_post(&priv->waitsem)) static inline void lpc43_setclock(uint32_t clkdiv); static inline void lpc43_sdcard_clock(bool enable); static int lpc43_ciu_sendcmd(uint32_t cmd, uint32_t arg); @@ -526,16 +526,7 @@ static void lpc43_putreg(uint32_t val, uint32_t addr) static void lpc43_takesem(struct lpc43_dev_s *priv) { - /* Take the semaphore (perhaps waiting) */ - - while (sem_wait(&priv->waitsem) != 0) - { - /* The only case that an error should occr here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(errno == EINTR || errno == ECANCELED); - } + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -882,7 +873,7 @@ static void lpc43_endwait(struct lpc43_dev_s *priv, sdio_eventset_t wkupevent) /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Disable event-related interrupts */ @@ -1856,7 +1847,7 @@ static int lpc43_cancel(FAR struct sdio_dev_s *dev) /* Cancel any watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Mark no transfer in progress */ @@ -2770,7 +2761,7 @@ static void lpc43_callback(struct lpc43_dev_s *priv) /* Yes.. queue it */ mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); - (void)work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, priv->cbarg, 0); + work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, priv->cbarg, 0); } else { @@ -2830,13 +2821,13 @@ FAR struct sdio_dev_s *lpc43_sdmmc_initialize(int slotno) /* Initialize semaphores */ - sem_init(&priv->waitsem, 0, 0); + nxsem_init(&priv->waitsem, 0, 0); /* The waitsem semaphore is used for signaling and, hence, should not have * priority inheritance enabled. */ - sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE); + nxsem_setprotocol(&priv->waitsem, SEM_PRIO_NONE); /* Create a watchdog timer */ diff --git a/arch/arm/src/lpc43xx/lpc43_serial.c b/arch/arm/src/lpc43xx/lpc43_serial.c index 73307f9ffd..8df1f7e0ee 100644 --- a/arch/arm/src/lpc43xx/lpc43_serial.c +++ b/arch/arm/src/lpc43xx/lpc43_serial.c @@ -1328,19 +1328,19 @@ void up_earlyserialinit(void) void up_serialinit(void) { #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #endif #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif } diff --git a/arch/arm/src/lpc43xx/lpc43_spi.c b/arch/arm/src/lpc43xx/lpc43_spi.c index 108e20c6ef..c8c5a96d34 100644 --- a/arch/arm/src/lpc43xx/lpc43_spi.c +++ b/arch/arm/src/lpc43xx/lpc43_spi.c @@ -180,24 +180,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -399,7 +386,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC43_SPI_SR); + getreg32(LPC43_SPI_SR); return (uint16_t)getreg32(LPC43_SPI_DR); } @@ -444,7 +431,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC43_SPI_SR); + getreg32(LPC43_SPI_SR); nwords--; } } @@ -490,7 +477,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC43_SPI_SR); + getreg32(LPC43_SPI_SR); /* Read the received data from the SPI Data Register */ diff --git a/arch/arm/src/lpc43xx/lpc43_ssp.c b/arch/arm/src/lpc43xx/lpc43_ssp.c index b105f6f641..fe5433bae6 100644 --- a/arch/arm/src/lpc43xx/lpc43_ssp.c +++ b/arch/arm/src/lpc43xx/lpc43_ssp.c @@ -276,24 +276,11 @@ static int ssp_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -840,7 +827,7 @@ FAR struct spi_dev_s *lpc43_sspbus_initialize(int port) ssp_putreg(priv, LPC43_SSP_CR1_OFFSET, regval | SSP_CR1_SSE); for (i = 0; i < LPC43_SSP_FIFOSZ; i++) { - (void)ssp_getreg(priv, LPC43_SSP_DR_OFFSET); + ssp_getreg(priv, LPC43_SSP_DR_OFFSET); } return &priv->spidev; @@ -882,7 +869,7 @@ void ssp_flush(FAR struct spi_dev_s *dev) do { - (void)ssp_getreg(priv, LPC43_SSP_DR_OFFSET); + ssp_getreg(priv, LPC43_SSP_DR_OFFSET); } while (ssp_getreg(priv, LPC43_SSP_SR_OFFSET) & SSP_SR_RNE); } diff --git a/arch/arm/src/lpc43xx/lpc43_timer.c b/arch/arm/src/lpc43xx/lpc43_timer.c index 7cfe3d2f3a..c674e5bcb3 100644 --- a/arch/arm/src/lpc43xx/lpc43_timer.c +++ b/arch/arm/src/lpc43xx/lpc43_timer.c @@ -757,7 +757,7 @@ void lpc43_tmrinitialize(FAR const char *devpath, int irq) priv->ops = &g_tmrops; - (void)irq_attach(irq, lpc43_interrupt, NULL); + irq_attach(irq, lpc43_interrupt, NULL); /* Enable NVIC interrupt. */ @@ -765,7 +765,7 @@ void lpc43_tmrinitialize(FAR const char *devpath, int irq) /* Register the timer driver as /dev/timerX */ - (void)timer_register(devpath, (FAR struct timer_lowerhalf_s *)priv); + timer_register(devpath, (FAR struct timer_lowerhalf_s *)priv); } #endif /* CONFIG_TIMER && CONFIG_LPC43_TMRx */ diff --git a/arch/arm/src/lpc43xx/lpc43_timerisr.c b/arch/arm/src/lpc43xx/lpc43_timerisr.c index d797941db8..208c9df467 100644 --- a/arch/arm/src/lpc43xx/lpc43_timerisr.c +++ b/arch/arm/src/lpc43xx/lpc43_timerisr.c @@ -134,7 +134,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(LPC43_IRQ_SYSTICK, (xcpt_t)lpc43_timerisr, NULL); + irq_attach(LPC43_IRQ_SYSTICK, (xcpt_t)lpc43_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/lpc43xx/lpc43_wwdt.c b/arch/arm/src/lpc43xx/lpc43_wwdt.c index 9e4414a950..7dda509812 100644 --- a/arch/arm/src/lpc43xx/lpc43_wwdt.c +++ b/arch/arm/src/lpc43xx/lpc43_wwdt.c @@ -644,7 +644,7 @@ void lpc43_wwdtinitialize(FAR const char *devpath) /* Attach our watchdog interrupt handler (But don't enable it yet) */ - (void)irq_attach(LPC43M4_IRQ_WWDT, lpc43_interrupt, NULL); + irq_attach(LPC43M4_IRQ_WWDT, lpc43_interrupt, NULL); /* Select an arbitrary initial timeout value. But don't start the watchdog * yet. NOTE: If the "Hardware watchdog" feature is enabled through the @@ -656,7 +656,7 @@ void lpc43_wwdtinitialize(FAR const char *devpath) /* Register the watchdog driver as /dev/watchdog0 */ - (void)watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv); + watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv); } #endif /* CONFIG_WATCHDOG && CONFIG_LPC43_WWDT */ diff --git a/arch/arm/src/lpc54xx/lpc54_ethernet.c b/arch/arm/src/lpc54xx/lpc54_ethernet.c index 7fb2d68d2c..23b0d52163 100644 --- a/arch/arm/src/lpc54xx/lpc54_ethernet.c +++ b/arch/arm/src/lpc54xx/lpc54_ethernet.c @@ -684,8 +684,8 @@ static int lpc54_eth_transmit(struct lpc54_ethdriver_s *priv, /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->eth_txtimeout, LPC54_TXTIMEOUT, - lpc54_eth_txtimeout_expiry, 1, (wdparm_t)priv); + wd_start(priv->eth_txtimeout, LPC54_TXTIMEOUT, + lpc54_eth_txtimeout_expiry, 1, (wdparm_t)priv); return OK; } @@ -1633,8 +1633,8 @@ static void lpc54_eth_txtimeout_work(void *arg) * again. */ - (void)lpc54_eth_ifdown(&priv->eth_dev); - (void)lpc54_eth_ifup(&priv->eth_dev); + lpc54_eth_ifdown(&priv->eth_dev); + lpc54_eth_ifup(&priv->eth_dev); /* Then poll the network for new XMIT data */ @@ -1731,7 +1731,7 @@ static void lpc54_eth_dotimer(struct lpc54_ethdriver_s *priv) priv->eth_dev.d_buf = (uint8_t *)lpc54_pktbuf_alloc(priv); if (priv->eth_dev.d_buf != NULL) { - (void)devif_timer(&priv->eth_dev, LPC54_WDDELAY, lpc54_eth_txpoll); + devif_timer(&priv->eth_dev, LPC54_WDDELAY, lpc54_eth_txpoll); /* Make sure that the Tx buffer remaining after the poll is * freed. @@ -1798,7 +1798,7 @@ static void lpc54_eth_dopoll(struct lpc54_ethdriver_s *priv) priv->eth_dev.d_buf = (uint8_t *)lpc54_pktbuf_alloc(priv); if (priv->eth_dev.d_buf != NULL) { - (void)devif_poll(&priv->eth_dev, lpc54_eth_txpoll); + devif_poll(&priv->eth_dev, lpc54_eth_txpoll); /* Make sure that the Tx buffer remaining after the poll is * freed. @@ -1848,8 +1848,8 @@ static void lpc54_eth_poll_work(void *arg) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->eth_txpoll, LPC54_WDDELAY, lpc54_eth_poll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->eth_txpoll, LPC54_WDDELAY, lpc54_eth_poll_expiry, 1, + (wdparm_t)priv); net_unlock(); } @@ -2156,8 +2156,8 @@ static int lpc54_eth_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->eth_txpoll, LPC54_WDDELAY, lpc54_eth_poll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->eth_txpoll, LPC54_WDDELAY, lpc54_eth_poll_expiry, 1, + (wdparm_t)priv); /* Enable the Ethernet interrupt */ diff --git a/arch/arm/src/lpc54xx/lpc54_i2c_master.c b/arch/arm/src/lpc54xx/lpc54_i2c_master.c index a2fe53156a..80e0a249ad 100644 --- a/arch/arm/src/lpc54xx/lpc54_i2c_master.c +++ b/arch/arm/src/lpc54xx/lpc54_i2c_master.c @@ -421,7 +421,7 @@ static void lpc54_i2c_xfrsetup(struct lpc54_i2cdev_s *priv) if (msg->frequency > 0) { - (void)lpc54_i2c_setfrequency(priv, msg->frequency); + lpc54_i2c_setfrequency(priv, msg->frequency); } /* Clear error status bits */ @@ -766,8 +766,8 @@ static int lpc54_i2c_transfer(FAR struct i2c_master_s *dev, /* Set up the transfer timeout */ - (void)wd_start(priv->timeout, priv->nmsgs * I2C_WDOG_TIMEOUT, - lpc54_i2c_timeout, 1, (uint32_t)priv); + wd_start(priv->timeout, priv->nmsgs * I2C_WDOG_TIMEOUT, + lpc54_i2c_timeout, 1, (uint32_t)priv); /* Initiate the transfer */ @@ -780,7 +780,7 @@ static int lpc54_i2c_transfer(FAR struct i2c_master_s *dev, #ifndef CONFIG_I2C_POLLED nxsem_wait(&priv->waitsem); #else - (void)lpc54_i2c_statemachine(priv); + lpc54_i2c_statemachine(priv); #endif } while (priv->state != I2CSTATE_IDLE); diff --git a/arch/arm/src/lpc54xx/lpc54_idle.c b/arch/arm/src/lpc54xx/lpc54_idle.c index 21fbfbabf2..45f7daae88 100644 --- a/arch/arm/src/lpc54xx/lpc54_idle.c +++ b/arch/arm/src/lpc54xx/lpc54_idle.c @@ -107,7 +107,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { @@ -131,7 +131,7 @@ static void up_idlepm(void) break; case PM_SLEEP: - (void)lpc54_pmsleep(); + lpc54_pmsleep(); break; default: diff --git a/arch/arm/src/lpc54xx/lpc54_irq.c b/arch/arm/src/lpc54xx/lpc54_irq.c index 2644380f73..286c02c398 100644 --- a/arch/arm/src/lpc54xx/lpc54_irq.c +++ b/arch/arm/src/lpc54xx/lpc54_irq.c @@ -156,7 +156,7 @@ static void lpc54_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int lpc54_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -164,7 +164,7 @@ static int lpc54_nmi(int irq, FAR void *context, FAR void *arg) static int lpc54_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received\n"); PANIC(); return 0; @@ -172,7 +172,7 @@ static int lpc54_busfault(int irq, FAR void *context, FAR void *arg) static int lpc54_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -180,7 +180,7 @@ static int lpc54_usagefault(int irq, FAR void *context, FAR void *arg) static int lpc54_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -188,7 +188,7 @@ static int lpc54_pendsv(int irq, FAR void *context, FAR void *arg) static int lpc54_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -196,7 +196,7 @@ static int lpc54_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int lpc54_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/lpc54xx/lpc54_rng.c b/arch/arm/src/lpc54xx/lpc54_rng.c index c61224d47d..65f35a8ea7 100644 --- a/arch/arm/src/lpc54xx/lpc54_rng.c +++ b/arch/arm/src/lpc54xx/lpc54_rng.c @@ -159,7 +159,7 @@ static ssize_t lpc54_read(struct file *filep, char *buffer, size_t buflen) void devrandom_register(void) { nxsem_init(&g_rngdev.rd_devsem, 0, 1); - (void)register_driver("/dev/random", &g_rngops, 0444, NULL); + register_driver("/dev/random", &g_rngops, 0444, NULL); } #endif @@ -183,7 +183,7 @@ void devurandom_register(void) #ifndef CONFIG_DEV_RANDOM nxsem_init(&g_rngdev.rd_devsem, 0, 1); #endif - (void)register_driver("/dev/urandom", &g_rngops, 0444, NULL); + register_driver("/dev/urandom", &g_rngops, 0444, NULL); } #endif diff --git a/arch/arm/src/lpc54xx/lpc54_rtc.c b/arch/arm/src/lpc54xx/lpc54_rtc.c index 90494c0edd..e08c180e9d 100644 --- a/arch/arm/src/lpc54xx/lpc54_rtc.c +++ b/arch/arm/src/lpc54xx/lpc54_rtc.c @@ -322,7 +322,7 @@ int lpc54_rtc_rdalarm(FAR struct tm *time) uint32_t match; match = getreg32(LPC54_RTC_MATCH); - (void)gmtime_r((time_t *)&match, time); + gmtime_r((time_t *)&match, time); return OK; } #endif diff --git a/arch/arm/src/lpc54xx/lpc54_sdmmc.c b/arch/arm/src/lpc54xx/lpc54_sdmmc.c index 6b389ecffa..bf3952d611 100644 --- a/arch/arm/src/lpc54xx/lpc54_sdmmc.c +++ b/arch/arm/src/lpc54xx/lpc54_sdmmc.c @@ -274,7 +274,7 @@ static void lpc54_putreg(uint32_t val, uint32_t addr); /* Low-level helpers ********************************************************/ static void lpc54_takesem(struct lpc54_dev_s *priv); -#define lpc54_givesem(priv) (sem_post(&priv->waitsem)) +#define lpc54_givesem(priv) (nxsem_post(&priv->waitsem)) static inline void lpc54_setclock(uint32_t clkdiv); static inline void lpc54_sdcard_clock(bool enable); static int lpc54_ciu_sendcmd(uint32_t cmd, uint32_t arg); @@ -530,16 +530,7 @@ static void lpc54_putreg(uint32_t val, uint32_t addr) static void lpc54_takesem(struct lpc54_dev_s *priv) { - /* Take the semaphore (perhaps waiting) */ - - while (sem_wait(&priv->waitsem) != 0) - { - /* The only case that an error should occr here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(errno == EINTR || errno == ECANCELED); - } + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -882,7 +873,7 @@ static void lpc54_endwait(struct lpc54_dev_s *priv, sdio_eventset_t wkupevent) /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Disable event-related interrupts */ @@ -1856,7 +1847,7 @@ static int lpc54_cancel(FAR struct sdio_dev_s *dev) /* Cancel any watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Mark no transfer in progress */ @@ -2770,7 +2761,7 @@ static void lpc54_callback(struct lpc54_dev_s *priv) /* Yes.. queue it */ mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); - (void)work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, priv->cbarg, 0); + work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, priv->cbarg, 0); } else { @@ -2837,13 +2828,13 @@ FAR struct sdio_dev_s *lpc54_sdmmc_initialize(int slotno) /* Initialize semaphores */ - sem_init(&priv->waitsem, 0, 0); + nxsem_init(&priv->waitsem, 0, 0); /* The waitsem semaphore is used for signaling and, hence, should not have * priority inheritance enabled. */ - sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE); + nxsem_setprotocol(&priv->waitsem, SEM_PRIO_NONE); /* Create a watchdog timer */ diff --git a/arch/arm/src/lpc54xx/lpc54_serial.c b/arch/arm/src/lpc54xx/lpc54_serial.c index 7ea3b38d42..2c93bae4f1 100644 --- a/arch/arm/src/lpc54xx/lpc54_serial.c +++ b/arch/arm/src/lpc54xx/lpc54_serial.c @@ -1431,38 +1431,38 @@ void up_serialinit(void) #ifdef HAVE_USART_CONSOLE /* Register the serial console */ - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all USARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif #ifdef TTYS6_DEV - (void)uart_register("/dev/ttyS6", &TTYS6_DEV); + uart_register("/dev/ttyS6", &TTYS6_DEV); #endif #ifdef TTYS7_DEV - (void)uart_register("/dev/ttyS7", &TTYS7_DEV); + uart_register("/dev/ttyS7", &TTYS7_DEV); #endif #ifdef TTYS8_DEV - (void)uart_register("/dev/ttyS8", &TTYS8_DEV); + uart_register("/dev/ttyS8", &TTYS8_DEV); #endif #ifdef TTYS9_DEV - (void)uart_register("/dev/ttyS9", &TTYS9_DEV); + uart_register("/dev/ttyS9", &TTYS9_DEV); #endif } diff --git a/arch/arm/src/lpc54xx/lpc54_spi_master.c b/arch/arm/src/lpc54xx/lpc54_spi_master.c index 40ba2618e8..dd2755d862 100644 --- a/arch/arm/src/lpc54xx/lpc54_spi_master.c +++ b/arch/arm/src/lpc54xx/lpc54_spi_master.c @@ -655,7 +655,7 @@ static void lpc54_spi_rxdiscard(FAR struct lpc54_spidev_s *priv) { while (lpc54_spi_rxavailable(priv)) { - (void)lpc54_spi_getreg(priv, LPC54_SPI_FIFORD_OFFSET); + lpc54_spi_getreg(priv, LPC54_SPI_FIFORD_OFFSET); } } @@ -1069,7 +1069,7 @@ static void lpc54_spi_sndblock8(FAR struct lpc54_spidev_s *priv, * Tx FIFO. */ - (void)lpc54_spi_txtransfer8(priv, &txtransfer); + lpc54_spi_txtransfer8(priv, &txtransfer); } } @@ -1266,24 +1266,11 @@ static int lpc54_spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; diff --git a/arch/arm/src/lpc54xx/lpc54_timerisr.c b/arch/arm/src/lpc54xx/lpc54_timerisr.c index 8035d3c3a9..c38a73a4e4 100644 --- a/arch/arm/src/lpc54xx/lpc54_timerisr.c +++ b/arch/arm/src/lpc54xx/lpc54_timerisr.c @@ -160,7 +160,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(LPC54_IRQ_SYSTICK, (xcpt_t)lpc54_timerisr, NULL); + irq_attach(LPC54_IRQ_SYSTICK, (xcpt_t)lpc54_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/lpc54xx/lpc54_usb0_ohci.c b/arch/arm/src/lpc54xx/lpc54_usb0_ohci.c index 0a0b869521..6582216985 100644 --- a/arch/arm/src/lpc54xx/lpc54_usb0_ohci.c +++ b/arch/arm/src/lpc54xx/lpc54_usb0_ohci.c @@ -701,21 +701,7 @@ static void lpc54_putreg(uint32_t val, uint32_t addr) static void lpc54_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -2175,7 +2161,7 @@ static int lpc54_rh_enumerate(struct usbhost_connection_s *conn, /* USB 2.0 spec says at least 50ms delay before port reset */ - (void)nxsig_usleep(100*1000); + nxsig_usleep(100*1000); /* Put RH port 1 in reset (the LPC546x supports only a single downstream port) */ @@ -2188,7 +2174,7 @@ static int lpc54_rh_enumerate(struct usbhost_connection_s *conn, /* Release RH port 1 from reset and wait a bit */ lpc54_putreg(OHCI_RHPORTST_PRSC, LPC54_OHCI_RHPORTST1); - (void)nxsig_usleep(200*1000); + nxsig_usleep(200*1000); return OK; } diff --git a/arch/arm/src/lpc54xx/lpc54_wwdt.c b/arch/arm/src/lpc54xx/lpc54_wwdt.c index 015e53a36a..ca720c3857 100644 --- a/arch/arm/src/lpc54xx/lpc54_wwdt.c +++ b/arch/arm/src/lpc54xx/lpc54_wwdt.c @@ -663,7 +663,7 @@ void lpc54_wwdt_initialize(FAR const char *devpath) /* Attach our watchdog interrupt handler (But don't enable it yet) */ - (void)irq_attach(LPC54_IRQ_WDT, lpc54_wwdt_interrupt); + irq_attach(LPC54_IRQ_WDT, lpc54_wwdt_interrupt); /* Select an arbitrary initial timeout value. But don't start the watchdog * yet. NOTE: If the "Hardware watchdog" feature is enabled through the @@ -675,7 +675,7 @@ void lpc54_wwdt_initialize(FAR const char *devpath) /* Register the watchdog driver as /dev/watchdog0 */ - (void)watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv); + watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv); } #endif /* CONFIG_WATCHDOG && CONFIG_LPC54_WWDT */ diff --git a/arch/arm/src/max326xx/common/max326_idle.c b/arch/arm/src/max326xx/common/max326_idle.c index 8aca772f6a..50c50f08e7 100644 --- a/arch/arm/src/max326xx/common/max326_idle.c +++ b/arch/arm/src/max326xx/common/max326_idle.c @@ -107,7 +107,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { @@ -131,7 +131,7 @@ static void up_idlepm(void) break; case PM_SLEEP: - (void)max326_pmsleep(); + max326_pmsleep(); break; default: diff --git a/arch/arm/src/max326xx/common/max326_irq.c b/arch/arm/src/max326xx/common/max326_irq.c index 058b62f254..886b723b07 100644 --- a/arch/arm/src/max326xx/common/max326_irq.c +++ b/arch/arm/src/max326xx/common/max326_irq.c @@ -156,7 +156,7 @@ static void max326_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int max326_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -164,7 +164,7 @@ static int max326_nmi(int irq, FAR void *context, FAR void *arg) static int max326_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received\n"); PANIC(); return 0; @@ -172,7 +172,7 @@ static int max326_busfault(int irq, FAR void *context, FAR void *arg) static int max326_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -180,7 +180,7 @@ static int max326_usagefault(int irq, FAR void *context, FAR void *arg) static int max326_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -188,7 +188,7 @@ static int max326_pendsv(int irq, FAR void *context, FAR void *arg) static int max326_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -196,7 +196,7 @@ static int max326_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int max326_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/max326xx/common/max326_rtc_lowerhalf.c b/arch/arm/src/max326xx/common/max326_rtc_lowerhalf.c index 6302799ac7..f7078bb409 100644 --- a/arch/arm/src/max326xx/common/max326_rtc_lowerhalf.c +++ b/arch/arm/src/max326xx/common/max326_rtc_lowerhalf.c @@ -603,9 +603,9 @@ static int max326_rdalarm(FAR struct rtc_lowerhalf_s *lower, /* Convert to struct rtc_time (aka struct tm) */ #ifdef CONFIG_LIBC_LOCALTIME - (void)localtime_r(&sec, (FAR struct tm *)alarminfo->time); + localtime_r(&sec, (FAR struct tm *)alarminfo->time); #else - (void)gmtime_r(&sec, (FAR struct tm *)alarminfo->time); + gmtime_r(&sec, (FAR struct tm *)alarminfo->time); #endif ret = OK; } diff --git a/arch/arm/src/max326xx/common/max326_timerisr.c b/arch/arm/src/max326xx/common/max326_timerisr.c index bc1e6f85ff..d05de6a67b 100644 --- a/arch/arm/src/max326xx/common/max326_timerisr.c +++ b/arch/arm/src/max326xx/common/max326_timerisr.c @@ -133,7 +133,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(MAX326_IRQ_SYSTICK, (xcpt_t)max326_timerisr, NULL); + irq_attach(MAX326_IRQ_SYSTICK, (xcpt_t)max326_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/max326xx/max32660/max32660_rtc.c b/arch/arm/src/max326xx/max32660/max32660_rtc.c index 9dd2a8cec8..e87e6e4412 100644 --- a/arch/arm/src/max326xx/max32660/max32660_rtc.c +++ b/arch/arm/src/max326xx/max32660/max32660_rtc.c @@ -334,7 +334,7 @@ int up_rtc_initialize(void) /* Attach the ALARM interrupt handler */ up_disable_irq(MAX326_IRQ_RTC); - (void)irq_attach(MAX326_IRQ_RTC, max326_rtc_interrupt, NULL); + irq_attach(MAX326_IRQ_RTC, max326_rtc_interrupt, NULL); #endif /* Enable the RTC */ diff --git a/arch/arm/src/max326xx/max32660/max32660_serial.c b/arch/arm/src/max326xx/max32660/max32660_serial.c index 236125b624..c61f4dc939 100644 --- a/arch/arm/src/max326xx/max32660/max32660_serial.c +++ b/arch/arm/src/max326xx/max32660/max32660_serial.c @@ -842,14 +842,14 @@ void up_serialinit(void) #ifdef HAVE_UART_CONSOLE /* Register the serial console */ - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif } diff --git a/arch/arm/src/max326xx/max32660/max32660_spim.c b/arch/arm/src/max326xx/max32660/max32660_spim.c index 2f5aa2a100..cf7fbc25a8 100644 --- a/arch/arm/src/max326xx/max32660/max32660_spim.c +++ b/arch/arm/src/max326xx/max32660/max32660_spim.c @@ -829,24 +829,11 @@ static int spi_lock(struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; diff --git a/arch/arm/src/max326xx/max32660/max32660_wdt.c b/arch/arm/src/max326xx/max32660/max32660_wdt.c index 81286c4f9b..74046f5069 100644 --- a/arch/arm/src/max326xx/max32660/max32660_wdt.c +++ b/arch/arm/src/max326xx/max32660/max32660_wdt.c @@ -200,7 +200,7 @@ static void max326_int_enable(FAR struct max326_wdt_lowerhalf_s *priv) { /* Yes.. attach handler and enable the interrupt */ - (void)irq_attach(MAX326_IRQ_WDT0, priv->handler, priv); + irq_attach(MAX326_IRQ_WDT0, priv->handler, priv); up_enable_irq(MAX326_IRQ_WDT0); /* Select the interrupt behavior (de-selecting the reset behavior) */ diff --git a/arch/arm/src/nrf52/nrf52_idle.c b/arch/arm/src/nrf52/nrf52_idle.c index c0c507cc95..fc94f409b3 100644 --- a/arch/arm/src/nrf52/nrf52_idle.c +++ b/arch/arm/src/nrf52/nrf52_idle.c @@ -107,7 +107,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { @@ -131,7 +131,7 @@ static void up_idlepm(void) break; case PM_SLEEP: - (void)nrf52_pmsleep(); + nrf52_pmsleep(); break; default: diff --git a/arch/arm/src/nrf52/nrf52_irq.c b/arch/arm/src/nrf52/nrf52_irq.c index f282c222e1..384e7c552a 100644 --- a/arch/arm/src/nrf52/nrf52_irq.c +++ b/arch/arm/src/nrf52/nrf52_irq.c @@ -156,7 +156,7 @@ static void nrf52_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int nrf52_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -164,7 +164,7 @@ static int nrf52_nmi(int irq, FAR void *context, FAR void *arg) static int nrf52_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received\n"); PANIC(); return 0; @@ -172,7 +172,7 @@ static int nrf52_busfault(int irq, FAR void *context, FAR void *arg) static int nrf52_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -180,7 +180,7 @@ static int nrf52_usagefault(int irq, FAR void *context, FAR void *arg) static int nrf52_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -188,7 +188,7 @@ static int nrf52_pendsv(int irq, FAR void *context, FAR void *arg) static int nrf52_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -196,7 +196,7 @@ static int nrf52_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int nrf52_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/nrf52/nrf52_rng.c b/arch/arm/src/nrf52/nrf52_rng.c index 0a120eac7f..d31a305587 100644 --- a/arch/arm/src/nrf52/nrf52_rng.c +++ b/arch/arm/src/nrf52/nrf52_rng.c @@ -143,11 +143,11 @@ static int nrf52_rng_initialize(void) memset(&g_rngdev, 0, sizeof(struct rng_dev_s)); - sem_init(&g_rngdev.rd_sem, 0, 0); - sem_setprotocol(&g_rngdev.rd_sem, SEM_PRIO_NONE); + nxsem_init(&g_rngdev.rd_sem, 0, 0); + nxsem_setprotocol(&g_rngdev.rd_sem, SEM_PRIO_NONE); - sem_init(&g_rngdev.excl_sem, 0, 1); - sem_setprotocol(&g_rngdev.excl_sem, SEM_PRIO_NONE); + nxsem_init(&g_rngdev.excl_sem, 0, 1); + nxsem_setprotocol(&g_rngdev.excl_sem, SEM_PRIO_NONE); _info("Ready to stop\n"); nrf52_rng_stop(); @@ -182,7 +182,7 @@ static int nrf52_rng_irqhandler(int irq, FAR void *context, FAR void *arg) if (priv->rd_count == priv->buflen) { nrf52_rng_stop(); - sem_post(&priv->rd_sem); + nxsem_post(&priv->rd_sem); } } @@ -216,10 +216,9 @@ static ssize_t nrf52_rng_read(FAR struct file *filep, FAR char *buffer, FAR struct rng_dev_s *priv = (struct rng_dev_s *)&g_rngdev; ssize_t read_len; - if (sem_wait(&priv->excl_sem) != OK) + if (nxsem_wait(&priv->excl_sem) != OK) { - errno = EBUSY; - return -errno; + return -EBUSY; } priv->rd_buf = (uint8_t *) buffer; @@ -230,7 +229,7 @@ static ssize_t nrf52_rng_read(FAR struct file *filep, FAR char *buffer, nrf52_rng_start(); - sem_wait(&priv->rd_sem); + nxsem_wait(&priv->rd_sem); read_len = priv->rd_count; if (priv->rd_count > priv->buflen) @@ -241,7 +240,7 @@ static ssize_t nrf52_rng_read(FAR struct file *filep, FAR char *buffer, /* Now , got data, and release rd_sem for next read */ - sem_post(&priv->excl_sem); + nxsem_post(&priv->excl_sem); return read_len; } @@ -269,7 +268,7 @@ static ssize_t nrf52_rng_read(FAR struct file *filep, FAR char *buffer, void devrandom_register(void) { nrf52_rng_initialize(); - (void)register_driver("/dev/random", FAR & g_rngops, 0444, NULL); + register_driver("/dev/random", FAR & g_rngops, 0444, NULL); } #endif @@ -293,7 +292,7 @@ void devurandom_register(void) #ifndef CONFIG_DEV_RANDOM nrf52_rng_initialize(); #endif - (void)register_driver("dev/urandom", FAR & g_rngops, 0444, NULL); + register_driver("dev/urandom", FAR & g_rngops, 0444, NULL); } #endif diff --git a/arch/arm/src/nrf52/nrf52_serial.c b/arch/arm/src/nrf52/nrf52_serial.c index a32b70360f..f4a269bd67 100644 --- a/arch/arm/src/nrf52/nrf52_serial.c +++ b/arch/arm/src/nrf52/nrf52_serial.c @@ -662,10 +662,10 @@ void up_serialinit(void) #ifdef HAVE_UART_CONSOLE /* Register the serial console */ - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); minor = 1; /* Register all remaining UARTs */ @@ -691,7 +691,7 @@ void up_serialinit(void) /* Register USARTs as devices in increasing order */ devname[9] = '0' + minor++; - (void)uart_register(devname, g_uart_devs[i]); + uart_register(devname, g_uart_devs[i]); } } diff --git a/arch/arm/src/nrf52/nrf52_timerisr.c b/arch/arm/src/nrf52/nrf52_timerisr.c index 8c23150753..0a9d2e981a 100644 --- a/arch/arm/src/nrf52/nrf52_timerisr.c +++ b/arch/arm/src/nrf52/nrf52_timerisr.c @@ -135,7 +135,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(NRF52_IRQ_SYSTICK, (xcpt_t)nrf52_timerisr, NULL); + irq_attach(NRF52_IRQ_SYSTICK, (xcpt_t)nrf52_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/nuc1xx/nuc_idle.c b/arch/arm/src/nuc1xx/nuc_idle.c index e6151ceada..54c2afc101 100644 --- a/arch/arm/src/nuc1xx/nuc_idle.c +++ b/arch/arm/src/nuc1xx/nuc_idle.c @@ -108,7 +108,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { @@ -132,7 +132,7 @@ static void up_idlepm(void) break; case PM_SLEEP: - (void)nuc_pmstandby(); + nuc_pmstandby(); break; default: diff --git a/arch/arm/src/nuc1xx/nuc_irq.c b/arch/arm/src/nuc1xx/nuc_irq.c index 6fc6db1d2f..72cc753c50 100644 --- a/arch/arm/src/nuc1xx/nuc_irq.c +++ b/arch/arm/src/nuc1xx/nuc_irq.c @@ -140,7 +140,7 @@ static void nuc_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int nuc_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -148,7 +148,7 @@ static int nuc_nmi(int irq, FAR void *context, FAR void *arg) static int nuc_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -156,7 +156,7 @@ static int nuc_pendsv(int irq, FAR void *context, FAR void *arg) static int nuc_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/nuc1xx/nuc_serial.c b/arch/arm/src/nuc1xx/nuc_serial.c index 38f25b38d7..797920f563 100644 --- a/arch/arm/src/nuc1xx/nuc_serial.c +++ b/arch/arm/src/nuc1xx/nuc_serial.c @@ -372,7 +372,7 @@ static inline void up_restoreuartint(struct nuc_dev_s *priv, uint32_t ier) { uint32_t setbits = ier & UART_IER_ALLIE; uint32_t clrbits = (~ier) & UART_IER_ALLIE; - (void)up_setier(priv, clrbits, setbits); + up_setier(priv, clrbits, setbits); } /**************************************************************************** @@ -397,7 +397,7 @@ static void up_rxto_disable(struct nuc_dev_s *priv) /* Disable the RX timeout interrupt and disable the timeout */ - (void)up_setier(priv, (UART_IER_RTO_IEN | UART_IER_TIME_OUT_EN), 0); + up_setier(priv, (UART_IER_RTO_IEN | UART_IER_TIME_OUT_EN), 0); } /**************************************************************************** @@ -430,7 +430,7 @@ static void up_rxto_enable(struct nuc_dev_s *priv) /* Enable the RX timeout interrupt and enable the timeout */ - (void)up_setier(priv, 0, (UART_IER_RTO_IEN | UART_IER_TIME_OUT_EN)); + up_setier(priv, 0, (UART_IER_RTO_IEN | UART_IER_TIME_OUT_EN)); } /**************************************************************************** @@ -663,7 +663,7 @@ static int up_interrupt(int irq, void *context, void *arg) * We need to read from the RBR to clear the interrupt. */ - (void)up_serialin(priv, NUC_UART_RBR_OFFSET); + up_serialin(priv, NUC_UART_RBR_OFFSET); /* Disable, further RX timeout interrupts and set the RX FIFO * threshold so that an interrupt will be generated when the @@ -857,9 +857,9 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) /* Enable receive data, line status and buffer error interrupts */ irqstate_t flags = enter_critical_section(); - (void)up_setier(priv, 0, - (UART_IER_RDA_IEN | UART_IER_RLS_IEN | - UART_IER_BUF_ERR_IEN)); + up_setier(priv, 0, + (UART_IER_RDA_IEN | UART_IER_RLS_IEN | + UART_IER_BUF_ERR_IEN)); /* Enable or disable timeouts based on the state of RX FIFO */ @@ -891,9 +891,9 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) * interrupts. Also disables the RX timer. */ - (void)up_setier(priv, 0, - (UART_IER_RDA_IEN | UART_IER_RLS_IEN | UART_IER_RTO_IEN | - UART_IER_BUF_ERR_IEN | UART_IER_TIME_OUT_EN)); + up_setier(priv, 0, + (UART_IER_RDA_IEN | UART_IER_RLS_IEN | UART_IER_RTO_IEN | + UART_IER_BUF_ERR_IEN | UART_IER_TIME_OUT_EN)); } } @@ -943,7 +943,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) /* Enable the THR empty interrupt */ irqstate_t flags = enter_critical_section(); - (void)up_setier(priv, 0, UART_IER_THRE_IEN); + up_setier(priv, 0, UART_IER_THRE_IEN); /* Fake a TX interrupt here by just calling uart_xmitchars() with * interrupts disabled (note this may recurse). @@ -957,7 +957,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) { /* Disable the THR empty interrupt */ - (void)up_setier(priv, UART_IER_THRE_IEN, 0); + up_setier(priv, UART_IER_THRE_IEN, 0); } } @@ -1033,16 +1033,16 @@ void up_earlyserialinit(void) void up_serialinit(void) { #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #endif #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif } diff --git a/arch/arm/src/nuc1xx/nuc_timerisr.c b/arch/arm/src/nuc1xx/nuc_timerisr.c index 338d2419ad..b6c630196f 100644 --- a/arch/arm/src/nuc1xx/nuc_timerisr.c +++ b/arch/arm/src/nuc1xx/nuc_timerisr.c @@ -226,7 +226,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(NUC_IRQ_SYSTICK, (xcpt_t)nuc_timerisr, NULL); + irq_attach(NUC_IRQ_SYSTICK, (xcpt_t)nuc_timerisr, NULL); /* Enable SysTick interrupts. We need to select the core clock here if * we are not using one of the alternative clock sources above. diff --git a/arch/arm/src/s32k1xx/s32k11x/s32k11x_irq.c b/arch/arm/src/s32k1xx/s32k11x/s32k11x_irq.c index 407269f764..ad456a609c 100644 --- a/arch/arm/src/s32k1xx/s32k11x/s32k11x_irq.c +++ b/arch/arm/src/s32k1xx/s32k11x/s32k11x_irq.c @@ -97,7 +97,7 @@ volatile uint32_t *g_current_regs[1]; #ifdef CONFIG_DEBUG_FEATURES static int s32k11x_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -105,7 +105,7 @@ static int s32k11x_nmi(int irq, FAR void *context, FAR void *arg) static int s32k11x_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -113,7 +113,7 @@ static int s32k11x_pendsv(int irq, FAR void *context, FAR void *arg) static int s32k11x_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/s32k1xx/s32k11x/s32k11x_timerisr.c b/arch/arm/src/s32k1xx/s32k11x/s32k11x_timerisr.c index dc8795fb75..d67ffe2434 100644 --- a/arch/arm/src/s32k1xx/s32k11x/s32k11x_timerisr.c +++ b/arch/arm/src/s32k1xx/s32k11x/s32k11x_timerisr.c @@ -147,7 +147,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(S32K1XX_IRQ_SYSTICK, (xcpt_t)s32k11x_timerisr, NULL); + irq_attach(S32K1XX_IRQ_SYSTICK, (xcpt_t)s32k11x_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/s32k1xx/s32k14x/s32k14x_irq.c b/arch/arm/src/s32k1xx/s32k14x/s32k14x_irq.c index bae162a79c..c9c10db1b1 100644 --- a/arch/arm/src/s32k1xx/s32k14x/s32k14x_irq.c +++ b/arch/arm/src/s32k1xx/s32k14x/s32k14x_irq.c @@ -177,7 +177,7 @@ static void s32k14x_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int s32k14x_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -185,7 +185,7 @@ static int s32k14x_nmi(int irq, FAR void *context, FAR void *arg) static int s32k14x_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received\n"); PANIC(); return 0; @@ -193,7 +193,7 @@ static int s32k14x_busfault(int irq, FAR void *context, FAR void *arg) static int s32k14x_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -201,7 +201,7 @@ static int s32k14x_usagefault(int irq, FAR void *context, FAR void *arg) static int s32k14x_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -209,7 +209,7 @@ static int s32k14x_pendsv(int irq, FAR void *context, FAR void *arg) static int s32k14x_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -217,7 +217,7 @@ static int s32k14x_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int s32k14x_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/s32k1xx/s32k14x/s32k14x_timerisr.c b/arch/arm/src/s32k1xx/s32k14x/s32k14x_timerisr.c index d175b45b89..3a1e3a56c3 100644 --- a/arch/arm/src/s32k1xx/s32k14x/s32k14x_timerisr.c +++ b/arch/arm/src/s32k1xx/s32k14x/s32k14x_timerisr.c @@ -133,7 +133,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(S32K1XX_IRQ_SYSTICK, (xcpt_t)s32k14x_timerisr, NULL); + irq_attach(S32K1XX_IRQ_SYSTICK, (xcpt_t)s32k14x_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/s32k1xx/s32k1xx_edma.c b/arch/arm/src/s32k1xx/s32k1xx_edma.c index bba1308601..e9ddc85ab2 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_edma.c +++ b/arch/arm/src/s32k1xx/s32k1xx_edma.c @@ -184,26 +184,12 @@ static struct s32k1xx_edmatcd_s g_tcd_pool[CONFIG_S32K1XX_EDMA_NTCD] static void s32k1xx_takechsem(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_edma.chsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR || ret == -ECANCELED); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_edma.chsem); } static inline void s32k1xx_givechsem(void) { - (void)nxsem_post(&g_edma.chsem); + nxsem_post(&g_edma.chsem); } /**************************************************************************** @@ -217,26 +203,12 @@ static inline void s32k1xx_givechsem(void) #if CONFIG_S32K1XX_EDMA_NTCD > 0 static void s32k1xx_takedsem(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_edma.dsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR || ret == -ECANCELED); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_edma.dsem); } static inline void s32k1xx_givedsem(void) { - (void)nxsem_post(&g_edma.dsem); + nxsem_post(&g_edma.dsem); } #endif @@ -295,7 +267,7 @@ static void s32k1xx_tcd_free(struct s32k1xx_edmatcd_s *tcd) flags = spin_lock_irqsave(); sq_addlast((sq_entry_t *)tcd, &g_tcd_free); - (void)s32k1xx_givedsem(); + s32k1xx_givedsem(); spin_unlock_irqrestore(flags); } #endif @@ -776,27 +748,27 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vectors. */ - (void)irq_attach(S32K1XX_IRQ_DMACH0, s32k1xx_edma_interrupt, &g_edma.dmach[0]); - (void)irq_attach(S32K1XX_IRQ_DMACH1, s32k1xx_edma_interrupt, &g_edma.dmach[1]); - (void)irq_attach(S32K1XX_IRQ_DMACH2, s32k1xx_edma_interrupt, &g_edma.dmach[2]); - (void)irq_attach(S32K1XX_IRQ_DMACH3, s32k1xx_edma_interrupt, &g_edma.dmach[3]); + irq_attach(S32K1XX_IRQ_DMACH0, s32k1xx_edma_interrupt, &g_edma.dmach[0]); + irq_attach(S32K1XX_IRQ_DMACH1, s32k1xx_edma_interrupt, &g_edma.dmach[1]); + irq_attach(S32K1XX_IRQ_DMACH2, s32k1xx_edma_interrupt, &g_edma.dmach[2]); + irq_attach(S32K1XX_IRQ_DMACH3, s32k1xx_edma_interrupt, &g_edma.dmach[3]); #if S32K1XX_EDMA_NCHANNELS > 4 - (void)irq_attach(S32K1XX_IRQ_DMACH4, s32k1xx_edma_interrupt, &g_edma.dmach[4]); - (void)irq_attach(S32K1XX_IRQ_DMACH5, s32k1xx_edma_interrupt, &g_edma.dmach[5]); - (void)irq_attach(S32K1XX_IRQ_DMACH6, s32k1xx_edma_interrupt, &g_edma.dmach[6]); - (void)irq_attach(S32K1XX_IRQ_DMACH7, s32k1xx_edma_interrupt, &g_edma.dmach[7]); - (void)irq_attach(S32K1XX_IRQ_DMACH8, s32k1xx_edma_interrupt, &g_edma.dmach[8]); - (void)irq_attach(S32K1XX_IRQ_DMACH9, s32k1xx_edma_interrupt, &g_edma.dmach[9]); - (void)irq_attach(S32K1XX_IRQ_DMACH10, s32k1xx_edma_interrupt, &g_edma.dmach[10]); - (void)irq_attach(S32K1XX_IRQ_DMACH11, s32k1xx_edma_interrupt, &g_edma.dmach[11]); - (void)irq_attach(S32K1XX_IRQ_DMACH12, s32k1xx_edma_interrupt, &g_edma.dmach[12]); - (void)irq_attach(S32K1XX_IRQ_DMACH13, s32k1xx_edma_interrupt, &g_edma.dmach[13]); - (void)irq_attach(S32K1XX_IRQ_DMACH14, s32k1xx_edma_interrupt, &g_edma.dmach[14]); - (void)irq_attach(S32K1XX_IRQ_DMACH15, s32k1xx_edma_interrupt, &g_edma.dmach[15]); + irq_attach(S32K1XX_IRQ_DMACH4, s32k1xx_edma_interrupt, &g_edma.dmach[4]); + irq_attach(S32K1XX_IRQ_DMACH5, s32k1xx_edma_interrupt, &g_edma.dmach[5]); + irq_attach(S32K1XX_IRQ_DMACH6, s32k1xx_edma_interrupt, &g_edma.dmach[6]); + irq_attach(S32K1XX_IRQ_DMACH7, s32k1xx_edma_interrupt, &g_edma.dmach[7]); + irq_attach(S32K1XX_IRQ_DMACH8, s32k1xx_edma_interrupt, &g_edma.dmach[8]); + irq_attach(S32K1XX_IRQ_DMACH9, s32k1xx_edma_interrupt, &g_edma.dmach[9]); + irq_attach(S32K1XX_IRQ_DMACH10, s32k1xx_edma_interrupt, &g_edma.dmach[10]); + irq_attach(S32K1XX_IRQ_DMACH11, s32k1xx_edma_interrupt, &g_edma.dmach[11]); + irq_attach(S32K1XX_IRQ_DMACH12, s32k1xx_edma_interrupt, &g_edma.dmach[12]); + irq_attach(S32K1XX_IRQ_DMACH13, s32k1xx_edma_interrupt, &g_edma.dmach[13]); + irq_attach(S32K1XX_IRQ_DMACH14, s32k1xx_edma_interrupt, &g_edma.dmach[14]); + irq_attach(S32K1XX_IRQ_DMACH15, s32k1xx_edma_interrupt, &g_edma.dmach[15]); #endif /* Attach the DMA error interrupt vector */ - (void)irq_attach(S32K1XX_IRQ_DMACH_ERR, s32k1xx_error_interrupt, NULL); + irq_attach(S32K1XX_IRQ_DMACH_ERR, s32k1xx_error_interrupt, NULL); /* Disable and clear all error interrupts */ diff --git a/arch/arm/src/s32k1xx/s32k1xx_enet.c b/arch/arm/src/s32k1xx/s32k1xx_enet.c index 3fd10641bd..2f5e719734 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_enet.c +++ b/arch/arm/src/s32k1xx/s32k1xx_enet.c @@ -562,8 +562,8 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, S32K1XX_TXTIMEOUT, s32k1xx_txtimeout_expiry, 1, - (wdparm_t)priv); + wd_start(priv->txtimeout, S32K1XX_TXTIMEOUT, s32k1xx_txtimeout_expiry, 1, + (wdparm_t)priv); /* Start the TX transfer (if it was not already waiting for buffers) */ @@ -963,7 +963,7 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv) * new XMIT data */ - (void)devif_poll(&priv->dev, s32k1xx_txpoll); + devif_poll(&priv->dev, s32k1xx_txpoll); } /**************************************************************************** @@ -1033,8 +1033,8 @@ static void s32k1xx_enet_interrupt_work(FAR void *arg) galrstore = getreg32(S32K1XX_ENET_GALR); #endif - (void)s32k1xx_ifdown(&priv->dev); - (void)s32k1xx_ifup_action(&priv->dev, false); + s32k1xx_ifdown(&priv->dev); + s32k1xx_ifup_action(&priv->dev, false); #ifdef CONFIG_NET_MCASTGROUP /* Now write the multicast table back */ @@ -1045,7 +1045,7 @@ static void s32k1xx_enet_interrupt_work(FAR void *arg) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->dev, s32k1xx_txpoll); + devif_poll(&priv->dev, s32k1xx_txpoll); } else { @@ -1151,12 +1151,12 @@ static void s32k1xx_txtimeout_work(FAR void *arg) * aggressive hardware reset. */ - (void)s32k1xx_ifdown(&priv->dev); - (void)s32k1xx_ifup_action(&priv->dev, false); + s32k1xx_ifdown(&priv->dev); + s32k1xx_ifup_action(&priv->dev, false); /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->dev, s32k1xx_txpoll); + devif_poll(&priv->dev, s32k1xx_txpoll); net_unlock(); } @@ -1230,13 +1230,13 @@ static void s32k1xx_poll_work(FAR void *arg) * transmit in progress, we will missing TCP time state updates? */ - (void)devif_timer(&priv->dev, S32K1XX_WDDELAY, s32k1xx_txpoll); + devif_timer(&priv->dev, S32K1XX_WDDELAY, s32k1xx_txpoll); } /* Setup the watchdog poll timer again in any case */ - (void)wd_start(priv->txpoll, S32K1XX_WDDELAY, s32k1xx_polltimer_expiry, - 1, (wdparm_t)priv); + wd_start(priv->txpoll, S32K1XX_WDDELAY, s32k1xx_polltimer_expiry, + 1, (wdparm_t)priv); net_unlock(); } @@ -1367,8 +1367,8 @@ static int s32k1xx_ifup_action(struct net_driver_s *dev, bool resetphy) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, S32K1XX_WDDELAY, s32k1xx_polltimer_expiry, 1, - (wdparm_t)priv); + wd_start(priv->txpoll, S32K1XX_WDDELAY, s32k1xx_polltimer_expiry, 1, + (wdparm_t)priv); /* Clear all pending ENET interrupt */ @@ -1505,7 +1505,7 @@ static void s32k1xx_txavail_work(FAR void *arg) * new XMIT data. */ - (void)devif_poll(&priv->dev, s32k1xx_txpoll); + devif_poll(&priv->dev, s32k1xx_txpoll); } } @@ -2579,11 +2579,11 @@ int s32k1xx_netinitialize(int intf) * the device and/or calling s32k1xx_ifdown(). */ - (void)s32k1xx_ifdown(&priv->dev); + s32k1xx_ifdown(&priv->dev); /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->dev, NET_LL_ETHERNET); + netdev_register(&priv->dev, NET_LL_ETHERNET); UNUSED(ret); return OK; @@ -2603,7 +2603,7 @@ int s32k1xx_netinitialize(int intf) #if CONFIG_S32K1XX_ENET_NETHIFS == 1 && !defined(CONFIG_NETDEV_LATEINIT) void up_netinitialize(void) { - (void)s32k1xx_netinitialize(0); + s32k1xx_netinitialize(0); } #endif diff --git a/arch/arm/src/s32k1xx/s32k1xx_lowputc.c b/arch/arm/src/s32k1xx/s32k1xx_lowputc.c index b65bd5075e..05f0c72beb 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_lowputc.c +++ b/arch/arm/src/s32k1xx/s32k1xx_lowputc.c @@ -132,14 +132,14 @@ void s32k1xx_lowsetup(void) * control is enabled. */ - (void)s32k1xx_pinconfig(PIN_LPUART0_RX); - (void)s32k1xx_pinconfig(PIN_LPUART0_TX); + s32k1xx_pinconfig(PIN_LPUART0_RX); + s32k1xx_pinconfig(PIN_LPUART0_TX); #ifdef CONFIG_LPUART0_OFLOWCONTROL - (void)s32k1xx_pinconfig(PIN_LPUART0_CTS); + s32k1xx_pinconfig(PIN_LPUART0_CTS); #endif #if ((defined(CONFIG_SERIAL_RS485CONTROL) && defined(CONFIG_LPUART0_RS485RTSCONTROL)) || \ (defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_LPUART0_IFLOWCONTROL))) - (void)s32k1xx_pinconfig(PIN_LPUART0_RTS); + s32k1xx_pinconfig(PIN_LPUART0_RTS); #endif #endif @@ -149,14 +149,14 @@ void s32k1xx_lowsetup(void) * control is enabled. */ - (void)s32k1xx_pinconfig(PIN_LPUART1_RX); - (void)s32k1xx_pinconfig(PIN_LPUART1_TX); + s32k1xx_pinconfig(PIN_LPUART1_RX); + s32k1xx_pinconfig(PIN_LPUART1_TX); #ifdef CONFIG_LPUART1_OFLOWCONTROL - (void)s32k1xx_pinconfig(PIN_LPUART1_CTS); + s32k1xx_pinconfig(PIN_LPUART1_CTS); #endif #if ((defined(CONFIG_SERIAL_RS485CONTROL) && defined(CONFIG_LPUART1_RS485RTSCONTROL)) || \ (defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_LPUART1_IFLOWCONTROL))) - (void)s32k1xx_pinconfig(PIN_LPUART1_RTS); + s32k1xx_pinconfig(PIN_LPUART1_RTS); #endif #endif @@ -166,21 +166,21 @@ void s32k1xx_lowsetup(void) * control is enabled. */ - (void)s32k1xx_pinconfig(PIN_LPUART2_RX); - (void)s32k1xx_pinconfig(PIN_LPUART2_TX); + s32k1xx_pinconfig(PIN_LPUART2_RX); + s32k1xx_pinconfig(PIN_LPUART2_TX); #ifdef CONFIG_LPUART2_OFLOWCONTROL - (void)s32k1xx_pinconfig(PIN_LPUART2_CTS); + s32k1xx_pinconfig(PIN_LPUART2_CTS); #endif #if ((defined(CONFIG_SERIAL_RS485CONTROL) && defined(CONFIG_LPUART2_RS485RTSCONTROL)) || \ (defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_LPUART2_IFLOWCONTROL))) - (void)s32k1xx_pinconfig(PIN_LPUART2_RTS); + s32k1xx_pinconfig(PIN_LPUART2_RTS); #endif #endif #ifdef HAVE_LPUART_CONSOLE /* Configure the serial console for initial, non-interrupt driver mode */ - (void)s32k1xx_lpuart_configure(S32K1XX_CONSOLE_BASE, &g_console_config); + s32k1xx_lpuart_configure(S32K1XX_CONSOLE_BASE, &g_console_config); #endif #endif /* HAVE_LPUART_DEVICE */ #endif /* CONFIG_SUPPRESS_LPUART_CONFIG */ diff --git a/arch/arm/src/s32k1xx/s32k1xx_lpi2c.c b/arch/arm/src/s32k1xx/s32k1xx_lpi2c.c index 23d8042e6e..eff2fadce9 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_lpi2c.c +++ b/arch/arm/src/s32k1xx/s32k1xx_lpi2c.c @@ -435,21 +435,7 @@ static inline void s32k1xx_lpi2c_modifyreg(FAR struct s32k1xx_lpi2c_priv_s *priv static inline void s32k1xx_lpi2c_sem_wait(FAR struct s32k1xx_lpi2c_priv_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sem_excl); } /**************************************************************************** @@ -535,7 +521,7 @@ static inline int s32k1xx_lpi2c_sem_waitdone(FAR struct s32k1xx_lpi2c_priv_s *pr { /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -564,12 +550,11 @@ static inline int s32k1xx_lpi2c_sem_waitdone(FAR struct s32k1xx_lpi2c_priv_s *pr /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->sem_isr, &abstime); - if (ret < 0 && ret != -EINTR) + ret = nxsem_timedwait_uninterruptible(&priv->sem_isr, &abstime); + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would * include timeouts and mystery errors reported by nxsem_timedwait. - * NOTE that we try again if we are awakened by a signal (EINTR). */ break; @@ -1312,7 +1297,7 @@ static int s32k1xx_lpi2c_isr_process(struct s32k1xx_lpi2c_priv_s *priv) * and wake it up */ - sem_post(&priv->sem_isr); + nxsem_post(&priv->sem_isr); priv->intstate = INTSTATE_DONE; } #else @@ -1360,7 +1345,7 @@ static int s32k1xx_lpi2c_isr_process(struct s32k1xx_lpi2c_priv_s *priv) * and wake it up */ - sem_post(&priv->sem_isr); + nxsem_post(&priv->sem_isr); priv->intstate = INTSTATE_DONE; } #else @@ -1408,8 +1393,8 @@ static int s32k1xx_lpi2c_init(FAR struct s32k1xx_lpi2c_priv_s *priv) /* Configure pins */ - (void)s32k1xx_pinconfig(priv->config->scl_pin); - (void)s32k1xx_pinconfig(priv->config->sda_pin); + s32k1xx_pinconfig(priv->config->scl_pin); + s32k1xx_pinconfig(priv->config->sda_pin); /* Reset LPI2C before configuring it */ diff --git a/arch/arm/src/s32k1xx/s32k1xx_lpspi.c b/arch/arm/src/s32k1xx/s32k1xx_lpspi.c index 31338e956a..356c4b304c 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_lpspi.c +++ b/arch/arm/src/s32k1xx/s32k1xx_lpspi.c @@ -854,24 +854,11 @@ static int s32k1xx_lpspi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -1501,9 +1488,9 @@ FAR struct spi_dev_s *s32k1xx_lpspibus_initialize(int bus) { /* Configure SPI0 pins: SCK, MISO, and MOSI */ - (void)s32k1xx_pinconfig(PIN_LPSPI0_SCK); - (void)s32k1xx_pinconfig(PIN_LPSPI0_MISO); - (void)s32k1xx_pinconfig(PIN_LPSPI0_MOSI); + s32k1xx_pinconfig(PIN_LPSPI0_SCK); + s32k1xx_pinconfig(PIN_LPSPI0_MISO); + s32k1xx_pinconfig(PIN_LPSPI0_MOSI); /* Set up default configuration: Master, 8-bit, etc. */ @@ -1525,9 +1512,9 @@ FAR struct spi_dev_s *s32k1xx_lpspibus_initialize(int bus) { /* Configure SPI1 pins: SCK, MISO, and MOSI */ - (void)s32k1xx_pinconfig(PIN_LPSPI1_SCK); - (void)s32k1xx_pinconfig(PIN_LPSPI1_MISO); - (void)s32k1xx_pinconfig(PIN_LPSPI1_MOSI); + s32k1xx_pinconfig(PIN_LPSPI1_SCK); + s32k1xx_pinconfig(PIN_LPSPI1_MISO); + s32k1xx_pinconfig(PIN_LPSPI1_MOSI); /* Set up default configuration: Master, 8-bit, etc. */ @@ -1549,9 +1536,9 @@ FAR struct spi_dev_s *s32k1xx_lpspibus_initialize(int bus) { /* Configure SPI2 pins: SCK, MISO, and MOSI */ - (void)s32k1xx_pinconfig(PIN_LPSPI2_SCK); - (void)s32k1xx_pinconfig(PIN_LPSPI2_MISO); - (void)s32k1xx_pinconfig(PIN_LPSPI2_MOSI); + s32k1xx_pinconfig(PIN_LPSPI2_SCK); + s32k1xx_pinconfig(PIN_LPSPI2_MISO); + s32k1xx_pinconfig(PIN_LPSPI2_MOSI); /* Set up default configuration: Master, 8-bit, etc. */ diff --git a/arch/arm/src/s32k1xx/s32k1xx_pinirq.c b/arch/arm/src/s32k1xx/s32k1xx_pinirq.c index 045b7336f7..aa859c3e08 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_pinirq.c +++ b/arch/arm/src/s32k1xx/s32k1xx_pinirq.c @@ -153,7 +153,7 @@ static int s32k1xx_portinterrupt(int irq, FAR void *context, /* There is a registered interrupt handler... invoke it */ - (void)handler(irq, context, arg); + handler(irq, context, arg); } /* Writing a one to the ISFR register will clear the pending @@ -228,27 +228,27 @@ static int s32k1xx_porteinterrupt(int irq, FAR void *context, FAR void *arg) void s32k1xx_pinirq_initialize(void) { #ifdef CONFIG_S32K1XX_PORTAINTS - (void)irq_attach(S32K1XX_IRQ_PORTA, s32k1xx_portainterrupt, NULL); + irq_attach(S32K1XX_IRQ_PORTA, s32k1xx_portainterrupt, NULL); putreg32(0xffffffff, S32K1XX_PORTA_ISFR); up_enable_irq(S32K1XX_IRQ_PORTA); #endif #ifdef CONFIG_S32K1XX_PORTBINTS - (void)irq_attach(S32K1XX_IRQ_PORTB, s32k1xx_portbinterrupt, NULL); + irq_attach(S32K1XX_IRQ_PORTB, s32k1xx_portbinterrupt, NULL); putreg32(0xffffffff, S32K1XX_PORTB_ISFR); up_enable_irq(S32K1XX_IRQ_PORTB); #endif #ifdef CONFIG_S32K1XX_PORTCINTS - (void)irq_attach(S32K1XX_IRQ_PORTC, s32k1xx_portcinterrupt, NULL); + irq_attach(S32K1XX_IRQ_PORTC, s32k1xx_portcinterrupt, NULL); putreg32(0xffffffff, S32K1XX_PORTC_ISFR); up_enable_irq(S32K1XX_IRQ_PORTC); #endif #ifdef CONFIG_S32K1XX_PORTDINTS - (void)irq_attach(S32K1XX_IRQ_PORTD, s32k1xx_portdinterrupt, NULL); + irq_attach(S32K1XX_IRQ_PORTD, s32k1xx_portdinterrupt, NULL); putreg32(0xffffffff, S32K1XX_PORTD_ISFR); up_enable_irq(S32K1XX_IRQ_PORTD); #endif #ifdef CONFIG_S32K1XX_PORTEINTS - (void)irq_attach(S32K1XX_IRQ_PORTE, s32k1xx_porteinterrupt, NULL); + irq_attach(S32K1XX_IRQ_PORTE, s32k1xx_porteinterrupt, NULL); putreg32(0xffffffff, S32K1XX_PORTE_ISFR); up_enable_irq(S32K1XX_IRQ_PORTE); #endif diff --git a/arch/arm/src/s32k1xx/s32k1xx_serial.c b/arch/arm/src/s32k1xx/s32k1xx_serial.c index 81c5323cc6..678383fadc 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_serial.c +++ b/arch/arm/src/s32k1xx/s32k1xx_serial.c @@ -1256,17 +1256,17 @@ void up_serialinit(void) #endif #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif } diff --git a/arch/arm/src/s32k1xx/s32k1xx_wdog.h b/arch/arm/src/s32k1xx/s32k1xx_wdog.h index f4e4b41938..47304e312c 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_wdog.h +++ b/arch/arm/src/s32k1xx/s32k1xx_wdog.h @@ -86,7 +86,7 @@ static inline void s32k1xx_wdog_disable(void) * completed. */ - (void)getreg32(S32K1XX_WDOG_CNT); + getreg32(S32K1XX_WDOG_CNT); /* Initial write of WDOG configuration register: Enables support for * 32-bit refresh/unlock command write words, clock select from LPO, diff --git a/arch/arm/src/sam34/sam4cm_cpuidlestack.c b/arch/arm/src/sam34/sam4cm_cpuidlestack.c index 976d40a42b..88043a3467 100644 --- a/arch/arm/src/sam34/sam4cm_cpuidlestack.c +++ b/arch/arm/src/sam34/sam4cm_cpuidlestack.c @@ -128,7 +128,7 @@ void up_idle(void) int up_cpu_idlestack(int cpu, FAR struct tcb_s *tcb, size_t stack_size) { #if CONFIG_SMP_NCPUS > 1 - (void)up_create_stack(tcb, stack_size, TCB_FLAG_TTYPE_KERNEL); + up_create_stack(tcb, stack_size, TCB_FLAG_TTYPE_KERNEL); #endif return OK; } diff --git a/arch/arm/src/sam34/sam4cm_cpustart.c b/arch/arm/src/sam34/sam4cm_cpustart.c index 2fd0f03c08..512c9ae526 100644 --- a/arch/arm/src/sam34/sam4cm_cpustart.c +++ b/arch/arm/src/sam34/sam4cm_cpustart.c @@ -134,7 +134,7 @@ static void cpu1_boot(void) /* Then transfer control to the IDLE task */ - (void)nx_idle_task(0, NULL); + nx_idle_task(0, NULL); } /**************************************************************************** diff --git a/arch/arm/src/sam34/sam4cm_freerun.c b/arch/arm/src/sam34/sam4cm_freerun.c index 4b09e1d5e6..1d01ccec0e 100644 --- a/arch/arm/src/sam34/sam4cm_freerun.c +++ b/arch/arm/src/sam34/sam4cm_freerun.c @@ -186,8 +186,8 @@ int sam_freerun_initialize(struct sam_freerun_s *freerun, int chan, /* Set up to receive the callback when the counter overflow occurs */ - (void)sam_tc_attach(freerun->tch, sam_freerun_handler, freerun, - TC_INT_COVFS); + sam_tc_attach(freerun->tch, sam_freerun_handler, freerun, + TC_INT_COVFS); /* Start the counter */ diff --git a/arch/arm/src/sam34/sam4cm_oneshot.c b/arch/arm/src/sam34/sam4cm_oneshot.c index 04c9cf8200..fe3a09c6ec 100644 --- a/arch/arm/src/sam34/sam4cm_oneshot.c +++ b/arch/arm/src/sam34/sam4cm_oneshot.c @@ -277,7 +277,7 @@ int sam_oneshot_start(struct sam_oneshot_s *oneshot, /* Yes.. then cancel it */ tmrinfo("Already running... cancelling\n"); - (void)sam_oneshot_cancel(oneshot, freerun, NULL); + sam_oneshot_cancel(oneshot, freerun, NULL); } /* Save the new handler and its argument */ @@ -303,8 +303,8 @@ int sam_oneshot_start(struct sam_oneshot_s *oneshot, /* Set up to receive the callback when the interrupt occurs */ - (void)sam_tc_attach(oneshot->tch, sam_oneshot_handler, oneshot, - TC_INT_CPCS); + sam_tc_attach(oneshot->tch, sam_oneshot_handler, oneshot, + TC_INT_CPCS); /* Set RC so that an event will be triggered when TC_CV register counts * up to RC. diff --git a/arch/arm/src/sam34/sam4cm_tc.c b/arch/arm/src/sam34/sam4cm_tc.c index 760a8a3bd0..614180356f 100644 --- a/arch/arm/src/sam34/sam4cm_tc.c +++ b/arch/arm/src/sam34/sam4cm_tc.c @@ -360,21 +360,7 @@ static const uint8_t g_regoffset[TC_NREGISTERS] = static void sam_takesem(struct sam_chan_s *chan) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&chan->exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&chan->exclsem); } /**************************************************************************** @@ -784,7 +770,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) /* Disable and clear all channel interrupts */ sam_chan_putreg(chan, SAM_TC_IDR_OFFSET, TC_INT_ALL); - (void)sam_chan_getreg(chan, SAM_TC_SR_OFFSET); + sam_chan_getreg(chan, SAM_TC_SR_OFFSET); /* Enable clocking to the timer counter */ @@ -792,7 +778,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) /* Attach the timer interrupt handler and enable the timer interrupts */ - (void)irq_attach(chan->irq, sam_tc_interrupt, chan); + irq_attach(chan->irq, sam_tc_interrupt, chan); up_enable_irq(chan->irq); /* Now the channel is initialized */ @@ -871,7 +857,7 @@ TC_HANDLE sam_tc_allocate(int channel, int mode) /* Clear and pending status */ - (void)sam_chan_getreg(chan, SAM_TC_SR_OFFSET); + sam_chan_getreg(chan, SAM_TC_SR_OFFSET); /* And set the requested mode */ @@ -942,7 +928,7 @@ void sam_tc_start(TC_HANDLE handle) /* Read the SR to clear any pending interrupts on this channel */ - (void)sam_chan_getreg(chan, SAM_TC_SR_OFFSET); + sam_chan_getreg(chan, SAM_TC_SR_OFFSET); /* Then enable the timer (by setting the CLKEN bit). Setting SWTRIG * will also reset the timer counter and starting the timer. diff --git a/arch/arm/src/sam34/sam_dmac.c b/arch/arm/src/sam34/sam_dmac.c index 1e06148cfe..892a659aa6 100644 --- a/arch/arm/src/sam34/sam_dmac.c +++ b/arch/arm/src/sam34/sam_dmac.c @@ -275,26 +275,12 @@ static struct sam_dma_s g_dma[SAM34_NDMACHAN] = static void sam_takechsem(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_chsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_chsem); } static inline void sam_givechsem(void) { - (void)nxsem_post(&g_chsem); + nxsem_post(&g_chsem); } /**************************************************************************** @@ -307,26 +293,12 @@ static inline void sam_givechsem(void) static void sam_takedsem(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_dsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_dsem); } static inline void sam_givedsem(void) { - (void)nxsem_post(&g_dsem); + nxsem_post(&g_dsem); } /**************************************************************************** @@ -1134,7 +1106,7 @@ static inline int sam_single(struct sam_dma_s *dmach) * EBCISR register could cause a loss of interrupts! */ - (void)getreg32(SAM_DMAC_EBCISR); + getreg32(SAM_DMAC_EBCISR); /* Write the starting source address in the SADDR register */ @@ -1208,7 +1180,7 @@ static inline int sam_multiple(struct sam_dma_s *dmach) * EBCISR register could cause a loss of interrupts! */ - (void)getreg32(SAM_DMAC_EBCISR); + getreg32(SAM_DMAC_EBCISR); /* Set up the initial CTRLA register */ @@ -1381,7 +1353,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vector */ - (void)irq_attach(SAM_IRQ_DMAC, sam_dmainterrupt, NULL); + irq_attach(SAM_IRQ_DMAC, sam_dmainterrupt, NULL); /* Enable the IRQ at the NVIC (still disabled at the DMA controller) */ @@ -1450,7 +1422,7 @@ DMA_HANDLE sam_dmachannel(uint32_t chflags) * reading the EBCISR register could cause a loss of interrupts! */ - (void)getreg32(SAM_DMAC_EBCISR); + getreg32(SAM_DMAC_EBCISR); /* Disable the channel by writing one to the write-only channel * disable register diff --git a/arch/arm/src/sam34/sam_emac.c b/arch/arm/src/sam34/sam_emac.c index dc0e4a4576..4b32dc5269 100644 --- a/arch/arm/src/sam34/sam_emac.c +++ b/arch/arm/src/sam34/sam_emac.c @@ -808,8 +808,8 @@ static int sam_transmit(struct sam_emac_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1, - (uint32_t)priv); + wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1, + (uint32_t)priv); /* Set d_len to zero meaning that the d_buf[] packet buffer is again * available. @@ -952,7 +952,7 @@ static void sam_dopoll(struct sam_emac_s *priv) { /* If we have the descriptor, then poll the network for new XMIT data. */ - (void)devif_poll(dev, sam_txpoll); + devif_poll(dev, sam_txpoll); } } @@ -1773,12 +1773,12 @@ static void sam_poll_work(FAR void *arg) { /* Update TCP timing states and poll the network for new XMIT data. */ - (void)devif_timer(dev, SAM_WDDELAY, sam_txpoll); + devif_timer(dev, SAM_WDDELAY, sam_txpoll); } /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); + wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); net_unlock(); } @@ -1877,7 +1877,7 @@ static int sam_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, (uint32_t)priv); + wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, (uint32_t)priv); /* Enable the EMAC interrupt */ @@ -3504,7 +3504,7 @@ static void sam_ipv6multicast(struct sam_emac_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)sam_addmac(dev, mac); + sam_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -3512,7 +3512,7 @@ static void sam_ipv6multicast(struct sam_emac_s *priv) * packets. */ - (void)sam_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + sam_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -3521,7 +3521,7 @@ static void sam_ipv6multicast(struct sam_emac_s *priv) * packets. */ - (void)sam_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + sam_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -3571,7 +3571,7 @@ static int sam_emac_configure(struct sam_emac_s *priv) /* Clear any pending interrupts */ - (void)sam_getreg(priv, SAM_EMAC_ISR); + sam_getreg(priv, SAM_EMAC_ISR); /* Enable/disable the copy of data into the buffers, ignore broadcasts. * Don't copy FCS. diff --git a/arch/arm/src/sam34/sam_gpioirq.c b/arch/arm/src/sam34/sam_gpioirq.c index f4936d8584..ff3cd1b5b5 100644 --- a/arch/arm/src/sam34/sam_gpioirq.c +++ b/arch/arm/src/sam34/sam_gpioirq.c @@ -275,12 +275,12 @@ void sam_gpioirqinitialize(void) /* Clear and disable all GPIOA interrupts */ - (void)getreg32(SAM_PIOA_ISR); + getreg32(SAM_PIOA_ISR); putreg32(0xffffffff, SAM_PIOA_IDR); /* Attach and enable the GPIOA IRQ */ - (void)irq_attach(SAM_IRQ_PIOA, sam_gpioainterrupt, NULL); + irq_attach(SAM_IRQ_PIOA, sam_gpioainterrupt, NULL); up_enable_irq(SAM_IRQ_PIOA); #endif @@ -293,12 +293,12 @@ void sam_gpioirqinitialize(void) /* Clear and disable all GPIOB interrupts */ - (void)getreg32(SAM_PIOB_ISR); + getreg32(SAM_PIOB_ISR); putreg32(0xffffffff, SAM_PIOB_IDR); /* Attach and enable the GPIOB IRQ */ - (void)irq_attach(SAM_IRQ_PIOB, sam_gpiobinterrupt, NULL); + irq_attach(SAM_IRQ_PIOB, sam_gpiobinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOB); #endif @@ -311,12 +311,12 @@ void sam_gpioirqinitialize(void) /* Clear and disable all GPIOC interrupts */ - (void)getreg32(SAM_PIOC_ISR); + getreg32(SAM_PIOC_ISR); putreg32(0xffffffff, SAM_PIOC_IDR); /* Attach and enable the GPIOC IRQ */ - (void)irq_attach(SAM_IRQ_PIOC, sam_gpiocinterrupt, NULL); + irq_attach(SAM_IRQ_PIOC, sam_gpiocinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOC); #endif @@ -329,12 +329,12 @@ void sam_gpioirqinitialize(void) /* Clear and disable all GPIOD interrupts */ - (void)getreg32(SAM_PIOD_ISR); + getreg32(SAM_PIOD_ISR); putreg32(0xffffffff, SAM_PIOD_IDR); /* Attach and enable the GPIOC IRQ */ - (void)irq_attach(SAM_IRQ_PIOD, sam_gpiodinterrupt, NULL); + irq_attach(SAM_IRQ_PIOD, sam_gpiodinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOD); #endif @@ -347,12 +347,12 @@ void sam_gpioirqinitialize(void) /* Clear and disable all GPIOE interrupts */ - (void)getreg32(SAM_PIOE_ISR); + getreg32(SAM_PIOE_ISR); putreg32(0xffffffff, SAM_PIOE_IDR); /* Attach and enable the GPIOE IRQ */ - (void)irq_attach(SAM_IRQ_PIOE, sam_gpioeinterrupt, NULL); + irq_attach(SAM_IRQ_PIOE, sam_gpioeinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOE); #endif @@ -365,12 +365,12 @@ void sam_gpioirqinitialize(void) /* Clear and disable all GPIOF interrupts */ - (void)getreg32(SAM_PIOF_ISR); + getreg32(SAM_PIOF_ISR); putreg32(0xffffffff, SAM_PIOF_IDR); /* Attach and enable the GPIOF IRQ */ - (void)irq_attach(SAM_IRQ_PIOF, sam_gpiofinterrupt, NULL); + irq_attach(SAM_IRQ_PIOF, sam_gpiofinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOF); #endif } diff --git a/arch/arm/src/sam34/sam_hsmci.c b/arch/arm/src/sam34/sam_hsmci.c index 1974c2d5aa..483c8f3b31 100644 --- a/arch/arm/src/sam34/sam_hsmci.c +++ b/arch/arm/src/sam34/sam_hsmci.c @@ -587,21 +587,7 @@ static bool g_cmdinitialized; static void sam_takesem(struct sam_dev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->waitsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -1117,7 +1103,7 @@ static void sam_endwait(struct sam_dev_s *priv, sdio_eventset_t wkupevent) { /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Disable event-related interrupts and save wakeup event */ @@ -1648,7 +1634,7 @@ static int sam_attach(FAR struct sdio_dev_s *dev) */ putreg32(0xffffffff, SAM_HSMCI_IDR); - (void)getreg32(SAM_HSMCI_SR); + getreg32(SAM_HSMCI_SR); /* Enable HSMCI interrupts at the NVIC. They can now be enabled at * the HSMCI controller as needed. @@ -1866,11 +1852,11 @@ static int sam_cancel(FAR struct sdio_dev_s *dev) /* Clearing (most) pending interrupt status by reading the status register */ - (void)getreg32(SAM_HSMCI_SR); + getreg32(SAM_HSMCI_SR); /* Cancel any watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Make sure that the DMA is stopped (it will be stopped automatically * on normal transfers, but not necessarily when the transfer terminates @@ -2234,7 +2220,7 @@ static void sam_waitenable(FAR struct sdio_dev_s *dev, * pending after this point must be valid event indications. */ - (void)getreg32(SAM_HSMCI_SR); + getreg32(SAM_HSMCI_SR); /* Wait interrupts are configured here, but not enabled until * sam_eventwait() is called. Why? Because the XFRDONE interrupt is @@ -2635,7 +2621,7 @@ static void sam_callback(void *arg) /* Yes.. queue it */ mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); - (void)work_queue(LPWORK, &priv->cbwork, (worker_t)priv->callback, priv->cbarg, 0); + work_queue(LPWORK, &priv->cbwork, (worker_t)priv->callback, priv->cbarg, 0); } else { diff --git a/arch/arm/src/sam34/sam_irq.c b/arch/arm/src/sam34/sam_irq.c index 8e1a998b4f..371a998977 100644 --- a/arch/arm/src/sam34/sam_irq.c +++ b/arch/arm/src/sam34/sam_irq.c @@ -181,7 +181,7 @@ static void sam_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int sam_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -189,7 +189,7 @@ static int sam_nmi(int irq, FAR void *context, FAR void *arg) static int sam_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -197,7 +197,7 @@ static int sam_busfault(int irq, FAR void *context, FAR void *arg) static int sam_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -205,7 +205,7 @@ static int sam_usagefault(int irq, FAR void *context, FAR void *arg) static int sam_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -213,7 +213,7 @@ static int sam_pendsv(int irq, FAR void *context, FAR void *arg) static int sam_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -221,7 +221,7 @@ static int sam_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int sam_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/sam34/sam_lowputc.c b/arch/arm/src/sam34/sam_lowputc.c index e0de24cf70..dd4c54a0ce 100644 --- a/arch/arm/src/sam34/sam_lowputc.c +++ b/arch/arm/src/sam34/sam_lowputc.c @@ -372,56 +372,56 @@ void sam_lowsetup(void) /* Configure UART pins for all selected UART/USARTs */ #ifdef CONFIG_SAM34_UART0 - (void)sam_configgpio(GPIO_UART0_RXD); - (void)sam_configgpio(GPIO_UART0_TXD); + sam_configgpio(GPIO_UART0_RXD); + sam_configgpio(GPIO_UART0_TXD); #endif #ifdef CONFIG_SAM34_UART1 - (void)sam_configgpio(GPIO_UART1_RXD); - (void)sam_configgpio(GPIO_UART1_TXD); + sam_configgpio(GPIO_UART1_RXD); + sam_configgpio(GPIO_UART1_TXD); #endif #ifdef CONFIG_SAM34_USART0 - (void)sam_configgpio(GPIO_USART0_RXD); - (void)sam_configgpio(GPIO_USART0_TXD); + sam_configgpio(GPIO_USART0_RXD); + sam_configgpio(GPIO_USART0_TXD); #ifdef CONFIG_USART0_OFLOWCONTROL - (void)sam_configgpio(GPIO_USART0_CTS); + sam_configgpio(GPIO_USART0_CTS); #endif #ifdef CONFIG_USART0_IFLOWCONTROL - (void)sam_configgpio(GPIO_USART0_RTS); + sam_configgpio(GPIO_USART0_RTS); #endif #endif #ifdef CONFIG_SAM34_USART1 - (void)sam_configgpio(GPIO_USART1_RXD); - (void)sam_configgpio(GPIO_USART1_TXD); + sam_configgpio(GPIO_USART1_RXD); + sam_configgpio(GPIO_USART1_TXD); #ifdef CONFIG_USART1_OFLOWCONTROL - (void)sam_configgpio(GPIO_USART1_CTS); + sam_configgpio(GPIO_USART1_CTS); #endif #ifdef CONFIG_USART1_IFLOWCONTROL - (void)sam_configgpio(GPIO_USART1_RTS); + sam_configgpio(GPIO_USART1_RTS); #endif #endif #ifdef CONFIG_SAM34_USART2 - (void)sam_configgpio(GPIO_USART2_RXD); - (void)sam_configgpio(GPIO_USART2_TXD); + sam_configgpio(GPIO_USART2_RXD); + sam_configgpio(GPIO_USART2_TXD); #ifdef CONFIG_USART2_OFLOWCONTROL - (void)sam_configgpio(GPIO_USART2_CTS); + sam_configgpio(GPIO_USART2_CTS); #endif #ifdef CONFIG_USART2_IFLOWCONTROL - (void)sam_configgpio(GPIO_USART2_RTS); + sam_configgpio(GPIO_USART2_RTS); #endif #endif #ifdef CONFIG_SAM34_USART3 - (void)sam_configgpio(GPIO_USART3_RXD); - (void)sam_configgpio(GPIO_USART3_TXD); + sam_configgpio(GPIO_USART3_RXD); + sam_configgpio(GPIO_USART3_TXD); #ifdef CONFIG_USART3_OFLOWCONTROL - (void)sam_configgpio(GPIO_USART3_CTS); + sam_configgpio(GPIO_USART3_CTS); #endif #ifdef CONFIG_USART3_IFLOWCONTROL - (void)sam_configgpio(GPIO_USART3_RTS); + sam_configgpio(GPIO_USART3_RTS); #endif #endif diff --git a/arch/arm/src/sam34/sam_rtc.c b/arch/arm/src/sam34/sam_rtc.c index 83739923ce..32f211cb84 100644 --- a/arch/arm/src/sam34/sam_rtc.c +++ b/arch/arm/src/sam34/sam_rtc.c @@ -540,7 +540,7 @@ int up_rtc_settime(FAR const struct timespec *tp) /* Break out the time values (note that the time is set only to units of seconds) */ - (void)gmtime_r(&tp->tv_sec, &newtime); + gmtime_r(&tp->tv_sec, &newtime); rtc_dumptime(&newtime, "Setting time"); /* Then write the broken out values to the RTC */ @@ -666,7 +666,7 @@ int sam_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback) * of seconds) */ - (void)gmtime_r(&tp->tv_sec, &newalarm); + gmtime_r(&tp->tv_sec, &newalarm); rtc_dumptime(&newalarm, "Setting alarm"); /* Then write the broken out values to the RTC */ diff --git a/arch/arm/src/sam34/sam_rtt.c b/arch/arm/src/sam34/sam_rtt.c index 1b945e42e8..cf61d92e3f 100644 --- a/arch/arm/src/sam34/sam_rtt.c +++ b/arch/arm/src/sam34/sam_rtt.c @@ -650,7 +650,7 @@ void sam_rttinitialize(FAR const char *devpath) priv->ops = &g_tcops; - (void)irq_attach(SAM_IRQ_RTT, sam34_interrupt, priv); + irq_attach(SAM_IRQ_RTT, sam34_interrupt, priv); /* Enable NVIC interrupt. */ @@ -658,7 +658,7 @@ void sam_rttinitialize(FAR const char *devpath) /* Register the timer driver as /dev/timerX */ - (void)timer_register(devpath, (FAR struct timer_lowerhalf_s *)priv); + timer_register(devpath, (FAR struct timer_lowerhalf_s *)priv); } #endif /* CONFIG_TIMER && CONFIG_SAM34_TCx */ diff --git a/arch/arm/src/sam34/sam_serial.c b/arch/arm/src/sam34/sam_serial.c index 0fae8f8f6e..a54c97058d 100644 --- a/arch/arm/src/sam34/sam_serial.c +++ b/arch/arm/src/sam34/sam_serial.c @@ -1381,26 +1381,26 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all USARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif } diff --git a/arch/arm/src/sam34/sam_spi.c b/arch/arm/src/sam34/sam_spi.c index 76c7f589d3..d0aaa7dda0 100644 --- a/arch/arm/src/sam34/sam_spi.c +++ b/arch/arm/src/sam34/sam_spi.c @@ -571,7 +571,7 @@ static inline void spi_flush(struct sam_spidev_s *spi) while ((spi_getreg(spi, SAM_SPI_SR_OFFSET) & SPI_INT_RDRF) != 0) { - (void)spi_getreg(spi, SAM_SPI_RDR_OFFSET); + spi_getreg(spi, SAM_SPI_RDR_OFFSET); } } @@ -775,7 +775,7 @@ static void spi_rxcallback(DMA_HANDLE handle, void *arg, int result) /* Cancel the watchdog timeout */ - (void)wd_cancel(spics->dmadog); + wd_cancel(spics->dmadog); /* Sample DMA registers at the time of the callback */ @@ -883,26 +883,11 @@ static int spi_lock(struct spi_dev_s *dev, bool lock) spiinfo("lock=%d\n", lock); if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&spi->spisem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&spi->spisem); } else { - (void)nxsem_post(&spi->spisem); - ret = OK; + ret = nxsem_post(&spi->spisem); } return ret; @@ -1603,17 +1588,15 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, /* Wait for the DMA complete */ - ret = nxsem_wait(&spics->dmawait); + ret = nxsem_wait_uninterruptible(&spics->dmawait); /* Cancel the watchdog timeout */ - (void)wd_cancel(spics->dmadog); + wd_cancel(spics->dmadog); - /* Check if we were awakened by an error of some kind. EINTR is not a - * failure. It simply means that the wait was awakened by a signal. - */ + /* Check if we were awakened by an error of some kind. */ - if (ret < 0 && ret != -EINTR) + if (ret < 0) { DEBUGPANIC(); return; @@ -1879,8 +1862,8 @@ struct spi_dev_s *sam_spibus_initialize(int port) /* Flush any pending transfers */ - (void)spi_getreg(spi, SAM_SPI_SR_OFFSET); - (void)spi_getreg(spi, SAM_SPI_RDR_OFFSET); + spi_getreg(spi, SAM_SPI_SR_OFFSET); + spi_getreg(spi, SAM_SPI_RDR_OFFSET); /* Initialize the SPI semaphore that enforces mutually exclusive * access to the SPI registers. diff --git a/arch/arm/src/sam34/sam_tc.c b/arch/arm/src/sam34/sam_tc.c index 80595546e7..2d8b0c160b 100644 --- a/arch/arm/src/sam34/sam_tc.c +++ b/arch/arm/src/sam34/sam_tc.c @@ -647,7 +647,7 @@ void sam_tcinitialize(FAR const char *devpath, int irq) priv->ops = &g_tcops; - (void)irq_attach(irq, sam34_interrupt, NULL); + irq_attach(irq, sam34_interrupt, NULL); /* Enable NVIC interrupt. */ @@ -655,7 +655,7 @@ void sam_tcinitialize(FAR const char *devpath, int irq) /* Register the timer driver as /dev/timerX */ - (void)timer_register(devpath, (FAR struct timer_lowerhalf_s *)priv); + timer_register(devpath, (FAR struct timer_lowerhalf_s *)priv); } #endif /* CONFIG_TIMER && CONFIG_SAM34_TCx */ diff --git a/arch/arm/src/sam34/sam_timerisr.c b/arch/arm/src/sam34/sam_timerisr.c index 3a3145547c..9857438f18 100644 --- a/arch/arm/src/sam34/sam_timerisr.c +++ b/arch/arm/src/sam34/sam_timerisr.c @@ -163,7 +163,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr, NULL); + irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/sam34/sam_twi.c b/arch/arm/src/sam34/sam_twi.c index 086bdd0d8a..5cd94d8047 100644 --- a/arch/arm/src/sam34/sam_twi.c +++ b/arch/arm/src/sam34/sam_twi.c @@ -225,21 +225,7 @@ static const struct i2c_ops_s g_twiops = static void twi_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -386,7 +372,7 @@ static int twi_wait(struct twi_dev_s *priv) { /* Start a timeout to avoid hangs */ - (void)wd_start(priv->timeout, TWI_TIMEOUT, twi_timeout, 1, (uint32_t)priv); + wd_start(priv->timeout, TWI_TIMEOUT, twi_timeout, 1, (uint32_t)priv); /* Wait for either the TWI transfer or the timeout to complete */ @@ -831,7 +817,7 @@ static void twi_hw_initialize(struct twi_dev_s *priv, unsigned int pid, /* Reset the TWI */ twi_putrel(priv, SAM_TWI_CR_OFFSET, TWI_CR_SWRST); - (void)twi_getrel(priv, SAM_TWI_RHR_OFFSET); + twi_getrel(priv, SAM_TWI_RHR_OFFSET); /* TWI Slave Mode Disabled, TWI Master Mode Disabled. */ diff --git a/arch/arm/src/sam34/sam_udp.c b/arch/arm/src/sam34/sam_udp.c index 1381f39628..3e2fd5ff62 100644 --- a/arch/arm/src/sam34/sam_udp.c +++ b/arch/arm/src/sam34/sam_udp.c @@ -962,7 +962,7 @@ static int sam_req_write(struct sam_usbdev_s *priv, struct sam_ep_s *privep) { /* Yes... stall the endpoint now */ - (void)sam_ep_stall(privep); + sam_ep_stall(privep); } return -ENOENT; @@ -1318,7 +1318,7 @@ static void sam_ep0_dispatch(struct sam_usbdev_s *priv) /* Stall on failure */ usbtrace(TRACE_DEVERROR(SAM_TRACEERR_DISPATCHSTALL), 0); - (void)sam_ep_stall(&priv->eplist[EP0]); + sam_ep_stall(&priv->eplist[EP0]); } } } @@ -1828,7 +1828,7 @@ static void sam_ep0_setup(struct sam_usbdev_s *priv) usbtrace(TRACE_DEVERROR(SAM_TRACEERR_EP0SETUPSTALLED), priv->ctrl.req); - (void)sam_ep_stall(&priv->eplist[EP0]); + sam_ep_stall(&priv->eplist[EP0]); } break; @@ -1875,7 +1875,7 @@ static void sam_ep_bankinterrupt(struct sam_usbdev_s *priv, * transferred from the FIFO. */ - (void)sam_req_read(priv, privep, pktsize, bank); + sam_req_read(priv, privep, pktsize, bank); } /* Did we just receive the data associated with an OUT SETUP command? */ @@ -1920,7 +1920,7 @@ static void sam_ep_bankinterrupt(struct sam_usbdev_s *priv, usbtrace(TRACE_DEVERROR(SAM_TRACEERR_EP0SETUPOUTSIZE), pktsize); sam_csr_clrbits(EP0, UDPEP_CSR_RXDATABK0); - (void)sam_ep_stall(privep); + sam_ep_stall(privep); } } @@ -1995,7 +1995,7 @@ static void sam_ep_interrupt(struct sam_usbdev_s *priv, int epno) /* Continue/resume processing the write requests */ privep->epstate = UDP_EPSTATE_IDLE; - (void)sam_req_write(priv, privep); + sam_req_write(priv, privep); } /* Setting of the device address is a special case. The address was @@ -2706,7 +2706,7 @@ static int sam_ep_resume(struct sam_ep_s *privep) { /* IN endpoint (or EP0). Restart any queued write requests */ - (void)sam_req_write(priv, privep); + sam_req_write(priv, privep); } } diff --git a/arch/arm/src/sam34/sam_wdt.c b/arch/arm/src/sam34/sam_wdt.c index 97b6d9a056..53a0755b26 100644 --- a/arch/arm/src/sam34/sam_wdt.c +++ b/arch/arm/src/sam34/sam_wdt.c @@ -681,7 +681,7 @@ void sam_wdtinitialize(FAR const char *devpath) /* Attach our EWI interrupt handler (But don't enable it yet) */ - (void)irq_attach(SAM_IRQ_WDT, sam34_interrupt, NULL); + irq_attach(SAM_IRQ_WDT, sam34_interrupt, NULL); /* Select an arbitrary initial timeout value. But don't start the watchdog * yet. NOTE: If the "Hardware watchdog" feature is enabled through the @@ -699,7 +699,7 @@ void sam_wdtinitialize(FAR const char *devpath) * (default /dev/watchdog0). */ - (void)watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv); + watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv); } #endif /* CONFIG_WDT_DISABLE_ON_RESET */ diff --git a/arch/arm/src/sama5/sam_adc.c b/arch/arm/src/sama5/sam_adc.c index f9b603324e..cbb3ec6b74 100644 --- a/arch/arm/src/sama5/sam_adc.c +++ b/arch/arm/src/sama5/sam_adc.c @@ -2145,21 +2145,8 @@ struct adc_dev_s *sam_adc_initialize(void) void sam_adc_lock(FAR struct sam_adc_s *priv) { - int ret; - ainfo("Locking\n"); - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* This should only fail if the wait was canceled by an signal - * (and the worker thread will receive a lot of signals). - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); } /**************************************************************************** diff --git a/arch/arm/src/sama5/sam_can.c b/arch/arm/src/sama5/sam_can.c index 86278d1a07..fb60e08483 100644 --- a/arch/arm/src/sama5/sam_can.c +++ b/arch/arm/src/sama5/sam_can.c @@ -558,19 +558,7 @@ static void can_dumpmbregs(FAR struct sam_can_s *priv, FAR const char *msg) static void can_semtake(FAR struct sam_can_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal. - */ - - do - { - ret = nxsem_wait(&priv->exclsem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); } /**************************************************************************** diff --git a/arch/arm/src/sama5/sam_dbgu.c b/arch/arm/src/sama5/sam_dbgu.c index 18f3503370..81294c4ab0 100644 --- a/arch/arm/src/sama5/sam_dbgu.c +++ b/arch/arm/src/sama5/sam_dbgu.c @@ -608,12 +608,12 @@ void sam_dbgu_register(void) /* Register the console */ #ifdef CONFIG_SAMA5_DBGU_CONSOLE - (void)uart_register("/dev/console", &g_dbgu_port); + uart_register("/dev/console", &g_dbgu_port); #endif /* Register the DBGU serial device */ - (void)uart_register("/dev/ttyDBGU", &g_dbgu_port); + uart_register("/dev/ttyDBGU", &g_dbgu_port); } #endif /* USE_SERIALDRIVER */ @@ -632,8 +632,8 @@ void sam_dbgu_initialize(void) { /* Initialize DBGU pins */ - (void)sam_configpio(PIO_DBGU_DRXD); - (void)sam_configpio(PIO_DBGU_DTXD); + sam_configpio(PIO_DBGU_DRXD); + sam_configpio(PIO_DBGU_DTXD); #if defined(USE_SERIALDRIVER) /* Initialize the DBGU device driver */ diff --git a/arch/arm/src/sama5/sam_dmac.c b/arch/arm/src/sama5/sam_dmac.c index 46aec6b848..54c7d94760 100644 --- a/arch/arm/src/sama5/sam_dmac.c +++ b/arch/arm/src/sama5/sam_dmac.c @@ -486,26 +486,12 @@ static struct sam_dmac_s g_dmac1 = static void sam_takechsem(struct sam_dmac_s *dmac) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&dmac->chsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&dmac->chsem); } static inline void sam_givechsem(struct sam_dmac_s *dmac) { - (void)nxsem_post(&dmac->chsem); + nxsem_post(&dmac->chsem); } /**************************************************************************** @@ -518,26 +504,12 @@ static inline void sam_givechsem(struct sam_dmac_s *dmac) static void sam_takedsem(struct sam_dmac_s *dmac) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&dmac->dsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&dmac->dsem); } static inline void sam_givedsem(struct sam_dmac_s *dmac) { - (void)nxsem_post(&dmac->dsem); + nxsem_post(&dmac->dsem); } /**************************************************************************** @@ -1627,7 +1599,7 @@ static inline int sam_single(struct sam_dmach_s *dmach) * the interrupt status register. */ - (void)sam_getdmac(dmac, SAM_DMAC_EBCISR_OFFSET); + sam_getdmac(dmac, SAM_DMAC_EBCISR_OFFSET); /* Write the starting source address in the SADDR register */ @@ -1701,7 +1673,7 @@ static inline int sam_multiple(struct sam_dmach_s *dmach) * the status register */ - (void)sam_getdmac(dmac, SAM_DMAC_EBCISR_OFFSET); + sam_getdmac(dmac, SAM_DMAC_EBCISR_OFFSET); /* Set up the initial CTRLA register */ @@ -1918,7 +1890,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vector */ - (void)irq_attach(SAM_IRQ_DMAC0, sam_dmac_interrupt, &g_dmac0); + irq_attach(SAM_IRQ_DMAC0, sam_dmac_interrupt, &g_dmac0); /* Initialize the controller */ @@ -1938,7 +1910,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vector */ - (void)irq_attach(SAM_IRQ_DMAC1, sam_dmac_interrupt, &g_dmac1); + irq_attach(SAM_IRQ_DMAC1, sam_dmac_interrupt, &g_dmac1); /* Initialize the controller */ @@ -2015,7 +1987,7 @@ DMA_HANDLE sam_dmachannel(uint8_t dmacno, uint32_t chflags) * channel */ - (void)sam_getdmac(dmac, SAM_DMAC_EBCISR_OFFSET); + sam_getdmac(dmac, SAM_DMAC_EBCISR_OFFSET); /* Disable the channel by writing one to the write-only channel * disable register diff --git a/arch/arm/src/sama5/sam_ehci.c b/arch/arm/src/sama5/sam_ehci.c index 6f631946b9..4d1ada715d 100644 --- a/arch/arm/src/sama5/sam_ehci.c +++ b/arch/arm/src/sama5/sam_ehci.c @@ -817,21 +817,7 @@ static int ehci_wait_usbsts(uint32_t maskbits, uint32_t donebits, static void sam_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -1468,7 +1454,7 @@ static void sam_qh_enqueue(struct sam_qh_s *qhead, struct sam_qh_s *qh) */ qh->fqp = qh->hw.overlay.nqp; - (void)sam_qh_dump(qh, NULL, NULL); + sam_qh_dump(qh, NULL, NULL); /* Add the new QH to the head of the asynchronous queue list. * diff --git a/arch/arm/src/sama5/sam_emaca.c b/arch/arm/src/sama5/sam_emaca.c index 7adbd832d3..d6ee3295f5 100644 --- a/arch/arm/src/sama5/sam_emaca.c +++ b/arch/arm/src/sama5/sam_emaca.c @@ -816,8 +816,8 @@ static int sam_transmit(struct sam_emac_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1, - (uint32_t)priv); + wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1, + (uint32_t)priv); /* Set d_len to zero meaning that the d_buf[] packet buffer is again * available. @@ -959,7 +959,7 @@ static void sam_dopoll(struct sam_emac_s *priv) { /* If we have the descriptor, then poll the network for new XMIT data. */ - (void)devif_poll(dev, sam_txpoll); + devif_poll(dev, sam_txpoll); } } @@ -1808,12 +1808,12 @@ static void sam_poll_work(FAR void *arg) { /* Update TCP timing states and poll the network for new XMIT data. */ - (void)devif_timer(dev, SAM_WDDELAY, sam_txpoll); + devif_timer(dev, SAM_WDDELAY, sam_txpoll); } /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); + wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); net_unlock(); } @@ -1912,7 +1912,7 @@ static int sam_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, (uint32_t)priv); + wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, (uint32_t)priv); /* Enable the EMAC interrupt */ @@ -3545,7 +3545,7 @@ static void sam_ipv6multicast(struct sam_emac_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)sam_addmac(dev, mac); + sam_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -3553,7 +3553,7 @@ static void sam_ipv6multicast(struct sam_emac_s *priv) * packets. */ - (void)sam_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + sam_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -3562,7 +3562,7 @@ static void sam_ipv6multicast(struct sam_emac_s *priv) * packets. */ - (void)sam_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + sam_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -3612,7 +3612,7 @@ static int sam_emac_configure(struct sam_emac_s *priv) /* Clear any pending interrupts */ - (void)sam_getreg(priv, SAM_EMAC_ISR); + sam_getreg(priv, SAM_EMAC_ISR); /* Enable/disable the copy of data into the buffers, ignore broadcasts. * Don't copy FCS. diff --git a/arch/arm/src/sama5/sam_emacb.c b/arch/arm/src/sama5/sam_emacb.c index cd15d048dc..3fd9fac15d 100644 --- a/arch/arm/src/sama5/sam_emacb.c +++ b/arch/arm/src/sama5/sam_emacb.c @@ -1151,8 +1151,8 @@ static int sam_transmit(struct sam_emac_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1, - (uint32_t)priv); + wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1, + (uint32_t)priv); /* Set d_len to zero meaning that the d_buf[] packet buffer is again * available. @@ -1295,7 +1295,7 @@ static void sam_dopoll(struct sam_emac_s *priv) { /* If we have the descriptor, then poll the network for new XMIT data. */ - (void)devif_poll(dev, sam_txpoll); + devif_poll(dev, sam_txpoll); } } @@ -2169,12 +2169,12 @@ static void sam_poll_work(FAR void *arg) { /* Update TCP timing states and poll the network for new XMIT data. */ - (void)devif_timer(dev, SAM_WDDELAY, sam_txpoll); + devif_timer(dev, SAM_WDDELAY, sam_txpoll); } /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); + wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); net_unlock(); } @@ -2281,7 +2281,7 @@ static int sam_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, (uint32_t)priv); + wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, (uint32_t)priv); /* Enable the EMAC interrupt */ @@ -4193,7 +4193,7 @@ static void sam_ipv6multicast(struct sam_emac_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)sam_addmac(dev, mac); + sam_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -4201,7 +4201,7 @@ static void sam_ipv6multicast(struct sam_emac_s *priv) * packets. */ - (void)sam_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + sam_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -4210,7 +4210,7 @@ static void sam_ipv6multicast(struct sam_emac_s *priv) * packets. */ - (void)sam_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + sam_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -4260,7 +4260,7 @@ static int sam_emac_configure(struct sam_emac_s *priv) /* Clear any pending interrupts */ - (void)sam_getreg(priv, SAM_EMAC_ISR_OFFSET); + sam_getreg(priv, SAM_EMAC_ISR_OFFSET); /* Enable/disable the copy of data into the buffers, ignore broadcasts. * Don't copy FCS. diff --git a/arch/arm/src/sama5/sam_flexcom_serial.c b/arch/arm/src/sama5/sam_flexcom_serial.c index 8a36fff8ec..54076cad30 100644 --- a/arch/arm/src/sama5/sam_flexcom_serial.c +++ b/arch/arm/src/sama5/sam_flexcom_serial.c @@ -1211,25 +1211,25 @@ void flexus_serialinit(void) /* Register the console */ #ifdef SAMA5_HAVE_FLEXCOM_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs/USARTs */ #ifdef TTYFC0_DEV - (void)uart_register("/dev/ttyFC0", &TTYFC0_DEV); + uart_register("/dev/ttyFC0", &TTYFC0_DEV); #endif #ifdef TTYFC1_DEV - (void)uart_register("/dev/ttyFC1", &TTYFC1_DEV); + uart_register("/dev/ttyFC1", &TTYFC1_DEV); #endif #ifdef TTYFC2_DEV - (void)uart_register("/dev/ttyFC2", &TTYFC2_DEV); + uart_register("/dev/ttyFC2", &TTYFC2_DEV); #endif #ifdef TTYFC3_DEV - (void)uart_register("/dev/ttyFC3", &TTYFC3_DEV); + uart_register("/dev/ttyFC3", &TTYFC3_DEV); #endif #ifdef TTYFC4_DEV - (void)uart_register("/dev/ttyFC4", &TTYFC4_DEV); + uart_register("/dev/ttyFC4", &TTYFC4_DEV); #endif } diff --git a/arch/arm/src/sama5/sam_freerun.c b/arch/arm/src/sama5/sam_freerun.c index 088cb10a6e..1b8b7d0441 100644 --- a/arch/arm/src/sama5/sam_freerun.c +++ b/arch/arm/src/sama5/sam_freerun.c @@ -188,8 +188,8 @@ int sam_freerun_initialize(struct sam_freerun_s *freerun, int chan, /* Set up to receive the callback when the counter overflow occurs */ - (void)sam_tc_attach(freerun->tch, sam_freerun_handler, freerun, - TC_INT_COVFS); + sam_tc_attach(freerun->tch, sam_freerun_handler, freerun, + TC_INT_COVFS); /* Start the counter */ diff --git a/arch/arm/src/sama5/sam_gmac.c b/arch/arm/src/sama5/sam_gmac.c index a05cac8c46..d597589b7e 100644 --- a/arch/arm/src/sama5/sam_gmac.c +++ b/arch/arm/src/sama5/sam_gmac.c @@ -748,8 +748,8 @@ static int sam_transmit(struct sam_gmac_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1, - (uint32_t)priv); + wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1, + (uint32_t)priv); /* Set d_len to zero meaning that the d_buf[] packet buffer is again * available. @@ -891,7 +891,7 @@ static void sam_dopoll(struct sam_gmac_s *priv) { /* If we have the descriptor, then poll the network for new XMIT data. */ - (void)devif_poll(dev, sam_txpoll); + devif_poll(dev, sam_txpoll); } } @@ -1760,12 +1760,12 @@ static void sam_poll_work(FAR void *arg) { /* Update TCP timing states and poll the network for new XMIT data. */ - (void)devif_timer(dev, SAM_WDDELAY, sam_txpoll); + devif_timer(dev, SAM_WDDELAY, sam_txpoll); } /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); + wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); net_unlock(); } @@ -1867,7 +1867,7 @@ static int sam_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, (uint32_t)priv); + wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, (uint32_t)priv); /* Enable the GMAC interrupt */ @@ -3593,7 +3593,7 @@ static void sam_ipv6multicast(struct sam_gmac_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)sam_addmac(dev, mac); + sam_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -3601,7 +3601,7 @@ static void sam_ipv6multicast(struct sam_gmac_s *priv) * packets. */ - (void)sam_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + sam_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -3610,7 +3610,7 @@ static void sam_ipv6multicast(struct sam_gmac_s *priv) * packets. */ - (void)sam_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + sam_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -3661,7 +3661,7 @@ static int sam_gmac_configure(struct sam_gmac_s *priv) /* Clear any pending interrupts */ - (void)sam_getreg(priv, SAM_GMAC_ISR); + sam_getreg(priv, SAM_GMAC_ISR); /* Initial configuration: * diff --git a/arch/arm/src/sama5/sam_hsmci.c b/arch/arm/src/sama5/sam_hsmci.c index 966c0f442d..f51c184ca5 100644 --- a/arch/arm/src/sama5/sam_hsmci.c +++ b/arch/arm/src/sama5/sam_hsmci.c @@ -678,21 +678,7 @@ static struct sam_dev_s g_hsmci2; static void sam_takesem(struct sam_dev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->waitsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -1370,7 +1356,7 @@ static void sam_endwait(struct sam_dev_s *priv, sdio_eventset_t wkupevent) { /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Disable event-related interrupts and save wakeup event */ @@ -1952,7 +1938,7 @@ static int sam_attach(FAR struct sdio_dev_s *dev) */ sam_putreg(priv, 0xffffffff, SAM_HSMCI_IDR_OFFSET); - (void)sam_getreg(priv, SAM_HSMCI_SR_OFFSET); + sam_getreg(priv, SAM_HSMCI_SR_OFFSET); /* Enable HSMCI interrupts at the NVIC. They can now be enabled at * the HSMCI controller as needed. @@ -2301,11 +2287,11 @@ static int sam_cancel(FAR struct sdio_dev_s *dev) /* Clearing (most) pending interrupt status by reading the status register */ - (void)sam_getreg(priv, SAM_HSMCI_SR_OFFSET); + sam_getreg(priv, SAM_HSMCI_SR_OFFSET); /* Cancel any watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Make sure that the DMA is stopped (it will be stopped automatically * on normal transfers, but not necessarily when the transfer terminates @@ -2663,7 +2649,7 @@ static void sam_waitenable(FAR struct sdio_dev_s *dev, * pending after this point must be valid event indications. */ - (void)sam_getreg(priv, SAM_HSMCI_SR_OFFSET); + sam_getreg(priv, SAM_HSMCI_SR_OFFSET); /* Wait interrupts are configured here, but not enabled until * sam_eventwait() is called. Why? Because the XFRDONE interrupt is diff --git a/arch/arm/src/sama5/sam_irq.c b/arch/arm/src/sama5/sam_irq.c index 81b56bf671..2ea6d67031 100644 --- a/arch/arm/src/sama5/sam_irq.c +++ b/arch/arm/src/sama5/sam_irq.c @@ -562,7 +562,7 @@ void up_irqinitialize(void) /* And finally, enable interrupts */ - (void)up_irq_enable(); + up_irq_enable(); #endif } diff --git a/arch/arm/src/sama5/sam_isi.c b/arch/arm/src/sama5/sam_isi.c index 86fa8e0dad..c845d1c1c2 100644 --- a/arch/arm/src/sama5/sam_isi.c +++ b/arch/arm/src/sama5/sam_isi.c @@ -124,23 +124,23 @@ int sam_isi_initialize(void) /* Configure PIO pins for the ISI (outputs) */ /* Data pins */ - (void)sam_configpio(PIO_ISI_D0); - (void)sam_configpio(PIO_ISI_D1); - (void)sam_configpio(PIO_ISI_D2); - (void)sam_configpio(PIO_ISI_D3); - (void)sam_configpio(PIO_ISI_D4); - (void)sam_configpio(PIO_ISI_D5); - (void)sam_configpio(PIO_ISI_D6); - (void)sam_configpio(PIO_ISI_D7); - (void)sam_configpio(PIO_ISI_D8); - (void)sam_configpio(PIO_ISI_D9); - (void)sam_configpio(PIO_ISI_D10); - (void)sam_configpio(PIO_ISI_D11); + sam_configpio(PIO_ISI_D0); + sam_configpio(PIO_ISI_D1); + sam_configpio(PIO_ISI_D2); + sam_configpio(PIO_ISI_D3); + sam_configpio(PIO_ISI_D4); + sam_configpio(PIO_ISI_D5); + sam_configpio(PIO_ISI_D6); + sam_configpio(PIO_ISI_D7); + sam_configpio(PIO_ISI_D8); + sam_configpio(PIO_ISI_D9); + sam_configpio(PIO_ISI_D10); + sam_configpio(PIO_ISI_D11); /* Horizontal and vertical sync pins (inputs) */ - (void)sam_configpio(PIO_ISI_HSYNC); - (void)sam_configpio(PIO_ISI_VSYNC); + sam_configpio(PIO_ISI_HSYNC); + sam_configpio(PIO_ISI_VSYNC); /* Pixel clock input (ISI_PCK, not to be confused with the processor clock * (PCK) or the programmable clock (PCK). @@ -151,7 +151,7 @@ int sam_isi_initialize(void) * Image Sensor Controller." */ - (void)sam_configpio(PIO_ISI_PCK); + sam_configpio(PIO_ISI_PCK); /* Configure ISI_MCK programmable clock output. * diff --git a/arch/arm/src/sama5/sam_lowputc.c b/arch/arm/src/sama5/sam_lowputc.c index 3ea72de827..89e0c86fb5 100644 --- a/arch/arm/src/sama5/sam_lowputc.c +++ b/arch/arm/src/sama5/sam_lowputc.c @@ -412,82 +412,82 @@ void sam_lowsetup(void) */ #ifdef CONFIG_SAMA5_UART0 - (void)sam_configpio(PIO_UART0_RXD); - (void)sam_configpio(PIO_UART0_TXD); + sam_configpio(PIO_UART0_RXD); + sam_configpio(PIO_UART0_TXD); #endif #ifdef CONFIG_SAMA5_UART1 - (void)sam_configpio(PIO_UART1_RXD); - (void)sam_configpio(PIO_UART1_TXD); + sam_configpio(PIO_UART1_RXD); + sam_configpio(PIO_UART1_TXD); #endif #ifdef CONFIG_SAMA5_UART2 - (void)sam_configpio(PIO_UART2_RXD); - (void)sam_configpio(PIO_UART2_TXD); + sam_configpio(PIO_UART2_RXD); + sam_configpio(PIO_UART2_TXD); #endif #ifdef CONFIG_SAMA5_UART3 - (void)sam_configpio(PIO_UART3_RXD); - (void)sam_configpio(PIO_UART3_TXD); + sam_configpio(PIO_UART3_RXD); + sam_configpio(PIO_UART3_TXD); #endif #ifdef CONFIG_SAMA5_UART4 - (void)sam_configpio(PIO_UART4_RXD); - (void)sam_configpio(PIO_UART4_TXD); + sam_configpio(PIO_UART4_RXD); + sam_configpio(PIO_UART4_TXD); #endif #if defined(CONFIG_USART0_SERIALDRIVER) && defined(CONFIG_SAMA5_USART0) - (void)sam_configpio(PIO_USART0_RXD); - (void)sam_configpio(PIO_USART0_TXD); + sam_configpio(PIO_USART0_RXD); + sam_configpio(PIO_USART0_TXD); #ifdef CONFIG_USART0_OFLOWCONTROL - (void)sam_configpio(PIO_USART0_CTS); + sam_configpio(PIO_USART0_CTS); #endif #ifdef CONFIG_USART0_IFLOWCONTROL - (void)sam_configpio(PIO_USART0_RTS); + sam_configpio(PIO_USART0_RTS); #endif #endif #if defined(CONFIG_USART1_SERIALDRIVER) && defined(CONFIG_SAMA5_USART1) - (void)sam_configpio(PIO_USART1_RXD); - (void)sam_configpio(PIO_USART1_TXD); + sam_configpio(PIO_USART1_RXD); + sam_configpio(PIO_USART1_TXD); #ifdef CONFIG_USART1_OFLOWCONTROL - (void)sam_configpio(PIO_USART1_CTS); + sam_configpio(PIO_USART1_CTS); #endif #ifdef CONFIG_USART1_IFLOWCONTROL - (void)sam_configpio(PIO_USART1_RTS); + sam_configpio(PIO_USART1_RTS); #endif #endif #if defined(CONFIG_USART2_SERIALDRIVER) && defined(CONFIG_SAMA5_USART2) - (void)sam_configpio(PIO_USART2_RXD); - (void)sam_configpio(PIO_USART2_TXD); + sam_configpio(PIO_USART2_RXD); + sam_configpio(PIO_USART2_TXD); #ifdef CONFIG_USART2_OFLOWCONTROL - (void)sam_configpio(PIO_USART2_CTS); + sam_configpio(PIO_USART2_CTS); #endif #ifdef CONFIG_USART2_IFLOWCONTROL - (void)sam_configpio(PIO_USART2_RTS); + sam_configpio(PIO_USART2_RTS); #endif #endif #if defined(CONFIG_USART3_SERIALDRIVER) && defined(CONFIG_SAMA5_USART3) - (void)sam_configpio(PIO_USART3_RXD); - (void)sam_configpio(PIO_USART3_TXD); + sam_configpio(PIO_USART3_RXD); + sam_configpio(PIO_USART3_TXD); #ifdef CONFIG_USART3_OFLOWCONTROL - (void)sam_configpio(PIO_USART3_CTS); + sam_configpio(PIO_USART3_CTS); #endif #ifdef CONFIG_USART3_IFLOWCONTROL - (void)sam_configpio(PIO_USART3_RTS); + sam_configpio(PIO_USART3_RTS); #endif #endif #if defined(CONFIG_USART4_SERIALDRIVER) && defined(CONFIG_SAMA5_USART4) - (void)sam_configpio(PIO_USART4_RXD); - (void)sam_configpio(PIO_USART4_TXD); + sam_configpio(PIO_USART4_RXD); + sam_configpio(PIO_USART4_TXD); #ifdef CONFIG_USART4_OFLOWCONTROL - (void)sam_configpio(PIO_USART4_CTS); + sam_configpio(PIO_USART4_CTS); #endif #ifdef CONFIG_USART4_IFLOWCONTROL - (void)sam_configpio(PIO_USART4_RTS); + sam_configpio(PIO_USART4_RTS); #endif #endif @@ -501,57 +501,57 @@ void sam_lowsetup(void) */ #if defined(CONFIG_USART0_SERIALDRIVER) && defined(CONFIG_SAMA5_FLEXCOM0_USART) - (void)sam_configpio(PIO_FLEXCOM0_IO0); - (void)sam_configpio(PIO_FLEXCOM0_IO1); + sam_configpio(PIO_FLEXCOM0_IO0); + sam_configpio(PIO_FLEXCOM0_IO1); #ifdef CONFIG_USART0_OFLOWCONTROL - (void)sam_configpio(PIO_FLEXCOM0_IO3); + sam_configpio(PIO_FLEXCOM0_IO3); #endif #ifdef CONFIG_USART0_IFLOWCONTROL - (void)sam_configpio(PIO_FLEXCOM0_IO4); + sam_configpio(PIO_FLEXCOM0_IO4); #endif #endif #if defined(CONFIG_USART1_SERIALDRIVER) && defined(CONFIG_SAMA5_FLEXCOM1_USART) - (void)sam_configpio(PIO_FLEXCOM1_IO0); - (void)sam_configpio(PIO_FLEXCOM1_IO1); + sam_configpio(PIO_FLEXCOM1_IO0); + sam_configpio(PIO_FLEXCOM1_IO1); #ifdef CONFIG_USART1_OFLOWCONTROL - (void)sam_configpio(PIO_FLEXCOM1_IO3); + sam_configpio(PIO_FLEXCOM1_IO3); #endif #ifdef CONFIG_USART1_IFLOWCONTROL - (void)sam_configpio(PIO_FLEXCOM1_IO4); + sam_configpio(PIO_FLEXCOM1_IO4); #endif #endif #if defined(CONFIG_USART2_SERIALDRIVER) && defined(CONFIG_SAMA5_FLEXCOM2_USART) - (void)sam_configpio(PIO_FLEXCOM2_IO0); - (void)sam_configpio(PIO_FLEXCOM2_IO1); + sam_configpio(PIO_FLEXCOM2_IO0); + sam_configpio(PIO_FLEXCOM2_IO1); #ifdef CONFIG_USART2_OFLOWCONTROL - (void)sam_configpio(PIO_FLEXCOM2_IO3); + sam_configpio(PIO_FLEXCOM2_IO3); #endif #ifdef CONFIG_USART2_IFLOWCONTROL - (void)sam_configpio(PIO_FLEXCOM2_IO4); + sam_configpio(PIO_FLEXCOM2_IO4); #endif #endif #if defined(CONFIG_USART3_SERIALDRIVER) && defined(CONFIG_SAMA5_FLEXCOM3_USART) - (void)sam_configpio(PIO_FLEXCOM3_IO0); - (void)sam_configpio(PIO_FLEXCOM3_IO1); + sam_configpio(PIO_FLEXCOM3_IO0); + sam_configpio(PIO_FLEXCOM3_IO1); #ifdef CONFIG_USART3_OFLOWCONTROL - (void)sam_configpio(PIO_FLEXCOM3_IO3); + sam_configpio(PIO_FLEXCOM3_IO3); #endif #ifdef CONFIG_USART3_IFLOWCONTROL - (void)sam_configpio(PIO_FLEXCOM3_IO4); + sam_configpio(PIO_FLEXCOM3_IO4); #endif #endif #if defined(CONFIG_USART4_SERIALDRIVER) && defined(CONFIG_SAMA5_FLEXCOM4_USART) - (void)sam_configpio(PIO_FLEXCOM4_IO0); - (void)sam_configpio(PIO_FLEXCOM4_IO1); + sam_configpio(PIO_FLEXCOM4_IO0); + sam_configpio(PIO_FLEXCOM4_IO1); #ifdef CONFIG_USART4_OFLOWCONTROL - (void)sam_configpio(PIO_FLEXCOM4_IO3); + sam_configpio(PIO_FLEXCOM4_IO3); #endif #ifdef CONFIG_USART4_IFLOWCONTROL - (void)sam_configpio(PIO_FLEXCOM4_IO4); + sam_configpio(PIO_FLEXCOM4_IO4); #endif #endif diff --git a/arch/arm/src/sama5/sam_nand.c b/arch/arm/src/sama5/sam_nand.c index 3f1bc5bd84..17e44327c3 100644 --- a/arch/arm/src/sama5/sam_nand.c +++ b/arch/arm/src/sama5/sam_nand.c @@ -313,14 +313,7 @@ struct sam_nand_s g_nand; #if NAND_NBANKS > 1 void nand_lock(void) { - int ret; - - do - { - ret = nxsem_wait(&g_nand.exclsem); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_nand.exclsem); } #endif @@ -681,15 +674,13 @@ static void nand_wait_cmddone(struct sam_nandcs_s *priv) { #ifdef CONFIG_SAMA5_NAND_HSMCINTERRUPTS irqstate_t flags; - int ret; /* Wait for the CMDDONE interrupt to occur */ flags = enter_critical_section(); do { - ret = nxsem_wait(&g_nand.waitsem); - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&g_nand.waitsem); } while (!g_nand.cmddone); @@ -703,7 +694,7 @@ static void nand_wait_cmddone(struct sam_nandcs_s *priv) do { - (void)nand_nfc_poll(); + nand_nfc_poll(); } while (!g_nand.cmddone); #endif @@ -746,7 +737,7 @@ static void nand_setup_cmddone(struct sam_nandcs_s *priv) #else /* Just sample and clear any pending NFC status, then clear CMDDONE status */ - (void)nand_nfc_poll(); + nand_nfc_poll(); g_nand.cmddone = false; #endif } @@ -769,15 +760,13 @@ static void nand_wait_xfrdone(struct sam_nandcs_s *priv) { #ifdef CONFIG_SAMA5_NAND_HSMCINTERRUPTS irqstate_t flags; - int ret; /* Wait for the XFRDONE interrupt to occur */ flags = enter_critical_section(); do { - ret = nxsem_wait(&g_nand.waitsem); - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&g_nand.waitsem); } while (!g_nand.xfrdone); @@ -791,7 +780,7 @@ static void nand_wait_xfrdone(struct sam_nandcs_s *priv) do { - (void)nand_nfc_poll(); + nand_nfc_poll(); } while (!g_nand.xfrdone); #endif @@ -834,7 +823,7 @@ static void nand_setup_xfrdone(struct sam_nandcs_s *priv) #else /* Just sample and clear any pending NFC status, then clear XFRDONE status */ - (void)nand_nfc_poll(); + nand_nfc_poll(); g_nand.xfrdone = false; #endif } @@ -857,15 +846,13 @@ static void nand_wait_rbedge(struct sam_nandcs_s *priv) { #ifdef CONFIG_SAMA5_NAND_HSMCINTERRUPTS irqstate_t flags; - int ret; /* Wait for the RBEDGE0 interrupt to occur */ flags = enter_critical_section(); do { - ret = nxsem_wait(&g_nand.waitsem); - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&g_nand.waitsem); } while (!g_nand.rbedge); @@ -879,7 +866,7 @@ static void nand_wait_rbedge(struct sam_nandcs_s *priv) do { - (void)nand_nfc_poll(); + nand_nfc_poll(); } while (!g_nand.rbedge); #endif @@ -922,7 +909,7 @@ static void nand_setup_rbedge(struct sam_nandcs_s *priv) #else /* Just sample and clear any pending NFC status, then clear RBEDGE0 status */ - (void)nand_nfc_poll(); + nand_nfc_poll(); g_nand.rbedge = false; #endif } @@ -1213,12 +1200,9 @@ static void nand_dma_sampledone(struct sam_nandcs_s *priv, int result) #ifdef CONFIG_SAMA5_NAND_DMA static int nand_wait_dma(struct sam_nandcs_s *priv) { - int ret; - while (!priv->dmadone) { - ret = nxsem_wait(&priv->waitsem); - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } finfo("Awakened: result=%d\n", priv->result); diff --git a/arch/arm/src/sama5/sam_ohci.c b/arch/arm/src/sama5/sam_ohci.c index 1cc36af7b7..fb3da59dda 100644 --- a/arch/arm/src/sama5/sam_ohci.c +++ b/arch/arm/src/sama5/sam_ohci.c @@ -642,21 +642,7 @@ static void sam_putreg(uint32_t val, uint32_t addr) static void sam_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -1590,8 +1576,8 @@ static int sam_ep0enqueue(struct sam_rhport_s *rhport) */ memset(edctrl, 0, sizeof(struct sam_ed_s)); - (void)sam_ep0configure(&rhport->drvr, &rhport->ep0, 0, - rhport->hport.hport.speed, 8); + sam_ep0configure(&rhport->drvr, &rhport->ep0, 0, + rhport->hport.hport.speed, 8); edctrl->hw.ctrl |= ED_CONTROL_K; edctrl->eplist = &rhport->ep0; diff --git a/arch/arm/src/sama5/sam_oneshot.c b/arch/arm/src/sama5/sam_oneshot.c index 1bab862afa..b81cc1bbb7 100644 --- a/arch/arm/src/sama5/sam_oneshot.c +++ b/arch/arm/src/sama5/sam_oneshot.c @@ -289,7 +289,7 @@ int sam_oneshot_start(struct sam_oneshot_s *oneshot, /* Yes.. then cancel it */ tmrinfo("Already running... cancelling\n"); - (void)sam_oneshot_cancel(oneshot, freerun, NULL); + sam_oneshot_cancel(oneshot, freerun, NULL); } /* Save the new handler and its argument */ @@ -315,8 +315,8 @@ int sam_oneshot_start(struct sam_oneshot_s *oneshot, /* Set up to receive the callback when the interrupt occurs */ - (void)sam_tc_attach(oneshot->tch, sam_oneshot_handler, oneshot, - TC_INT_CPCS); + sam_tc_attach(oneshot->tch, sam_oneshot_handler, oneshot, + TC_INT_CPCS); /* Set RC so that an event will be triggered when TC_CV register counts * up to RC. diff --git a/arch/arm/src/sama5/sam_pck.c b/arch/arm/src/sama5/sam_pck.c index fc63e80425..6fe8b667ad 100644 --- a/arch/arm/src/sama5/sam_pck.c +++ b/arch/arm/src/sama5/sam_pck.c @@ -229,7 +229,7 @@ uint32_t sam_pck_configure(enum pckid_e pckid, enum pckid_clksrc_e clksrc, case PCK0: putreg32(PMC_PCK0, SAM_PMC_SCDR); #ifdef PIO_PMC_PCK0 - (void)sam_configpio(PIO_PMC_PCK0); + sam_configpio(PIO_PMC_PCK0); #endif putreg32(regval, SAM_PMC_PCK0); break; @@ -237,7 +237,7 @@ uint32_t sam_pck_configure(enum pckid_e pckid, enum pckid_clksrc_e clksrc, case PCK1: putreg32(PMC_PCK1, SAM_PMC_SCDR); #ifdef PIO_PMC_PCK1 - (void)sam_configpio(PIO_PMC_PCK1); + sam_configpio(PIO_PMC_PCK1); #endif putreg32(regval, SAM_PMC_PCK1); break; @@ -245,7 +245,7 @@ uint32_t sam_pck_configure(enum pckid_e pckid, enum pckid_clksrc_e clksrc, case PCK2: putreg32(PMC_PCK2, SAM_PMC_SCDR); #ifdef PIO_PMC_PCK2 - (void)sam_configpio(PIO_PMC_PCK2); + sam_configpio(PIO_PMC_PCK2); #endif putreg32(regval, SAM_PMC_PCK2); break; diff --git a/arch/arm/src/sama5/sam_pioirq.c b/arch/arm/src/sama5/sam_pioirq.c index 36dc7d61c3..9bc2888480 100644 --- a/arch/arm/src/sama5/sam_pioirq.c +++ b/arch/arm/src/sama5/sam_pioirq.c @@ -267,12 +267,12 @@ void sam_pioirqinitialize(void) /* Clear and disable all PIOA interrupts */ - (void)getreg32(SAM_PIOA_ISR); + getreg32(SAM_PIOA_ISR); putreg32(0xffffffff, SAM_PIOA_IDR); /* Attach and enable the PIOA IRQ */ - (void)irq_attach(SAM_IRQ_PIOA, sam_pioainterrupt, NULL); + irq_attach(SAM_IRQ_PIOA, sam_pioainterrupt, NULL); up_enable_irq(SAM_IRQ_PIOA); #endif @@ -285,12 +285,12 @@ void sam_pioirqinitialize(void) /* Clear and disable all PIOB interrupts */ - (void)getreg32(SAM_PIOB_ISR); + getreg32(SAM_PIOB_ISR); putreg32(0xffffffff, SAM_PIOB_IDR); /* Attach and enable the PIOB IRQ */ - (void)irq_attach(SAM_IRQ_PIOB, sam_piobinterrupt, NULL); + irq_attach(SAM_IRQ_PIOB, sam_piobinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOB); #endif @@ -303,12 +303,12 @@ void sam_pioirqinitialize(void) /* Clear and disable all PIOC interrupts */ - (void)getreg32(SAM_PIOC_ISR); + getreg32(SAM_PIOC_ISR); putreg32(0xffffffff, SAM_PIOC_IDR); /* Attach and enable the PIOC IRQ */ - (void)irq_attach(SAM_IRQ_PIOC, sam_piocinterrupt, NULL); + irq_attach(SAM_IRQ_PIOC, sam_piocinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOC); #endif @@ -321,12 +321,12 @@ void sam_pioirqinitialize(void) /* Clear and disable all PIOD interrupts */ - (void)getreg32(SAM_PIOD_ISR); + getreg32(SAM_PIOD_ISR); putreg32(0xffffffff, SAM_PIOD_IDR); /* Attach and enable the PIOC IRQ */ - (void)irq_attach(SAM_IRQ_PIOD, sam_piodinterrupt, NULL); + irq_attach(SAM_IRQ_PIOD, sam_piodinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOD); #endif @@ -339,12 +339,12 @@ void sam_pioirqinitialize(void) /* Clear and disable all PIOE interrupts */ - (void)getreg32(SAM_PIOE_ISR); + getreg32(SAM_PIOE_ISR); putreg32(0xffffffff, SAM_PIOE_IDR); /* Attach and enable the PIOE IRQ */ - (void)irq_attach(SAM_IRQ_PIOE, sam_pioeinterrupt, NULL); + irq_attach(SAM_IRQ_PIOE, sam_pioeinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOE); #endif @@ -357,12 +357,12 @@ void sam_pioirqinitialize(void) /* Clear and disable all PIOF interrupts */ - (void)getreg32(SAM_PIOF_ISR); + getreg32(SAM_PIOF_ISR); putreg32(0xffffffff, SAM_PIOF_IDR); /* Attach and enable the PIOF IRQ */ - (void)irq_attach(SAM_IRQ_PIOF, sam_piofinterrupt, NULL); + irq_attach(SAM_IRQ_PIOF, sam_piofinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOF); #endif } diff --git a/arch/arm/src/sama5/sam_pmecc.c b/arch/arm/src/sama5/sam_pmecc.c index 75ff66279c..f9b6661e73 100644 --- a/arch/arm/src/sama5/sam_pmecc.c +++ b/arch/arm/src/sama5/sam_pmecc.c @@ -1236,14 +1236,7 @@ int pmecc_configure(struct sam_nandcs_s *priv, bool protected) #if NAND_NPMECC_BANKS > 1 void pmecc_lock(void) { - int ret; - - do - { - ret = nxsem_wait(&g_pmecc.exclsem); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_pmecc.exclsem); } #endif diff --git a/arch/arm/src/sama5/sam_pwm.c b/arch/arm/src/sama5/sam_pwm.c index c9589f9572..71cce715f5 100644 --- a/arch/arm/src/sama5/sam_pwm.c +++ b/arch/arm/src/sama5/sam_pwm.c @@ -873,17 +873,17 @@ static int pwm_setup(FAR struct pwm_lowerhalf_s *dev) if (chan->ohpincfg) { - (void)sam_configpio(chan->ohpincfg); + sam_configpio(chan->ohpincfg); } if (chan->olpincfg) { - (void)sam_configpio(chan->olpincfg); + sam_configpio(chan->olpincfg); } if (chan->fipincfg) { - (void)sam_configpio(chan->fipincfg); + sam_configpio(chan->fipincfg); } return OK; @@ -1267,17 +1267,17 @@ static void pwm_resetpins(FAR struct sam_pwm_chan_s *chan) { if (chan->ohpincfg) { - (void)sam_configpio(PWM_MKINPUT(chan->ohpincfg)); + sam_configpio(PWM_MKINPUT(chan->ohpincfg)); } if (chan->olpincfg) { - (void)sam_configpio(PWM_MKINPUT(chan->olpincfg)); + sam_configpio(PWM_MKINPUT(chan->olpincfg)); } if (chan->fipincfg) { - (void)sam_configpio(PWM_MKINPUT(chan->fipincfg)); + sam_configpio(PWM_MKINPUT(chan->fipincfg)); } } @@ -1404,8 +1404,8 @@ FAR struct pwm_lowerhalf_s *sam_pwminitialize(int channel) /* Clear any pending PWM interrupts */ - (void)pwm_getreg(chan, SAM_PWM_ISR1_OFFSET); - (void)pwm_getreg(chan, SAM_PWM_ISR2_OFFSET); + pwm_getreg(chan, SAM_PWM_ISR1_OFFSET); + pwm_getreg(chan, SAM_PWM_ISR2_OFFSET); /* Enable PWM interrupts at the AIC */ diff --git a/arch/arm/src/sama5/sam_rtc.c b/arch/arm/src/sama5/sam_rtc.c index b5a893b361..756530b259 100644 --- a/arch/arm/src/sama5/sam_rtc.c +++ b/arch/arm/src/sama5/sam_rtc.c @@ -471,7 +471,7 @@ int up_rtc_settime(FAR const struct timespec *tp) /* Break out the time values (note that the time is set only to units of seconds) */ - (void)gmtime_r(&tp->tv_sec, &newtime); + gmtime_r(&tp->tv_sec, &newtime); rtc_dumptime(&newtime, "Setting time"); /* Then write the broken out values to the RTC */ @@ -597,7 +597,7 @@ int sam_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback) * of seconds) */ - (void)gmtime_r(&tp->tv_sec, &newalarm); + gmtime_r(&tp->tv_sec, &newalarm); rtc_dumptime(&newalarm, "Setting alarm"); /* Then write the broken out values to the RTC */ diff --git a/arch/arm/src/sama5/sam_serial.c b/arch/arm/src/sama5/sam_serial.c index aaf26e7aee..4b1e3b50aa 100644 --- a/arch/arm/src/sama5/sam_serial.c +++ b/arch/arm/src/sama5/sam_serial.c @@ -1647,40 +1647,40 @@ void uart_serialinit(void) /* Register the console */ #if defined(SAMA5_HAVE_UART_CONSOLE) || defined(SAMA5_HAVE_USART_CONSOLE) - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs/USARTs */ #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #endif #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif #ifdef TTYS6_DEV - (void)uart_register("/dev/ttyS6", &TTYS6_DEV); + uart_register("/dev/ttyS6", &TTYS6_DEV); #endif #ifdef TTYS7_DEV - (void)uart_register("/dev/ttyS7", &TTYS7_DEV); + uart_register("/dev/ttyS7", &TTYS7_DEV); #endif #ifdef TTYS8_DEV - (void)uart_register("/dev/ttyS8", &TTYS8_DEV); + uart_register("/dev/ttyS8", &TTYS8_DEV); #endif #ifdef TTYS9_DEV - (void)uart_register("/dev/ttyS9", &TTYS9_DEV); + uart_register("/dev/ttyS9", &TTYS9_DEV); #endif } diff --git a/arch/arm/src/sama5/sam_spi.c b/arch/arm/src/sama5/sam_spi.c index a09f23bd17..8b955a2ecf 100644 --- a/arch/arm/src/sama5/sam_spi.c +++ b/arch/arm/src/sama5/sam_spi.c @@ -558,7 +558,7 @@ static inline void spi_flush(struct sam_spidev_s *spi) while ((spi_getreg(spi, SAM_SPI_SR_OFFSET) & SPI_INT_RDRF) != 0) { - (void)spi_getreg(spi, SAM_SPI_RDR_OFFSET); + spi_getreg(spi, SAM_SPI_RDR_OFFSET); } } @@ -762,7 +762,7 @@ static void spi_rxcallback(DMA_HANDLE handle, void *arg, int result) /* Cancel the watchdog timeout */ - (void)wd_cancel(spics->dmadog); + wd_cancel(spics->dmadog); /* Sample DMA registers at the time of the callback */ @@ -870,26 +870,11 @@ static int spi_lock(struct spi_dev_s *dev, bool lock) spiinfo("lock=%d\n", lock); if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&spi->spisem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&spi->spisem); } else { - (void)nxsem_post(&spi->spisem); - ret = OK; + ret = nxsem_post(&spi->spisem); } return ret; @@ -1527,17 +1512,15 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, /* Wait for the DMA complete */ - ret = nxsem_wait(&spics->dmawait); + ret = nxsem_wait_uninterruptible(&spics->dmawait); /* Cancel the watchdog timeout */ - (void)wd_cancel(spics->dmadog); + wd_cancel(spics->dmadog); - /* Check if we were awakened by an error of some kind. EINTR is not a - * failure. It simply means that the wait was awakened by a signal. - */ + /* Check if we were awakened by an error of some kind. */ - if (ret < 0 && ret != -EINTR) + if (ret < 0) { DEBUGPANIC(); return; @@ -1800,8 +1783,8 @@ struct spi_dev_s *sam_spibus_initialize(int port) /* Flush any pending transfers */ - (void)spi_getreg(spi, SAM_SPI_SR_OFFSET); - (void)spi_getreg(spi, SAM_SPI_RDR_OFFSET); + spi_getreg(spi, SAM_SPI_SR_OFFSET); + spi_getreg(spi, SAM_SPI_RDR_OFFSET); /* Initialize the SPI semaphore that enforces mutually exclusive * access to the SPI registers. diff --git a/arch/arm/src/sama5/sam_ssc.c b/arch/arm/src/sama5/sam_ssc.c index 9872adcee7..d18d98210a 100644 --- a/arch/arm/src/sama5/sam_ssc.c +++ b/arch/arm/src/sama5/sam_ssc.c @@ -888,19 +888,7 @@ static void ssc_dump_queues(struct sam_transport_s *xpt, const char *msg) static void ssc_exclsem_take(struct sam_ssc_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal. - */ - - do - { - ret = nxsem_wait(&priv->exclsem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); } /**************************************************************************** @@ -919,19 +907,7 @@ static void ssc_exclsem_take(struct sam_ssc_s *priv) static void ssc_bufsem_take(struct sam_ssc_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal. - */ - - do - { - ret = nxsem_wait(&priv->bufsem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->bufsem); } /**************************************************************************** @@ -1448,7 +1424,7 @@ static void ssc_rx_worker(void *arg) */ flags = enter_critical_section(); - (void)ssc_rxdma_setup(priv); + ssc_rxdma_setup(priv); leave_critical_section(flags); } @@ -1594,7 +1570,7 @@ static void ssc_rxdma_callback(DMA_HANDLE handle, void *arg, int result) /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->rx.dog); + wd_cancel(priv->rx.dog); /* Sample DMA registers at the time of the DMA completion */ @@ -1860,7 +1836,7 @@ static void ssc_tx_worker(void *arg) */ flags = enter_critical_section(); - (void)ssc_txdma_setup(priv); + ssc_txdma_setup(priv); leave_critical_section(flags); } @@ -1994,7 +1970,7 @@ static void ssc_txdma_callback(DMA_HANDLE handle, void *arg, int result) /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->tx.dog); + wd_cancel(priv->tx.dog); /* Sample DMA registers at the time of the DMA completion */ @@ -2901,7 +2877,7 @@ static void ssc_clocking(struct sam_ssc_s *priv) /* Configure MCK/2 divider */ - (void)ssc_mck2divider(priv); + ssc_mck2divider(priv); /* Enable peripheral clocking */ diff --git a/arch/arm/src/sama5/sam_tc.c b/arch/arm/src/sama5/sam_tc.c index 4ac41adf51..ef104c1202 100644 --- a/arch/arm/src/sama5/sam_tc.c +++ b/arch/arm/src/sama5/sam_tc.c @@ -471,21 +471,7 @@ static const uint8_t g_regoffset[TC_NREGISTERS] = static void sam_takesem(struct sam_tc_s *tc) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&tc->exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&tc->exclsem); } /**************************************************************************** @@ -1022,7 +1008,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) /* Disable and clear all channel interrupts */ sam_chan_putreg(chan, SAM_TC_IDR_OFFSET, TC_INT_ALL); - (void)sam_chan_getreg(chan, SAM_TC_SR_OFFSET); + sam_chan_getreg(chan, SAM_TC_SR_OFFSET); } /* Set the maximum TC peripheral clock frequency */ @@ -1043,7 +1029,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) /* Attach the timer interrupt handler and enable the timer interrupts */ - (void)irq_attach(tc->pid, handler, NULL); + irq_attach(tc->pid, handler, NULL); up_enable_irq(tc->pid); /* Now the channel is initialized */ @@ -1126,7 +1112,7 @@ TC_HANDLE sam_tc_allocate(int channel, int mode) /* Clear and pending status */ - (void)sam_chan_getreg(chan, SAM_TC_SR_OFFSET); + sam_chan_getreg(chan, SAM_TC_SR_OFFSET); /* And set the requested mode */ @@ -1197,7 +1183,7 @@ void sam_tc_start(TC_HANDLE handle) /* Read the SR to clear any pending interrupts on this channel */ - (void)sam_chan_getreg(chan, SAM_TC_SR_OFFSET); + sam_chan_getreg(chan, SAM_TC_SR_OFFSET); /* Then enable the timer (by setting the CLKEN bit). Setting SWTRIG * will also reset the timer counter and starting the timer. diff --git a/arch/arm/src/sama5/sam_timerisr.c b/arch/arm/src/sama5/sam_timerisr.c index 1826f7956c..ca02241673 100644 --- a/arch/arm/src/sama5/sam_timerisr.c +++ b/arch/arm/src/sama5/sam_timerisr.c @@ -136,7 +136,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(SAM_IRQ_PIT, (xcpt_t)sam_timerisr, NULL); + irq_attach(SAM_IRQ_PIT, (xcpt_t)sam_timerisr, NULL); /* Set the PIT overflow value (PIV), enable the PIT, and enable * interrupts from the PIT. diff --git a/arch/arm/src/sama5/sam_trng.c b/arch/arm/src/sama5/sam_trng.c index 50816fefaf..8b4cb77ac2 100644 --- a/arch/arm/src/sama5/sam_trng.c +++ b/arch/arm/src/sama5/sam_trng.c @@ -254,8 +254,6 @@ static ssize_t sam_read(struct file *filep, char *buffer, size_t buflen) ret = nxsem_wait(&g_trngdev.exclsem); if (ret < 0) { - /* This is probably -EINTR meaning that we were awakened by a signal */ - return ret; } @@ -276,7 +274,7 @@ static ssize_t sam_read(struct file *filep, char *buffer, size_t buflen) * register */ - (void)getreg32(SAM_TRNG_ISR); + getreg32(SAM_TRNG_ISR); /* Enable TRNG interrupts */ diff --git a/arch/arm/src/sama5/sam_tsd.c b/arch/arm/src/sama5/sam_tsd.c index 66107631b8..bd45d3466f 100644 --- a/arch/arm/src/sama5/sam_tsd.c +++ b/arch/arm/src/sama5/sam_tsd.c @@ -383,7 +383,6 @@ static int sam_tsd_waitsample(struct sam_tsd_s *priv, struct sam_sample_s *sampl */ ierr("ERROR: nxsem_wait: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } } @@ -587,8 +586,8 @@ static void sam_tsd_bottomhalf(void *arg) * this case; we rely on the timer expiry to get us going again. */ - (void)wd_start(priv->wdog, TSD_WDOG_DELAY, sam_tsd_expiry, 1, - (uint32_t)priv); + wd_start(priv->wdog, TSD_WDOG_DELAY, sam_tsd_expiry, 1, + (uint32_t)priv); ier = 0; goto ignored; } @@ -666,8 +665,8 @@ static void sam_tsd_bottomhalf(void *arg) /* Continue to sample the position while the pen is down */ - (void)wd_start(priv->wdog, TSD_WDOG_DELAY, sam_tsd_expiry, 1, - (uint32_t)priv); + wd_start(priv->wdog, TSD_WDOG_DELAY, sam_tsd_expiry, 1, + (uint32_t)priv); /* Check the thresholds. Bail if (1) this is not the first * measurement and (2) there is no significant difference from @@ -812,7 +811,7 @@ static void sam_tsd_expiry(int argc, uint32_t arg1, ...) /* Schedule touchscreen work */ - (void)sam_tsd_schedule(priv); + sam_tsd_schedule(priv); } /**************************************************************************** @@ -1668,7 +1667,7 @@ int sam_tsd_register(struct sam_adc_s *adc, int minor) /* Register the device as an input device */ - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); iinfo("Registering %s\n", devname); ret = register_driver(devname, &g_tsdops, 0666, priv); diff --git a/arch/arm/src/sama5/sam_twi.c b/arch/arm/src/sama5/sam_twi.c index 05fb5c6e0b..32ab61630e 100644 --- a/arch/arm/src/sama5/sam_twi.c +++ b/arch/arm/src/sama5/sam_twi.c @@ -309,21 +309,7 @@ static const struct i2c_ops_s g_twiops = static void twi_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -487,7 +473,7 @@ static int twi_wait(struct twi_dev_s *priv, unsigned int size) * TWI transfer stalls. */ - (void)wd_start(priv->timeout, timeout, twi_timeout, 1, (uint32_t)priv); + wd_start(priv->timeout, timeout, twi_timeout, 1, (uint32_t)priv); /* Wait for either the TWI transfer or the timeout to complete */ @@ -1099,7 +1085,7 @@ static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency) /* Reset the TWI */ twi_putrel(priv, SAM_TWI_CR_OFFSET, TWI_CR_SWRST); - (void)twi_getrel(priv, SAM_TWI_RHR_OFFSET); + twi_getrel(priv, SAM_TWI_RHR_OFFSET); /* TWI Slave Mode Disabled, TWI Master Mode Disabled. */ @@ -1273,8 +1259,8 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) /* Initialize semaphores */ - (void)nxsem_init(&priv->exclsem, 0, 1); - (void)nxsem_init(&priv->waitsem, 0, 0); + nxsem_init(&priv->exclsem, 0, 1); + nxsem_init(&priv->waitsem, 0, 0); /* The waitsem semaphore is used for signaling and, hence, should not have * priority inheritance enabled. @@ -1327,7 +1313,7 @@ int sam_i2cbus_uninitialize(FAR struct i2c_master_s *dev) /* Detach Interrupt Handler */ - (void)irq_detach(priv->attr->irq); + irq_detach(priv->attr->irq); return OK; } diff --git a/arch/arm/src/sama5/sam_udphs.c b/arch/arm/src/sama5/sam_udphs.c index 0927669e42..8b6a63798b 100644 --- a/arch/arm/src/sama5/sam_udphs.c +++ b/arch/arm/src/sama5/sam_udphs.c @@ -912,7 +912,7 @@ static void sam_dma_single(uint8_t epno, struct sam_req_s *privreq, /* Clear any pending interrupts then enable the DMA interrupt */ - (void)sam_getreg(SAM_UDPHS_DMASTATUS(epno)); + sam_getreg(SAM_UDPHS_DMASTATUS(epno)); regval = sam_getreg(SAM_UDPHS_IEN); regval |= UDPHS_INT_DMA(epno); sam_putreg(regval, SAM_UDPHS_IEN); @@ -1808,7 +1808,7 @@ static void sam_ep0_dispatch(struct sam_usbdev_s *priv) /* Stall on failure */ usbtrace(TRACE_DEVERROR(SAM_TRACEERR_DISPATCHSTALL), 0); - (void)sam_ep_stall(&priv->eplist[EP0].ep, false); + sam_ep_stall(&priv->eplist[EP0].ep, false); } } } @@ -2298,7 +2298,7 @@ static void sam_ep0_setup(struct sam_usbdev_s *priv) usbtrace(TRACE_DEVERROR(SAM_TRACEERR_EP0SETUPSTALLED), priv->ctrl.req); - (void)sam_ep_stall(&priv->eplist[EP0].ep, false); + sam_ep_stall(&priv->eplist[EP0].ep, false); } break; @@ -2397,7 +2397,7 @@ static void sam_dma_interrupt(struct sam_usbdev_s *priv, int epno) DEBUGASSERT(USB_ISEPIN(privep->ep.eplog)); privep->epstate = UDPHS_EPSTATE_IDLE; - (void)sam_req_write(priv, privep); + sam_req_write(priv, privep); } else if (privep->epstate == UDPHS_EPSTATE_RECEIVING) { @@ -2423,7 +2423,7 @@ static void sam_dma_interrupt(struct sam_usbdev_s *priv, int epno) */ privep->epstate = UDPHS_EPSTATE_IDLE; - (void)sam_req_read(priv, privep, xfrsize); + sam_req_read(priv, privep, xfrsize); } else { @@ -2476,7 +2476,7 @@ static void sam_dma_interrupt(struct sam_usbdev_s *priv, int epno) */ privep->epstate = UDPHS_EPSTATE_IDLE; - (void)sam_req_read(priv, privep, xfrsize); + sam_req_read(priv, privep, xfrsize); } else { @@ -2541,7 +2541,7 @@ static void sam_ep_interrupt(struct sam_usbdev_s *priv, int epno) */ privep->epstate = UDPHS_EPSTATE_IDLE; - (void)sam_req_write(priv, privep); + sam_req_write(priv, privep); } /* Setting of the device address is a special case. The address was @@ -2635,7 +2635,7 @@ static void sam_ep_interrupt(struct sam_usbdev_s *priv, int epno) /* STALL and discard received data. */ - (void)sam_ep_stall(&privep->ep, false); + sam_ep_stall(&privep->ep, false); sam_putreg(UDPHS_EPTSTA_RXRDYTXKL, SAM_UDPHS_EPTCLRSTA(epno)); } } @@ -3737,13 +3737,13 @@ static int sam_ep_stall(struct usbdev_ep_s *ep, bool resume) { /* IN endpoint (or EP0). Restart any queued write requests */ - (void)sam_req_write(priv, privep); + sam_req_write(priv, privep); } else { /* OUT endpoint. Restart any queued read requests. */ - (void)sam_req_read(priv, privep, 0); + sam_req_read(priv, privep, 0); } } } diff --git a/arch/arm/src/sama5/sam_wdt.c b/arch/arm/src/sama5/sam_wdt.c index 0fd0fa21ee..7e6708a162 100644 --- a/arch/arm/src/sama5/sam_wdt.c +++ b/arch/arm/src/sama5/sam_wdt.c @@ -684,15 +684,15 @@ int sam_wdt_initialize(void) #ifdef CONFIG_SAMA5_WDT_INTERRUPT /* Attach our WDT interrupt handler (But don't enable it yet) */ - (void)irq_attach(SAM_IRQ_WDT, sam_interrupt, NULL); + irq_attach(SAM_IRQ_WDT, sam_interrupt, NULL); #endif /* Register the watchdog driver at the configured location (default * /dev/watchdog0). */ - (void)watchdog_register(CONFIG_WATCHDOG_DEVPATH, - (FAR struct watchdog_lowerhalf_s *)priv); + watchdog_register(CONFIG_WATCHDOG_DEVPATH, + (FAR struct watchdog_lowerhalf_s *)priv); return OK; } diff --git a/arch/arm/src/sama5/sam_xdmac.c b/arch/arm/src/sama5/sam_xdmac.c index b2c2e5a246..490353e1e9 100644 --- a/arch/arm/src/sama5/sam_xdmac.c +++ b/arch/arm/src/sama5/sam_xdmac.c @@ -644,26 +644,12 @@ static struct sam_xdmac_s g_xdmac1 = static void sam_takechsem(struct sam_xdmac_s *xdmac) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&xdmac->chsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&xdmac->chsem); } static inline void sam_givechsem(struct sam_xdmac_s *xdmac) { - (void)nxsem_post(&xdmac->chsem); + nxsem_post(&xdmac->chsem); } /**************************************************************************** @@ -676,26 +662,12 @@ static inline void sam_givechsem(struct sam_xdmac_s *xdmac) static void sam_takedsem(struct sam_xdmac_s *xdmac) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&xdmac->dsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&xdmac->dsem); } static inline void sam_givedsem(struct sam_xdmac_s *xdmac) { - (void)nxsem_post(&xdmac->dsem); + nxsem_post(&xdmac->dsem); } /**************************************************************************** @@ -1566,7 +1538,7 @@ static inline int sam_single(struct sam_xdmach_s *xdmach) * reading the XDMAC Channel Interrupt Status Register (CIS). */ - (void)sam_getdmach(xdmach, SAM_XDMACH_CIS_OFFSET); + sam_getdmach(xdmach, SAM_XDMACH_CIS_OFFSET); /* 3. Write the starting source address in the Channel Source Address (CSA) * Register. @@ -1668,7 +1640,7 @@ static inline int sam_multiple(struct sam_xdmach_s *xdmach) * reading the XDMAC Channel Interrupt Status Register (CIS). */ - (void)sam_getdmach(xdmach, SAM_XDMACH_CIS_OFFSET); + sam_getdmach(xdmach, SAM_XDMACH_CIS_OFFSET); /* 3. Build a linked list of transfer descriptors in memory. The * descriptor view is programmable on a per descriptor basis. The @@ -1945,7 +1917,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vector */ - (void)irq_attach(SAM_IRQ_XDMAC0, sam_xdmac_interrupt, &g_xdmac0); + irq_attach(SAM_IRQ_XDMAC0, sam_xdmac_interrupt, &g_xdmac0); /* Initialize the controller */ @@ -1965,7 +1937,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vector */ - (void)irq_attach(SAM_IRQ_XDMAC1, sam_xdmac_interrupt, &g_xdmac1); + irq_attach(SAM_IRQ_XDMAC1, sam_xdmac_interrupt, &g_xdmac1); /* Initialize the controller */ @@ -2042,7 +2014,7 @@ DMA_HANDLE sam_dmachannel(uint8_t dmacno, uint32_t chflags) * Channel Interrupt Status (CIS) Register */ - (void)sam_getdmach(xdmach, SAM_XDMACH_CIS_OFFSET); + sam_getdmach(xdmach, SAM_XDMACH_CIS_OFFSET); /* Disable the channel by writing one to the write-only Global * Channel Disable (GD) Register diff --git a/arch/arm/src/sama5/sama5d2x_pio.c b/arch/arm/src/sama5/sama5d2x_pio.c index 163d957085..5147eb3eb5 100644 --- a/arch/arm/src/sama5/sama5d2x_pio.c +++ b/arch/arm/src/sama5/sama5d2x_pio.c @@ -478,7 +478,7 @@ int sam_configpio(pio_pinset_t cfgset) /* Put the pin in an initial state -- a vanilla input pin */ - (void)sam_configinput(base, pin, MK_INPUT(cfgset)); + sam_configinput(base, pin, MK_INPUT(cfgset)); /* Then handle the real pin configuration according to pin type */ diff --git a/arch/arm/src/sama5/sama5d3x4x_pio.c b/arch/arm/src/sama5/sama5d3x4x_pio.c index af2d7a40af..0e9b53a349 100644 --- a/arch/arm/src/sama5/sama5d3x4x_pio.c +++ b/arch/arm/src/sama5/sama5d3x4x_pio.c @@ -730,7 +730,7 @@ int sam_configpio(pio_pinset_t cfgset) /* Put the pin in an initial state -- a vanilla input pin */ - (void)sam_configinput(base, pin, MK_INPUT(cfgset)); + sam_configinput(base, pin, MK_INPUT(cfgset)); /* Then handle the real pin configuration according to pin type */ diff --git a/arch/arm/src/samd2l2/sam_dmac.c b/arch/arm/src/samd2l2/sam_dmac.c index 831da156cd..799c3ca5b6 100644 --- a/arch/arm/src/samd2l2/sam_dmac.c +++ b/arch/arm/src/samd2l2/sam_dmac.c @@ -181,26 +181,12 @@ static struct dma_desc_s g_dma_desc[CONFIG_SAMD2L2_DMAC_NDESC] static void sam_takechsem(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_chsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_chsem); } static inline void sam_givechsem(void) { - (void)nxsem_post(&g_chsem); + nxsem_post(&g_chsem); } /**************************************************************************** @@ -214,26 +200,12 @@ static inline void sam_givechsem(void) #if CONFIG_SAMD2L2_DMAC_NDESC > 0 static void sam_takedsem(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_dsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_dsem); } static inline void sam_givedsem(void) { - (void)nxsem_post(&g_dsem); + nxsem_post(&g_dsem); } #endif @@ -840,7 +812,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vector */ - (void)irq_attach(SAM_IRQ_DMAC, sam_dmainterrupt, NULL); + irq_attach(SAM_IRQ_DMAC, sam_dmainterrupt, NULL); /* Set the LPRAM DMA descriptor table addresses. These can only be * written when the DMAC is disabled. diff --git a/arch/arm/src/samd2l2/sam_i2c_master.c b/arch/arm/src/samd2l2/sam_i2c_master.c index ca085f1a30..eeaec5c8e0 100644 --- a/arch/arm/src/samd2l2/sam_i2c_master.c +++ b/arch/arm/src/samd2l2/sam_i2c_master.c @@ -464,21 +464,7 @@ static void i2c_putreg32(struct sam_i2c_dev_s *priv, uint32_t regval, static void i2c_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /******************************************************************************* @@ -1386,8 +1372,8 @@ struct i2c_master_s *sam_i2c_master_initialize(int bus) priv->dev.ops = &g_i2cops; priv->flags = 0; - (void)nxsem_init(&priv->exclsem, 0, 1); - (void)nxsem_init(&priv->waitsem, 0, 0); + nxsem_init(&priv->exclsem, 0, 1); + nxsem_init(&priv->waitsem, 0, 0); /* Perform repeatable I2C hardware initialization */ @@ -1421,7 +1407,7 @@ int sam_i2c_uninitialize(FAR struct i2c_master_s *dev) /* Detach Interrupt Handler */ - (void)irq_detach(priv->attr->irq); + irq_detach(priv->attr->irq); return OK; } diff --git a/arch/arm/src/samd2l2/sam_idle.c b/arch/arm/src/samd2l2/sam_idle.c index 6d69b2afc9..c3d1b0717f 100644 --- a/arch/arm/src/samd2l2/sam_idle.c +++ b/arch/arm/src/samd2l2/sam_idle.c @@ -108,7 +108,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { @@ -132,7 +132,7 @@ static void up_idlepm(void) break; case PM_SLEEP: - (void)sam_pmstandby(); + sam_pmstandby(); break; default: diff --git a/arch/arm/src/samd2l2/sam_irq.c b/arch/arm/src/samd2l2/sam_irq.c index 0f33c45f66..7ee18e745a 100644 --- a/arch/arm/src/samd2l2/sam_irq.c +++ b/arch/arm/src/samd2l2/sam_irq.c @@ -96,7 +96,7 @@ volatile uint32_t *g_current_regs[1]; #ifdef CONFIG_DEBUG_FEATURES static int sam_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -104,7 +104,7 @@ static int sam_nmi(int irq, FAR void *context, FAR void *arg) static int sam_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -112,7 +112,7 @@ static int sam_pendsv(int irq, FAR void *context, FAR void *arg) static int sam_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/samd2l2/sam_serial.c b/arch/arm/src/samd2l2/sam_serial.c index d42afa3244..dbf57a4fa7 100644 --- a/arch/arm/src/samd2l2/sam_serial.c +++ b/arch/arm/src/samd2l2/sam_serial.c @@ -676,7 +676,7 @@ static int sam_setup(struct uart_dev_s *dev) #ifdef HAVE_RS485 if (priv->rs485_dir_gpio != 0) { - (void)sam_configport(priv->rs485_dir_gpio); + sam_configport(priv->rs485_dir_gpio); sam_portwrite(priv->rs485_dir_gpio, !priv->rs485_dir_polarity); } #endif @@ -1012,26 +1012,26 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all USARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif } diff --git a/arch/arm/src/samd2l2/sam_spi.c b/arch/arm/src/samd2l2/sam_spi.c index 4f88264373..230ac61be8 100644 --- a/arch/arm/src/samd2l2/sam_spi.c +++ b/arch/arm/src/samd2l2/sam_spi.c @@ -827,24 +827,11 @@ static int spi_lock(struct spi_dev_s *dev, bool lock) spiinfo("lock=%d\n", lock); if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->spilock); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->spilock); } else { - (void)nxsem_post(&priv->spilock); - ret = OK; + ret = nxsem_post(&priv->spilock); } return ret; @@ -1173,7 +1160,6 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, #ifdef CONFIG_SAMD2L2_SPI_DMA uint32_t regval; - int ret; spiinfo("txbuffer=%p rxbuffer=%p nwords=%d\n", txbuffer, rxbuffer, nwords); @@ -1203,13 +1189,9 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, spi_putreg32(priv, regval, SAM_SPI_CTRLA_OFFSET); spi_wait_synchronization(priv); - do - { - /* Wait for the DMA callback to notify us that the transfer is complete */ + /* Wait for the DMA callback to notify us that the transfer is complete */ - ret = nxsem_wait(&priv->dmasem); - } - while (ret < 0 && ret == -EINTR); + nxsem_wait_uninterruptible(&priv->dmasem); #else const uint16_t *ptx16; const uint8_t *ptx8; @@ -1593,7 +1575,7 @@ struct spi_dev_s *sam_spibus_initialize(int port) * driver as soon as it starts. */ - (void)spi_setfrequency((struct spi_dev_s *)priv, 400000); + spi_setfrequency((struct spi_dev_s *)priv, 400000); /* Set MSB first data order and the configured pad mux setting. * SPI mode 0 is assumed initially (CPOL=0 and CPHA=0). diff --git a/arch/arm/src/samd2l2/sam_timerisr.c b/arch/arm/src/samd2l2/sam_timerisr.c index 640be1a501..8724af5eee 100644 --- a/arch/arm/src/samd2l2/sam_timerisr.c +++ b/arch/arm/src/samd2l2/sam_timerisr.c @@ -133,7 +133,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr, NULL); + irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/samd2l2/sam_usb.c b/arch/arm/src/samd2l2/sam_usb.c index 8479192aad..737b0bbce5 100644 --- a/arch/arm/src/samd2l2/sam_usb.c +++ b/arch/arm/src/samd2l2/sam_usb.c @@ -1128,7 +1128,7 @@ static int sam_req_write(struct sam_usbdev_s *priv, struct sam_ep_s *privep) { /* Yes... stall the endpoint now */ - (void)sam_ep_stall(privep); + sam_ep_stall(privep); } return -ENOENT; @@ -2450,7 +2450,7 @@ static void sam_ep0_dispatch(struct sam_usbdev_s *priv) /* Stall on failure */ usbtrace(TRACE_DEVERROR(SAM_TRACEERR_DISPATCHSTALL), 0); - (void)sam_ep_stall(&priv->eplist[EP0]); + sam_ep_stall(&priv->eplist[EP0]); } } } @@ -2951,7 +2951,7 @@ static void sam_ep0_setup(struct sam_usbdev_s *priv) usbtrace(TRACE_DEVERROR(SAM_TRACEERR_EP0SETUPSTALLED), priv->ctrl.req); - (void)sam_ep_stall(&priv->eplist[EP0]); + sam_ep_stall(&priv->eplist[EP0]); } break; @@ -3036,7 +3036,7 @@ static void sam_ep_trcpt_interrupt(struct sam_usbdev_s *priv, { /* continue processing the read request. */ - (void)sam_req_read(priv, privep, pktsize); + sam_req_read(priv, privep, pktsize); } /* Did we just receive the data associated with an OUT SETUP command? */ @@ -3066,7 +3066,7 @@ static void sam_ep_trcpt_interrupt(struct sam_usbdev_s *priv, usbtrace(TRACE_DEVERROR(SAM_TRACEERR_EP0SETUPOUTSIZE), pktsize); - (void)sam_ep_stall(privep); + sam_ep_stall(privep); } } @@ -3149,7 +3149,7 @@ static void sam_ep_interrupt(struct sam_usbdev_s *priv, int epno) /* Continue/resume processing the write requests */ privep->epstate = USB_EPSTATE_IDLE; - (void)sam_req_write(priv, privep); + sam_req_write(priv, privep); } /* Setting of the device address is a special case. The address was @@ -3658,7 +3658,7 @@ static int sam_ep_resume(struct sam_ep_s *privep) { /* IN endpoint (or EP0). Restart any queued write requests */ - (void)sam_req_write(priv, privep); + sam_req_write(priv, privep); } } @@ -3958,7 +3958,6 @@ static void sam_sw_setup(struct sam_usbdev_s *priv) static void sam_sw_shutdown(struct sam_usbdev_s *priv) { - (void)priv; } /**************************************************************************** diff --git a/arch/arm/src/samd5e5/sam_dmac.c b/arch/arm/src/samd5e5/sam_dmac.c index 67822a4cef..1b6b69bc2e 100644 --- a/arch/arm/src/samd5e5/sam_dmac.c +++ b/arch/arm/src/samd5e5/sam_dmac.c @@ -179,26 +179,12 @@ static struct dma_desc_s g_dma_desc[CONFIG_SAMD5E5_DMAC_NDESC] static void sam_takechsem(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_chsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_chsem); } static inline void sam_givechsem(void) { - (void)nxsem_post(&g_chsem); + nxsem_post(&g_chsem); } /**************************************************************************** @@ -212,26 +198,12 @@ static inline void sam_givechsem(void) #if CONFIG_SAMD5E5_DMAC_NDESC > 0 static void sam_takedsem(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_dsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_dsem); } static inline void sam_givedsem(void) { - (void)nxsem_post(&g_dsem); + nxsem_post(&g_dsem); } #endif @@ -810,11 +782,11 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vectors */ - (void)irq_attach(SAM_IRQ_DMACH0, sam_dmainterrupt, NULL); - (void)irq_attach(SAM_IRQ_DMACH1, sam_dmainterrupt, NULL); - (void)irq_attach(SAM_IRQ_DMACH2, sam_dmainterrupt, NULL); - (void)irq_attach(SAM_IRQ_DMACH3, sam_dmainterrupt, NULL); - (void)irq_attach(SAM_IRQ_DMACH4_31, sam_dmainterrupt, NULL); + irq_attach(SAM_IRQ_DMACH0, sam_dmainterrupt, NULL); + irq_attach(SAM_IRQ_DMACH1, sam_dmainterrupt, NULL); + irq_attach(SAM_IRQ_DMACH2, sam_dmainterrupt, NULL); + irq_attach(SAM_IRQ_DMACH3, sam_dmainterrupt, NULL); + irq_attach(SAM_IRQ_DMACH4_31, sam_dmainterrupt, NULL); /* Set the LPRAM DMA descriptor table addresses. These can only be * written when the DMAC is disabled. diff --git a/arch/arm/src/samd5e5/sam_i2c_master.c b/arch/arm/src/samd5e5/sam_i2c_master.c index dac149d62b..6a31e8168f 100644 --- a/arch/arm/src/samd5e5/sam_i2c_master.c +++ b/arch/arm/src/samd5e5/sam_i2c_master.c @@ -489,21 +489,7 @@ static void i2c_putreg32(struct sam_i2c_dev_s *priv, uint32_t regval, static void i2c_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /******************************************************************************* @@ -1424,8 +1410,8 @@ struct i2c_master_s *sam_i2c_master_initialize(int bus) priv->dev.ops = &g_i2cops; priv->flags = 0; - (void)nxsem_init(&priv->exclsem, 0, 1); - (void)nxsem_init(&priv->waitsem, 0, 0); + nxsem_init(&priv->exclsem, 0, 1); + nxsem_init(&priv->waitsem, 0, 0); /* Perform repeatable I2C hardware initialization */ @@ -1459,7 +1445,7 @@ int sam_i2c_uninitialize(FAR struct i2c_master_s *dev) /* Detach Interrupt Handler */ - (void)irq_detach(priv->attr->irq); + irq_detach(priv->attr->irq); return OK; } diff --git a/arch/arm/src/samd5e5/sam_idle.c b/arch/arm/src/samd5e5/sam_idle.c index 83cd28bc0f..099213f882 100644 --- a/arch/arm/src/samd5e5/sam_idle.c +++ b/arch/arm/src/samd5e5/sam_idle.c @@ -107,7 +107,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { @@ -131,7 +131,7 @@ static void up_idlepm(void) break; case PM_SLEEP: - (void)sam_pmstandby(); + sam_pmstandby(); break; default: diff --git a/arch/arm/src/samd5e5/sam_irq.c b/arch/arm/src/samd5e5/sam_irq.c index 6f09ec0684..f9822dc47f 100644 --- a/arch/arm/src/samd5e5/sam_irq.c +++ b/arch/arm/src/samd5e5/sam_irq.c @@ -210,7 +210,7 @@ static void sam_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int sam_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -218,7 +218,7 @@ static int sam_nmi(int irq, FAR void *context, FAR void *arg) static int sam_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -226,7 +226,7 @@ static int sam_busfault(int irq, FAR void *context, FAR void *arg) static int sam_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -234,7 +234,7 @@ static int sam_usagefault(int irq, FAR void *context, FAR void *arg) static int sam_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -242,7 +242,7 @@ static int sam_pendsv(int irq, FAR void *context, FAR void *arg) static int sam_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -250,7 +250,7 @@ static int sam_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int sam_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/samd5e5/sam_serial.c b/arch/arm/src/samd5e5/sam_serial.c index 150292a33b..7afeeed3ab 100644 --- a/arch/arm/src/samd5e5/sam_serial.c +++ b/arch/arm/src/samd5e5/sam_serial.c @@ -1067,32 +1067,32 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all USARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif #ifdef TTYS6_DEV - (void)uart_register("/dev/ttyS6", &TTYS6_DEV); + uart_register("/dev/ttyS6", &TTYS6_DEV); #endif #ifdef TTYS7_DEV - (void)uart_register("/dev/ttyS7", &TTYS7_DEV); + uart_register("/dev/ttyS7", &TTYS7_DEV); #endif } diff --git a/arch/arm/src/samd5e5/sam_spi.c b/arch/arm/src/samd5e5/sam_spi.c index f8e476f7ee..8edb2e3694 100644 --- a/arch/arm/src/samd5e5/sam_spi.c +++ b/arch/arm/src/samd5e5/sam_spi.c @@ -922,24 +922,11 @@ static int spi_lock(struct spi_dev_s *dev, bool lock) spiinfo("lock=%d\n", lock); if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->spilock); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->spilock); } else { - (void)nxsem_post(&priv->spilock); - ret = OK; + ret = nxsem_post(&priv->spilock); } return ret; @@ -1268,7 +1255,6 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, #ifdef CONFIG_SAMD5E5SPI_DMA uint32_t regval; - int ret; spiinfo("txbuffer=%p rxbuffer=%p nwords=%d\n", txbuffer, rxbuffer, nwords); @@ -1298,13 +1284,9 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, spi_putreg32(priv, regval, SAM_SPI_CTRLA_OFFSET); spi_wait_synchronization(priv); - do - { - /* Wait for the DMA callback to notify us that the transfer is complete */ + /* Wait for the DMA callback to notify us that the transfer is complete */ - ret = nxsem_wait(&priv->dmasem); - } - while (ret < 0 && ret == -EINTR); + nxsem_wait_uninterruptible(&priv->dmasem); #else const uint16_t *ptx16; const uint8_t *ptx8; @@ -1676,7 +1658,7 @@ struct spi_dev_s *sam_spibus_initialize(int port) * driver as soon as it starts. */ - (void)spi_setfrequency((struct spi_dev_s *)priv, 400000); + spi_setfrequency((struct spi_dev_s *)priv, 400000); /* Set MSB first data order and the configured pad mux setting. * SPI mode 0 is assumed initially (CPOL=0 and CPHA=0). diff --git a/arch/arm/src/samd5e5/sam_timerisr.c b/arch/arm/src/samd5e5/sam_timerisr.c index d808cc7243..af322d5063 100644 --- a/arch/arm/src/samd5e5/sam_timerisr.c +++ b/arch/arm/src/samd5e5/sam_timerisr.c @@ -129,7 +129,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr, NULL); + irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr, NULL); /* Enable SysTick interrupts using the processor clock source. */ diff --git a/arch/arm/src/samd5e5/sam_usb.c b/arch/arm/src/samd5e5/sam_usb.c index 41f9a28b02..d9d34ccf94 100644 --- a/arch/arm/src/samd5e5/sam_usb.c +++ b/arch/arm/src/samd5e5/sam_usb.c @@ -1130,7 +1130,7 @@ static int sam_req_write(struct sam_usbdev_s *priv, struct sam_ep_s *privep) { /* Yes... stall the endpoint now */ - (void)sam_ep_stall(privep); + sam_ep_stall(privep); } return -ENOENT; @@ -2448,7 +2448,7 @@ static void sam_ep0_dispatch(struct sam_usbdev_s *priv) /* Stall on failure */ usbtrace(TRACE_DEVERROR(SAM_TRACEERR_DISPATCHSTALL), 0); - (void)sam_ep_stall(&priv->eplist[EP0]); + sam_ep_stall(&priv->eplist[EP0]); } } } @@ -2949,7 +2949,7 @@ static void sam_ep0_setup(struct sam_usbdev_s *priv) usbtrace(TRACE_DEVERROR(SAM_TRACEERR_EP0SETUPSTALLED), priv->ctrl.req); - (void)sam_ep_stall(&priv->eplist[EP0]); + sam_ep_stall(&priv->eplist[EP0]); } break; @@ -3034,7 +3034,7 @@ static void sam_ep_trcpt_interrupt(struct sam_usbdev_s *priv, { /* continue processing the read request. */ - (void)sam_req_read(priv, privep, pktsize); + sam_req_read(priv, privep, pktsize); } /* Did we just receive the data associated with an OUT SETUP command? */ @@ -3064,7 +3064,7 @@ static void sam_ep_trcpt_interrupt(struct sam_usbdev_s *priv, usbtrace(TRACE_DEVERROR(SAM_TRACEERR_EP0SETUPOUTSIZE), pktsize); - (void)sam_ep_stall(privep); + sam_ep_stall(privep); } } @@ -3147,7 +3147,7 @@ static void sam_ep_interrupt(struct sam_usbdev_s *priv, int epno) /* Continue/resume processing the write requests */ privep->epstate = USB_EPSTATE_IDLE; - (void)sam_req_write(priv, privep); + sam_req_write(priv, privep); } /* Setting of the device address is a special case. The address was @@ -3656,7 +3656,7 @@ static int sam_ep_resume(struct sam_ep_s *privep) { /* IN endpoint (or EP0). Restart any queued write requests */ - (void)sam_req_write(priv, privep); + sam_req_write(priv, privep); } } @@ -3923,7 +3923,6 @@ static void sam_sw_setup(struct sam_usbdev_s *priv) static void sam_sw_shutdown(struct sam_usbdev_s *priv) { - (void)priv; } /**************************************************************************** diff --git a/arch/arm/src/samv7/sam_emac.c b/arch/arm/src/samv7/sam_emac.c index 2e81773244..112bba8c3d 100644 --- a/arch/arm/src/samv7/sam_emac.c +++ b/arch/arm/src/samv7/sam_emac.c @@ -1460,8 +1460,8 @@ static int sam_transmit(struct sam_emac_s *priv, int qid) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1, - (uint32_t)priv); + wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1, + (uint32_t)priv); /* Set d_len to zero meaning that the d_buf[] packet buffer is again * available. @@ -1607,7 +1607,7 @@ static void sam_dopoll(struct sam_emac_s *priv, int qid) { /* If we have the descriptor, then poll the network for new XMIT data. */ - (void)devif_poll(dev, sam_txpoll); + devif_poll(dev, sam_txpoll); } } @@ -2636,12 +2636,12 @@ static void sam_poll_work(FAR void *arg) { /* Update TCP timing states and poll the network for new XMIT data. */ - (void)devif_timer(dev, SAM_WDDELAY, sam_txpoll); + devif_timer(dev, SAM_WDDELAY, sam_txpoll); } /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); + wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); net_unlock(); } @@ -2759,7 +2759,7 @@ static int sam_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, (uint32_t)priv); + wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, (uint32_t)priv); /* Enable the EMAC interrupt */ @@ -4741,7 +4741,7 @@ static void sam_ipv6multicast(struct sam_emac_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)sam_addmac(dev, mac); + sam_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -4749,7 +4749,7 @@ static void sam_ipv6multicast(struct sam_emac_s *priv) * packets. */ - (void)sam_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + sam_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -4758,7 +4758,7 @@ static void sam_ipv6multicast(struct sam_emac_s *priv) * packets. */ - (void)sam_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + sam_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -4901,9 +4901,9 @@ static int sam_emac_configure(struct sam_emac_s *priv) /* Clear any pending interrupts */ - (void)sam_getreg(priv, SAM_EMAC_ISR_OFFSET); - (void)sam_getreg(priv, SAM_EMAC_ISRPQ_ISRPQ_OFFSET(1)); - (void)sam_getreg(priv, SAM_EMAC_ISRPQ_ISRPQ_OFFSET(2)); + sam_getreg(priv, SAM_EMAC_ISR_OFFSET); + sam_getreg(priv, SAM_EMAC_ISRPQ_ISRPQ_OFFSET(1)); + sam_getreg(priv, SAM_EMAC_ISRPQ_ISRPQ_OFFSET(2)); /* Enable/disable the copy of data into the buffers, ignore broadcasts. * Don't copy FCS. diff --git a/arch/arm/src/samv7/sam_freerun.c b/arch/arm/src/samv7/sam_freerun.c index 4db9511218..9c27d9d245 100644 --- a/arch/arm/src/samv7/sam_freerun.c +++ b/arch/arm/src/samv7/sam_freerun.c @@ -189,8 +189,8 @@ int sam_freerun_initialize(struct sam_freerun_s *freerun, int chan, /* Set up to receive the callback when the counter overflow occurs */ - (void)sam_tc_attach(freerun->tch, sam_freerun_handler, freerun, - TC_INT_COVFS); + sam_tc_attach(freerun->tch, sam_freerun_handler, freerun, + TC_INT_COVFS); /* Start the counter */ diff --git a/arch/arm/src/samv7/sam_gpioirq.c b/arch/arm/src/samv7/sam_gpioirq.c index cefcacc239..72f099b826 100644 --- a/arch/arm/src/samv7/sam_gpioirq.c +++ b/arch/arm/src/samv7/sam_gpioirq.c @@ -250,12 +250,12 @@ void sam_gpioirqinitialize(void) /* Clear and disable all GPIOA interrupts */ - (void)getreg32(SAM_PIOA_ISR); + getreg32(SAM_PIOA_ISR); putreg32(0xffffffff, SAM_PIOA_IDR); /* Attach and enable the GPIOA IRQ */ - (void)irq_attach(SAM_IRQ_PIOA, sam_gpioainterrupt, NULL); + irq_attach(SAM_IRQ_PIOA, sam_gpioainterrupt, NULL); up_enable_irq(SAM_IRQ_PIOA); #endif @@ -268,12 +268,12 @@ void sam_gpioirqinitialize(void) /* Clear and disable all GPIOB interrupts */ - (void)getreg32(SAM_PIOB_ISR); + getreg32(SAM_PIOB_ISR); putreg32(0xffffffff, SAM_PIOB_IDR); /* Attach and enable the GPIOB IRQ */ - (void)irq_attach(SAM_IRQ_PIOB, sam_gpiobinterrupt, NULL); + irq_attach(SAM_IRQ_PIOB, sam_gpiobinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOB); #endif @@ -286,12 +286,12 @@ void sam_gpioirqinitialize(void) /* Clear and disable all GPIOC interrupts */ - (void)getreg32(SAM_PIOC_ISR); + getreg32(SAM_PIOC_ISR); putreg32(0xffffffff, SAM_PIOC_IDR); /* Attach and enable the GPIOC IRQ */ - (void)irq_attach(SAM_IRQ_PIOC, sam_gpiocinterrupt, NULL); + irq_attach(SAM_IRQ_PIOC, sam_gpiocinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOC); #endif @@ -304,12 +304,12 @@ void sam_gpioirqinitialize(void) /* Clear and disable all GPIOD interrupts */ - (void)getreg32(SAM_PIOD_ISR); + getreg32(SAM_PIOD_ISR); putreg32(0xffffffff, SAM_PIOD_IDR); /* Attach and enable the GPIOC IRQ */ - (void)irq_attach(SAM_IRQ_PIOD, sam_gpiodinterrupt, NULL); + irq_attach(SAM_IRQ_PIOD, sam_gpiodinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOD); #endif @@ -322,12 +322,12 @@ void sam_gpioirqinitialize(void) /* Clear and disable all GPIOE interrupts */ - (void)getreg32(SAM_PIOE_ISR); + getreg32(SAM_PIOE_ISR); putreg32(0xffffffff, SAM_PIOE_IDR); /* Attach and enable the GPIOE IRQ */ - (void)irq_attach(SAM_IRQ_PIOE, sam_gpioeinterrupt, NULL); + irq_attach(SAM_IRQ_PIOE, sam_gpioeinterrupt, NULL); up_enable_irq(SAM_IRQ_PIOE); #endif } diff --git a/arch/arm/src/samv7/sam_hsmci.c b/arch/arm/src/samv7/sam_hsmci.c index 49059d4db3..dda5464c94 100644 --- a/arch/arm/src/samv7/sam_hsmci.c +++ b/arch/arm/src/samv7/sam_hsmci.c @@ -610,21 +610,7 @@ static struct sam_dev_s g_hsmci1; static void sam_takesem(struct sam_dev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->waitsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -1306,7 +1292,7 @@ static void sam_endwait(struct sam_dev_s *priv, sdio_eventset_t wkupevent) { /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Disable event-related interrupts and save wakeup event */ @@ -1929,7 +1915,7 @@ static int sam_attach(FAR struct sdio_dev_s *dev) */ sam_putreg(priv, 0xffffffff, SAM_HSMCI_IDR_OFFSET); - (void)sam_getreg(priv, SAM_HSMCI_SR_OFFSET); + sam_getreg(priv, SAM_HSMCI_SR_OFFSET); /* Enable HSMCI interrupts at the NVIC. They can now be enabled at * the HSMCI controller as needed. @@ -2343,11 +2329,11 @@ static int sam_cancel(FAR struct sdio_dev_s *dev) /* Clearing (most) pending interrupt status by reading the status register */ - (void)sam_getreg(priv, SAM_HSMCI_SR_OFFSET); + sam_getreg(priv, SAM_HSMCI_SR_OFFSET); /* Cancel any watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Make sure that the DMA is stopped (it will be stopped automatically * on normal transfers, but not necessarily when the transfer terminates @@ -2708,7 +2694,7 @@ static void sam_waitenable(FAR struct sdio_dev_s *dev, * pending after this point must be valid event indications. */ - (void)sam_getreg(priv, SAM_HSMCI_SR_OFFSET); + sam_getreg(priv, SAM_HSMCI_SR_OFFSET); /* Wait interrupts are configured here, but not enabled until * sam_eventwait() is called. Why? Because the XFRDONE interrupt is diff --git a/arch/arm/src/samv7/sam_irq.c b/arch/arm/src/samv7/sam_irq.c index 191256d5b9..afc0864b79 100644 --- a/arch/arm/src/samv7/sam_irq.c +++ b/arch/arm/src/samv7/sam_irq.c @@ -177,7 +177,7 @@ static void sam_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int sam_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -185,7 +185,7 @@ static int sam_nmi(int irq, FAR void *context, FAR void *arg) static int sam_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -193,7 +193,7 @@ static int sam_busfault(int irq, FAR void *context, FAR void *arg) static int sam_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -201,7 +201,7 @@ static int sam_usagefault(int irq, FAR void *context, FAR void *arg) static int sam_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -209,7 +209,7 @@ static int sam_pendsv(int irq, FAR void *context, FAR void *arg) static int sam_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -217,7 +217,7 @@ static int sam_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int sam_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/samv7/sam_lowputc.c b/arch/arm/src/samv7/sam_lowputc.c index 3fff6b6b25..b65d0340e3 100644 --- a/arch/arm/src/samv7/sam_lowputc.c +++ b/arch/arm/src/samv7/sam_lowputc.c @@ -293,49 +293,49 @@ void sam_lowsetup(void) /* Configure UART pins for all selected UART/USARTs */ #ifdef CONFIG_SAMV7_UART0 - (void)sam_configgpio(GPIO_UART0_RXD); - (void)sam_configgpio(GPIO_UART0_TXD); + sam_configgpio(GPIO_UART0_RXD); + sam_configgpio(GPIO_UART0_TXD); #endif #ifdef CONFIG_SAMV7_UART1 - (void)sam_configgpio(GPIO_UART1_RXD); - (void)sam_configgpio(GPIO_UART1_TXD); + sam_configgpio(GPIO_UART1_RXD); + sam_configgpio(GPIO_UART1_TXD); #endif #ifdef CONFIG_SAMV7_UART2 - (void)sam_configgpio(GPIO_UART2_RXD); - (void)sam_configgpio(GPIO_UART2_TXD); + sam_configgpio(GPIO_UART2_RXD); + sam_configgpio(GPIO_UART2_TXD); #endif #ifdef CONFIG_SAMV7_UART3 - (void)sam_configgpio(GPIO_UART3_RXD); - (void)sam_configgpio(GPIO_UART3_TXD); + sam_configgpio(GPIO_UART3_RXD); + sam_configgpio(GPIO_UART3_TXD); #endif #ifdef CONFIG_SAMV7_UART4 - (void)sam_configgpio(GPIO_UART4_RXD); - (void)sam_configgpio(GPIO_UART4_TXD); + sam_configgpio(GPIO_UART4_RXD); + sam_configgpio(GPIO_UART4_TXD); #endif #ifdef CONFIG_SAMV7_USART0 - (void)sam_configgpio(GPIO_USART0_RXD); - (void)sam_configgpio(GPIO_USART0_TXD); + sam_configgpio(GPIO_USART0_RXD); + sam_configgpio(GPIO_USART0_TXD); #ifdef CONFIG_USART0_OFLOWCONTROL - (void)sam_configgpio(GPIO_USART0_CTS); + sam_configgpio(GPIO_USART0_CTS); #endif #ifdef CONFIG_USART0_IFLOWCONTROL - (void)sam_configgpio(GPIO_USART0_RTS); + sam_configgpio(GPIO_USART0_RTS); #endif #endif #ifdef CONFIG_SAMV7_USART1 - (void)sam_configgpio(GPIO_USART1_RXD); - (void)sam_configgpio(GPIO_USART1_TXD); + sam_configgpio(GPIO_USART1_RXD); + sam_configgpio(GPIO_USART1_TXD); # ifdef CONFIG_USART1_OFLOWCONTROL - (void)sam_configgpio(GPIO_USART1_CTS); + sam_configgpio(GPIO_USART1_CTS); # endif # ifdef CONFIG_USART1_IFLOWCONTROL - (void)sam_configgpio(GPIO_USART1_RTS); + sam_configgpio(GPIO_USART1_RTS); # endif /* To use the USART1 as an USART, the SYSIO Pin4 must be bound to PB4 @@ -354,13 +354,13 @@ void sam_lowsetup(void) #endif #ifdef CONFIG_SAMV7_USART2 - (void)sam_configgpio(GPIO_USART2_RXD); - (void)sam_configgpio(GPIO_USART2_TXD); + sam_configgpio(GPIO_USART2_RXD); + sam_configgpio(GPIO_USART2_TXD); #ifdef CONFIG_USART2_OFLOWCONTROL - (void)sam_configgpio(GPIO_USART2_CTS); + sam_configgpio(GPIO_USART2_CTS); #endif #ifdef CONFIG_USART2_IFLOWCONTROL - (void)sam_configgpio(GPIO_USART2_RTS); + sam_configgpio(GPIO_USART2_RTS); #endif #endif diff --git a/arch/arm/src/samv7/sam_mcan.c b/arch/arm/src/samv7/sam_mcan.c index bafa19d314..ab67d5f0df 100644 --- a/arch/arm/src/samv7/sam_mcan.c +++ b/arch/arm/src/samv7/sam_mcan.c @@ -1371,19 +1371,7 @@ static void mcan_dumpregs(FAR struct sam_mcan_s *priv, FAR const char *msg) static void mcan_dev_lock(FAR struct sam_mcan_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal. - */ - - do - { - ret = nxsem_wait(&priv->locksem); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->locksem); } /**************************************************************************** @@ -1440,7 +1428,7 @@ static void mcan_buffer_reserve(FAR struct sam_mcan_s *priv) flags = enter_critical_section(); txfqs1 = mcan_getreg(priv, SAM_MCAN_TXFQS_OFFSET); - (void)nxsem_getvalue(&priv->txfsem, &sval); + nxsem_getvalue(&priv->txfsem, &sval); txfqs2 = mcan_getreg(priv, SAM_MCAN_TXFQS_OFFSET); /* If the semaphore count and the TXFQS samples are in @@ -1549,7 +1537,6 @@ static void mcan_buffer_reserve(FAR struct sam_mcan_s *priv) ret = nxsem_wait(&priv->txfsem); leave_critical_section(flags); - DEBUGASSERT(ret == OK || ret == -EINTR); } while (ret < 0); } @@ -1586,7 +1573,7 @@ static void mcan_buffer_release(FAR struct sam_mcan_s *priv) * many times. */ - (void)nxsem_getvalue(&priv->txfsem, &sval); + nxsem_getvalue(&priv->txfsem, &sval); if (sval < priv->config->ntxfifoq) { nxsem_post(&priv->txfsem); @@ -2975,7 +2962,7 @@ static int mcan_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) * called from the tasking level. */ - (void)can_txdone(dev); + can_txdone(dev); return OK; } @@ -3020,7 +3007,7 @@ static bool mcan_txready(FAR struct can_dev_s *dev) * the TX FIFO/queue. Make sure that they are consistent. */ - (void)nxsem_getvalue(&priv->txfsem, &sval); + nxsem_getvalue(&priv->txfsem, &sval); DEBUGASSERT(((notfull && sval > 0) || (!notfull && sval <= 0)) && (sval <= priv->config->ntxfifoq)); #endif @@ -3087,7 +3074,7 @@ static bool mcan_txempty(FAR struct can_dev_s *dev) * elements, then there is no transfer in progress. */ - (void)nxsem_getvalue(&priv->txfsem, &sval); + nxsem_getvalue(&priv->txfsem, &sval); DEBUGASSERT(sval > 0 && sval <= priv->config->ntxfifoq); empty = (sval == priv->config->ntxfifoq); @@ -3552,7 +3539,7 @@ static int mcan_interrupt(int irq, void *context, FAR void *arg) * data in mcan_send(). */ - (void)can_txready(dev); + can_txready(dev); #endif } else if ((pending & priv->txints) != 0) diff --git a/arch/arm/src/samv7/sam_oneshot.c b/arch/arm/src/samv7/sam_oneshot.c index 0162a4d0e6..8fb50a875e 100644 --- a/arch/arm/src/samv7/sam_oneshot.c +++ b/arch/arm/src/samv7/sam_oneshot.c @@ -290,7 +290,7 @@ int sam_oneshot_start(struct sam_oneshot_s *oneshot, /* Yes.. then cancel it */ tmrinfo("Already running... cancelling\n"); - (void)sam_oneshot_cancel(oneshot, freerun, NULL); + sam_oneshot_cancel(oneshot, freerun, NULL); } /* Save the new handler and its argument */ @@ -317,8 +317,8 @@ int sam_oneshot_start(struct sam_oneshot_s *oneshot, /* Set up to receive the callback when the interrupt occurs */ - (void)sam_tc_attach(oneshot->tch, sam_oneshot_handler, oneshot, - TC_INT_CPCS); + sam_tc_attach(oneshot->tch, sam_oneshot_handler, oneshot, + TC_INT_CPCS); /* Set RC so that an event will be triggered when TC_CV register counts * up to RC. diff --git a/arch/arm/src/samv7/sam_pck.c b/arch/arm/src/samv7/sam_pck.c index d372cbe916..9b467bc9e4 100644 --- a/arch/arm/src/samv7/sam_pck.c +++ b/arch/arm/src/samv7/sam_pck.c @@ -156,7 +156,7 @@ uint32_t sam_pck_configure(enum pckid_e pckid, enum pckid_clksrc_e clksrc, case PCK0: putreg32(PMC_PCK0, SAM_PMC_SCDR); #ifdef GPIO_PMC_PCK0 - (void)cam_configgpio(GPIO_PMC_PCK0); + cam_configgpio(GPIO_PMC_PCK0); #endif putreg32(regval, SAM_PMC_PCK0); break; @@ -164,7 +164,7 @@ uint32_t sam_pck_configure(enum pckid_e pckid, enum pckid_clksrc_e clksrc, case PCK1: putreg32(PMC_PCK1, SAM_PMC_SCDR); #ifdef GPIO_PMC_PCK1 - (void)cam_configgpio(GPIO_PMC_PCK1); + cam_configgpio(GPIO_PMC_PCK1); #endif putreg32(regval, SAM_PMC_PCK1); break; @@ -172,7 +172,7 @@ uint32_t sam_pck_configure(enum pckid_e pckid, enum pckid_clksrc_e clksrc, case PCK2: putreg32(PMC_PCK2, SAM_PMC_SCDR); #ifdef GPIO_PMC_PCK2 - (void)cam_configgpio(GPIO_PMC_PCK2); + cam_configgpio(GPIO_PMC_PCK2); #endif putreg32(regval, SAM_PMC_PCK2); break; @@ -180,7 +180,7 @@ uint32_t sam_pck_configure(enum pckid_e pckid, enum pckid_clksrc_e clksrc, case PCK3: putreg32(PMC_PCK3, SAM_PMC_SCDR); #ifdef GPIO_PMC_PCK3 - (void)cam_configgpio(GPIO_PMC_PCK3); + cam_configgpio(GPIO_PMC_PCK3); #endif putreg32(regval, SAM_PMC_PCK3); break; @@ -188,7 +188,7 @@ uint32_t sam_pck_configure(enum pckid_e pckid, enum pckid_clksrc_e clksrc, case PCK4: putreg32(PMC_PCK4, SAM_PMC_SCDR); #ifdef GPIO_PMC_PCK4 - (void)cam_configgpio(GPIO_PMC_PCK4); + cam_configgpio(GPIO_PMC_PCK4); #endif putreg32(regval, SAM_PMC_PCK4); break; @@ -196,7 +196,7 @@ uint32_t sam_pck_configure(enum pckid_e pckid, enum pckid_clksrc_e clksrc, case PCK5: putreg32(PMC_PCK5, SAM_PMC_SCDR); #ifdef GPIO_PMC_PCK5 - (void)cam_configgpio(GPIO_PMC_PCK5); + cam_configgpio(GPIO_PMC_PCK5); #endif putreg32(regval, SAM_PMC_PCK5); break; @@ -204,7 +204,7 @@ uint32_t sam_pck_configure(enum pckid_e pckid, enum pckid_clksrc_e clksrc, case PCK6: putreg32(PMC_PCK6, SAM_PMC_SCDR); #ifdef GPIO_PMC_PCK6 - (void)cam_configgpio(GPIO_PMC_PCK6); + cam_configgpio(GPIO_PMC_PCK6); #endif putreg32(regval, SAM_PMC_PCK6); break; diff --git a/arch/arm/src/samv7/sam_progmem.c b/arch/arm/src/samv7/sam_progmem.c index d554429ed9..de8feda2b2 100644 --- a/arch/arm/src/samv7/sam_progmem.c +++ b/arch/arm/src/samv7/sam_progmem.c @@ -187,21 +187,7 @@ static sem_t g_page_sem; static void page_buffer_lock(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_page_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_page_sem); } #define page_buffer_unlock() nxsem_post(&g_page_sem) @@ -518,7 +504,7 @@ ssize_t up_progmem_eraseblock(size_t cluster) /* Erase all pages in the cluster */ - (void)efc_unlock(page, SAMV7_PAGE_PER_CLUSTER); + efc_unlock(page, SAMV7_PAGE_PER_CLUSTER); /* Get FARG field for EPA command: * @@ -680,7 +666,7 @@ ssize_t up_progmem_write(size_t address, const void *buffer, size_t buflen) /* Make sure that the FLASH is unlocked */ - (void)efc_unlock(page, SAMV7_BYTE2PAGE(buflen + SAMV7_PAGE_MASK)); + efc_unlock(page, SAMV7_BYTE2PAGE(buflen + SAMV7_PAGE_MASK)); /* Loop until all of the data has been written */ diff --git a/arch/arm/src/samv7/sam_qspi.c b/arch/arm/src/samv7/sam_qspi.c index db7520434e..5197cff5ea 100644 --- a/arch/arm/src/samv7/sam_qspi.c +++ b/arch/arm/src/samv7/sam_qspi.c @@ -631,7 +631,7 @@ static void qspi_dma_callback(DMA_HANDLE handle, void *arg, int result) /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->dmadog); + wd_cancel(priv->dmadog); /* Sample DMA registers at the time of the callback */ @@ -782,7 +782,7 @@ static int qspi_memory_enable(struct sam_qspidev_s *priv, /* Write the instruction frame value */ qspi_putreg(priv, regval, SAM_QSPI_IFR_OFFSET); - (void)qspi_getreg(priv, SAM_QSPI_IFR_OFFSET); + qspi_getreg(priv, SAM_QSPI_IFR_OFFSET); return OK; } @@ -892,17 +892,15 @@ static int qspi_memory_dma(struct sam_qspidev_s *priv, /* Wait for the DMA complete */ - ret = nxsem_wait(&priv->dmawait); + ret = nxsem_wait_uninterruptible(&priv->dmawait); /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->dmadog); + wd_cancel(priv->dmadog); - /* Check if we were awakened by an error of some kind. EINTR is not a - * failure. That simply means that the wait was awakened by a signal. - */ + /* Check if we were awakened by an error of some kind. */ - if (ret < 0 && ret != -EINTR) + if (ret < 0) { DEBUGPANIC(); return ret; @@ -1060,24 +1058,11 @@ static int qspi_lock(struct qspi_dev_s *dev, bool lock) spiinfo("lock=%d\n", lock); if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -1452,7 +1437,7 @@ static int qspi_command(struct qspi_dev_s *dev, * accesses. */ - (void)qspi_getreg(priv, SAM_QSPI_IFR_OFFSET); + qspi_getreg(priv, SAM_QSPI_IFR_OFFSET); /* Copy the data to write to QSPI_RAM */ @@ -1476,7 +1461,7 @@ static int qspi_command(struct qspi_dev_s *dev, * accesses. */ - (void)qspi_getreg(priv, SAM_QSPI_IFR_OFFSET); + qspi_getreg(priv, SAM_QSPI_IFR_OFFSET); /* Copy the data from QSPI memory into the user buffer */ @@ -1697,8 +1682,8 @@ static int qspi_hw_initialize(struct sam_qspidev_s *priv) /* Flush any pending transfers */ - (void)qspi_getreg(priv, SAM_QSPI_SR_OFFSET); - (void)qspi_getreg(priv, SAM_QSPI_RDR_OFFSET); + qspi_getreg(priv, SAM_QSPI_SR_OFFSET); + qspi_getreg(priv, SAM_QSPI_RDR_OFFSET); qspi_dumpregs(priv, "After initialization"); return OK; diff --git a/arch/arm/src/samv7/sam_rswdt.c b/arch/arm/src/samv7/sam_rswdt.c index 5651e612ee..c1d849e9fc 100644 --- a/arch/arm/src/samv7/sam_rswdt.c +++ b/arch/arm/src/samv7/sam_rswdt.c @@ -684,13 +684,13 @@ int sam_rswdt_initialize(void) #ifdef CONFIG_SAMV7_RSWDT_INTERRUPT /* Attach our RSWDT interrupt handler (But don't enable it yet) */ - (void)irq_attach(SAM_IRQ_RSWDT, sam_interrupt, NULL); + irq_attach(SAM_IRQ_RSWDT, sam_interrupt, NULL); #endif /* Register the watchdog driver as /dev/rswdt */ - (void)watchdog_register("/dev/rswdt", - (FAR struct watchdog_lowerhalf_s *)priv); + watchdog_register("/dev/rswdt", + (FAR struct watchdog_lowerhalf_s *)priv); return OK; } diff --git a/arch/arm/src/samv7/sam_serial.c b/arch/arm/src/samv7/sam_serial.c index 3248bcd90a..c57bc55713 100644 --- a/arch/arm/src/samv7/sam_serial.c +++ b/arch/arm/src/samv7/sam_serial.c @@ -1457,34 +1457,34 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all USARTs */ #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #endif #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif #ifdef TTYS6_DEV - (void)uart_register("/dev/ttyS6", &TTYS6_DEV); + uart_register("/dev/ttyS6", &TTYS6_DEV); #endif #ifdef TTYS7_DEV - (void)uart_register("/dev/ttyS7", &TTYS7_DEV); + uart_register("/dev/ttyS7", &TTYS7_DEV); #endif } diff --git a/arch/arm/src/samv7/sam_spi.c b/arch/arm/src/samv7/sam_spi.c index ef5118334f..bbcaf64a9b 100644 --- a/arch/arm/src/samv7/sam_spi.c +++ b/arch/arm/src/samv7/sam_spi.c @@ -580,7 +580,7 @@ static inline void spi_flush(struct sam_spidev_s *spi) while ((spi_getreg(spi, SAM_SPI_SR_OFFSET) & SPI_INT_RDRF) != 0) { - (void)spi_getreg(spi, SAM_SPI_RDR_OFFSET); + spi_getreg(spi, SAM_SPI_RDR_OFFSET); } } @@ -799,7 +799,7 @@ static void spi_rxcallback(DMA_HANDLE handle, void *arg, int result) /* Cancel the watchdog timeout */ - (void)wd_cancel(spics->dmadog); + wd_cancel(spics->dmadog); /* Sample DMA registers at the time of the callback */ @@ -907,26 +907,11 @@ static int spi_lock(struct spi_dev_s *dev, bool lock) spiinfo("lock=%d\n", lock); if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&spi->spisem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&spi->spisem); } else { - (void)nxsem_post(&spi->spisem); - ret = OK; + ret = nxsem_post(&spi->spisem); } return ret; @@ -1870,17 +1855,15 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, /* Wait for the DMA complete */ - ret = nxsem_wait(&spics->dmawait); + ret = nxsem_wait_uninterruptible(&spics->dmawait); /* Cancel the watchdog timeout */ - (void)wd_cancel(spics->dmadog); + wd_cancel(spics->dmadog); - /* Check if we were awakened by an error of some kind. EINTR is not a - * failure. It simply means that the wait was awakened by a signal. - */ + /* Check if we were awakened by an error of some kind. */ - if (ret < 0 && ret != -EINTR) + if (ret < 0) { DEBUGPANIC(); return; @@ -2155,8 +2138,8 @@ FAR struct spi_dev_s *sam_spibus_initialize(int port) /* Flush any pending transfers */ - (void)spi_getreg(spi, SAM_SPI_SR_OFFSET); - (void)spi_getreg(spi, SAM_SPI_RDR_OFFSET); + spi_getreg(spi, SAM_SPI_SR_OFFSET); + spi_getreg(spi, SAM_SPI_RDR_OFFSET); /* Initialize the SPI semaphore that enforces mutually exclusive * access to the SPI registers. diff --git a/arch/arm/src/samv7/sam_spi_slave.c b/arch/arm/src/samv7/sam_spi_slave.c index 9206b4e4a5..b0605e80b0 100644 --- a/arch/arm/src/samv7/sam_spi_slave.c +++ b/arch/arm/src/samv7/sam_spi_slave.c @@ -360,19 +360,7 @@ static void spi_dumpregs(struct sam_spidev_s *priv, const char *msg) static void spi_semtake(struct sam_spidev_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal. - */ - - do - { - ret = nxsem_wait(&priv->spisem); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->spisem); } /**************************************************************************** @@ -1191,8 +1179,8 @@ struct spi_sctrlr_s *sam_spi_slave_initialize(int port) /* Flush any pending interrupts/transfers */ - (void)spi_getreg(priv, SAM_SPI_SR_OFFSET); - (void)spi_getreg(priv, SAM_SPI_RDR_OFFSET); + spi_getreg(priv, SAM_SPI_SR_OFFSET); + spi_getreg(priv, SAM_SPI_RDR_OFFSET); /* Initialize the SPI semaphore that enforces mutually exclusive * access to the SPI registers. diff --git a/arch/arm/src/samv7/sam_ssc.c b/arch/arm/src/samv7/sam_ssc.c index db730b66cb..e49aa63a7b 100644 --- a/arch/arm/src/samv7/sam_ssc.c +++ b/arch/arm/src/samv7/sam_ssc.c @@ -862,19 +862,7 @@ static void ssc_dump_queues(struct sam_transport_s *xpt, const char *msg) static void ssc_exclsem_take(struct sam_ssc_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal. - */ - - do - { - ret = nxsem_wait(&priv->exclsem); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); } /**************************************************************************** @@ -893,19 +881,7 @@ static void ssc_exclsem_take(struct sam_ssc_s *priv) static void ssc_bufsem_take(struct sam_ssc_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal. - */ - - do - { - ret = nxsem_wait(&priv->bufsem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->bufsem); } /**************************************************************************** @@ -1423,7 +1399,7 @@ static void ssc_rx_worker(void *arg) */ flags = enter_critical_section(); - (void)ssc_rxdma_setup(priv); + ssc_rxdma_setup(priv); leave_critical_section(flags); } @@ -1569,7 +1545,7 @@ static void ssc_rxdma_callback(DMA_HANDLE handle, void *arg, int result) /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->rx.dog); + wd_cancel(priv->rx.dog); /* Sample DMA registers at the time of the DMA completion */ @@ -1839,7 +1815,7 @@ static void ssc_tx_worker(void *arg) */ flags = enter_critical_section(); - (void)ssc_txdma_setup(priv); + ssc_txdma_setup(priv); leave_critical_section(flags); } @@ -1973,7 +1949,7 @@ static void ssc_txdma_callback(DMA_HANDLE handle, void *arg, int result) /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->tx.dog); + wd_cancel(priv->tx.dog); /* Sample DMA registers at the time of the DMA completion */ @@ -2880,7 +2856,7 @@ static void ssc_clocking(struct sam_ssc_s *priv) /* Configure MCK/2 divider */ - (void)ssc_mck2divider(priv); + ssc_mck2divider(priv); /* Enable peripheral clocking */ diff --git a/arch/arm/src/samv7/sam_tc.c b/arch/arm/src/samv7/sam_tc.c index 535d3df5ad..1e6821599e 100644 --- a/arch/arm/src/samv7/sam_tc.c +++ b/arch/arm/src/samv7/sam_tc.c @@ -610,21 +610,7 @@ static const uint8_t g_regoffset[TC_NREGISTERS] = static void sam_takesem(struct sam_tc_s *tc) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&tc->exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&tc->exclsem); } /**************************************************************************** @@ -1212,7 +1198,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) /* Disable and clear all channel interrupts */ sam_chan_putreg(chan, SAM_TC_IDR_OFFSET, TC_INT_ALL); - (void)sam_chan_getreg(chan, SAM_TC_SR_OFFSET); + sam_chan_getreg(chan, SAM_TC_SR_OFFSET); } /* Now the timer/counter is initialized */ @@ -1284,7 +1270,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) /* Attach the timer interrupt handler and enable the timer interrupts */ - (void)irq_attach(chconfig->irq, chconfig->handler, NULL); + irq_attach(chconfig->irq, chconfig->handler, NULL); up_enable_irq(chconfig->irq); /* Mark the channel "inuse" */ @@ -1342,7 +1328,7 @@ TC_HANDLE sam_tc_allocate(int channel, int mode) /* Clear and pending status */ - (void)sam_chan_getreg(chan, SAM_TC_SR_OFFSET); + sam_chan_getreg(chan, SAM_TC_SR_OFFSET); /* And set the requested mode */ @@ -1413,7 +1399,7 @@ void sam_tc_start(TC_HANDLE handle) /* Read the SR to clear any pending interrupts on this channel */ - (void)sam_chan_getreg(chan, SAM_TC_SR_OFFSET); + sam_chan_getreg(chan, SAM_TC_SR_OFFSET); /* Then enable the timer (by setting the CLKEN bit). Setting SWTRIG * will also reset the timer counter and starting the timer. diff --git a/arch/arm/src/samv7/sam_timerisr.c b/arch/arm/src/samv7/sam_timerisr.c index 6c161bd633..5ae1982b61 100644 --- a/arch/arm/src/samv7/sam_timerisr.c +++ b/arch/arm/src/samv7/sam_timerisr.c @@ -130,7 +130,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr, NULL); + irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr, NULL); /* Enable SysTick interrupts (no divide-by-8) */ diff --git a/arch/arm/src/samv7/sam_trng.c b/arch/arm/src/samv7/sam_trng.c index 13e67336e3..a9b5ddb6c3 100644 --- a/arch/arm/src/samv7/sam_trng.c +++ b/arch/arm/src/samv7/sam_trng.c @@ -277,7 +277,7 @@ static ssize_t sam_read(struct file *filep, char *buffer, size_t buflen) * register */ - (void)getreg32(SAM_TRNG_ISR); + getreg32(SAM_TRNG_ISR); /* Enable TRNG interrupts */ diff --git a/arch/arm/src/samv7/sam_twihs.c b/arch/arm/src/samv7/sam_twihs.c index 6dc4b139d6..868c5b2b23 100644 --- a/arch/arm/src/samv7/sam_twihs.c +++ b/arch/arm/src/samv7/sam_twihs.c @@ -313,21 +313,7 @@ static const struct i2c_ops_s g_twiops = static void twi_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -491,8 +477,8 @@ static int twi_wait(struct twi_dev_s *priv, unsigned int size) * TWIHS transfer stalls. */ - (void)wd_start(priv->timeout, (timeout * size), twi_timeout, 1, - (uint32_t)priv); + wd_start(priv->timeout, (timeout * size), twi_timeout, 1, + (uint32_t)priv); /* Wait for either the TWIHS transfer or the timeout to complete */ @@ -1259,7 +1245,7 @@ static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency) /* Reset the TWIHS */ twi_putrel(priv, SAM_TWIHS_CR_OFFSET, TWIHS_CR_SWRST); - (void)twi_getrel(priv, SAM_TWIHS_RHR_OFFSET); + twi_getrel(priv, SAM_TWIHS_RHR_OFFSET); /* TWIHS Slave Mode Disabled, TWIHS Master Mode Disabled. */ @@ -1439,8 +1425,8 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) /* Initialize semaphores */ - (void)nxsem_init(&priv->exclsem, 0, 1); - (void)nxsem_init(&priv->waitsem, 0, 0); + nxsem_init(&priv->exclsem, 0, 1); + nxsem_init(&priv->waitsem, 0, 0); /* The waitsem semaphore is used for signaling and, hence, should not * have priority inheritance enabled. @@ -1510,7 +1496,7 @@ int sam_i2cbus_uninitialize(FAR struct i2c_master_s *dev) /* Detach Interrupt Handler */ - (void)irq_detach(priv->attr->irq); + irq_detach(priv->attr->irq); } leave_critical_section(flags); diff --git a/arch/arm/src/samv7/sam_usbdevhs.c b/arch/arm/src/samv7/sam_usbdevhs.c index b474f334ec..4160b7a74d 100644 --- a/arch/arm/src/samv7/sam_usbdevhs.c +++ b/arch/arm/src/samv7/sam_usbdevhs.c @@ -980,7 +980,7 @@ static void sam_dma_single(uint8_t epno, struct sam_req_s *privreq, /* Clear any pending interrupts then enable the DMA interrupt */ - (void)sam_getreg(SAM_USBHS_DEVDMASTA(epno)); + sam_getreg(SAM_USBHS_DEVDMASTA(epno)); sam_putreg(USBHS_DEVINT_DMA(epno), SAM_USBHS_DEVIER); /* Setup and enable the DMA */ @@ -1945,7 +1945,7 @@ static void sam_ep0_dispatch(struct sam_usbdev_s *priv) /* Stall on failure */ usbtrace(TRACE_DEVERROR(SAM_TRACEERR_DISPATCHSTALL), 0); - (void)sam_ep_stall(&priv->eplist[EP0].ep, false); + sam_ep_stall(&priv->eplist[EP0].ep, false); } } } @@ -2414,7 +2414,7 @@ static void sam_ep0_setup(struct sam_usbdev_s *priv) usbtrace(TRACE_DEVERROR(SAM_TRACEERR_EP0SETUPSTALLED), priv->ctrl.req); - (void)sam_ep_stall(&priv->eplist[EP0].ep, false); + sam_ep_stall(&priv->eplist[EP0].ep, false); } break; @@ -2564,7 +2564,7 @@ static void sam_dma_interrupt(struct sam_usbdev_s *priv, int epno) sam_putreg(USBHS_DEVEPTINT_TXINI, SAM_USBHS_DEVEPTICR(epno)); privep->epstate = USBHS_EPSTATE_IDLE; - (void)sam_req_write(priv, privep); + sam_req_write(priv, privep); } } else if (privep->epstate == USBHS_EPSTATE_RECEIVING) @@ -2594,7 +2594,7 @@ static void sam_dma_interrupt(struct sam_usbdev_s *priv, int epno) */ privep->epstate = USBHS_EPSTATE_IDLE; - (void)sam_req_read(priv, privep, xfrsize); + sam_req_read(priv, privep, xfrsize); } else { @@ -2650,7 +2650,7 @@ static void sam_dma_interrupt(struct sam_usbdev_s *priv, int epno) */ privep->epstate = USBHS_EPSTATE_IDLE; - (void)sam_req_read(priv, privep, xfrsize); + sam_req_read(priv, privep, xfrsize); } else { @@ -2719,7 +2719,7 @@ static void sam_ep_interrupt(struct sam_usbdev_s *priv, int epno) /* Continue/resume processing the write requests. */ privep->epstate = USBHS_EPSTATE_IDLE; - (void)sam_req_write(priv, privep); + sam_req_write(priv, privep); } else #endif @@ -2756,7 +2756,7 @@ static void sam_ep_interrupt(struct sam_usbdev_s *priv, int epno) } privep->epstate = USBHS_EPSTATE_IDLE; - (void)sam_req_write(priv, privep); + sam_req_write(priv, privep); } /* Setting of the device address is a special case. The address was @@ -2861,7 +2861,7 @@ static void sam_ep_interrupt(struct sam_usbdev_s *priv, int epno) /* STALL and discard received data. */ - (void)sam_ep_stall(&privep->ep, false); + sam_ep_stall(&privep->ep, false); sam_putreg(USBHS_DEVEPTINT_STALLRQI, SAM_USBHS_DEVEPTICR(epno)); } } @@ -4053,13 +4053,13 @@ static int sam_ep_stall(struct usbdev_ep_s *ep, bool resume) { /* IN endpoint (or EP0). Restart any queued write requests */ - (void)sam_req_write(priv, privep); + sam_req_write(priv, privep); } else { /* OUT endpoint. Restart any queued read requests. */ - (void)sam_req_read(priv, privep, 0); + sam_req_read(priv, privep, 0); } } } diff --git a/arch/arm/src/samv7/sam_wdt.c b/arch/arm/src/samv7/sam_wdt.c index b6990b9370..cc5330fb6d 100644 --- a/arch/arm/src/samv7/sam_wdt.c +++ b/arch/arm/src/samv7/sam_wdt.c @@ -697,15 +697,15 @@ int sam_wdt_initialize(void) #ifdef CONFIG_SAMV7_WDT_INTERRUPT /* Attach our WDT interrupt handler (But don't enable it yet) */ - (void)irq_attach(SAM_IRQ_WDT, sam_interrupt, NULL); + irq_attach(SAM_IRQ_WDT, sam_interrupt, NULL); #endif /* Register the watchdog driver as device-node configured via .config. * Normally /dev/watchdog0 */ - (void)watchdog_register(CONFIG_WATCHDOG_DEVPATH, - (FAR struct watchdog_lowerhalf_s *)priv); + watchdog_register(CONFIG_WATCHDOG_DEVPATH, + (FAR struct watchdog_lowerhalf_s *)priv); return OK; } diff --git a/arch/arm/src/samv7/sam_xdmac.c b/arch/arm/src/samv7/sam_xdmac.c index dcc6f3cef7..24e4d5f69a 100644 --- a/arch/arm/src/samv7/sam_xdmac.c +++ b/arch/arm/src/samv7/sam_xdmac.c @@ -369,26 +369,12 @@ static struct sam_xdmac_s g_xdmac; static void sam_takechsem(struct sam_xdmac_s *xdmac) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&xdmac->chsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&xdmac->chsem); } static inline void sam_givechsem(struct sam_xdmac_s *xdmac) { - (void)nxsem_post(&xdmac->chsem); + nxsem_post(&xdmac->chsem); } /**************************************************************************** @@ -401,26 +387,12 @@ static inline void sam_givechsem(struct sam_xdmac_s *xdmac) static void sam_takedsem(struct sam_xdmac_s *xdmac) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&xdmac->dsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&xdmac->dsem); } static inline void sam_givedsem(struct sam_xdmac_s *xdmac) { - (void)nxsem_post(&xdmac->dsem); + nxsem_post(&xdmac->dsem); } /**************************************************************************** @@ -1257,7 +1229,7 @@ static inline int sam_single(struct sam_xdmach_s *xdmach) * reading the XDMAC Channel Interrupt Status Register (CIS). */ - (void)sam_getdmach(xdmach, SAM_XDMACH_CIS_OFFSET); + sam_getdmach(xdmach, SAM_XDMACH_CIS_OFFSET); /* 3. Write the starting source address in the Channel Source Address (CSA) * Register. @@ -1359,7 +1331,7 @@ static inline int sam_multiple(struct sam_xdmach_s *xdmach) * reading the XDMAC Channel Interrupt Status Register (CIS). */ - (void)sam_getdmach(xdmach, SAM_XDMACH_CIS_OFFSET); + sam_getdmach(xdmach, SAM_XDMACH_CIS_OFFSET); /* 3. Build a linked list of transfer descriptors in memory. The * descriptor view is programmable on a per descriptor basis. The @@ -1630,7 +1602,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vector */ - (void)irq_attach(SAM_IRQ_XDMAC, sam_xdmac_interrupt, NULL); + irq_attach(SAM_IRQ_XDMAC, sam_xdmac_interrupt, NULL); /* Initialize the controller */ @@ -1682,7 +1654,7 @@ DMA_HANDLE sam_dmachannel(uint8_t dmacno, uint32_t chflags) * Channel Interrupt Status (CIS) Register */ - (void)sam_getdmach(xdmach, SAM_XDMACH_CIS_OFFSET); + sam_getdmach(xdmach, SAM_XDMACH_CIS_OFFSET); /* Disable the channel by writing one to the write-only Global * Channel Disable (GD) Register diff --git a/arch/arm/src/stm32/stm32_1wire.c b/arch/arm/src/stm32/stm32_1wire.c index dc4aef9cba..fe2a1d68d4 100644 --- a/arch/arm/src/stm32/stm32_1wire.c +++ b/arch/arm/src/stm32/stm32_1wire.c @@ -752,21 +752,7 @@ static inline void stm32_1wire_sem_destroy(FAR struct stm32_1wire_priv_s *priv) static inline void stm32_1wire_sem_wait(FAR struct stm32_1wire_priv_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sem_excl); } /**************************************************************************** @@ -828,7 +814,7 @@ static int stm32_1wire_process(struct stm32_1wire_priv_s *priv, clock_gettime(CLOCK_REALTIME, &abstime); abstime.tv_sec += BUS_TIMEOUT; - (void)nxsem_timedwait(&priv->sem_isr, &abstime); + nxsem_timedwait(&priv->sem_isr, &abstime); break; case ONEWIRETASK_WRITE: @@ -851,7 +837,7 @@ static int stm32_1wire_process(struct stm32_1wire_priv_s *priv, clock_gettime(CLOCK_REALTIME, &abstime); abstime.tv_sec += BUS_TIMEOUT; - (void)nxsem_timedwait(&priv->sem_isr, &abstime); + nxsem_timedwait(&priv->sem_isr, &abstime); break; case ONEWIRETASK_READ: @@ -874,7 +860,7 @@ static int stm32_1wire_process(struct stm32_1wire_priv_s *priv, clock_gettime(CLOCK_REALTIME, &abstime); abstime.tv_sec += BUS_TIMEOUT; - (void)nxsem_timedwait(&priv->sem_isr, &abstime); + nxsem_timedwait(&priv->sem_isr, &abstime); break; } @@ -1015,7 +1001,7 @@ static int stm32_1wire_isr(int irq, void *context, void *arg) * good byte will be lost. */ - (void)stm32_1wire_recv(priv); + stm32_1wire_recv(priv); #endif if (priv->msgs != NULL) diff --git a/arch/arm/src/stm32/stm32_adc.c b/arch/arm/src/stm32/stm32_adc.c index 37e4c77481..e792760834 100644 --- a/arch/arm/src/stm32/stm32_adc.c +++ b/arch/arm/src/stm32/stm32_adc.c @@ -1854,28 +1854,15 @@ static void adc_inj_startconv(FAR struct stm32_dev_s *priv, bool enable) #ifdef HAVE_ADC_CMN_DATA static int adccmn_lock(FAR struct stm32_dev_s *priv, bool lock) { - int ret; + int ret = OK; if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->cmn->lock); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->cmn->lock); } else { - (void)nxsem_post(&priv->cmn->lock); - ret = OK; + nxsem_post(&priv->cmn->lock); } return ret; @@ -2803,7 +2790,7 @@ static void adc_configure(FAR struct adc_dev_s *dev) #ifdef HAVE_ADC_RESOLUTION /* Configure ADC resolution */ - (void)adc_resolution_set(dev, priv->resolution); + adc_resolution_set(dev, priv->resolution); #endif #ifdef ADC_HAVE_EXTCFG diff --git a/arch/arm/src/stm32/stm32_aes.c b/arch/arm/src/stm32/stm32_aes.c index 5c46040e01..7115bdf8a2 100644 --- a/arch/arm/src/stm32/stm32_aes.c +++ b/arch/arm/src/stm32/stm32_aes.c @@ -130,8 +130,6 @@ static void stm32aes_setkey(FAR const void *key, size_t key_len) { FAR uint32_t *in = (FAR uint32_t *)key; - (void)key_len; - putreg32(__builtin_bswap32(*in), STM32_AES_KEYR3); in++; putreg32(__builtin_bswap32(*in), STM32_AES_KEYR2); diff --git a/arch/arm/src/stm32/stm32_bbsram.c b/arch/arm/src/stm32/stm32_bbsram.c index 3bd1626efb..51c388851e 100644 --- a/arch/arm/src/stm32/stm32_bbsram.c +++ b/arch/arm/src/stm32/stm32_bbsram.c @@ -220,19 +220,7 @@ static void stm32_bbsram_semgive(FAR struct stm32_bbsram_s *priv) static void stm32_bbsram_semtake(FAR struct stm32_bbsram_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal. - */ - - do - { - ret = nxsem_wait(&priv->exclsem); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); } /**************************************************************************** @@ -336,7 +324,7 @@ static int stm32_bbsram_open(FAR struct file *filep) static int stm32_bbsram_internal_close(FAR struct bbsramfh_s *bbf) { bbf->dirty = 0; - (void)clock_gettime(CLOCK_REALTIME, &bbf->lastwrite); + clock_gettime(CLOCK_REALTIME, &bbf->lastwrite); bbf->crc = stm32_bbsram_crc(bbf); BBSRAM_DUMP(bbf, "close done"); diff --git a/arch/arm/src/stm32/stm32_can.c b/arch/arm/src/stm32/stm32_can.c index d69439b682..1f3a4cf512 100644 --- a/arch/arm/src/stm32/stm32_can.c +++ b/arch/arm/src/stm32/stm32_can.c @@ -1559,7 +1559,7 @@ static int stm32can_txinterrupt(int irq, FAR void *context, FAR void *arg) /* Tell the upper half that the transfer is finished. */ - (void)can_txdone(dev); + can_txdone(dev); } /* Check for RQCP1: Request completed mailbox 1 */ @@ -1574,7 +1574,7 @@ static int stm32can_txinterrupt(int irq, FAR void *context, FAR void *arg) /* Tell the upper half that the transfer is finished. */ - (void)can_txdone(dev); + can_txdone(dev); } /* Check for RQCP2: Request completed mailbox 2 */ @@ -1589,7 +1589,7 @@ static int stm32can_txinterrupt(int irq, FAR void *context, FAR void *arg) /* Tell the upper half that the transfer is finished. */ - (void)can_txdone(dev); + can_txdone(dev); } return OK; diff --git a/arch/arm/src/stm32/stm32_dma2d.c b/arch/arm/src/stm32/stm32_dma2d.c index 67c86deb2a..5b67a628b5 100644 --- a/arch/arm/src/stm32/stm32_dma2d.c +++ b/arch/arm/src/stm32/stm32_dma2d.c @@ -1130,7 +1130,7 @@ int stm32_dma2dinitialize(void) /* Attach DMA2D interrupt vector */ - (void)irq_attach(g_interrupt.irq, stm32_dma2dirq, NULL); + irq_attach(g_interrupt.irq, stm32_dma2dirq, NULL); /* Enable the IRQ at the NVIC */ diff --git a/arch/arm/src/stm32/stm32_dma_v1.c b/arch/arm/src/stm32/stm32_dma_v1.c index ff31979340..7dce110ad9 100644 --- a/arch/arm/src/stm32/stm32_dma_v1.c +++ b/arch/arm/src/stm32/stm32_dma_v1.c @@ -224,26 +224,12 @@ static inline void dmachan_putreg(struct stm32_dma_s *dmach, uint32_t offset, ui static void stm32_dmatake(FAR struct stm32_dma_s *dmach) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&dmach->sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&dmach->sem); } static inline void stm32_dmagive(FAR struct stm32_dma_s *dmach) { - (void)nxsem_post(&dmach->sem); + nxsem_post(&dmach->sem); } /************************************************************************************ @@ -357,7 +343,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vectors */ - (void)irq_attach(dmach->irq, stm32_dmainterrupt, NULL); + irq_attach(dmach->irq, stm32_dmainterrupt, NULL); /* Disable the DMA channel */ diff --git a/arch/arm/src/stm32/stm32_dma_v2.c b/arch/arm/src/stm32/stm32_dma_v2.c index 67590fe38d..311e43c814 100644 --- a/arch/arm/src/stm32/stm32_dma_v2.c +++ b/arch/arm/src/stm32/stm32_dma_v2.c @@ -247,26 +247,12 @@ static inline void dmast_putreg(struct stm32_dma_s *dmast, uint32_t offset, uint static void stm32_dmatake(FAR struct stm32_dma_s *dmast) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&dmast->sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&dmast->sem); } static inline void stm32_dmagive(FAR struct stm32_dma_s *dmast) { - (void)nxsem_post(&dmast->sem); + nxsem_post(&dmast->sem); } /************************************************************************************ @@ -481,7 +467,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vectors */ - (void)irq_attach(dmast->irq, stm32_dmainterrupt, dmast); + irq_attach(dmast->irq, stm32_dmainterrupt, dmast); /* Disable the DMA stream */ diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index 929d32a4f1..744193153b 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -1211,7 +1211,7 @@ static int stm32_transmit(FAR struct stm32_ethmac_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, STM32_TXTIMEOUT, stm32_txtimeout_expiry, 1, (uint32_t)priv); + wd_start(priv->txtimeout, STM32_TXTIMEOUT, stm32_txtimeout_expiry, 1, (uint32_t)priv); return OK; } @@ -1375,7 +1375,7 @@ static void stm32_dopoll(FAR struct stm32_ethmac_s *priv) if (dev->d_buf) { - (void)devif_poll(dev, stm32_txpoll); + devif_poll(dev, stm32_txpoll); /* We will, most likely end up with a buffer to be freed. But it * might not be the same one that we allocated above. @@ -2174,8 +2174,8 @@ static void stm32_txtimeout_work(FAR void *arg) /* Reset the hardware. Just take the interface down, then back up again. */ net_lock(); - (void)stm32_ifdown(&priv->dev); - (void)stm32_ifup(&priv->dev); + stm32_ifdown(&priv->dev); + stm32_ifup(&priv->dev); /* Then poll for new XMIT data */ @@ -2275,7 +2275,7 @@ static void stm32_poll_work(FAR void *arg) /* Update TCP timing states and poll the network for new XMIT data. */ - (void)devif_timer(dev, STM32_WDDELAY, stm32_txpoll); + devif_timer(dev, STM32_WDDELAY, stm32_txpoll); /* We will, most likely end up with a buffer to be freed. But it * might not be the same one that we allocated above. @@ -2292,7 +2292,7 @@ static void stm32_poll_work(FAR void *arg) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); + wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); net_unlock(); } @@ -2368,7 +2368,7 @@ static int stm32_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, (uint32_t)priv); + wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, (uint32_t)priv); /* Enable the Ethernet interrupt */ @@ -3821,7 +3821,7 @@ static void stm32_ipv6multicast(FAR struct stm32_ethmac_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)stm32_addmac(dev, mac); + stm32_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -3829,7 +3829,7 @@ static void stm32_ipv6multicast(FAR struct stm32_ethmac_s *priv) * packets. */ - (void)stm32_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + stm32_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -3838,7 +3838,7 @@ static void stm32_ipv6multicast(FAR struct stm32_ethmac_s *priv) * packets. */ - (void)stm32_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + stm32_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -4083,7 +4083,7 @@ int stm32_ethinitialize(int intf) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->dev, NET_LL_ETHERNET); + netdev_register(&priv->dev, NET_LL_ETHERNET); return OK; } @@ -4110,7 +4110,7 @@ int stm32_ethinitialize(int intf) #if STM32_NETHERNET == 1 && !defined(CONFIG_NETDEV_LATEINIT) void up_netinitialize(void) { - (void)stm32_ethinitialize(0); + stm32_ethinitialize(0); } #endif diff --git a/arch/arm/src/stm32/stm32_hciuart.c b/arch/arm/src/stm32/stm32_hciuart.c index 840a57eaad..aec8442fbc 100644 --- a/arch/arm/src/stm32/stm32_hciuart.c +++ b/arch/arm/src/stm32/stm32_hciuart.c @@ -1799,7 +1799,7 @@ static int hciuart_interrupt(int irq, void *context, void *arg) * good byte will be lost. */ - (void)hciuart_getreg32(config, STM32_USART_RDR_OFFSET); + hciuart_getreg32(config, STM32_USART_RDR_OFFSET); #endif } @@ -2095,9 +2095,7 @@ static ssize_t hciuart_read(const struct btuart_lowerhalf_s *lower, state->rxwaiting = true; do { - int ret = nxsem_wait(&state->rxwait); - DEBUGASSERT(ret == 0 || ret == -EINTR); - UNUSED(ret); + nxsem_wait_uninterruptible(&state->rxwait); } while (state->rxwaiting); } @@ -2259,9 +2257,7 @@ static ssize_t hciuart_write(const struct btuart_lowerhalf_s *lower, state->txwaiting = true; do { - int ret = nxsem_wait(&state->txwait); - DEBUGASSERT(ret == 0 || ret == -EINTR); - UNUSED(ret); + nxsem_wait_uninterruptible(&state->txwait); } while (state->txwaiting); diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c index d6c8f6661b..2100d2f91a 100644 --- a/arch/arm/src/stm32/stm32_i2c.c +++ b/arch/arm/src/stm32/stm32_i2c.c @@ -505,21 +505,7 @@ static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv, static inline void stm32_i2c_sem_wait(FAR struct stm32_i2c_priv_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sem_excl); } /************************************************************************************ @@ -585,7 +571,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) { /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -614,12 +600,11 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->sem_isr, &abstime); - if (ret < 0 && ret != -EINTR) + ret = nxsem_timedwait_uninterruptible(&priv->sem_isr, &abstime); + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would * include timeouts and mystery errors reported by nxsem_timedwait. - * NOTE that we try again if we are awakened by a signal (EINTR). */ break; diff --git a/arch/arm/src/stm32/stm32_i2c_alt.c b/arch/arm/src/stm32/stm32_i2c_alt.c index b511aae443..ad35866f9d 100644 --- a/arch/arm/src/stm32/stm32_i2c_alt.c +++ b/arch/arm/src/stm32/stm32_i2c_alt.c @@ -514,21 +514,7 @@ static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv, static inline void stm32_i2c_sem_wait(FAR struct stm32_i2c_priv_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sem_excl); } /************************************************************************************ @@ -594,7 +580,7 @@ static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) { /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -623,12 +609,11 @@ static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->sem_isr, &abstime); - if (ret < 0 && ret != -EINTR) + ret = nxsem_timedwait_uninterruptible(&priv->sem_isr, &abstime); + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would * include timeouts and mystery errors reported by nxsem_timedwait. - * NOTE that we try again if we are awakened by a signal (EINTR). */ break; diff --git a/arch/arm/src/stm32/stm32_i2c_v2.c b/arch/arm/src/stm32/stm32_i2c_v2.c index 213a8c42d2..47f74fdae9 100644 --- a/arch/arm/src/stm32/stm32_i2c_v2.c +++ b/arch/arm/src/stm32/stm32_i2c_v2.c @@ -713,21 +713,7 @@ static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv, static inline void stm32_i2c_sem_wait(FAR struct i2c_master_s *dev) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); } /************************************************************************************ @@ -810,7 +796,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) { /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -838,12 +824,11 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) #endif /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->sem_isr, &abstime); - if (ret < 0 && ret != -EINTR) + ret = nxsem_timedwait_uninterruptible(&priv->sem_isr, &abstime); + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would * include timeouts and mystery errors reported by nxsem_timedwait. - * NOTE that we try again if we are awakened by a signal (EINTR). */ break; diff --git a/arch/arm/src/stm32/stm32_i2s.c b/arch/arm/src/stm32/stm32_i2s.c index b41d069e5b..5d2e53bd22 100644 --- a/arch/arm/src/stm32/stm32_i2s.c +++ b/arch/arm/src/stm32/stm32_i2s.c @@ -630,19 +630,7 @@ static void i2s_dump_regs(struct stm32_i2s_s *priv, const char *msg) static void i2s_exclsem_take(struct stm32_i2s_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal. - */ - - do - { - ret = nxsem_wait(&priv->exclsem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); } /**************************************************************************** @@ -661,19 +649,7 @@ static void i2s_exclsem_take(struct stm32_i2s_s *priv) static void i2s_bufsem_take(struct stm32_i2s_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal. - */ - - do - { - ret = nxsem_wait(&priv->bufsem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->bufsem); } /**************************************************************************** @@ -1176,7 +1152,7 @@ static void i2s_rx_worker(void *arg) */ flags = enter_critical_section(); - (void)i2s_rxdma_setup(priv); + i2s_rxdma_setup(priv); leave_critical_section(flags); } @@ -1318,7 +1294,7 @@ static void i2s_rxdma_callback(DMA_HANDLE handle, uint8_t result, void *arg) /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->rx.dog); + wd_cancel(priv->rx.dog); /* Sample DMA registers at the time of the DMA completion */ @@ -1568,7 +1544,7 @@ static void i2s_tx_worker(void *arg) */ flags = enter_critical_section(); - (void)i2s_txdma_setup(priv); + i2s_txdma_setup(priv); leave_critical_section(flags); } @@ -1698,7 +1674,7 @@ static void i2s_txdma_callback(DMA_HANDLE handle, uint8_t result, void *arg) /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->tx.dog); + wd_cancel(priv->tx.dog); /* Sample DMA registers at the time of the DMA completion */ diff --git a/arch/arm/src/stm32/stm32_idle.c b/arch/arm/src/stm32/stm32_idle.c index 160df1d8b4..6ca9c56c21 100644 --- a/arch/arm/src/stm32/stm32_idle.c +++ b/arch/arm/src/stm32/stm32_idle.c @@ -110,7 +110,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { @@ -134,7 +134,7 @@ static void up_idlepm(void) break; case PM_SLEEP: - (void)stm32_pmstandby(); + stm32_pmstandby(); break; default: diff --git a/arch/arm/src/stm32/stm32_irq.c b/arch/arm/src/stm32/stm32_irq.c index 3a54fa92d5..3845fa0e19 100644 --- a/arch/arm/src/stm32/stm32_irq.c +++ b/arch/arm/src/stm32/stm32_irq.c @@ -166,7 +166,7 @@ static void stm32_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int stm32_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -174,7 +174,7 @@ static int stm32_nmi(int irq, FAR void *context, FAR void *arg) static int stm32_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -182,7 +182,7 @@ static int stm32_busfault(int irq, FAR void *context, FAR void *arg) static int stm32_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -190,7 +190,7 @@ static int stm32_usagefault(int irq, FAR void *context, FAR void *arg) static int stm32_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -198,7 +198,7 @@ static int stm32_pendsv(int irq, FAR void *context, FAR void *arg) static int stm32_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -206,7 +206,7 @@ static int stm32_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int stm32_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/stm32/stm32_iwdg.c b/arch/arm/src/stm32/stm32_iwdg.c index 903c0372d0..795221f1e1 100644 --- a/arch/arm/src/stm32/stm32_iwdg.c +++ b/arch/arm/src/stm32/stm32_iwdg.c @@ -679,7 +679,7 @@ void stm32_iwdginitialize(FAR const char *devpath, uint32_t lsifreq) /* Register the watchdog driver as /dev/watchdog0 */ - (void)watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv); + watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv); /* When the microcontroller enters debug mode (Cortex-M4F core halted), * the IWDG counter either continues to work normally or stops, depending diff --git a/arch/arm/src/stm32/stm32_ltdc.c b/arch/arm/src/stm32/stm32_ltdc.c index 280f5a0e0e..3c405977a8 100644 --- a/arch/arm/src/stm32/stm32_ltdc.c +++ b/arch/arm/src/stm32/stm32_ltdc.c @@ -1636,7 +1636,7 @@ static void stm32_ltdc_irqconfig(void) /* Attach LTDC interrupt vector */ - (void)irq_attach(g_interrupt.irq, stm32_ltdcirq, NULL); + irq_attach(g_interrupt.irq, stm32_ltdcirq, NULL); /* Enable the IRQ at the NVIC */ diff --git a/arch/arm/src/stm32/stm32_oneshot.c b/arch/arm/src/stm32/stm32_oneshot.c index 437d80a999..430ccfdc9d 100644 --- a/arch/arm/src/stm32/stm32_oneshot.c +++ b/arch/arm/src/stm32/stm32_oneshot.c @@ -287,7 +287,7 @@ int stm32_oneshot_start(struct stm32_oneshot_s *oneshot, /* Yes.. then cancel it */ tmrinfo("Already running... cancelling\n"); - (void)stm32_oneshot_cancel(oneshot, NULL); + stm32_oneshot_cancel(oneshot, NULL); } /* Save the new handler and its argument */ diff --git a/arch/arm/src/stm32/stm32_otgfsdev.c b/arch/arm/src/stm32/stm32_otgfsdev.c index 34b075b544..b84cf7fbcf 100644 --- a/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/arch/arm/src/stm32/stm32_otgfsdev.c @@ -1499,7 +1499,7 @@ static void stm32_rxfifo_discard(FAR struct stm32_ep_s *privep, int len) for (i = 0; i < len; i += 4) { volatile uint32_t data = stm32_getreg(regaddr); - (void)data; + UNUSED(data); } } } @@ -2268,7 +2268,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, { /* Actually, I think we could just stall here. */ - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } } else @@ -2314,7 +2314,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, { /* Actually, I think we could just stall here. */ - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2378,7 +2378,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_GETSETDESC), 0); if ((ctrlreq->type & USB_REQ_RECIPIENT_MASK) == USB_REQ_RECIPIENT_DEVICE) { - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2403,7 +2403,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, ctrlreq->index == 0 && ctrlreq->len == 1) { - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2475,7 +2475,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, { usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_GETSETIF), 0); - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } break; @@ -2553,7 +2553,7 @@ static inline void stm32_ep0out_setup(struct stm32_usbdev_s *priv) { /* Dispatch any non-standard requests */ - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -4058,10 +4058,10 @@ static void stm32_ep0_configure(FAR struct stm32_usbdev_s *priv) { /* Enable EP0 IN and OUT */ - (void)stm32_epin_configure(&priv->epin[EP0], USB_EP_ATTR_XFER_CONTROL, - CONFIG_USBDEV_EP0_MAXSIZE); - (void)stm32_epout_configure(&priv->epout[EP0], USB_EP_ATTR_XFER_CONTROL, - CONFIG_USBDEV_EP0_MAXSIZE); + stm32_epin_configure(&priv->epin[EP0], USB_EP_ATTR_XFER_CONTROL, + CONFIG_USBDEV_EP0_MAXSIZE); + stm32_epout_configure(&priv->epout[EP0], USB_EP_ATTR_XFER_CONTROL, + CONFIG_USBDEV_EP0_MAXSIZE); } /**************************************************************************** diff --git a/arch/arm/src/stm32/stm32_otgfshost.c b/arch/arm/src/stm32/stm32_otgfshost.c index 3713a62946..da3245cead 100644 --- a/arch/arm/src/stm32/stm32_otgfshost.c +++ b/arch/arm/src/stm32/stm32_otgfshost.c @@ -650,21 +650,7 @@ static inline void stm32_modifyreg(uint32_t addr, uint32_t clrbits, uint32_t set static void stm32_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -1116,13 +1102,7 @@ static int stm32_chan_wait(FAR struct stm32_usbhost_s *priv, * wait here. */ - ret = nxsem_wait(&chan->waitsem); - - /* nxsem_wait should succeed. But it is possible that we could be - * awakened by a signal too. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&chan->waitsem); } while (chan->waiter); diff --git a/arch/arm/src/stm32/stm32_otghsdev.c b/arch/arm/src/stm32/stm32_otghsdev.c index f5108a5f7e..7a5acf2882 100644 --- a/arch/arm/src/stm32/stm32_otghsdev.c +++ b/arch/arm/src/stm32/stm32_otghsdev.c @@ -1450,7 +1450,7 @@ static void stm32_rxfifo_discard(FAR struct stm32_ep_s *privep, int len) for (i = 0; i < len; i += 4) { volatile uint32_t data = stm32_getreg(regaddr); - (void)data; + UNUSED(data); } } } @@ -2219,7 +2219,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, { /* Actually, I think we could just stall here. */ - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } } else @@ -2265,7 +2265,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, { /* Actually, I think we could just stall here. */ - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2329,7 +2329,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_GETSETDESC), 0); if ((ctrlreq->type & USB_REQ_RECIPIENT_MASK) == USB_REQ_RECIPIENT_DEVICE) { - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2354,7 +2354,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, ctrlreq->index == 0 && ctrlreq->len == 1) { - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2426,7 +2426,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, { usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_GETSETIF), 0); - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } break; @@ -2504,7 +2504,7 @@ static inline void stm32_ep0out_setup(struct stm32_usbdev_s *priv) { /* Dispatch any non-standard requests */ - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -4008,10 +4008,10 @@ static void stm32_ep0_configure(FAR struct stm32_usbdev_s *priv) { /* Enable EP0 IN and OUT */ - (void)stm32_epin_configure(&priv->epin[EP0], USB_EP_ATTR_XFER_CONTROL, - CONFIG_USBDEV_EP0_MAXSIZE); - (void)stm32_epout_configure(&priv->epout[EP0], USB_EP_ATTR_XFER_CONTROL, - CONFIG_USBDEV_EP0_MAXSIZE); + stm32_epin_configure(&priv->epin[EP0], USB_EP_ATTR_XFER_CONTROL, + CONFIG_USBDEV_EP0_MAXSIZE); + stm32_epout_configure(&priv->epout[EP0], USB_EP_ATTR_XFER_CONTROL, + CONFIG_USBDEV_EP0_MAXSIZE); } /**************************************************************************** diff --git a/arch/arm/src/stm32/stm32_otghshost.c b/arch/arm/src/stm32/stm32_otghshost.c index 468c4b5d63..76fa756e85 100644 --- a/arch/arm/src/stm32/stm32_otghshost.c +++ b/arch/arm/src/stm32/stm32_otghshost.c @@ -655,21 +655,7 @@ static inline void stm32_modifyreg(uint32_t addr, uint32_t clrbits, uint32_t set static void stm32_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -1121,13 +1107,7 @@ static int stm32_chan_wait(FAR struct stm32_usbhost_s *priv, * wait here. */ - ret = nxsem_wait(&chan->waitsem); - - /* nxsem_wait should succeed. But it is possible that we could be - * awakened by a signal too. - */ - - DEBUGASSERT(ret == OK || get_errno() == EINTR); + nxsem_wait_uninterruptible(&chan->waitsem); } while (chan->waiter); diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c index 12e52b522e..d25b12ebe3 100644 --- a/arch/arm/src/stm32/stm32_pwm.c +++ b/arch/arm/src/stm32/stm32_pwm.c @@ -3793,7 +3793,7 @@ static int pwm_interrupt(FAR struct pwm_lowerhalf_s *dev) /* Disable first interrtups, stop and reset the timer */ - (void)pwm_stop(dev); + pwm_stop(dev); /* Then perform the callback into the upper half driver */ diff --git a/arch/arm/src/stm32/stm32_qencoder.c b/arch/arm/src/stm32/stm32_qencoder.c index 72a3a3c070..d42b662bc5 100644 --- a/arch/arm/src/stm32/stm32_qencoder.c +++ b/arch/arm/src/stm32/stm32_qencoder.c @@ -970,7 +970,7 @@ static int stm32_shutdown(FAR struct qe_lowerhalf_s *lower) /* Detach the interrupt handler */ - (void)irq_detach(priv->config->irq); + irq_detach(priv->config->irq); /* Disable interrupts momentary to stop any ongoing timer processing and * to prevent any concurrent access to the reset register. diff --git a/arch/arm/src/stm32/stm32_rng.c b/arch/arm/src/stm32/stm32_rng.c index b3e1647c11..77dc6e4068 100644 --- a/arch/arm/src/stm32/stm32_rng.c +++ b/arch/arm/src/stm32/stm32_rng.c @@ -303,7 +303,7 @@ static ssize_t stm32_rng_read(struct file *filep, char *buffer, size_t buflen) void devrandom_register(void) { stm32_rng_initialize(); - (void)register_driver("/dev/random", &g_rngops, 0444, NULL); + register_driver("/dev/random", &g_rngops, 0444, NULL); } #endif @@ -327,7 +327,7 @@ void devurandom_register(void) #ifndef CONFIG_DEV_RANDOM stm32_rng_initialize(); #endif - (void)register_driver("/dev/urandom", &g_rngops, 0444, NULL); + register_driver("/dev/urandom", &g_rngops, 0444, NULL); } #endif diff --git a/arch/arm/src/stm32/stm32_rtc_lowerhalf.c b/arch/arm/src/stm32/stm32_rtc_lowerhalf.c index a880426f8e..27519560dc 100644 --- a/arch/arm/src/stm32/stm32_rtc_lowerhalf.c +++ b/arch/arm/src/stm32/stm32_rtc_lowerhalf.c @@ -564,7 +564,7 @@ static int stm32_setrelative(FAR struct rtc_lowerhalf_s *lower, /* And convert the time back to broken out format */ - (void)gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); + gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); /* The set the alarm using this absolute time */ diff --git a/arch/arm/src/stm32/stm32_rtcc.c b/arch/arm/src/stm32/stm32_rtcc.c index 418fb5d3ec..5b6db8db62 100644 --- a/arch/arm/src/stm32/stm32_rtcc.c +++ b/arch/arm/src/stm32/stm32_rtcc.c @@ -1030,7 +1030,7 @@ int up_rtc_settime(FAR const struct timespec *tp) /* Break out the time values (not that the time is set only to units of seconds) */ - (void)gmtime_r(&tp->tv_sec, &newtime); + gmtime_r(&tp->tv_sec, &newtime); return stm32_rtc_setdatetime(&newtime); } diff --git a/arch/arm/src/stm32/stm32_sdio.c b/arch/arm/src/stm32/stm32_sdio.c index f51028052c..0f9a75441a 100644 --- a/arch/arm/src/stm32/stm32_sdio.c +++ b/arch/arm/src/stm32/stm32_sdio.c @@ -598,21 +598,7 @@ static struct stm32_sampleregs_s g_sampleregs[DEBUG_NSAMPLES]; static void stm32_takesem(struct stm32_dev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->waitsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -701,16 +687,16 @@ static void stm32_configwaitints(struct stm32_dev_s *priv, uint32_t waitmask, /* Arm the SDIO_D Ready and install Isr */ - (void)stm32_gpiosetevent(pinset, true, false, false, - stm32_rdyinterrupt, priv); + stm32_gpiosetevent(pinset, true, false, false, + stm32_rdyinterrupt, priv); } /* Disarm SDIO_D ready */ if ((wkupevent & SDIOWAIT_WRCOMPLETE) != 0) { - (void)stm32_gpiosetevent(GPIO_SDIO_D0, false, false, false, - NULL, NULL); + stm32_gpiosetevent(GPIO_SDIO_D0, false, false, false, + NULL, NULL); stm32_configgpio(GPIO_SDIO_D0); } #endif @@ -1281,7 +1267,7 @@ static void stm32_endwait(struct stm32_dev_s *priv, sdio_eventset_t wkupevent) { /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Disable event-related interrupts */ @@ -2141,7 +2127,7 @@ static int stm32_cancel(FAR struct sdio_dev_s *dev) /* Cancel any watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* If this was a DMA transfer, make sure that DMA is stopped */ @@ -3001,8 +2987,8 @@ static void stm32_callback(void *arg) mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); - (void)work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, - priv->cbarg, 0); + work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, + priv->cbarg, 0); } else { diff --git a/arch/arm/src/stm32/stm32_serial.c b/arch/arm/src/stm32/stm32_serial.c index 603f785997..c1075d50ce 100644 --- a/arch/arm/src/stm32/stm32_serial.c +++ b/arch/arm/src/stm32/stm32_serial.c @@ -1886,7 +1886,7 @@ static int up_interrupt(int irq, void *context, void *arg) * good byte will be lost. */ - (void)up_serialin(priv, STM32_USART_RDR_OFFSET); + up_serialin(priv, STM32_USART_RDR_OFFSET); #endif } @@ -2765,14 +2765,14 @@ void up_serialinit(void) /* Register the console */ #if CONSOLE_UART > 0 - (void)uart_register("/dev/console", &g_uart_devs[CONSOLE_UART - 1]->dev); + uart_register("/dev/console", &g_uart_devs[CONSOLE_UART - 1]->dev); #ifndef CONFIG_STM32_SERIAL_DISABLE_REORDERING /* If not disabled, register the console UART to ttyS0 and exclude * it from initializing it further down */ - (void)uart_register("/dev/ttyS0", &g_uart_devs[CONSOLE_UART - 1]->dev); + uart_register("/dev/ttyS0", &g_uart_devs[CONSOLE_UART - 1]->dev); minor = 1; #endif @@ -2808,7 +2808,7 @@ void up_serialinit(void) /* Register USARTs as devices in increasing order */ devname[9] = '0' + minor++; - (void)uart_register(devname, &g_uart_devs[i]->dev); + uart_register(devname, &g_uart_devs[i]->dev); } #endif /* HAVE UART */ } diff --git a/arch/arm/src/stm32/stm32_spi.c b/arch/arm/src/stm32/stm32_spi.c index 383b2cbef8..48f2e908b1 100644 --- a/arch/arm/src/stm32/stm32_spi.c +++ b/arch/arm/src/stm32/stm32_spi.c @@ -800,23 +800,7 @@ static inline bool spi_16bitmode(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32_SPI_DMA static void spi_dmarxwait(FAR struct stm32_spidev_s *priv) { - int ret; - - /* Take the semaphore (perhaps waiting). If the result is zero, then the DMA - * must not really have completed??? - */ - - do - { - ret = nxsem_wait(&priv->rxsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR || priv->rxresult == 0); + nxsem_wait_uninterruptible(&priv->rxsem); } #endif @@ -831,23 +815,7 @@ static void spi_dmarxwait(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32_SPI_DMA static void spi_dmatxwait(FAR struct stm32_spidev_s *priv) { - int ret; - - /* Take the semaphore (perhaps waiting). If the result is zero, then the DMA - * must not really have completed??? - */ - - do - { - ret = nxsem_wait(&priv->txsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR || priv->txresult == 0); + nxsem_wait_uninterruptible(&priv->txsem); } #endif @@ -862,7 +830,7 @@ static void spi_dmatxwait(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32_SPI_DMA static inline void spi_dmarxwakeup(FAR struct stm32_spidev_s *priv) { - (void)nxsem_post(&priv->rxsem); + nxsem_post(&priv->rxsem); } #endif @@ -877,7 +845,7 @@ static inline void spi_dmarxwakeup(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32_SPI_DMA static inline void spi_dmatxwakeup(FAR struct stm32_spidev_s *priv) { - (void)nxsem_post(&priv->txsem); + nxsem_post(&priv->txsem); } #endif @@ -1137,24 +1105,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; diff --git a/arch/arm/src/stm32/stm32_tickless.c b/arch/arm/src/stm32/stm32_tickless.c index f1db0c4512..6c9edb6a14 100644 --- a/arch/arm/src/stm32/stm32_tickless.c +++ b/arch/arm/src/stm32/stm32_tickless.c @@ -914,7 +914,7 @@ int up_timer_start(FAR const struct timespec *ts) /* Yes.. then cancel it */ tmrinfo("Already running... cancelling\n"); - (void)up_timer_cancel(NULL); + up_timer_cancel(NULL); } /* Express the delay in microseconds */ diff --git a/arch/arm/src/stm32/stm32_timerisr.c b/arch/arm/src/stm32/stm32_timerisr.c index 3cc98d227c..b553316c47 100644 --- a/arch/arm/src/stm32/stm32_timerisr.c +++ b/arch/arm/src/stm32/stm32_timerisr.c @@ -148,7 +148,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)stm32_timerisr, NULL); + irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)stm32_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/stm32/stm32_usbdev.c b/arch/arm/src/stm32/stm32_usbdev.c index 6968b6a57e..a894cbaead 100644 --- a/arch/arm/src/stm32/stm32_usbdev.c +++ b/arch/arm/src/stm32/stm32_usbdev.c @@ -1623,7 +1623,7 @@ static void stm32_epdone(struct stm32_usbdev_s *priv, uint8_t epno) { /* Read host data into the current read request */ - (void)stm32_rdrequest(priv, privep); + stm32_rdrequest(priv, privep); /* "After the received data is processed, the application software * should set the STAT_RX bits to '11' (Valid) in the USB_EPnR, @@ -1673,11 +1673,11 @@ static void stm32_epdone(struct stm32_usbdev_s *priv, uint8_t epno) priv->txstatus = USB_EPR_STATTX_NAK; if (epno == EP0) { - (void)stm32_wrrequest_ep0(priv, privep); + stm32_wrrequest_ep0(priv, privep); } else { - (void)stm32_wrrequest(priv, privep); + stm32_wrrequest(priv, privep); } /* Set the new TX status */ @@ -1936,7 +1936,7 @@ static void stm32_ep0setup(struct stm32_usbdev_s *priv) { privep = &priv->eplist[epno]; privep->halted = 0; - (void)stm32_epstall(&privep->ep, true); + stm32_epstall(&privep->ep, true); } else { @@ -1980,7 +1980,7 @@ static void stm32_ep0setup(struct stm32_usbdev_s *priv) { privep = &priv->eplist[epno]; privep->halted = 1; - (void)stm32_epstall(&privep->ep, false); + stm32_epstall(&privep->ep, false); } else { @@ -3223,11 +3223,11 @@ static int stm32_epstall(struct usbdev_ep_s *ep, bool resume) priv->txstatus = USB_EPR_STATTX_NAK; if (epno == EP0) { - (void)stm32_wrrequest_ep0(priv, privep); + stm32_wrrequest_ep0(priv, privep); } else { - (void)stm32_wrrequest(priv, privep); + stm32_wrrequest(priv, privep); } /* Set the new TX status */ @@ -3718,8 +3718,8 @@ void up_usbinitialize(void) /* Configure USB GPIO alternate function pins */ #ifdef CONFIG_STM32_STM32F30XX - (void)stm32_configgpio(GPIO_USB_DM); - (void)stm32_configgpio(GPIO_USB_DP); + stm32_configgpio(GPIO_USB_DM); + stm32_configgpio(GPIO_USB_DP); #endif /* Power up the USB controller, but leave it in the reset state */ diff --git a/arch/arm/src/stm32/stm32_wwdg.c b/arch/arm/src/stm32/stm32_wwdg.c index 6b6618b681..c38b4f8e72 100644 --- a/arch/arm/src/stm32/stm32_wwdg.c +++ b/arch/arm/src/stm32/stm32_wwdg.c @@ -766,7 +766,7 @@ void stm32_wwdginitialize(FAR const char *devpath) /* Attach our EWI interrupt handler (But don't enable it yet) */ - (void)irq_attach(STM32_IRQ_WWDG, stm32_interrupt, NULL); + irq_attach(STM32_IRQ_WWDG, stm32_interrupt, NULL); /* Select an arbitrary initial timeout value. But don't start the watchdog * yet. NOTE: If the "Hardware watchdog" feature is enabled through the @@ -778,7 +778,7 @@ void stm32_wwdginitialize(FAR const char *devpath) /* Register the watchdog driver as /dev/watchdog0 */ - (void)watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv); + watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv); /* When the microcontroller enters debug mode (Cortex-M core halted), * the WWDG counter either continues to work normally or stops, depending diff --git a/arch/arm/src/stm32/stm32f10xxf30xx_flash.c b/arch/arm/src/stm32/stm32f10xxf30xx_flash.c index 261d05ca49..5e79faeb82 100644 --- a/arch/arm/src/stm32/stm32f10xxf30xx_flash.c +++ b/arch/arm/src/stm32/stm32f10xxf30xx_flash.c @@ -96,21 +96,7 @@ static sem_t g_sem = SEM_INITIALIZER(1); static void sem_lock(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_sem); } static inline void sem_unlock(void) diff --git a/arch/arm/src/stm32/stm32f20xxf40xx_flash.c b/arch/arm/src/stm32/stm32f20xxf40xx_flash.c index e245c7a82d..83c88a0fd5 100644 --- a/arch/arm/src/stm32/stm32f20xxf40xx_flash.c +++ b/arch/arm/src/stm32/stm32f20xxf40xx_flash.c @@ -89,21 +89,7 @@ static sem_t g_sem = SEM_INITIALIZER(1); static void sem_lock(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_sem); } static inline void sem_unlock(void) diff --git a/arch/arm/src/stm32/stm32f40xxx_i2c.c b/arch/arm/src/stm32/stm32f40xxx_i2c.c index 6cbe0979d6..90a3e1148a 100644 --- a/arch/arm/src/stm32/stm32f40xxx_i2c.c +++ b/arch/arm/src/stm32/stm32f40xxx_i2c.c @@ -560,21 +560,7 @@ static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv, static inline void stm32_i2c_sem_wait(FAR struct stm32_i2c_priv_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sem_excl); } /************************************************************************************ @@ -640,7 +626,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) { /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -669,12 +655,11 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->sem_isr, &abstime); - if (ret < 0 && ret != -EINTR) + ret = nxsem_timedwait_uninterruptible(&priv->sem_isr, &abstime); + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would * include timeouts and mystery errors reported by nxsem_timedwait. - * NOTE that we try again if we are awakened by a signal (EINTR). */ break; diff --git a/arch/arm/src/stm32/stm32f40xxx_rtcc.c b/arch/arm/src/stm32/stm32f40xxx_rtcc.c index 780462e1a9..8529924fc9 100644 --- a/arch/arm/src/stm32/stm32f40xxx_rtcc.c +++ b/arch/arm/src/stm32/stm32f40xxx_rtcc.c @@ -828,7 +828,7 @@ static inline void rtc_enable_alarm(void) * 3. Configure the RTC to generate RTC alarms (Alarm A or Alarm B). */ - (void)stm32_exti_alarm(true, false, true, stm32_rtc_alarm_handler, NULL); + stm32_exti_alarm(true, false, true, stm32_rtc_alarm_handler, NULL); g_alarm_enabled = true; } } @@ -1386,7 +1386,7 @@ int up_rtc_settime(FAR const struct timespec *tp) * seconds) */ - (void)gmtime_r(&tp->tv_sec, &newtime); + gmtime_r(&tp->tv_sec, &newtime); return stm32_rtc_setdatetime(&newtime); } diff --git a/arch/arm/src/stm32/stm32l15xx_flash.c b/arch/arm/src/stm32/stm32l15xx_flash.c index 694a2e20d3..67b7dda933 100644 --- a/arch/arm/src/stm32/stm32l15xx_flash.c +++ b/arch/arm/src/stm32/stm32l15xx_flash.c @@ -99,21 +99,7 @@ static sem_t g_sem = SEM_INITIALIZER(1); static void sem_lock(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_sem); } static inline void sem_unlock(void) diff --git a/arch/arm/src/stm32/stm32l15xxx_rtcc.c b/arch/arm/src/stm32/stm32l15xxx_rtcc.c index b8a1d10ebb..b12346b7ec 100644 --- a/arch/arm/src/stm32/stm32l15xxx_rtcc.c +++ b/arch/arm/src/stm32/stm32l15xxx_rtcc.c @@ -778,7 +778,7 @@ static inline void rtc_enable_alarm(void) * 3. Configure the RTC to generate RTC alarms (Alarm A or Alarm B). */ - (void)stm32_exti_alarm(true, false, true, stm32_rtc_alarm_handler, NULL); + stm32_exti_alarm(true, false, true, stm32_rtc_alarm_handler, NULL); g_alarm_enabled = true; } } @@ -1361,7 +1361,7 @@ int up_rtc_settime(FAR const struct timespec *tp) * seconds) */ - (void)gmtime_r(&tp->tv_sec, &newtime); + gmtime_r(&tp->tv_sec, &newtime); return stm32_rtc_setdatetime(&newtime); } @@ -1655,7 +1655,7 @@ static inline void rtc_enable_wakeup(void) { if (!g_wakeup_enabled) { - (void)stm32_exti_wakeup(true, false, true, stm32_rtc_wakeup_handler, NULL); + stm32_exti_wakeup(true, false, true, stm32_rtc_wakeup_handler, NULL); g_wakeup_enabled = true; } } diff --git a/arch/arm/src/stm32f0l0g0/stm32_adc.c b/arch/arm/src/stm32f0l0g0/stm32_adc.c index 2bcbe7bc51..0adae5a6d8 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_adc.c +++ b/arch/arm/src/stm32f0l0g0/stm32_adc.c @@ -837,24 +837,11 @@ static int adccmn_lock(FAR struct stm32_dev_s *priv, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->cmn->lock); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->cmn->lock); } else { - (void)nxsem_post(&priv->cmn->lock); - ret = OK; + ret = nxsem_post(&priv->cmn->lock); } return ret; @@ -1312,7 +1299,7 @@ static void adc_configure(FAR struct adc_dev_s *dev) #ifdef HAVE_ADC_RESOLUTION /* Configure ADC resolution */ - (void)adc_resolution_set(dev, priv->resolution); + adc_resolution_set(dev, priv->resolution); #endif #ifdef ADC_HAVE_EXTCFG diff --git a/arch/arm/src/stm32f0l0g0/stm32_aes.c b/arch/arm/src/stm32f0l0g0/stm32_aes.c index 2a5281f01e..70284a07c6 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_aes.c +++ b/arch/arm/src/stm32f0l0g0/stm32_aes.c @@ -130,8 +130,6 @@ static void stm32aes_setkey(FAR const void *key, size_t key_len) { FAR uint32_t *in = (FAR uint32_t *)key; - (void)key_len; - putreg32(__builtin_bswap32(*in), STM32_AES_KEYR3); in++; putreg32(__builtin_bswap32(*in), STM32_AES_KEYR2); diff --git a/arch/arm/src/stm32f0l0g0/stm32_dma_v1.c b/arch/arm/src/stm32f0l0g0/stm32_dma_v1.c index 6740509c0c..c779682b53 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_dma_v1.c +++ b/arch/arm/src/stm32f0l0g0/stm32_dma_v1.c @@ -226,26 +226,12 @@ static inline void dmachan_putreg(struct stm32_dma_s *dmach, static void stm32_dmatake(FAR struct stm32_dma_s *dmach) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&dmach->sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&dmach->sem); } static inline void stm32_dmagive(FAR struct stm32_dma_s *dmach) { - (void)nxsem_post(&dmach->sem); + nxsem_post(&dmach->sem); } /**************************************************************************** @@ -357,7 +343,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vectors */ - (void)irq_attach(dmach->irq, stm32_dmainterrupt, NULL); + irq_attach(dmach->irq, stm32_dmainterrupt, NULL); /* Disable the DMA channel */ diff --git a/arch/arm/src/stm32f0l0g0/stm32_i2c.c b/arch/arm/src/stm32f0l0g0/stm32_i2c.c index 1c725c8fdd..edcf891a6d 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_i2c.c +++ b/arch/arm/src/stm32f0l0g0/stm32_i2c.c @@ -708,21 +708,7 @@ static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv, static inline void stm32_i2c_sem_wait(FAR struct i2c_master_s *dev) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); } /************************************************************************************ @@ -805,7 +791,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) { /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -833,12 +819,11 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) #endif /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->sem_isr, &abstime); - if (ret < 0 && ret != -EINTR) + ret = nxsem_timedwait_uninterruptible(&priv->sem_isr, &abstime); + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would * include timeouts and mystery errors reported by nxsem_timedwait. - * NOTE that we try again if we are awakened by a signal (EINTR). */ break; diff --git a/arch/arm/src/stm32f0l0g0/stm32_irq.c b/arch/arm/src/stm32f0l0g0/stm32_irq.c index d2d70eb7fd..c0ba411e12 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_irq.c +++ b/arch/arm/src/stm32f0l0g0/stm32_irq.c @@ -137,7 +137,7 @@ static void stm32_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int stm32_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -145,7 +145,7 @@ static int stm32_nmi(int irq, FAR void *context, FAR void *arg) static int stm32_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -153,7 +153,7 @@ static int stm32_pendsv(int irq, FAR void *context, FAR void *arg) static int stm32_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/stm32f0l0g0/stm32_pwm.c b/arch/arm/src/stm32f0l0g0/stm32_pwm.c index 7672a6faa2..a92d9d10be 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_pwm.c +++ b/arch/arm/src/stm32f0l0g0/stm32_pwm.c @@ -1547,7 +1547,7 @@ static int stm32pwm_interrupt(struct stm32_pwmtimer_s *priv) /* Disable first interrtups, stop and reset the timer */ - (void)stm32pwm_stop((FAR struct pwm_lowerhalf_s *)priv); + stm32pwm_stop((FAR struct pwm_lowerhalf_s *)priv); /* Then perform the callback into the upper half driver */ diff --git a/arch/arm/src/stm32f0l0g0/stm32_rng.c b/arch/arm/src/stm32f0l0g0/stm32_rng.c index 001c5805e9..7e9ac76118 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_rng.c +++ b/arch/arm/src/stm32f0l0g0/stm32_rng.c @@ -303,7 +303,7 @@ static ssize_t stm32_rng_read(struct file *filep, char *buffer, size_t buflen) void devrandom_register(void) { stm32_rng_initialize(); - (void)register_driver("/dev/random", &g_rngops, 0444, NULL); + register_driver("/dev/random", &g_rngops, 0444, NULL); } #endif @@ -327,7 +327,7 @@ void devurandom_register(void) #ifndef CONFIG_DEV_RANDOM stm32_rng_initialize(); #endif - (void)register_driver("/dev/urandom", &g_rngops, 0444, NULL); + register_driver("/dev/urandom", &g_rngops, 0444, NULL); } #endif diff --git a/arch/arm/src/stm32f0l0g0/stm32_serial_v1.c b/arch/arm/src/stm32f0l0g0/stm32_serial_v1.c index 62b7358d2f..66d40c4298 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_serial_v1.c +++ b/arch/arm/src/stm32f0l0g0/stm32_serial_v1.c @@ -2427,14 +2427,14 @@ void up_serialinit(void) /* Register the console */ #if CONSOLE_USART > 0 - (void)uart_register("/dev/console", &g_uart_devs[CONSOLE_USART - 1]->dev); + uart_register("/dev/console", &g_uart_devs[CONSOLE_USART - 1]->dev); #ifndef CONFIG_STM32F0L0G0_SERIAL_DISABLE_REORDERING /* If not disabled, register the console USART to ttyS0 and exclude * it from initializing it further down */ - (void)uart_register("/dev/ttyS0", &g_uart_devs[CONSOLE_USART - 1]->dev); + uart_register("/dev/ttyS0", &g_uart_devs[CONSOLE_USART - 1]->dev); minor = 1; #endif @@ -2470,7 +2470,7 @@ void up_serialinit(void) /* Register USARTs as devices in increasing order */ devname[9] = '0' + minor++; - (void)uart_register(devname, &g_uart_devs[i]->dev); + uart_register(devname, &g_uart_devs[i]->dev); } #endif /* HAVE USART */ } diff --git a/arch/arm/src/stm32f0l0g0/stm32_serial_v2.c b/arch/arm/src/stm32f0l0g0/stm32_serial_v2.c index c4ebab329b..66e5e87588 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_serial_v2.c +++ b/arch/arm/src/stm32f0l0g0/stm32_serial_v2.c @@ -1851,14 +1851,14 @@ void up_serialinit(void) /* Register the console */ #if CONSOLE_USART > 0 - (void)uart_register("/dev/console", &g_uart_devs[CONSOLE_USART - 1]->dev); + uart_register("/dev/console", &g_uart_devs[CONSOLE_USART - 1]->dev); #ifndef CONFIG_STM32F0L0G0_SERIAL_DISABLE_REORDERING /* If not disabled, register the console UART to ttyS0 and exclude * it from initializing it further down */ - (void)uart_register("/dev/ttyS0", &g_uart_devs[CONSOLE_USART - 1]->dev); + uart_register("/dev/ttyS0", &g_uart_devs[CONSOLE_USART - 1]->dev); minor = 1; #endif @@ -1889,7 +1889,7 @@ void up_serialinit(void) /* Register USARTs as devices in increasing order */ devname[9] = '0' + minor++; - (void)uart_register(devname, &g_uart_devs[i]->dev); + uart_register(devname, &g_uart_devs[i]->dev); } #endif /* HAVE UART */ } diff --git a/arch/arm/src/stm32f0l0g0/stm32_spi.c b/arch/arm/src/stm32f0l0g0/stm32_spi.c index af02731f67..69aefaea6f 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_spi.c +++ b/arch/arm/src/stm32f0l0g0/stm32_spi.c @@ -570,23 +570,15 @@ static inline bool spi_16bitmode(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32F0L0G0_SPI_DMA static void spi_dmarxwait(FAR struct stm32_spidev_s *priv) { - int ret; - /* Take the semaphore (perhaps waiting). If the result is zero, then the DMA * must not really have completed??? */ do { - ret = nxsem_wait(&priv->rxsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&priv->rxsem); } - while (ret == -EINTR || priv->rxresult == 0); + while (priv->rxresult == 0); } #endif @@ -601,23 +593,15 @@ static void spi_dmarxwait(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32F0L0G0_SPI_DMA static void spi_dmatxwait(FAR struct stm32_spidev_s *priv) { - int ret; - /* Take the semaphore (perhaps waiting). If the result is zero, then the DMA * must not really have completed??? */ do { - ret = nxsem_wait(&priv->txsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&priv->txsem); } - while (ret == -EINTR || priv->txresult == 0); + while (priv->txresult == 0); } #endif @@ -632,7 +616,7 @@ static void spi_dmatxwait(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32F0L0G0_SPI_DMA static inline void spi_dmarxwakeup(FAR struct stm32_spidev_s *priv) { - (void)nxsem_post(&priv->rxsem); + nxsem_post(&priv->rxsem); } #endif @@ -647,7 +631,7 @@ static inline void spi_dmarxwakeup(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32F0L0G0_SPI_DMA static inline void spi_dmatxwakeup(FAR struct stm32_spidev_s *priv) { - (void)nxsem_post(&priv->txsem); + nxsem_post(&priv->txsem); } #endif @@ -878,24 +862,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; diff --git a/arch/arm/src/stm32f0l0g0/stm32_timerisr.c b/arch/arm/src/stm32f0l0g0/stm32_timerisr.c index f4bddc4ef1..8cffbed8d9 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_timerisr.c +++ b/arch/arm/src/stm32f0l0g0/stm32_timerisr.c @@ -145,7 +145,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)stm32_timerisr, NULL); + irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)stm32_timerisr, NULL); /* Enable SysTick interrupts. "The CLKSOURCE bit in SysTick Control and * Status register selects either the core clock (when CLKSOURCE = 1) or diff --git a/arch/arm/src/stm32f0l0g0/stm32_usbdev.c b/arch/arm/src/stm32f0l0g0/stm32_usbdev.c index be4eea7ff7..4994cce79a 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_usbdev.c +++ b/arch/arm/src/stm32f0l0g0/stm32_usbdev.c @@ -1584,7 +1584,7 @@ static void stm32_epdone(struct stm32_usbdev_s *priv, uint8_t epno) { /* Read host data into the current read request */ - (void)stm32_rdrequest(priv, privep); + stm32_rdrequest(priv, privep); /* "After the received data is processed, the application software * should set the STAT_RX bits to '11' (Valid) in the USB_EPnR, @@ -1634,11 +1634,11 @@ static void stm32_epdone(struct stm32_usbdev_s *priv, uint8_t epno) priv->txstatus = USB_EPR_STATTX_NAK; if (epno == EP0) { - (void)stm32_wrrequest_ep0(priv, privep); + stm32_wrrequest_ep0(priv, privep); } else { - (void)stm32_wrrequest(priv, privep); + stm32_wrrequest(priv, privep); } /* Set the new TX status */ @@ -1892,7 +1892,7 @@ static void stm32_ep0setup(struct stm32_usbdev_s *priv) { privep = &priv->eplist[epno]; privep->halted = 0; - (void)stm32_epstall(&privep->ep, true); + stm32_epstall(&privep->ep, true); } else { @@ -1936,7 +1936,7 @@ static void stm32_ep0setup(struct stm32_usbdev_s *priv) { privep = &priv->eplist[epno]; privep->halted = 1; - (void)stm32_epstall(&privep->ep, false); + stm32_epstall(&privep->ep, false); } else { @@ -3163,11 +3163,11 @@ static int stm32_epstall(struct usbdev_ep_s *ep, bool resume) priv->txstatus = USB_EPR_STATTX_NAK; if (epno == EP0) { - (void)stm32_wrrequest_ep0(priv, privep); + stm32_wrrequest_ep0(priv, privep); } else { - (void)stm32_wrrequest(priv, privep); + stm32_wrrequest(priv, privep); } /* Set the new TX status */ @@ -3658,8 +3658,8 @@ void up_usbinitialize(void) /* Configure USB GPIO alternate function pins */ - (void)stm32_configgpio(GPIO_USB_DM); - (void)stm32_configgpio(GPIO_USB_DP); + stm32_configgpio(GPIO_USB_DM); + stm32_configgpio(GPIO_USB_DP); /* Enable clocking to the USB peripheral */ diff --git a/arch/arm/src/stm32f7/stm32_bbsram.c b/arch/arm/src/stm32f7/stm32_bbsram.c index 091a349218..81cb853c10 100644 --- a/arch/arm/src/stm32f7/stm32_bbsram.c +++ b/arch/arm/src/stm32f7/stm32_bbsram.c @@ -221,19 +221,7 @@ static void stm32_bbsram_semgive(FAR struct stm32_bbsram_s *priv) static void stm32_bbsram_semtake(FAR struct stm32_bbsram_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal. - */ - - do - { - ret = nxsem_wait(&priv->exclsem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); } /**************************************************************************** @@ -337,7 +325,7 @@ static int stm32_bbsram_open(FAR struct file *filep) static int stm32_bbsram_internal_close(FAR struct bbsramfh_s *bbf) { bbf->dirty = 0; - (void)clock_gettime(CLOCK_REALTIME, &bbf->lastwrite); + clock_gettime(CLOCK_REALTIME, &bbf->lastwrite); bbf->crc = stm32_bbsram_crc(bbf); BBSRAM_DUMP(bbf, "close done"); diff --git a/arch/arm/src/stm32f7/stm32_can.c b/arch/arm/src/stm32f7/stm32_can.c index 4e121e49e5..bc5606c09d 100644 --- a/arch/arm/src/stm32f7/stm32_can.c +++ b/arch/arm/src/stm32f7/stm32_can.c @@ -1593,7 +1593,7 @@ static int stm32can_txinterrupt(int irq, FAR void *context, FAR void *arg) /* Tell the upper half that the transfer is finished. */ - (void)can_txdone(dev); + can_txdone(dev); } /* Check for RQCP1: Request completed mailbox 1 */ @@ -1608,7 +1608,7 @@ static int stm32can_txinterrupt(int irq, FAR void *context, FAR void *arg) /* Tell the upper half that the transfer is finished. */ - (void)can_txdone(dev); + can_txdone(dev); } /* Check for RQCP2: Request completed mailbox 2 */ @@ -1623,7 +1623,7 @@ static int stm32can_txinterrupt(int irq, FAR void *context, FAR void *arg) /* Tell the upper half that the transfer is finished. */ - (void)can_txdone(dev); + can_txdone(dev); } return OK; diff --git a/arch/arm/src/stm32f7/stm32_dma.c b/arch/arm/src/stm32f7/stm32_dma.c index 7c37219f56..092aa1a1c0 100644 --- a/arch/arm/src/stm32f7/stm32_dma.c +++ b/arch/arm/src/stm32f7/stm32_dma.c @@ -250,26 +250,12 @@ static inline void dmast_putreg(struct stm32_dma_s *dmast, uint32_t offset, uint static void stm32_dmatake(FAR struct stm32_dma_s *dmast) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&dmast->sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&dmast->sem); } static inline void stm32_dmagive(FAR struct stm32_dma_s *dmast) { - (void)nxsem_post(&dmast->sem); + nxsem_post(&dmast->sem); } /************************************************************************************ @@ -485,7 +471,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vectors */ - (void)irq_attach(dmast->irq, stm32_dmainterrupt, dmast); + irq_attach(dmast->irq, stm32_dmainterrupt, dmast); /* Disable the DMA stream */ diff --git a/arch/arm/src/stm32f7/stm32_dma2d.c b/arch/arm/src/stm32f7/stm32_dma2d.c index dfe587cc0b..26d634a46e 100644 --- a/arch/arm/src/stm32f7/stm32_dma2d.c +++ b/arch/arm/src/stm32f7/stm32_dma2d.c @@ -1131,7 +1131,7 @@ int stm32_dma2dinitialize(void) /* Attach DMA2D interrupt vector */ - (void)irq_attach(g_interrupt.irq, stm32_dma2dirq, NULL); + irq_attach(g_interrupt.irq, stm32_dma2dirq, NULL); /* Enable the IRQ at the NVIC */ diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index c35d05d3df..7f96c167f8 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -1258,7 +1258,7 @@ static int stm32_transmit(struct stm32_ethmac_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, STM32_TXTIMEOUT, stm32_txtimeout_expiry, 1, (uint32_t)priv); + wd_start(priv->txtimeout, STM32_TXTIMEOUT, stm32_txtimeout_expiry, 1, (uint32_t)priv); return OK; } @@ -1422,7 +1422,7 @@ static void stm32_dopoll(struct stm32_ethmac_s *priv) if (dev->d_buf) { - (void)devif_poll(dev, stm32_txpoll); + devif_poll(dev, stm32_txpoll); /* We will, most likely end up with a buffer to be freed. But it * might not be the same one that we allocated above. @@ -2380,7 +2380,7 @@ static void stm32_poll_work(void *arg) /* Update TCP timing states and poll the network for new XMIT data. */ - (void)devif_timer(dev, STM32_WDDELAY, stm32_txpoll); + devif_timer(dev, STM32_WDDELAY, stm32_txpoll); /* We will, most likely end up with a buffer to be freed. But it * might not be the same one that we allocated above. @@ -2397,7 +2397,7 @@ static void stm32_poll_work(void *arg) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); + wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); net_unlock(); } @@ -2431,7 +2431,7 @@ static void stm32_poll_expiry(int argc, uint32_t arg, ...) } else { - (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); + wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); } } @@ -2479,7 +2479,7 @@ static int stm32_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, (uint32_t)priv); + wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, (uint32_t)priv); /* Enable the Ethernet interrupt */ @@ -3911,7 +3911,7 @@ static void stm32_ipv6multicast(struct stm32_ethmac_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)stm32_addmac(dev, mac); + stm32_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -3919,7 +3919,7 @@ static void stm32_ipv6multicast(struct stm32_ethmac_s *priv) * packets. */ - (void)stm32_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + stm32_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -3928,7 +3928,7 @@ static void stm32_ipv6multicast(struct stm32_ethmac_s *priv) * packets. */ - (void)stm32_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + stm32_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -4182,7 +4182,7 @@ int stm32_ethinitialize(int intf) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->dev, NET_LL_ETHERNET); + netdev_register(&priv->dev, NET_LL_ETHERNET); return OK; } @@ -4209,7 +4209,7 @@ int stm32_ethinitialize(int intf) #if STM32F7_NETHERNET == 1 && !defined(CONFIG_NETDEV_LATEINIT) void up_netinitialize(void) { - (void)stm32_ethinitialize(0); + stm32_ethinitialize(0); } #endif diff --git a/arch/arm/src/stm32f7/stm32_flash.c b/arch/arm/src/stm32f7/stm32_flash.c index bff212e441..075a3950ab 100644 --- a/arch/arm/src/stm32f7/stm32_flash.c +++ b/arch/arm/src/stm32f7/stm32_flash.c @@ -102,26 +102,12 @@ static const size_t page_sizes[STM32_FLASH_NPAGES] = STM32_FLASH_SIZES; static void sem_lock(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = sem_wait(&g_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_sem); } static inline void sem_unlock(void) { - sem_post(&g_sem); + nxsem_post(&g_sem); } static void flash_unlock(void) diff --git a/arch/arm/src/stm32f7/stm32_i2c.c b/arch/arm/src/stm32f7/stm32_i2c.c index eac2435e00..2a3cfcb1e6 100644 --- a/arch/arm/src/stm32f7/stm32_i2c.c +++ b/arch/arm/src/stm32f7/stm32_i2c.c @@ -749,21 +749,7 @@ static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv, static inline void stm32_i2c_sem_wait(FAR struct i2c_master_s *dev) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); } /************************************************************************************ @@ -846,7 +832,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) { /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -874,12 +860,11 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) #endif /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->sem_isr, &abstime); - if (ret < 0 && ret != -EINTR) + ret = nxsem_timedwait_uninterruptible(&priv->sem_isr, &abstime); + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would * include timeouts and mystery errors reported by nxsem_timedwait. - * NOTE that we try again if we are awakened by a signal (EINTR). */ break; diff --git a/arch/arm/src/stm32f7/stm32_irq.c b/arch/arm/src/stm32f7/stm32_irq.c index a0836e7a32..b43b36f671 100644 --- a/arch/arm/src/stm32f7/stm32_irq.c +++ b/arch/arm/src/stm32f7/stm32_irq.c @@ -188,7 +188,7 @@ static void stm32_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int stm32_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -196,7 +196,7 @@ static int stm32_nmi(int irq, FAR void *context, FAR void *arg) static int stm32_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -204,7 +204,7 @@ static int stm32_busfault(int irq, FAR void *context, FAR void *arg) static int stm32_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -212,7 +212,7 @@ static int stm32_usagefault(int irq, FAR void *context, FAR void *arg) static int stm32_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -220,7 +220,7 @@ static int stm32_pendsv(int irq, FAR void *context, FAR void *arg) static int stm32_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -228,7 +228,7 @@ static int stm32_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int stm32_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/stm32f7/stm32_ltdc.c b/arch/arm/src/stm32f7/stm32_ltdc.c index ec83b81616..1782edff28 100644 --- a/arch/arm/src/stm32f7/stm32_ltdc.c +++ b/arch/arm/src/stm32f7/stm32_ltdc.c @@ -1638,7 +1638,7 @@ static void stm32_ltdc_irqconfig(void) /* Attach LTDC interrupt vector */ - (void)irq_attach(g_interrupt.irq, stm32_ltdcirq, NULL); + irq_attach(g_interrupt.irq, stm32_ltdcirq, NULL); /* Enable the IRQ at the NVIC */ diff --git a/arch/arm/src/stm32f7/stm32_otgdev.c b/arch/arm/src/stm32f7/stm32_otgdev.c index feced07c22..22edbe65e7 100644 --- a/arch/arm/src/stm32f7/stm32_otgdev.c +++ b/arch/arm/src/stm32f7/stm32_otgdev.c @@ -1563,7 +1563,7 @@ static void stm32_rxfifo_discard(FAR struct stm32_ep_s *privep, int len) for (i = 0; i < len; i += 4) { volatile uint32_t data = stm32_getreg(regaddr); - (void)data; + UNUSED(data); } } } @@ -2344,7 +2344,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, { /* Actually, I think we could just stall here. */ - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } } else @@ -2390,7 +2390,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, { /* Actually, I think we could just stall here. */ - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2455,7 +2455,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, ((ctrlreq->type & USB_REQ_RECIPIENT_MASK) == USB_REQ_RECIPIENT_INTERFACE)) { - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2478,7 +2478,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, (ctrlreq->type & USB_REQ_RECIPIENT_MASK) == USB_REQ_RECIPIENT_DEVICE && ctrlreq->value == 0 && ctrlreq->index == 0 && ctrlreq->len == 1) { - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2549,7 +2549,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, { usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_GETSETIF), 0); - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } break; @@ -2627,7 +2627,7 @@ static inline void stm32_ep0out_setup(struct stm32_usbdev_s *priv) { /* Dispatch any non-standard requests */ - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -4141,10 +4141,10 @@ static void stm32_ep0_configure(FAR struct stm32_usbdev_s *priv) { /* Enable EP0 IN and OUT */ - (void)stm32_epin_configure(&priv->epin[EP0], USB_EP_ATTR_XFER_CONTROL, - CONFIG_USBDEV_EP0_MAXSIZE); - (void)stm32_epout_configure(&priv->epout[EP0], USB_EP_ATTR_XFER_CONTROL, - CONFIG_USBDEV_EP0_MAXSIZE); + stm32_epin_configure(&priv->epin[EP0], USB_EP_ATTR_XFER_CONTROL, + CONFIG_USBDEV_EP0_MAXSIZE); + stm32_epout_configure(&priv->epout[EP0], USB_EP_ATTR_XFER_CONTROL, + CONFIG_USBDEV_EP0_MAXSIZE); } /**************************************************************************** diff --git a/arch/arm/src/stm32f7/stm32_otghost.c b/arch/arm/src/stm32f7/stm32_otghost.c index 5a1b1ea525..fd4f877550 100644 --- a/arch/arm/src/stm32f7/stm32_otghost.c +++ b/arch/arm/src/stm32f7/stm32_otghost.c @@ -647,21 +647,7 @@ static inline void stm32_modifyreg(uint32_t addr, uint32_t clrbits, static void stm32_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -1113,13 +1099,7 @@ static int stm32_chan_wait(FAR struct stm32_usbhost_s *priv, * wait here. */ - ret = nxsem_wait(&chan->waitsem); - - /* nxsem_wait should succeed. But it is possible that we could be - * awakened by a signal too. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&chan->waitsem); } while (chan->waiter); diff --git a/arch/arm/src/stm32f7/stm32_pwm.c b/arch/arm/src/stm32f7/stm32_pwm.c index ccb9399965..d9db68f51c 100644 --- a/arch/arm/src/stm32f7/stm32_pwm.c +++ b/arch/arm/src/stm32f7/stm32_pwm.c @@ -1754,7 +1754,7 @@ static int pwm_interrupt(struct stm32_pwmtimer_s *priv) /* Disable first interrtups, stop and reset the timer */ - (void)pwm_stop((FAR struct pwm_lowerhalf_s *)priv); + pwm_stop((FAR struct pwm_lowerhalf_s *)priv); /* Then perform the callback into the upper half driver */ diff --git a/arch/arm/src/stm32f7/stm32_qencoder.c b/arch/arm/src/stm32f7/stm32_qencoder.c index 26272dcb92..b44272fb71 100644 --- a/arch/arm/src/stm32f7/stm32_qencoder.c +++ b/arch/arm/src/stm32f7/stm32_qencoder.c @@ -925,7 +925,7 @@ static int stm32_shutdown(FAR struct qe_lowerhalf_s *lower) /* Detach the interrupt handler */ - (void)irq_detach(priv->config->irq); + irq_detach(priv->config->irq); /* Disable interrupts momentary to stop any ongoing timer processing and * to prevent any concurrent access to the reset register. diff --git a/arch/arm/src/stm32f7/stm32_qspi.c b/arch/arm/src/stm32f7/stm32_qspi.c index 54e27a34ef..ec9dd7c75f 100644 --- a/arch/arm/src/stm32f7/stm32_qspi.c +++ b/arch/arm/src/stm32f7/stm32_qspi.c @@ -567,7 +567,7 @@ static void qspi_dumpregs(struct stm32f7_qspidev_s *priv, const char *msg) spiinfo(" PIR:%08x LPTR:%08x\n", getreg32(priv->base + STM32_QUADSPI_PIR_OFFSET), /* Polling Interval Register */ getreg32(priv->base + STM32_QUADSPI_LPTR_OFFSET)); /* Low-Power Timeout Register */ - (void)regval; + UNUSED(regval); #endif } #endif @@ -1381,7 +1381,7 @@ static void qspi_dma_callback(DMA_HANDLE handle, uint8_t isr, void *arg) /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->dmadog); + wd_cancel(priv->dmadog); /* Sample DMA registers at the time of the callback */ @@ -1520,7 +1520,7 @@ static int qspi_memory_dma(struct stm32f7_qspidev_s *priv, /* Wait for the DMA complete */ - ret = nxsem_wait(&priv->dmawait); + ret = nxsem_wait_uninterruptible(&priv->dmawait); if (QSPIMEM_ISREAD(meminfo->flags)) { @@ -1530,24 +1530,17 @@ static int qspi_memory_dma(struct stm32f7_qspidev_s *priv, /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->dmadog); + wd_cancel(priv->dmadog); /* Check if we were awakened by an error of some kind */ if (ret < 0) { - /* EINTR is not a failure. That simply means that the wait - * was awakened by a signal. - */ - - if (ret != -EINTR) - { - DEBUGPANIC(); - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval &= ~QSPI_CR_DMAEN; - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - return ret; - } + DEBUGPANIC(); + regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); + regval &= ~QSPI_CR_DMAEN; + qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); + return ret; } /* Note that we might be awakened before the wait is over due to @@ -1759,24 +1752,11 @@ static int qspi_lock(struct qspi_dev_s *dev, bool lock) spiinfo("lock=%d\n", lock); if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -2108,7 +2088,7 @@ static int qspi_command(struct qspi_dev_s *dev, /* Wait for the interrupt routine to finish it's magic */ - (void)nxsem_wait(&priv->op_sem); + nxsem_wait(&priv->op_sem); MEMORY_SYNC(); /* Convey the result */ @@ -2266,7 +2246,7 @@ static int qspi_memory(struct qspi_dev_s *dev, /* Wait for the interrupt routine to finish it's magic */ - (void)nxsem_wait(&priv->op_sem); + nxsem_wait(&priv->op_sem); MEMORY_SYNC(); /* convey the result */ diff --git a/arch/arm/src/stm32f7/stm32_rng.c b/arch/arm/src/stm32f7/stm32_rng.c index 947088cdf6..9a59736882 100644 --- a/arch/arm/src/stm32f7/stm32_rng.c +++ b/arch/arm/src/stm32f7/stm32_rng.c @@ -328,7 +328,7 @@ static ssize_t stm32_rngread(struct file *filep, char *buffer, size_t buflen) void devrandom_register(void) { stm32_rng_initialize(); - (void)register_driver("/dev/random", &g_rngops, 0444, NULL); + register_driver("/dev/random", &g_rngops, 0444, NULL); } #endif @@ -352,7 +352,7 @@ void devurandom_register(void) #ifndef CONFIG_DEV_RANDOM stm32_rng_initialize(); #endif - (void)register_driver("/dev/urandom", &g_rngops, 0444, NULL); + register_driver("/dev/urandom", &g_rngops, 0444, NULL); } #endif diff --git a/arch/arm/src/stm32f7/stm32_rtc.c b/arch/arm/src/stm32f7/stm32_rtc.c index f7d7234fa6..3ce5ffa650 100644 --- a/arch/arm/src/stm32f7/stm32_rtc.c +++ b/arch/arm/src/stm32f7/stm32_rtc.c @@ -594,7 +594,7 @@ static int stm32_rtc_alarm_handler(int irq, void *context, void *arg) * backup data registers and backup SRAM). */ - (void)stm32_pwr_enablebkp(true); + stm32_pwr_enablebkp(true); isr = getreg32(STM32_RTC_ISR); @@ -656,7 +656,7 @@ static int stm32_rtc_alarm_handler(int irq, void *context, void *arg) * data registers and backup SRAM). */ - (void)stm32_pwr_enablebkp(false); + stm32_pwr_enablebkp(false); return ret; } @@ -1424,7 +1424,7 @@ int up_rtc_settime(FAR const struct timespec *tp) * seconds) */ - (void)gmtime_r(&tp->tv_sec, &newtime); + gmtime_r(&tp->tv_sec, &newtime); return stm32_rtc_setdatetime(&newtime); } @@ -1469,7 +1469,7 @@ int stm32_rtc_setalarm(FAR struct alm_setalarm_s *alminfo) if (!once) { once = true; - (void)stm32_exti_alarm(true, false, true, stm32_rtc_alarm_handler, NULL); + stm32_exti_alarm(true, false, true, stm32_rtc_alarm_handler, NULL); } /* REVISIT: Should test that the time is in the future */ @@ -1735,8 +1735,8 @@ static inline void rtc_enable_wakeup(void) { if (!g_wakeup_enabled) { - (void)stm32_exti_wakeup(true, false, true, stm32_rtc_wakeup_handler, - NULL); + stm32_exti_wakeup(true, false, true, stm32_rtc_wakeup_handler, + NULL); g_wakeup_enabled = true; } } diff --git a/arch/arm/src/stm32f7/stm32_rtc_lowerhalf.c b/arch/arm/src/stm32f7/stm32_rtc_lowerhalf.c index ebb278acd6..36d210ad19 100644 --- a/arch/arm/src/stm32f7/stm32_rtc_lowerhalf.c +++ b/arch/arm/src/stm32f7/stm32_rtc_lowerhalf.c @@ -481,7 +481,7 @@ static int stm32_setrelative(FAR struct rtc_lowerhalf_s *lower, /* And convert the time back to broken out format */ - (void)gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); + gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); /* The set the alarm using this absolute time */ diff --git a/arch/arm/src/stm32f7/stm32_sdmmc.c b/arch/arm/src/stm32f7/stm32_sdmmc.c index 626ecb2d81..0f9c9e51df 100644 --- a/arch/arm/src/stm32f7/stm32_sdmmc.c +++ b/arch/arm/src/stm32f7/stm32_sdmmc.c @@ -797,21 +797,7 @@ static inline void sdmmc_modifyreg32(struct stm32_dev_s *priv, int offset, static void stm32_takesem(struct stm32_dev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->waitsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -904,16 +890,16 @@ static void stm32_configwaitints(struct stm32_dev_s *priv, uint32_t waitmask, /* Arm the SDMMC_D Ready and install Isr */ - (void)stm32_gpiosetevent(pinset, true, false, false, - stm32_sdmmc_rdyinterrupt, priv); + stm32_gpiosetevent(pinset, true, false, false, + stm32_sdmmc_rdyinterrupt, priv); } /* Disarm SDMMC_D ready */ if ((wkupevent & SDIOWAIT_WRCOMPLETE) != 0) { - (void)stm32_gpiosetevent(priv->d0_gpio, false, false, false, - NULL, NULL); + stm32_gpiosetevent(priv->d0_gpio, false, false, false, + NULL, NULL); stm32_configgpio(priv->d0_gpio); } #endif @@ -1516,7 +1502,7 @@ static void stm32_endwait(struct stm32_dev_s *priv, sdio_eventset_t wkupevent) { /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Disable event-related interrupts */ @@ -2402,7 +2388,7 @@ static int stm32_cancel(FAR struct sdio_dev_s *dev) /* Cancel any watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* If this was a DMA transfer, make sure that DMA is stopped */ @@ -3340,8 +3326,8 @@ static void stm32_callback(void *arg) mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); - (void)work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, - priv->cbarg, 0); + work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, + priv->cbarg, 0); } else { diff --git a/arch/arm/src/stm32f7/stm32_serial.c b/arch/arm/src/stm32f7/stm32_serial.c index 1e08b0366c..2b36ab2655 100644 --- a/arch/arm/src/stm32f7/stm32_serial.c +++ b/arch/arm/src/stm32f7/stm32_serial.c @@ -3624,14 +3624,14 @@ void up_serialinit(void) /* Register the console */ #if CONSOLE_UART > 0 - (void)uart_register("/dev/console", &g_uart_devs[CONSOLE_UART - 1]->dev); + uart_register("/dev/console", &g_uart_devs[CONSOLE_UART - 1]->dev); #ifndef CONFIG_STM32F7_SERIAL_DISABLE_REORDERING /* If not disabled, register the console UART to ttyS0 and exclude * it from initializing it further down */ - (void)uart_register("/dev/ttyS0", &g_uart_devs[CONSOLE_UART - 1]->dev); + uart_register("/dev/ttyS0", &g_uart_devs[CONSOLE_UART - 1]->dev); minor = 1; #endif @@ -3667,7 +3667,7 @@ void up_serialinit(void) /* Register USARTs as devices in increasing order */ devname[9] = '0' + minor++; - (void)uart_register(devname, &g_uart_devs[i]->dev); + uart_register(devname, &g_uart_devs[i]->dev); } #endif /* HAVE UART */ } diff --git a/arch/arm/src/stm32f7/stm32_spi.c b/arch/arm/src/stm32f7/stm32_spi.c index f195948b5f..bc8d849291 100644 --- a/arch/arm/src/stm32f7/stm32_spi.c +++ b/arch/arm/src/stm32f7/stm32_spi.c @@ -791,23 +791,15 @@ static inline bool spi_9to16bitmode(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32F7_SPI_DMA static void spi_dmarxwait(FAR struct stm32_spidev_s *priv) { - int ret; - /* Take the semaphore (perhaps waiting). If the result is zero, then the DMA * must not really have completed??? */ do { - ret = nxsem_wait(&priv->rxsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&priv->rxsem); } - while (ret == -EINTR || priv->rxresult == 0); + while (priv->rxresult == 0); } #endif @@ -822,23 +814,15 @@ static void spi_dmarxwait(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32F7_SPI_DMA static void spi_dmatxwait(FAR struct stm32_spidev_s *priv) { - int ret; - /* Take the semaphore (perhaps waiting). If the result is zero, then the DMA * must not really have completed??? */ do { - ret = nxsem_wait(&priv->txsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&priv->txsem); } - while (ret == -EINTR || priv->txresult == 0); + while (priv->txresult == 0); } #endif @@ -853,7 +837,7 @@ static void spi_dmatxwait(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32F7_SPI_DMA static inline void spi_dmarxwakeup(FAR struct stm32_spidev_s *priv) { - (void)nxsem_post(&priv->rxsem); + nxsem_post(&priv->rxsem); } #endif @@ -868,7 +852,7 @@ static inline void spi_dmarxwakeup(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32F7_SPI_DMA static inline void spi_dmatxwakeup(FAR struct stm32_spidev_s *priv) { - (void)nxsem_post(&priv->txsem); + nxsem_post(&priv->txsem); } #endif @@ -1124,24 +1108,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; diff --git a/arch/arm/src/stm32f7/stm32_tickless.c b/arch/arm/src/stm32f7/stm32_tickless.c index bcaba42620..9cc8c190f4 100644 --- a/arch/arm/src/stm32f7/stm32_tickless.c +++ b/arch/arm/src/stm32f7/stm32_tickless.c @@ -939,7 +939,7 @@ int up_timer_start(FAR const struct timespec *ts) /* Yes.. then cancel it */ tmrinfo("Already running... cancelling\n"); - (void)up_timer_cancel(NULL); + up_timer_cancel(NULL); } /* Express the delay in microseconds */ diff --git a/arch/arm/src/stm32f7/stm32_timerisr.c b/arch/arm/src/stm32f7/stm32_timerisr.c index 5966984bb5..00657bf9de 100644 --- a/arch/arm/src/stm32f7/stm32_timerisr.c +++ b/arch/arm/src/stm32f7/stm32_timerisr.c @@ -136,7 +136,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)stm32_timerisr, NULL); + irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)stm32_timerisr, NULL); /* Enable SysTick interrupts: * diff --git a/arch/arm/src/stm32h7/stm32_bbsram.c b/arch/arm/src/stm32h7/stm32_bbsram.c index f5830d715b..1806f9e7eb 100644 --- a/arch/arm/src/stm32h7/stm32_bbsram.c +++ b/arch/arm/src/stm32h7/stm32_bbsram.c @@ -242,19 +242,7 @@ static void stm32_bbsram_semgive(FAR struct stm32_bbsram_s *priv) static void stm32_bbsram_semtake(FAR struct stm32_bbsram_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal. - */ - - do - { - ret = nxsem_wait(&priv->exclsem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); } /**************************************************************************** @@ -383,7 +371,7 @@ static int stm32_bbsram_open(FAR struct file *filep) static int stm32_bbsram_internal_close(FAR struct bbsramfh_s *bbf) { bbf->dirty = 0; - (void)clock_gettime(CLOCK_REALTIME, &bbf->lastwrite); + clock_gettime(CLOCK_REALTIME, &bbf->lastwrite); bbf->crc = stm32_bbsram_crc(bbf); stm32_bbsram_ecc_workaround(bbf); BBSRAM_DUMP(bbf, "close done"); diff --git a/arch/arm/src/stm32h7/stm32_dma.c b/arch/arm/src/stm32h7/stm32_dma.c index ec2d0f5ebc..7b1b448bd8 100644 --- a/arch/arm/src/stm32h7/stm32_dma.c +++ b/arch/arm/src/stm32h7/stm32_dma.c @@ -1973,8 +1973,8 @@ void weak_function up_dma_initialize(void) /* Attach standard DMA interrupt vectors */ - (void)irq_attach(dmachan->irq, g_dma_ops[controller].dma_interrupt, - dmachan); + irq_attach(dmachan->irq, g_dma_ops[controller].dma_interrupt, + dmachan); /* Disable the DMA stream */ diff --git a/arch/arm/src/stm32h7/stm32_ethernet.c b/arch/arm/src/stm32h7/stm32_ethernet.c index 4e445c5e37..bdef5be8e9 100644 --- a/arch/arm/src/stm32h7/stm32_ethernet.c +++ b/arch/arm/src/stm32h7/stm32_ethernet.c @@ -1277,8 +1277,8 @@ static int stm32_transmit(struct stm32_ethmac_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, STM32_TXTIMEOUT, stm32_txtimeout_expiry, - 1, (uint32_t)priv); + wd_start(priv->txtimeout, STM32_TXTIMEOUT, stm32_txtimeout_expiry, + 1, (uint32_t)priv); /* Update the tx descriptor tail pointer register to start the DMA */ @@ -1445,7 +1445,7 @@ static void stm32_dopoll(struct stm32_ethmac_s *priv) if (dev->d_buf) { - (void)devif_poll(dev, stm32_txpoll); + devif_poll(dev, stm32_txpoll); /* We will, most likely end up with a buffer to be freed. But it * might not be the same one that we allocated above. @@ -2469,7 +2469,7 @@ static void stm32_poll_work(void *arg) * data. */ - (void)devif_timer(dev, STM32_WDDELAY, stm32_txpoll); + devif_timer(dev, STM32_WDDELAY, stm32_txpoll); /* We will, most likely end up with a buffer to be freed. But it * might not be the same one that we allocated above. @@ -2486,7 +2486,7 @@ static void stm32_poll_work(void *arg) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); + wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); net_unlock(); } @@ -2520,7 +2520,7 @@ static void stm32_poll_expiry(int argc, uint32_t arg, ...) } else { - (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); + wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); } } @@ -2568,8 +2568,8 @@ static int stm32_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, - (uint32_t)priv); + wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, + (uint32_t)priv); /* Enable the Ethernet interrupt */ @@ -4128,7 +4128,7 @@ static void stm32_ipv6multicast(struct stm32_ethmac_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)stm32_addmac(dev, mac); + stm32_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -4136,7 +4136,7 @@ static void stm32_ipv6multicast(struct stm32_ethmac_s *priv) * packets. */ - (void)stm32_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + stm32_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -4145,7 +4145,7 @@ static void stm32_ipv6multicast(struct stm32_ethmac_s *priv) * packets. */ - (void)stm32_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + stm32_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -4383,7 +4383,7 @@ int stm32_ethinitialize(int intf) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->dev, NET_LL_ETHERNET); + netdev_register(&priv->dev, NET_LL_ETHERNET); return OK; } @@ -4410,7 +4410,7 @@ int stm32_ethinitialize(int intf) #if STM32H7_NETHERNET == 1 && !defined(CONFIG_NETDEV_LATEINIT) void up_netinitialize(void) { - (void)stm32_ethinitialize(0); + stm32_ethinitialize(0); } #endif diff --git a/arch/arm/src/stm32h7/stm32_flash.c b/arch/arm/src/stm32h7/stm32_flash.c index 5c275c8eb6..0ab7263580 100644 --- a/arch/arm/src/stm32h7/stm32_flash.c +++ b/arch/arm/src/stm32h7/stm32_flash.c @@ -239,21 +239,7 @@ static inline void stm32h7_flash_modifyreg32(FAR struct stm32h7_flash_priv_s static void stm32h7_flash_sem_lock(FAR struct stm32h7_flash_priv_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = sem_wait(&priv->sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sem); } /***************************************************************************** @@ -267,7 +253,7 @@ static void stm32h7_flash_sem_lock(FAR struct stm32h7_flash_priv_s *priv) static inline void stm32h7_flash_sem_unlock(FAR struct stm32h7_flash_priv_s *priv) { - sem_post(&priv->sem); + nxsem_post(&priv->sem); } /***************************************************************************** diff --git a/arch/arm/src/stm32h7/stm32_i2c.c b/arch/arm/src/stm32h7/stm32_i2c.c index 94e96af3d5..ca1797e414 100644 --- a/arch/arm/src/stm32h7/stm32_i2c.c +++ b/arch/arm/src/stm32h7/stm32_i2c.c @@ -702,21 +702,7 @@ static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv, static inline void stm32_i2c_sem_wait(FAR struct i2c_master_s *dev) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); } /************************************************************************************ @@ -800,7 +786,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) { /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -828,12 +814,11 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) #endif /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->sem_isr, &abstime); - if (ret < 0 && ret != -EINTR) + ret = nxsem_timedwait_uninterruptible(&priv->sem_isr, &abstime); + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would * include timeouts and mystery errors reported by nxsem_timedwait. - * NOTE that we try again if we are awakened by a signal (EINTR). */ break; diff --git a/arch/arm/src/stm32h7/stm32_irq.c b/arch/arm/src/stm32h7/stm32_irq.c index 408c530819..0e878c972d 100644 --- a/arch/arm/src/stm32h7/stm32_irq.c +++ b/arch/arm/src/stm32h7/stm32_irq.c @@ -186,7 +186,7 @@ static void stm32_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int stm32_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -194,7 +194,7 @@ static int stm32_nmi(int irq, FAR void *context, FAR void *arg) static int stm32_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -202,7 +202,7 @@ static int stm32_busfault(int irq, FAR void *context, FAR void *arg) static int stm32_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -210,7 +210,7 @@ static int stm32_usagefault(int irq, FAR void *context, FAR void *arg) static int stm32_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -218,7 +218,7 @@ static int stm32_pendsv(int irq, FAR void *context, FAR void *arg) static int stm32_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -226,7 +226,7 @@ static int stm32_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int stm32_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/stm32h7/stm32_otgdev.c b/arch/arm/src/stm32h7/stm32_otgdev.c index 3350ea4de7..d6fecb5736 100644 --- a/arch/arm/src/stm32h7/stm32_otgdev.c +++ b/arch/arm/src/stm32h7/stm32_otgdev.c @@ -1519,7 +1519,7 @@ static void stm32_rxfifo_discard(FAR struct stm32_ep_s *privep, int len) for (i = 0; i < len; i += 4) { volatile uint32_t data = stm32_getreg(regaddr); - (void)data; + UNUSED(data); } } } @@ -2287,7 +2287,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, { /* Actually, I think we could just stall here. */ - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } } else @@ -2333,7 +2333,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, { /* Actually, I think we could just stall here. */ - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2397,7 +2397,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_GETSETDESC), 0); if ((ctrlreq->type & USB_REQ_RECIPIENT_MASK) == USB_REQ_RECIPIENT_DEVICE) { - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2422,7 +2422,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, ctrlreq->index == 0 && ctrlreq->len == 1) { - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2494,7 +2494,7 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, { usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_GETSETIF), 0); - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } break; @@ -2572,7 +2572,7 @@ static inline void stm32_ep0out_setup(struct stm32_usbdev_s *priv) { /* Dispatch any non-standard requests */ - (void)stm32_req_dispatch(priv, &priv->ctrlreq); + stm32_req_dispatch(priv, &priv->ctrlreq); } else { @@ -4019,10 +4019,10 @@ static void stm32_ep0_configure(FAR struct stm32_usbdev_s *priv) { /* Enable EP0 IN and OUT */ - (void)stm32_epin_configure(&priv->epin[EP0], USB_EP_ATTR_XFER_CONTROL, - CONFIG_USBDEV_EP0_MAXSIZE); - (void)stm32_epout_configure(&priv->epout[EP0], USB_EP_ATTR_XFER_CONTROL, - CONFIG_USBDEV_EP0_MAXSIZE); + stm32_epin_configure(&priv->epin[EP0], USB_EP_ATTR_XFER_CONTROL, + CONFIG_USBDEV_EP0_MAXSIZE); + stm32_epout_configure(&priv->epout[EP0], USB_EP_ATTR_XFER_CONTROL, + CONFIG_USBDEV_EP0_MAXSIZE); } /**************************************************************************** diff --git a/arch/arm/src/stm32h7/stm32_otghost.c b/arch/arm/src/stm32h7/stm32_otghost.c index 78499a533a..3fc1123727 100644 --- a/arch/arm/src/stm32h7/stm32_otghost.c +++ b/arch/arm/src/stm32h7/stm32_otghost.c @@ -652,21 +652,7 @@ static inline void stm32_modifyreg(uint32_t addr, uint32_t clrbits, static void stm32_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -1118,13 +1104,7 @@ static int stm32_chan_wait(FAR struct stm32_usbhost_s *priv, * wait here. */ - ret = nxsem_wait(&chan->waitsem); - - /* nxsem_wait should succeed. But it is possible that we could be - * awakened by a signal too. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&chan->waitsem); } while (chan->waiter); diff --git a/arch/arm/src/stm32h7/stm32_pwm.c b/arch/arm/src/stm32h7/stm32_pwm.c index a780012850..62b588b5c6 100644 --- a/arch/arm/src/stm32h7/stm32_pwm.c +++ b/arch/arm/src/stm32h7/stm32_pwm.c @@ -3511,7 +3511,7 @@ static int pwm_interrupt(FAR struct pwm_lowerhalf_s *dev) /* Disable first interrtups, stop and reset the timer */ - (void)pwm_stop(dev); + pwm_stop(dev); /* Then perform the callback into the upper half driver */ diff --git a/arch/arm/src/stm32h7/stm32_qencoder.c b/arch/arm/src/stm32h7/stm32_qencoder.c index 41d56c244a..e71edbc694 100644 --- a/arch/arm/src/stm32h7/stm32_qencoder.c +++ b/arch/arm/src/stm32h7/stm32_qencoder.c @@ -925,7 +925,7 @@ static int stm32_shutdown(FAR struct qe_lowerhalf_s *lower) /* Detach the interrupt handler */ - (void)irq_detach(priv->config->irq); + irq_detach(priv->config->irq); /* Disable interrupts momentary to stop any ongoing timer processing and * to prevent any concurrent access to the reset register. diff --git a/arch/arm/src/stm32h7/stm32_rtc.c b/arch/arm/src/stm32h7/stm32_rtc.c index 4af11daedc..6301c91895 100644 --- a/arch/arm/src/stm32h7/stm32_rtc.c +++ b/arch/arm/src/stm32h7/stm32_rtc.c @@ -594,7 +594,7 @@ static int stm32_rtc_alarm_handler(int irq, void *context, void *arg) * backup data registers and backup SRAM). */ - (void)stm32_pwr_enablebkp(true); + stm32_pwr_enablebkp(true); isr = getreg32(STM32_RTC_ISR); @@ -656,7 +656,7 @@ static int stm32_rtc_alarm_handler(int irq, void *context, void *arg) * data registers and backup SRAM). */ - (void)stm32_pwr_enablebkp(false); + stm32_pwr_enablebkp(false); return ret; } @@ -1424,7 +1424,7 @@ int up_rtc_settime(FAR const struct timespec *tp) * seconds) */ - (void)gmtime_r(&tp->tv_sec, &newtime); + gmtime_r(&tp->tv_sec, &newtime); return stm32_rtc_setdatetime(&newtime); } @@ -1469,7 +1469,7 @@ int stm32_rtc_setalarm(FAR struct alm_setalarm_s *alminfo) if (!once) { once = true; - (void)stm32_exti_alarm(true, false, true, stm32_rtc_alarm_handler, NULL); + stm32_exti_alarm(true, false, true, stm32_rtc_alarm_handler, NULL); } /* REVISIT: Should test that the time is in the future */ @@ -1735,8 +1735,8 @@ static inline void rtc_enable_wakeup(void) { if (!g_wakeup_enabled) { - (void)stm32_exti_wakeup(true, false, true, stm32_rtc_wakeup_handler, - NULL); + stm32_exti_wakeup(true, false, true, stm32_rtc_wakeup_handler, + NULL); g_wakeup_enabled = true; } } diff --git a/arch/arm/src/stm32h7/stm32_rtc_lowerhalf.c b/arch/arm/src/stm32h7/stm32_rtc_lowerhalf.c index f41c342fab..2b5a2b5f0d 100644 --- a/arch/arm/src/stm32h7/stm32_rtc_lowerhalf.c +++ b/arch/arm/src/stm32h7/stm32_rtc_lowerhalf.c @@ -482,7 +482,7 @@ static int stm32_setrelative(FAR struct rtc_lowerhalf_s *lower, /* And convert the time back to broken out format */ - (void)gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); + gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); /* The set the alarm using this absolute time */ diff --git a/arch/arm/src/stm32h7/stm32_sdmmc.c b/arch/arm/src/stm32h7/stm32_sdmmc.c index 42ca191754..a395a7751a 100644 --- a/arch/arm/src/stm32h7/stm32_sdmmc.c +++ b/arch/arm/src/stm32h7/stm32_sdmmc.c @@ -686,21 +686,7 @@ static inline void sdmmc_modifyreg32(struct stm32_dev_s *priv, int offset, static void stm32_takesem(struct stm32_dev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->waitsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -796,16 +782,16 @@ static void stm32_configwaitints(struct stm32_dev_s *priv, uint32_t waitmask, /* Arm the SDMMC_D Ready and install Isr */ - (void)stm32_gpiosetevent(pinset, true, false, false, - stm32_sdmmc_rdyinterrupt, priv); + stm32_gpiosetevent(pinset, true, false, false, + stm32_sdmmc_rdyinterrupt, priv); } /* Disarm SDMMC_D ready */ if ((wkupevent & SDIOWAIT_WRCOMPLETE) != 0) { - (void)stm32_gpiosetevent(priv->d0_gpio, false, false, false, - NULL, NULL); + stm32_gpiosetevent(priv->d0_gpio, false, false, false, + NULL, NULL); stm32_configgpio(priv->d0_gpio); } #endif @@ -1337,7 +1323,7 @@ static void stm32_endwait(struct stm32_dev_s *priv, sdio_eventset_t wkupevent) { /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Disable event-related interrupts */ @@ -1450,8 +1436,8 @@ static void stm32_sdmmc_fifo_monitor(FAR void *arg) if (sdmmc_getreg32(priv, STM32_SDMMC_DCOUNT_OFFSET) != 0 && sdmmc_getreg32(priv, STM32_SDMMC_STA_OFFSET) == STM32_SDMMC_STA_DPSMACT) { - (void)work_queue(HPWORK, &priv->cbfifo, - (worker_t)stm32_sdmmc_fifo_monitor, arg, 1); + work_queue(HPWORK, &priv->cbfifo, + (worker_t)stm32_sdmmc_fifo_monitor, arg, 1); } } #endif @@ -1535,8 +1521,8 @@ static int stm32_sdmmc_interrupt(int irq, void *context, void *arg) stm32_recvfifo(priv); #if !defined(CONFIG_STM32H7_SDMMC_IDMA) - (void)work_queue(HPWORK, &priv->cbfifo, - (worker_t)stm32_sdmmc_fifo_monitor, arg, 1); + work_queue(HPWORK, &priv->cbfifo, + (worker_t)stm32_sdmmc_fifo_monitor, arg, 1); #endif } @@ -2307,7 +2293,7 @@ static int stm32_cancel(FAR struct sdio_dev_s *dev) /* Cancel any watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Mark no transfer in progress */ @@ -3225,8 +3211,8 @@ static void stm32_callback(void *arg) /* Yes.. queue it */ mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); - (void)work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, - priv->cbarg, 0); + work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, + priv->cbarg, 0); } else { diff --git a/arch/arm/src/stm32h7/stm32_serial.c b/arch/arm/src/stm32h7/stm32_serial.c index 04e0784542..47d9ff3f5a 100644 --- a/arch/arm/src/stm32h7/stm32_serial.c +++ b/arch/arm/src/stm32h7/stm32_serial.c @@ -2313,14 +2313,14 @@ void up_serialinit(void) /* Register the console */ #if CONSOLE_UART > 0 - (void)uart_register("/dev/console", &g_uart_devs[CONSOLE_UART - 1]->dev); + uart_register("/dev/console", &g_uart_devs[CONSOLE_UART - 1]->dev); #ifndef CONFIG_STM32H7_SERIAL_DISABLE_REORDERING /* If not disabled, register the console UART to ttyS0 and exclude * it from initializing it further down */ - (void)uart_register("/dev/ttyS0", &g_uart_devs[CONSOLE_UART - 1]->dev); + uart_register("/dev/ttyS0", &g_uart_devs[CONSOLE_UART - 1]->dev); minor = 1; #endif @@ -2351,7 +2351,7 @@ void up_serialinit(void) /* Register USARTs as devices in increasing order */ devname[9] = '0' + minor++; - (void)uart_register(devname, &g_uart_devs[i]->dev); + uart_register(devname, &g_uart_devs[i]->dev); } #endif /* HAVE UART */ } diff --git a/arch/arm/src/stm32h7/stm32_spi.c b/arch/arm/src/stm32h7/stm32_spi.c index c2f7bd5e4c..f90578d3eb 100644 --- a/arch/arm/src/stm32h7/stm32_spi.c +++ b/arch/arm/src/stm32h7/stm32_spi.c @@ -830,23 +830,15 @@ static inline bool spi_9to16bitmode(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32H7_SPI_DMA static void spi_dmarxwait(FAR struct stm32_spidev_s *priv) { - int ret; - /* Take the semaphore (perhaps waiting). If the result is zero, then the DMA * must not really have completed??? */ do { - ret = nxsem_wait(&priv->rxsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&priv->rxsem); } - while (ret == -EINTR || priv->rxresult == 0); + while (priv->rxresult == 0); } #endif @@ -861,23 +853,7 @@ static void spi_dmarxwait(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32H7_SPI_DMA static void spi_dmatxwait(FAR struct stm32_spidev_s *priv) { - int ret; - - /* Take the semaphore (perhaps waiting). If the result is zero, then the DMA - * must not really have completed??? - */ - - do - { - ret = nxsem_wait(&priv->txsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR || priv->txresult == 0); + nxsem_wait_uninterruptible(&priv->txsem); } #endif @@ -892,7 +868,7 @@ static void spi_dmatxwait(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32H7_SPI_DMA static inline void spi_dmarxwakeup(FAR struct stm32_spidev_s *priv) { - (void)nxsem_post(&priv->rxsem); + nxsem_post(&priv->rxsem); } #endif @@ -907,7 +883,7 @@ static inline void spi_dmarxwakeup(FAR struct stm32_spidev_s *priv) #ifdef CONFIG_STM32H7_SPI_DMA static inline void spi_dmatxwakeup(FAR struct stm32_spidev_s *priv) { - (void)nxsem_post(&priv->txsem); + nxsem_post(&priv->txsem); } #endif @@ -1133,24 +1109,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; diff --git a/arch/arm/src/stm32h7/stm32_timerisr.c b/arch/arm/src/stm32h7/stm32_timerisr.c index 5305f16e60..027fbf3689 100644 --- a/arch/arm/src/stm32h7/stm32_timerisr.c +++ b/arch/arm/src/stm32h7/stm32_timerisr.c @@ -159,7 +159,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)stm32_timerisr, NULL); + irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)stm32_timerisr, NULL); /* Enable SysTick interrupts: * diff --git a/arch/arm/src/stm32l4/stm32l4_1wire.c b/arch/arm/src/stm32l4/stm32l4_1wire.c index 435375ac42..a3320bde4b 100644 --- a/arch/arm/src/stm32l4/stm32l4_1wire.c +++ b/arch/arm/src/stm32l4/stm32l4_1wire.c @@ -676,21 +676,7 @@ static inline void stm32_1wire_sem_destroy(FAR struct stm32_1wire_priv_s *priv) static inline void stm32_1wire_sem_wait(FAR struct stm32_1wire_priv_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sem_excl); } /**************************************************************************** @@ -753,7 +739,7 @@ static int stm32_1wire_process(struct stm32_1wire_priv_s *priv, clock_gettime(CLOCK_REALTIME, &abstime); abstime.tv_sec += BUS_TIMEOUT; - (void)nxsem_timedwait(&priv->sem_isr, &abstime); + nxsem_timedwait(&priv->sem_isr, &abstime); break; case ONEWIRETASK_WRITE: @@ -776,7 +762,7 @@ static int stm32_1wire_process(struct stm32_1wire_priv_s *priv, clock_gettime(CLOCK_REALTIME, &abstime); abstime.tv_sec += BUS_TIMEOUT; - (void)nxsem_timedwait(&priv->sem_isr, &abstime); + nxsem_timedwait(&priv->sem_isr, &abstime); break; case ONEWIRETASK_READ: @@ -799,7 +785,7 @@ static int stm32_1wire_process(struct stm32_1wire_priv_s *priv, clock_gettime(CLOCK_REALTIME, &abstime); abstime.tv_sec += BUS_TIMEOUT; - (void)nxsem_timedwait(&priv->sem_isr, &abstime); + nxsem_timedwait(&priv->sem_isr, &abstime); break; } diff --git a/arch/arm/src/stm32l4/stm32l4_can.c b/arch/arm/src/stm32l4/stm32l4_can.c index 7ad8c68065..d50b99a5e7 100644 --- a/arch/arm/src/stm32l4/stm32l4_can.c +++ b/arch/arm/src/stm32l4/stm32l4_can.c @@ -1531,7 +1531,7 @@ static int stm32l4can_txinterrupt(int irq, FAR void *context, FAR void *arg) { /* Tell the upper half that the tansfer is finished. */ - (void)can_txdone(dev); + can_txdone(dev); } } @@ -1551,7 +1551,7 @@ static int stm32l4can_txinterrupt(int irq, FAR void *context, FAR void *arg) { /* Tell the upper half that the tansfer is finished. */ - (void)can_txdone(dev); + can_txdone(dev); } } @@ -1571,7 +1571,7 @@ static int stm32l4can_txinterrupt(int irq, FAR void *context, FAR void *arg) { /* Tell the upper half that the tansfer is finished. */ - (void)can_txdone(dev); + can_txdone(dev); } } diff --git a/arch/arm/src/stm32l4/stm32l4_flash.c b/arch/arm/src/stm32l4/stm32l4_flash.c index e26742d181..170ec89dbf 100644 --- a/arch/arm/src/stm32l4/stm32l4_flash.c +++ b/arch/arm/src/stm32l4/stm32l4_flash.c @@ -120,21 +120,7 @@ static uint32_t g_page_buffer[FLASH_PAGE_WORDS]; static inline void sem_lock(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_sem); } static inline void sem_unlock(void) diff --git a/arch/arm/src/stm32l4/stm32l4_i2c.c b/arch/arm/src/stm32l4/stm32l4_i2c.c index 9e1fa50514..060843d71e 100644 --- a/arch/arm/src/stm32l4/stm32l4_i2c.c +++ b/arch/arm/src/stm32l4/stm32l4_i2c.c @@ -743,21 +743,7 @@ static inline void stm32l4_i2c_modifyreg32(FAR struct stm32l4_i2c_priv_s *priv, static inline void stm32l4_i2c_sem_wait(FAR struct i2c_master_s *dev) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&((struct stm32l4_i2c_inst_s *)dev)->priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&((struct stm32l4_i2c_inst_s *)dev)->priv->sem_excl); } /************************************************************************************ @@ -841,7 +827,7 @@ static inline int stm32l4_i2c_sem_waitdone(FAR struct stm32l4_i2c_priv_s *priv) { /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -869,12 +855,11 @@ static inline int stm32l4_i2c_sem_waitdone(FAR struct stm32l4_i2c_priv_s *priv) #endif /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->sem_isr, &abstime); - if (ret < 0 && ret != -EINTR) + ret = nxsem_timedwait_uninterruptible(&priv->sem_isr, &abstime); + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would * include timeouts and mystery errors reported by nxsem_timedwait. - * NOTE that we try again if we are awakened by a signal (EINTR). */ break; diff --git a/arch/arm/src/stm32l4/stm32l4_idle.c b/arch/arm/src/stm32l4/stm32l4_idle.c index 089a47a479..8f55d5f84e 100644 --- a/arch/arm/src/stm32l4/stm32l4_idle.c +++ b/arch/arm/src/stm32l4/stm32l4_idle.c @@ -110,7 +110,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { @@ -152,7 +152,7 @@ static void up_idlepm(void) break; case PM_SLEEP: - (void)stm32l4_pmstandby(); + stm32l4_pmstandby(); break; default: diff --git a/arch/arm/src/stm32l4/stm32l4_irq.c b/arch/arm/src/stm32l4/stm32l4_irq.c index 7e60dcf37f..07cf739758 100644 --- a/arch/arm/src/stm32l4/stm32l4_irq.c +++ b/arch/arm/src/stm32l4/stm32l4_irq.c @@ -158,7 +158,7 @@ static void stm32l4_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int stm32l4_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -166,7 +166,7 @@ static int stm32l4_nmi(int irq, FAR void *context, FAR void *arg) static int stm32l4_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -174,7 +174,7 @@ static int stm32l4_busfault(int irq, FAR void *context, FAR void *arg) static int stm32l4_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -182,7 +182,7 @@ static int stm32l4_usagefault(int irq, FAR void *context, FAR void *arg) static int stm32l4_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -190,7 +190,7 @@ static int stm32l4_pendsv(int irq, FAR void *context, FAR void *arg) static int stm32l4_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -198,7 +198,7 @@ static int stm32l4_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int stm32l4_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/stm32l4/stm32l4_iwdg.c b/arch/arm/src/stm32l4/stm32l4_iwdg.c index 6660d9717e..a4542a4c50 100644 --- a/arch/arm/src/stm32l4/stm32l4_iwdg.c +++ b/arch/arm/src/stm32l4/stm32l4_iwdg.c @@ -643,7 +643,7 @@ void stm32l4_iwdginitialize(FAR const char *devpath, uint32_t lsifreq) /* Register the watchdog driver as /dev/watchdog0 */ - (void)watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv); + watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv); /* When the microcontroller enters debug mode (Cortex-M4F core halted), * the IWDG counter either continues to work normally or stops, depending diff --git a/arch/arm/src/stm32l4/stm32l4_lse.c b/arch/arm/src/stm32l4/stm32l4_lse.c index 0bfff23711..983bfe5c55 100644 --- a/arch/arm/src/stm32l4/stm32l4_lse.c +++ b/arch/arm/src/stm32l4/stm32l4_lse.c @@ -135,6 +135,6 @@ void stm32l4_rcc_enablelse(void) /* Disable backup domain access if it was disabled on entry */ - (void)stm32l4_pwr_enablebkp(writable); + stm32l4_pwr_enablebkp(writable); } } diff --git a/arch/arm/src/stm32l4/stm32l4_oneshot.c b/arch/arm/src/stm32l4/stm32l4_oneshot.c index 2c5191404d..afe4e8e362 100644 --- a/arch/arm/src/stm32l4/stm32l4_oneshot.c +++ b/arch/arm/src/stm32l4/stm32l4_oneshot.c @@ -289,7 +289,7 @@ int stm32l4_oneshot_start(FAR struct stm32l4_oneshot_s *oneshot, /* Yes.. then cancel it */ tmrinfo("Already running... cancelling\n"); - (void)stm32l4_oneshot_cancel(oneshot, NULL); + stm32l4_oneshot_cancel(oneshot, NULL); } /* Save the new handler and its argument */ diff --git a/arch/arm/src/stm32l4/stm32l4_otgfsdev.c b/arch/arm/src/stm32l4/stm32l4_otgfsdev.c index 97e7fa9549..a735cc2b1a 100644 --- a/arch/arm/src/stm32l4/stm32l4_otgfsdev.c +++ b/arch/arm/src/stm32l4/stm32l4_otgfsdev.c @@ -1564,7 +1564,7 @@ static void stm32l4_rxfifo_discard(FAR struct stm32l4_ep_s *privep, int len) for (i = 0; i < len; i += 4) { volatile uint32_t data = stm32l4_getreg(regaddr); - (void)data; + UNUSED(data); } uinfo("<<< discarding %d\n", len); @@ -2336,7 +2336,7 @@ static inline void stm32l4_ep0out_stdrequest(struct stm32l4_usbdev_s *priv, { /* Actually, I think we could just stall here. */ - (void)stm32l4_req_dispatch(priv, &priv->ctrlreq); + stm32l4_req_dispatch(priv, &priv->ctrlreq); } } else @@ -2382,7 +2382,7 @@ static inline void stm32l4_ep0out_stdrequest(struct stm32l4_usbdev_s *priv, { /* Actually, I think we could just stall here. */ - (void)stm32l4_req_dispatch(priv, &priv->ctrlreq); + stm32l4_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2446,7 +2446,7 @@ static inline void stm32l4_ep0out_stdrequest(struct stm32l4_usbdev_s *priv, usbtrace(TRACE_INTDECODE(STM32L4_TRACEINTID_GETSETDESC), 0); if ((ctrlreq->type & USB_REQ_RECIPIENT_MASK) == USB_REQ_RECIPIENT_DEVICE) { - (void)stm32l4_req_dispatch(priv, &priv->ctrlreq); + stm32l4_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2471,7 +2471,7 @@ static inline void stm32l4_ep0out_stdrequest(struct stm32l4_usbdev_s *priv, ctrlreq->index == 0 && ctrlreq->len == 1) { - (void)stm32l4_req_dispatch(priv, &priv->ctrlreq); + stm32l4_req_dispatch(priv, &priv->ctrlreq); } else { @@ -2543,7 +2543,7 @@ static inline void stm32l4_ep0out_stdrequest(struct stm32l4_usbdev_s *priv, { usbtrace(TRACE_INTDECODE(STM32L4_TRACEINTID_GETSETIF), 0); - (void)stm32l4_req_dispatch(priv, &priv->ctrlreq); + stm32l4_req_dispatch(priv, &priv->ctrlreq); } break; @@ -2621,7 +2621,7 @@ static inline void stm32l4_ep0out_setup(struct stm32l4_usbdev_s *priv) { /* Dispatch any non-standard requests */ - (void)stm32l4_req_dispatch(priv, &priv->ctrlreq); + stm32l4_req_dispatch(priv, &priv->ctrlreq); } else { @@ -4129,10 +4129,10 @@ static void stm32l4_ep0_configure(FAR struct stm32l4_usbdev_s *priv) { /* Enable EP0 IN and OUT */ - (void)stm32l4_epin_configure(&priv->epin[EP0], USB_EP_ATTR_XFER_CONTROL, - CONFIG_USBDEV_EP0_MAXSIZE); - (void)stm32l4_epout_configure(&priv->epout[EP0], USB_EP_ATTR_XFER_CONTROL, - CONFIG_USBDEV_EP0_MAXSIZE); + stm32l4_epin_configure(&priv->epin[EP0], USB_EP_ATTR_XFER_CONTROL, + CONFIG_USBDEV_EP0_MAXSIZE); + stm32l4_epout_configure(&priv->epout[EP0], USB_EP_ATTR_XFER_CONTROL, + CONFIG_USBDEV_EP0_MAXSIZE); } /**************************************************************************** diff --git a/arch/arm/src/stm32l4/stm32l4_otgfshost.c b/arch/arm/src/stm32l4/stm32l4_otgfshost.c index dbea969705..247a737e0c 100644 --- a/arch/arm/src/stm32l4/stm32l4_otgfshost.c +++ b/arch/arm/src/stm32l4/stm32l4_otgfshost.c @@ -650,21 +650,7 @@ static inline void stm32l4_modifyreg(uint32_t addr, uint32_t clrbits, static void stm32l4_takesem(FAR sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -1093,7 +1079,6 @@ static int stm32l4_chan_wait(FAR struct stm32l4_usbhost_s *priv, FAR struct stm32l4_chan_s *chan) { irqstate_t flags; - int ret; /* Disable interrupts so that the following operations will be atomic. On * the OTG FS global interrupt needs to be disabled. However, here we disable @@ -1116,13 +1101,7 @@ static int stm32l4_chan_wait(FAR struct stm32l4_usbhost_s *priv, * wait here. */ - ret = nxsem_wait(&chan->waitsem); - - /* nxsem_wait should succeed. But it is possible that we could be - * awakened by a signal too. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&chan->waitsem); } while (chan->waiter); diff --git a/arch/arm/src/stm32l4/stm32l4_pwm.c b/arch/arm/src/stm32l4/stm32l4_pwm.c index 8b87546ae5..84b36eb5e6 100644 --- a/arch/arm/src/stm32l4/stm32l4_pwm.c +++ b/arch/arm/src/stm32l4/stm32l4_pwm.c @@ -1735,7 +1735,7 @@ static int stm32l4pwm_interrupt(struct stm32l4_pwmtimer_s *priv) /* Disable first interrtups, stop and reset the timer */ - (void)stm32l4pwm_stop((FAR struct pwm_lowerhalf_s *)priv); + stm32l4pwm_stop((FAR struct pwm_lowerhalf_s *)priv); /* Then perform the callback into the upper half driver */ diff --git a/arch/arm/src/stm32l4/stm32l4_qencoder.c b/arch/arm/src/stm32l4/stm32l4_qencoder.c index 683b2f6263..dce2a2a791 100644 --- a/arch/arm/src/stm32l4/stm32l4_qencoder.c +++ b/arch/arm/src/stm32l4/stm32l4_qencoder.c @@ -909,7 +909,7 @@ static int stm32l4_shutdown(FAR struct qe_lowerhalf_s *lower) /* Detach the interrupt handler */ - (void)irq_detach(priv->config->irq); + irq_detach(priv->config->irq); /* Disable interrupts momentary to stop any ongoing timer processing and * to prevent any concurrent access to the reset register. diff --git a/arch/arm/src/stm32l4/stm32l4_qspi.c b/arch/arm/src/stm32l4/stm32l4_qspi.c index 06cfba52f9..0d7671319e 100644 --- a/arch/arm/src/stm32l4/stm32l4_qspi.c +++ b/arch/arm/src/stm32l4/stm32l4_qspi.c @@ -563,7 +563,7 @@ static void qspi_dumpregs(struct stm32l4_qspidev_s *priv, const char *msg) spiinfo(" PIR:%08x LPTR:%08x\n", getreg32(priv->base + STM32L4_QUADSPI_PIR_OFFSET), /* Polling Interval Register */ getreg32(priv->base + STM32L4_QUADSPI_LPTR_OFFSET)); /* Low-Power Timeout Register */ - (void)regval; + UNUSED(regval); #endif } #endif @@ -1325,7 +1325,7 @@ static void qspi_dma_callback(DMA_HANDLE handle, uint8_t isr, void *arg) /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->dmadog); + wd_cancel(priv->dmadog); /* Sample DMA registers at the time of the callback */ @@ -1461,28 +1461,21 @@ static int qspi_memory_dma(struct stm32l4_qspidev_s *priv, /* Wait for the DMA complete */ - ret = nxsem_wait(&priv->dmawait); + ret = nxsem_wait_uninterruptible(&priv->dmawait); /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->dmadog); + wd_cancel(priv->dmadog); /* Check if we were awakened by an error of some kind */ if (ret < 0) { - /* EINTR is not a failure. That simply means that the wait - * was awakened by a signal. - */ - - if (ret != -EINTR) - { - DEBUGPANIC(); - regval = qspi_getreg(priv, STM32L4_QUADSPI_CR_OFFSET); - regval &= ~QSPI_CR_DMAEN; - qspi_putreg(priv, regval, STM32L4_QUADSPI_CR_OFFSET); - return ret; - } + DEBUGPANIC(); + regval = qspi_getreg(priv, STM32L4_QUADSPI_CR_OFFSET); + regval &= ~QSPI_CR_DMAEN; + qspi_putreg(priv, regval, STM32L4_QUADSPI_CR_OFFSET); + return ret; } /* Note that we might be awakened before the wait is over due to @@ -1694,24 +1687,11 @@ static int qspi_lock(struct qspi_dev_s *dev, bool lock) spiinfo("lock=%d\n", lock); if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -2043,7 +2023,7 @@ static int qspi_command(struct qspi_dev_s *dev, /* Wait for the interrupt routine to finish it's magic */ - (void)nxsem_wait(&priv->op_sem); + nxsem_wait(&priv->op_sem); MEMORY_SYNC(); /* Convey the result */ @@ -2201,7 +2181,7 @@ static int qspi_memory(struct qspi_dev_s *dev, /* Wait for the interrupt routine to finish it's magic */ - (void)nxsem_wait(&priv->op_sem); + nxsem_wait(&priv->op_sem); MEMORY_SYNC(); /* convey the result */ diff --git a/arch/arm/src/stm32l4/stm32l4_rcc.c b/arch/arm/src/stm32l4/stm32l4_rcc.c index 1994718a8e..e29d1b53bd 100644 --- a/arch/arm/src/stm32l4/stm32l4_rcc.c +++ b/arch/arm/src/stm32l4/stm32l4_rcc.c @@ -136,7 +136,7 @@ static inline void rcc_resetbkp(void) * backup data registers and backup SRAM). */ - (void)stm32l4_pwr_enablebkp(true); + stm32l4_pwr_enablebkp(true); /* We might be changing RTCSEL - to ensure such changes work, we must * reset the backup domain (having backed up the RTC_MAGIC token) @@ -157,7 +157,7 @@ static inline void rcc_resetbkp(void) putreg32(bkregs[i], STM32L4_RTC_BKR(i)); } - (void)stm32l4_pwr_enablebkp(false); + stm32l4_pwr_enablebkp(false); } } #else diff --git a/arch/arm/src/stm32l4/stm32l4_rng.c b/arch/arm/src/stm32l4/stm32l4_rng.c index 84b6fdd5ff..ea06855386 100644 --- a/arch/arm/src/stm32l4/stm32l4_rng.c +++ b/arch/arm/src/stm32l4/stm32l4_rng.c @@ -313,7 +313,7 @@ static ssize_t stm32l4_rngread(struct file *filep, char *buffer, size_t buflen) void devrandom_register(void) { stm32l4_rng_initialize(); - (void)register_driver("/dev/random", &g_rngops, 0444, NULL); + register_driver("/dev/random", &g_rngops, 0444, NULL); } #endif @@ -337,7 +337,7 @@ void devurandom_register(void) #ifndef CONFIG_DEV_RANDOM stm32l4_rng_initialize(); #endif - (void)register_driver("/dev/urandom", &g_rngops, 0444, NULL); + register_driver("/dev/urandom", &g_rngops, 0444, NULL); } #endif diff --git a/arch/arm/src/stm32l4/stm32l4_rtc.c b/arch/arm/src/stm32l4/stm32l4_rtc.c index b319e32d8a..0cdf628a4a 100644 --- a/arch/arm/src/stm32l4/stm32l4_rtc.c +++ b/arch/arm/src/stm32l4/stm32l4_rtc.c @@ -221,7 +221,7 @@ static void rtc_wprunlock(void) { /* Enable write access to the backup domain. */ - (void)stm32l4_pwr_enablebkp(true); + stm32l4_pwr_enablebkp(true); /* The following steps are required to unlock the write protection on all the * RTC registers (except for RTC_ISR[13:8], RTC_TAFCR, and RTC_BKPxR). @@ -258,7 +258,7 @@ static inline void rtc_wprlock(void) /* Disable write access to the backup domain. */ - (void)stm32l4_pwr_enablebkp(false); + stm32l4_pwr_enablebkp(false); } /**************************************************************************** @@ -485,7 +485,7 @@ static int stm32l4_rtc_alarm_handler(int irq, FAR void *context, FAR void *rtc_h * backup data registers and backup SRAM). */ - (void)stm32l4_pwr_enablebkp(true); + stm32l4_pwr_enablebkp(true); /* Check for EXTI from Alarm A or B and handle according */ @@ -551,7 +551,7 @@ static int stm32l4_rtc_alarm_handler(int irq, FAR void *context, FAR void *rtc_h * data registers and backup SRAM). */ - (void)stm32l4_pwr_enablebkp(false); + stm32l4_pwr_enablebkp(false); return ret; } @@ -757,7 +757,7 @@ static inline void rtc_enable_alarm(void) * 3. Configure the RTC to generate RTC alarms (Alarm A or Alarm B). */ - (void)stm32l4_exti_alarm(true, false, true, stm32l4_rtc_alarm_handler, NULL); + stm32l4_exti_alarm(true, false, true, stm32l4_rtc_alarm_handler, NULL); g_alarm_enabled = true; } } @@ -871,7 +871,7 @@ int up_rtc_initialize(void) * backup data registers and backup SRAM). */ - (void)stm32l4_pwr_enablebkp(true); + stm32l4_pwr_enablebkp(true); #if defined(CONFIG_STM32L4_RTC_HSECLOCK) modifyreg32(STM32L4_RCC_BDCR, RCC_BDCR_RTCSEL_MASK, RCC_BDCR_RTCSEL_HSE); @@ -903,7 +903,7 @@ int up_rtc_initialize(void) * data registers and backup SRAM). */ - (void)stm32l4_pwr_enablebkp(false); + stm32l4_pwr_enablebkp(false); rtc_dumpregs("After Failed Initialization"); @@ -968,7 +968,7 @@ int up_rtc_initialize(void) * data registers and backup SRAM). */ - (void)stm32l4_pwr_enablebkp(false); + stm32l4_pwr_enablebkp(false); } } else @@ -977,7 +977,7 @@ int up_rtc_initialize(void) * backup data registers and backup SRAM). */ - (void)stm32l4_pwr_enablebkp(true); + stm32l4_pwr_enablebkp(true); /* Write protection for RTC registers does not need to be disabled. */ @@ -987,7 +987,7 @@ int up_rtc_initialize(void) * data registers and backup SRAM). */ - (void)stm32l4_pwr_enablebkp(false); + stm32l4_pwr_enablebkp(false); } g_rtc_enabled = true; @@ -1318,7 +1318,7 @@ int up_rtc_settime(FAR const struct timespec *tp) * seconds) */ - (void)gmtime_r(&tp->tv_sec, &newtime); + gmtime_r(&tp->tv_sec, &newtime); return stm32l4_rtc_setdatetime(&newtime); } @@ -1582,13 +1582,13 @@ static int stm32l4_rtc_wakeup_handler(int irq, FAR void *context, FAR void *arg) { uint32_t regval = 0; - (void)stm32l4_pwr_enablebkp(true); + stm32l4_pwr_enablebkp(true); regval = getreg32(STM32L4_RTC_ISR); regval &= ~RTC_ISR_WUTF; putreg32(regval, STM32L4_RTC_ISR); - (void)stm32l4_pwr_enablebkp(false); + stm32l4_pwr_enablebkp(false); if (g_wakeupcb != NULL) { @@ -1612,7 +1612,7 @@ static inline void rtc_enable_wakeup(void) { if (!g_wakeup_enabled) { - (void)stm32l4_exti_wakeup(true, false, true, stm32l4_rtc_wakeup_handler, NULL); + stm32l4_exti_wakeup(true, false, true, stm32l4_rtc_wakeup_handler, NULL); g_wakeup_enabled = true; } } diff --git a/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c b/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c index 67656227f7..de3414d249 100644 --- a/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c +++ b/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c @@ -447,7 +447,7 @@ static int stm32l4_setrelative(FAR struct rtc_lowerhalf_s *lower, /* And convert the time back to broken out format */ - (void)gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); + gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); /* The set the alarm using this absolute time */ diff --git a/arch/arm/src/stm32l4/stm32l4_sai.c b/arch/arm/src/stm32l4/stm32l4_sai.c index dd9d399413..5308aafde7 100644 --- a/arch/arm/src/stm32l4/stm32l4_sai.c +++ b/arch/arm/src/stm32l4/stm32l4_sai.c @@ -457,19 +457,7 @@ static void sai_dump_regs(struct stm32l4_sai_s *priv, const char *msg) static void sai_exclsem_take(struct stm32l4_sai_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal). - */ - - do - { - ret = nxsem_wait(&priv->exclsem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); } /**************************************************************************** @@ -730,7 +718,7 @@ static void sai_worker(void *arg) flags = enter_critical_section(); #ifdef CONFIG_STM32L4_SAI_DMA - (void)sai_dma_setup(priv); + sai_dma_setup(priv); #endif leave_critical_section(flags); } @@ -849,7 +837,7 @@ static void sai_dma_callback(DMA_HANDLE handle, uint8_t isr, void *arg) /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->dog); + wd_cancel(priv->dog); /* Then schedule completion of the transfer to occur on the worker thread */ @@ -1157,19 +1145,7 @@ errout_with_exclsem: static void sai_bufsem_take(struct stm32l4_sai_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal). - */ - - do - { - ret = nxsem_wait(&priv->bufsem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->bufsem); } /**************************************************************************** diff --git a/arch/arm/src/stm32l4/stm32l4_sdmmc.c b/arch/arm/src/stm32l4/stm32l4_sdmmc.c index c5449c45f3..3320a0ba05 100644 --- a/arch/arm/src/stm32l4/stm32l4_sdmmc.c +++ b/arch/arm/src/stm32l4/stm32l4_sdmmc.c @@ -710,21 +710,7 @@ static inline void sdmmc_modifyreg32(struct stm32_dev_s *priv, int offset, static void stm32_takesem(struct stm32_dev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->waitsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -816,16 +802,16 @@ static void stm32_configwaitints(struct stm32_dev_s *priv, uint32_t waitmask, /* Arm the SDMMC_D Ready and install ISR */ - (void)stm32_gpiosetevent(pinset, true, false, false, - stm32_sdmmc_rdyinterrupt, priv); + stm32_gpiosetevent(pinset, true, false, false, + stm32_sdmmc_rdyinterrupt, priv); } /* Disarm SDMMC_D ready */ if ((wkupevent & SDIOWAIT_WRCOMPLETE) != 0) { - (void)stm32_gpiosetevent(priv->d0_gpio, false, false, false, - NULL, NULL); + stm32_gpiosetevent(priv->d0_gpio, false, false, false, + NULL, NULL); stm32_configgpio(priv->d0_gpio); } #endif @@ -1387,7 +1373,7 @@ static void stm32_endwait(struct stm32_dev_s *priv, sdio_eventset_t wkupevent) { /* Cancel the watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* Disable event-related interrupts */ @@ -2178,7 +2164,7 @@ static int stm32_cancel(FAR struct sdio_dev_s *dev) /* Cancel any watchdog timeout */ - (void)wd_cancel(priv->waitwdog); + wd_cancel(priv->waitwdog); /* If this was a DMA transfer, make sure that DMA is stopped */ @@ -3026,8 +3012,8 @@ static void stm32_callback(void *arg) mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); - (void)work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, - priv->cbarg, 0); + work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, + priv->cbarg, 0); } else { diff --git a/arch/arm/src/stm32l4/stm32l4_serial.c b/arch/arm/src/stm32l4/stm32l4_serial.c index 4e0d0ab24c..c3bd0f25d0 100644 --- a/arch/arm/src/stm32l4/stm32l4_serial.c +++ b/arch/arm/src/stm32l4/stm32l4_serial.c @@ -1137,7 +1137,7 @@ static void stm32l4serial_setsuspend(struct uart_dev_s *dev, bool suspend) #ifdef CONFIG_SERIAL_IFLOWCONTROL if (priv->iflow) { - (void)stm32l4serial_dmaiflowrestart(priv); + stm32l4serial_dmaiflowrestart(priv); } else #endif @@ -2503,7 +2503,7 @@ static void stm32l4serial_dmarxint(FAR struct uart_dev_s *dev, bool enable) { /* Re-enable RX DMA. */ - (void)stm32l4serial_dmaiflowrestart(priv); + stm32l4serial_dmaiflowrestart(priv); } #endif } @@ -2657,7 +2657,7 @@ static void stm32l4serial_dmarxcallback(DMA_HANDLE handle, uint8_t status, { /* Re-enable RX DMA. */ - (void)stm32l4serial_dmaiflowrestart(priv); + stm32l4serial_dmaiflowrestart(priv); } #endif } @@ -2924,14 +2924,14 @@ void up_serialinit(void) /* Register the console */ #if CONSOLE_UART > 0 - (void)uart_register("/dev/console", &g_uart_devs[CONSOLE_UART - 1]->dev); + uart_register("/dev/console", &g_uart_devs[CONSOLE_UART - 1]->dev); #ifndef CONFIG_STM32L4_SERIAL_DISABLE_REORDERING /* If not disabled, register the console UART to ttyS0 and exclude * it from initializing it further down */ - (void)uart_register("/dev/ttyS0", &g_uart_devs[CONSOLE_UART - 1]->dev); + uart_register("/dev/ttyS0", &g_uart_devs[CONSOLE_UART - 1]->dev); minor = 1; #endif @@ -2967,7 +2967,7 @@ void up_serialinit(void) /* Register USARTs as devices in increasing order */ devname[9] = '0' + minor++; - (void)uart_register(devname, &g_uart_devs[i]->dev); + uart_register(devname, &g_uart_devs[i]->dev); } #endif /* HAVE UART */ } diff --git a/arch/arm/src/stm32l4/stm32l4_spi.c b/arch/arm/src/stm32l4/stm32l4_spi.c index 8322f573e3..76a3724348 100644 --- a/arch/arm/src/stm32l4/stm32l4_spi.c +++ b/arch/arm/src/stm32l4/stm32l4_spi.c @@ -614,23 +614,15 @@ static inline bool spi_16bitmode(FAR struct stm32l4_spidev_s *priv) #ifdef CONFIG_STM32L4_SPI_DMA static void spi_dmarxwait(FAR struct stm32l4_spidev_s *priv) { - int ret; - /* Take the semaphore (perhaps waiting). If the result is zero, then the DMA * must not really have completed??? */ do { - ret = nxsem_wait(&priv->rxsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&priv->rxsem); } - while (ret == -EINTR || priv->rxresult == 0); + while (priv->rxresult == 0); } #endif @@ -645,23 +637,7 @@ static void spi_dmarxwait(FAR struct stm32l4_spidev_s *priv) #ifdef CONFIG_STM32L4_SPI_DMA static void spi_dmatxwait(FAR struct stm32l4_spidev_s *priv) { - int ret; - - /* Take the semaphore (perhaps waiting). If the result is zero, then the DMA - * must not really have completed??? - */ - - do - { - ret = nxsem_wait(&priv->txsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR || priv->txresult == 0); + nxsem_wait_uninterruptible(&priv->txsem); } #endif @@ -676,7 +652,7 @@ static void spi_dmatxwait(FAR struct stm32l4_spidev_s *priv) #ifdef CONFIG_STM32L4_SPI_DMA static inline void spi_dmarxwakeup(FAR struct stm32l4_spidev_s *priv) { - (void)nxsem_post(&priv->rxsem); + nxsem_post(&priv->rxsem); } #endif @@ -691,7 +667,7 @@ static inline void spi_dmarxwakeup(FAR struct stm32l4_spidev_s *priv) #ifdef CONFIG_STM32L4_SPI_DMA static inline void spi_dmatxwakeup(FAR struct stm32l4_spidev_s *priv) { - (void)nxsem_post(&priv->txsem); + nxsem_post(&priv->txsem); } #endif @@ -922,24 +898,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; diff --git a/arch/arm/src/stm32l4/stm32l4_timerisr.c b/arch/arm/src/stm32l4/stm32l4_timerisr.c index 4ca680eec6..b259acb713 100644 --- a/arch/arm/src/stm32l4/stm32l4_timerisr.c +++ b/arch/arm/src/stm32l4/stm32l4_timerisr.c @@ -148,7 +148,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(STM32L4_IRQ_SYSTICK, (xcpt_t)stm32l4_timerisr, NULL); + irq_attach(STM32L4_IRQ_SYSTICK, (xcpt_t)stm32l4_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/stm32l4/stm32l4_usbdev.c b/arch/arm/src/stm32l4/stm32l4_usbdev.c index a608eb7b23..32e6680134 100644 --- a/arch/arm/src/stm32l4/stm32l4_usbdev.c +++ b/arch/arm/src/stm32l4/stm32l4_usbdev.c @@ -1600,7 +1600,7 @@ static void stm32l4_epdone(struct stm32l4_usbdev_s *priv, uint8_t epno) { /* Read host data into the current read request */ - (void)stm32l4_rdrequest(priv, privep); + stm32l4_rdrequest(priv, privep); /* "After the received data is processed, the application software * should set the STAT_RX bits to '11' (Valid) in the USB_EPnR, @@ -1651,11 +1651,11 @@ static void stm32l4_epdone(struct stm32l4_usbdev_s *priv, uint8_t epno) priv->txstatus = USB_EPR_STATTX_NAK; if (epno == EP0) { - (void)stm32l4_wrrequest_ep0(priv, privep); + stm32l4_wrrequest_ep0(priv, privep); } else { - (void)stm32l4_wrrequest(priv, privep); + stm32l4_wrrequest(priv, privep); } /* Set the new TX status */ @@ -1913,7 +1913,7 @@ static void stm32l4_ep0setup(struct stm32l4_usbdev_s *priv) { privep = &priv->eplist[epno]; privep->halted = 0; - (void)stm32l4_epstall(&privep->ep, true); + stm32l4_epstall(&privep->ep, true); } else { @@ -1961,7 +1961,7 @@ static void stm32l4_ep0setup(struct stm32l4_usbdev_s *priv) { privep = &priv->eplist[epno]; privep->halted = 1; - (void)stm32l4_epstall(&privep->ep, false); + stm32l4_epstall(&privep->ep, false); } else { @@ -3170,11 +3170,11 @@ static int stm32l4_epstall(struct usbdev_ep_s *ep, bool resume) priv->txstatus = USB_EPR_STATTX_NAK; if (epno == EP0) { - (void)stm32l4_wrrequest_ep0(priv, privep); + stm32l4_wrrequest_ep0(priv, privep); } else { - (void)stm32l4_wrrequest(priv, privep); + stm32l4_wrrequest(priv, privep); } /* Set the new TX status */ diff --git a/arch/arm/src/stm32l4/stm32l4x6xx_dma.c b/arch/arm/src/stm32l4/stm32l4x6xx_dma.c index 8f7d05bcc6..69d07e66e1 100644 --- a/arch/arm/src/stm32l4/stm32l4x6xx_dma.c +++ b/arch/arm/src/stm32l4/stm32l4x6xx_dma.c @@ -219,26 +219,12 @@ static inline void dmachan_putreg(struct stm32l4_dma_s *dmach, uint32_t offset, static void stm32l4_dmatake(FAR struct stm32l4_dma_s *dmach) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&dmach->sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&dmach->sem); } static inline void stm32l4_dmagive(FAR struct stm32l4_dma_s *dmach) { - (void)nxsem_post(&dmach->sem); + nxsem_post(&dmach->sem); } /************************************************************************************ @@ -352,7 +338,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vectors */ - (void)irq_attach(dmach->irq, stm32l4_dmainterrupt, NULL); + irq_attach(dmach->irq, stm32l4_dmainterrupt, NULL); /* Disable the DMA channel */ diff --git a/arch/arm/src/stm32l4/stm32l4xrxx_dma.c b/arch/arm/src/stm32l4/stm32l4xrxx_dma.c index 55f5b46bb3..8b495a5044 100644 --- a/arch/arm/src/stm32l4/stm32l4xrxx_dma.c +++ b/arch/arm/src/stm32l4/stm32l4xrxx_dma.c @@ -960,8 +960,8 @@ void weak_function up_dma_initialize(void) /* Attach standard DMA interrupt vectors */ - (void)irq_attach(dmachan->irq, g_dma_ops[controller].dma_interrupt, - dmachan); + irq_attach(dmachan->irq, g_dma_ops[controller].dma_interrupt, + dmachan); /* Disable the DMA channel */ diff --git a/arch/arm/src/str71x/str71x_serial.c b/arch/arm/src/str71x/str71x_serial.c index c68220e8a5..49429bfd3f 100644 --- a/arch/arm/src/str71x/str71x_serial.c +++ b/arch/arm/src/str71x/str71x_serial.c @@ -931,20 +931,20 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif } diff --git a/arch/arm/src/str71x/str71x_timerisr.c b/arch/arm/src/str71x/str71x_timerisr.c index 2dc68bdd01..380736319c 100644 --- a/arch/arm/src/str71x/str71x_timerisr.c +++ b/arch/arm/src/str71x/str71x_timerisr.c @@ -190,7 +190,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(STR71X_IRQ_SYSTIMER, (xcpt_t)str71x_timerisr, NULL); + irq_attach(STR71X_IRQ_SYSTIMER, (xcpt_t)str71x_timerisr, NULL); /* And enable the timer interrupt */ diff --git a/arch/arm/src/tiva/cc13xx/cc13x0_rom.c b/arch/arm/src/tiva/cc13xx/cc13x0_rom.c index 19bc9449ab..1319084a26 100644 --- a/arch/arm/src/tiva/cc13xx/cc13x0_rom.c +++ b/arch/arm/src/tiva/cc13xx/cc13x0_rom.c @@ -111,7 +111,7 @@ static void rom_set_vddr_level(uint32_t ccfg_modeconf) currenttrim += deltatrim; - (void)getreg32(TIVA_AON_RTC_SYNC); /* Wait one SCLK_LF period */ + getreg32(TIVA_AON_RTC_SYNC); /* Wait one SCLK_LF period */ regval16 = (ADI3_REFSYS_DCDCCTL0_VDDR_TRIM_MASK << 8) | ((currenttrim << ADI3_REFSYS_DCDCCTL0_VDDR_TRIM_SHIFT) & @@ -124,18 +124,18 @@ static void rom_set_vddr_level(uint32_t ccfg_modeconf) putreg32(1, TIVA_AON_RTC_SYNC); } - (void)getreg32(TIVA_AON_RTC_SYNC); /* Wait one SCLK_LF period */ + getreg32(TIVA_AON_RTC_SYNC); /* Wait one SCLK_LF period */ /* Force SCLK_LF period wait on next read */ putreg32(1, TIVA_AON_RTC_SYNC); - (void)getreg32(TIVA_AON_RTC_SYNC); /* Wait one more SCLK_LF period + getreg32(TIVA_AON_RTC_SYNC); /* Wait one more SCLK_LF period * before re-enabling VDDR BOD */ modifyreg32(TIVA_AON_SYSCTL_RESETCTL, 0, AON_SYSCTL_RESETCTL_VDDR_LOSS_EN); - (void)getreg32(TIVA_AON_RTC_SYNC); /* And finally wait for + getreg32(TIVA_AON_RTC_SYNC); /* And finally wait for * VDDR_LOSS_EN setting to * propagate */ } diff --git a/arch/arm/src/tiva/cc13xx/cc13x2_cc26x2_v1_rom.c b/arch/arm/src/tiva/cc13xx/cc13x2_cc26x2_v1_rom.c index 57f113a6c4..0bd3228ead 100644 --- a/arch/arm/src/tiva/cc13xx/cc13x2_cc26x2_v1_rom.c +++ b/arch/arm/src/tiva/cc13xx/cc13x2_cc26x2_v1_rom.c @@ -93,14 +93,14 @@ void rom_setup_stepvaddrtrimto(uint32_t tocode) /* Wait for VDDR_LOSS_EN setting to propagate */ - (void)getreg32(TIVA_AON_RTC_SYNC); + getreg32(TIVA_AON_RTC_SYNC); } while (target_trim != current_trim) { /* Wait for next edge on SCLK_LF (positive or negative) */ - (void)getreg32(TIVA_AON_RTC_SYNCLF); + getreg32(TIVA_AON_RTC_SYNCLF); if (target_trim > current_trim) { @@ -121,23 +121,23 @@ void rom_setup_stepvaddrtrimto(uint32_t tocode) /* Wait for next edge on SCLK_LF (positive or negative) */ - (void)getreg32(TIVA_AON_RTC_SYNCLF); + getreg32(TIVA_AON_RTC_SYNCLF); if ((pmctl_regsetctrl & AON_PMCTL_RESETCTL_VDDR_LOSS_EN) != 0) { /* Wait for next edge on SCLK_LF (positive or negative) */ - (void)getreg32(TIVA_AON_RTC_SYNCLF); + getreg32(TIVA_AON_RTC_SYNCLF); /* Wait for next edge on SCLK_LF (positive or negative) */ - (void)getreg32(TIVA_AON_RTC_SYNCLF); + getreg32(TIVA_AON_RTC_SYNCLF); putreg32(pmctl_regsetctrl, TIVA_AON_PMCTL_RESETCTL); /* And finally wait for VDDR_LOSS_EN setting to propagate */ - (void)getreg32(TIVA_AON_RTC_SYNC); + getreg32(TIVA_AON_RTC_SYNC); } } } diff --git a/arch/arm/src/tiva/cc13xx/cc13x2_v1_trim.c b/arch/arm/src/tiva/cc13xx/cc13x2_v1_trim.c index 0042e574d4..633c18add2 100644 --- a/arch/arm/src/tiva/cc13xx/cc13x2_v1_trim.c +++ b/arch/arm/src/tiva/cc13xx/cc13x2_v1_trim.c @@ -109,7 +109,7 @@ static void Step_RCOSCHF_CTRIM(uint32_t tocode) /* Wait for next edge on SCLK_LF (positive or negative) */ - (void)getreg32(TIVA_AON_RTC_SYNCLF); + getreg32(TIVA_AON_RTC_SYNCLF); if (tocode > current_trim) { @@ -162,7 +162,7 @@ static void step_vbg(int32_t target_signed) /* Wait for next edge on SCLK_LF (positive or negative) */ - (void)getreg32(TIVA_AON_RTC_SYNCLF); + getreg32(TIVA_AON_RTC_SYNCLF); if (target_signed != current_signed) { @@ -251,7 +251,7 @@ static void trim_wakeup_fromshutdown(uint32_t fcfg1_revision) /* Dummy read to ensure that the write has propagated */ - (void)getreg16(TIVA_DDI0_OSC_CTL0); + getreg16(TIVA_DDI0_OSC_CTL0); /* read the MODE_CONF register in CCFG */ @@ -333,7 +333,7 @@ static void trim_wakeup_fromshutdown(uint32_t fcfg1_revision) /* Wait for xxx_LOSS_EN setting to propagate */ - (void)getreg32(TIVA_AON_RTC_SYNC); + getreg32(TIVA_AON_RTC_SYNC); /* The VDDS_BOD trim and the VDDR trim is already stepped up to max/HH if * "CC1352 boost mode" is requested. See function @@ -402,17 +402,17 @@ static void trim_wakeup_fromshutdown(uint32_t fcfg1_revision) * Wait for first edge on SCLK_LF (positive or negative) */ - (void)getreg32(TIVA_AON_RTC_SYNCLF); + getreg32(TIVA_AON_RTC_SYNCLF); /* Wait for second edge on SCLK_LF (positive or negative) */ - (void)getreg32(TIVA_AON_RTC_SYNCLF); + getreg32(TIVA_AON_RTC_SYNCLF); putreg32(org_resetctl, TIVA_AON_PMCTL_RESETCTL) ; /* Wait for xxx_LOSS_EN setting to propagate */ - (void)getreg32(TIVA_AON_RTC_SYNC); + getreg32(TIVA_AON_RTC_SYNC); /* Propagate the LPM_BIAS trim */ diff --git a/arch/arm/src/tiva/cc13xx/cc13x2_v2_trim.c b/arch/arm/src/tiva/cc13xx/cc13x2_v2_trim.c index d434e420f0..b8ec697912 100644 --- a/arch/arm/src/tiva/cc13xx/cc13x2_v2_trim.c +++ b/arch/arm/src/tiva/cc13xx/cc13x2_v2_trim.c @@ -131,7 +131,7 @@ static void trim_wakeup_fromshutdown(uint32_t fcfg1_revision) /* Dummy read to ensure that the write has propagated */ - (void)getreg16(TIVA_DDI0_OSC_CTL0); + getreg16(TIVA_DDI0_OSC_CTL0); /* read the MODE_CONF register in CCFG */ diff --git a/arch/arm/src/tiva/common/tiva_adclow.c b/arch/arm/src/tiva/common/tiva_adclow.c index 3a4fdc1f0e..ba4dee3160 100644 --- a/arch/arm/src/tiva/common/tiva_adclow.c +++ b/arch/arm/src/tiva/common/tiva_adclow.c @@ -944,33 +944,9 @@ int tiva_adc_initialize(const char *devpath, struct tiva_adc_cfg_s *cfg, void tiva_adc_lock(FAR struct tiva_adc_s *priv, int sse) { struct tiva_adc_sse_s *s = g_sses[SSE_IDX(priv->devno, sse)]; - int ret; -#ifdef CONFIG_DEBUG_ANALOG - uint16_t loop_count = 0; -#endif ainfo("Locking...\n"); - - do - { - ret = nxsem_wait(&s->exclsem); - - /* This should only fail if the wait was canceled by an signal (and the - * worker thread will receive a lot of signals). - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - -#ifdef CONFIG_DEBUG_ANALOG - if (loop_count % 1000) - { - ainfo("loop=%d\n"); - } - - ++loop_count; -#endif - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&s->exclsem); } /**************************************************************************** diff --git a/arch/arm/src/tiva/common/tiva_hciuart.c b/arch/arm/src/tiva/common/tiva_hciuart.c index c17acd2a99..fefe913b43 100644 --- a/arch/arm/src/tiva/common/tiva_hciuart.c +++ b/arch/arm/src/tiva/common/tiva_hciuart.c @@ -1415,9 +1415,7 @@ static ssize_t hciuart_read(const struct btuart_lowerhalf_s *lower, state->rxwaiting = true; do { - int ret = nxsem_wait(&state->rxwait); - DEBUGASSERT(ret == 0 || ret == -EINTR); - UNUSED(ret); + nxsem_wait_uninterruptible(&state->rxwait); } while (state->rxwaiting); } @@ -1568,9 +1566,7 @@ static ssize_t hciuart_write(const struct btuart_lowerhalf_s *lower, state->txwaiting = true; do { - int ret = nxsem_wait(&state->txwait); - DEBUGASSERT(ret == 0 || ret == -EINTR); - UNUSED(ret); + nxsem_wait_uninterruptible(&state->txwait); } while (state->txwaiting); diff --git a/arch/arm/src/tiva/common/tiva_i2c.c b/arch/arm/src/tiva/common/tiva_i2c.c index d7f2170e6b..5ccbf47e2d 100644 --- a/arch/arm/src/tiva/common/tiva_i2c.c +++ b/arch/arm/src/tiva/common/tiva_i2c.c @@ -646,21 +646,7 @@ static inline void tiva_i2c_putreg(struct tiva_i2c_priv_s *priv, static inline void tiva_i2c_sem_wait(struct tiva_i2c_priv_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); } /************************************************************************************ @@ -725,7 +711,7 @@ static inline int tiva_i2c_sem_waitdone(struct tiva_i2c_priv_s *priv) { /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -754,12 +740,11 @@ static inline int tiva_i2c_sem_waitdone(struct tiva_i2c_priv_s *priv) /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->waitsem, &abstime); - if (ret < 0 && ret != -EINTR) + ret = nxsem_timedwait_uninterruptible(&priv->waitsem, &abstime); + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would * include timeouts and mystery errors reported by nxsem_timedwait. - * NOTE that we try again if we are awakened by a signal (EINTR). */ tiva_i2c_traceevent(priv, I2CEVENT_TIMEOUT, @@ -1190,7 +1175,7 @@ static int tiva_i2c_process(struct tiva_i2c_priv_s *priv, uint32_t status) * harmless (other than the slight performance hit). */ - (void)tiva_i2c_getreg(priv, TIVA_I2CM_MIS_OFFSET); + tiva_i2c_getreg(priv, TIVA_I2CM_MIS_OFFSET); #endif /* We need look at the Master Control/Status register to determine the cause @@ -1505,7 +1490,7 @@ static int tiva_i2c_initialize(struct tiva_i2c_priv_s *priv, uint32_t frequency) */ #ifndef CONFIG_I2C_POLLED - (void)irq_attach(config->irq, tiva_i2c_interrupt, priv); + irq_attach(config->irq, tiva_i2c_interrupt, priv); up_enable_irq(config->irq); #endif diff --git a/arch/arm/src/tiva/common/tiva_irq.c b/arch/arm/src/tiva/common/tiva_irq.c index da5cebdb81..b643604f4a 100644 --- a/arch/arm/src/tiva/common/tiva_irq.c +++ b/arch/arm/src/tiva/common/tiva_irq.c @@ -215,7 +215,7 @@ static void tiva_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int tiva_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -223,7 +223,7 @@ static int tiva_nmi(int irq, FAR void *context, FAR void *arg) static int tiva_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received\n"); PANIC(); return 0; @@ -231,7 +231,7 @@ static int tiva_busfault(int irq, FAR void *context, FAR void *arg) static int tiva_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -239,7 +239,7 @@ static int tiva_usagefault(int irq, FAR void *context, FAR void *arg) static int tiva_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -247,7 +247,7 @@ static int tiva_pendsv(int irq, FAR void *context, FAR void *arg) static int tiva_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -255,7 +255,7 @@ static int tiva_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int tiva_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/tiva/common/tiva_pwm.c b/arch/arm/src/tiva/common/tiva_pwm.c index b1ffd43430..99a203187c 100644 --- a/arch/arm/src/tiva/common/tiva_pwm.c +++ b/arch/arm/src/tiva/common/tiva_pwm.c @@ -472,7 +472,7 @@ static int tiva_pwm_shutdown(FAR struct pwm_lowerhalf_s *dev) /* Remove unused-variable warning */ - (void)chan; + UNUSED(chan); /* Ensure the PWM channel has been stopped */ @@ -710,7 +710,7 @@ static int tiva_pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd, /* Remove unused-variable warning */ - (void)chan; + UNUSED(chan); /* There are no platform-specific ioctl commands */ diff --git a/arch/arm/src/tiva/common/tiva_serial.c b/arch/arm/src/tiva/common/tiva_serial.c index 735faa9279..539f18fc21 100644 --- a/arch/arm/src/tiva/common/tiva_serial.c +++ b/arch/arm/src/tiva/common/tiva_serial.c @@ -1378,32 +1378,32 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif #ifdef TTYS6_DEV - (void)uart_register("/dev/ttyS6", &TTYS6_DEV); + uart_register("/dev/ttyS6", &TTYS6_DEV); #endif #ifdef TTYS7_DEV - (void)uart_register("/dev/ttyS7", &TTYS7_DEV); + uart_register("/dev/ttyS7", &TTYS7_DEV); #endif } diff --git a/arch/arm/src/tiva/common/tiva_ssi.c b/arch/arm/src/tiva/common/tiva_ssi.c index 57e8f82923..abe534ba97 100644 --- a/arch/arm/src/tiva/common/tiva_ssi.c +++ b/arch/arm/src/tiva/common/tiva_ssi.c @@ -504,13 +504,7 @@ static void ssi_enable(struct tiva_ssidev_s *priv, uint32_t enable) #ifndef CONFIG_SSI_POLLWAIT static void ssi_semtake(sem_t *sem) { - int ret; - do - { - ret = nxsem_wait(sem); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } #endif @@ -576,7 +570,7 @@ static void ssi_rxnull(struct tiva_ssidev_s *priv) uint32_t regval = ssi_getreg(priv, TIVA_SSI_DR_OFFSET); spiinfo("RX: discard %04x\n", regval); #else - (void)ssi_getreg(priv, TIVA_SSI_DR_OFFSET); + ssi_getreg(priv, TIVA_SSI_DR_OFFSET); #endif } @@ -1031,7 +1025,7 @@ static int ssi_interrupt(int irq, void *context, FAR void *arg) /* Handle outgoing Tx FIFO transfers */ - (void)ssi_performtx(priv); + ssi_performtx(priv); /* Handle incoming Rx FIFO transfers */ @@ -1088,24 +1082,11 @@ static int ssi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -1388,7 +1369,7 @@ static uint16_t ssi_send(FAR struct spi_dev_s *dev, uint16_t wd) struct tiva_ssidev_s *priv = (struct tiva_ssidev_s *)dev; uint16_t response = 0; - (void)ssi_transfer(priv, &wd, &response, 1); + ssi_transfer(priv, &wd, &response, 1); return response; } @@ -1417,7 +1398,7 @@ static void ssi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, FAR void *rxbuffer, size_t nwords) { struct tiva_ssidev_s *priv = (struct tiva_ssidev_s *)dev; - (void)ssi_transfer(priv, txbuffer, rxbuffer, nwords); + ssi_transfer(priv, txbuffer, rxbuffer, nwords); } #endif @@ -1445,7 +1426,7 @@ static void ssi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords) { struct tiva_ssidev_s *priv = (struct tiva_ssidev_s *)dev; - (void)ssi_transfer(priv, buffer, NULL, nwords); + ssi_transfer(priv, buffer, NULL, nwords); } #endif @@ -1473,7 +1454,7 @@ static void ssi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords) { struct tiva_ssidev_s *priv = (struct tiva_ssidev_s *)dev; - (void)ssi_transfer(priv, NULL, buffer, nwords); + ssi_transfer(priv, NULL, buffer, nwords); } #endif diff --git a/arch/arm/src/tiva/common/tiva_timerisr.c b/arch/arm/src/tiva/common/tiva_timerisr.c index 9e820a157f..a3e4e9bc88 100644 --- a/arch/arm/src/tiva/common/tiva_timerisr.c +++ b/arch/arm/src/tiva/common/tiva_timerisr.c @@ -126,7 +126,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(TIVA_IRQ_SYSTICK, (xcpt_t)tiva_timerisr, NULL); + irq_attach(TIVA_IRQ_SYSTICK, (xcpt_t)tiva_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/arm/src/tiva/common/tiva_timerlib.c b/arch/arm/src/tiva/common/tiva_timerlib.c index 2020ea3631..f53ad5fa7c 100644 --- a/arch/arm/src/tiva/common/tiva_timerlib.c +++ b/arch/arm/src/tiva/common/tiva_timerlib.c @@ -1854,8 +1854,8 @@ TIMER_HANDLE tiva_gptm_configure(const struct tiva_gptmconfig_s *config) up_disable_irq(attr->irq[TIMER16A]); up_disable_irq(attr->irq[TIMER16B]); - (void)irq_detach(attr->irq[TIMER16A]); - (void)irq_detach(attr->irq[TIMER16B]); + irq_detach(attr->irq[TIMER16A]); + irq_detach(attr->irq[TIMER16B]); /* Enable power and clocking to the GPTM module * @@ -2030,8 +2030,8 @@ void tiva_gptm_release(TIMER_HANDLE handle) up_disable_irq(attr->irq[TIMER16A]); up_disable_irq(attr->irq[TIMER16B]); - (void)irq_detach(attr->irq[TIMER16A]); - (void)irq_detach(attr->irq[TIMER16B]); + irq_detach(attr->irq[TIMER16A]); + irq_detach(attr->irq[TIMER16B]); /* Reset the time to be certain that it is in the disabled state */ diff --git a/arch/arm/src/tiva/lm/lm3s_ethernet.c b/arch/arm/src/tiva/lm/lm3s_ethernet.c index ae73343e29..a8ddf70f48 100644 --- a/arch/arm/src/tiva/lm/lm3s_ethernet.c +++ b/arch/arm/src/tiva/lm/lm3s_ethernet.c @@ -579,8 +579,8 @@ static int tiva_transmit(struct tiva_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->ld_txtimeout, TIVA_TXTIMEOUT, - tiva_txtimeout_expiry, 1, (uint32_t)priv); + wd_start(priv->ld_txtimeout, TIVA_TXTIMEOUT, + tiva_txtimeout_expiry, 1, (uint32_t)priv); ret = OK; } @@ -736,7 +736,7 @@ static void tiva_receive(struct tiva_driver_s *priv) while (wordlen--) { - (void)tiva_ethin(priv, TIVA_MAC_DATA_OFFSET); + tiva_ethin(priv, TIVA_MAC_DATA_OFFSET); } /* Check for another packet */ @@ -945,7 +945,7 @@ static void tiva_txdone(struct tiva_driver_s *priv) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->ld_dev, tiva_txpoll); + devif_poll(&priv->ld_dev, tiva_txpoll); } /**************************************************************************** @@ -1139,7 +1139,7 @@ static void tiva_txtimeout_work(void *arg) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->ld_dev, tiva_txpoll); + devif_poll(&priv->ld_dev, tiva_txpoll); net_unlock(); } @@ -1218,12 +1218,12 @@ static void tiva_poll_work(void *arg) * data. */ - (void)devif_timer(&priv->ld_dev, TIVA_WDDELAY, tiva_txpoll); + devif_timer(&priv->ld_dev, TIVA_WDDELAY, tiva_txpoll); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->ld_txpoll, TIVA_WDDELAY, tiva_poll_expiry, - 1, priv); + wd_start(priv->ld_txpoll, TIVA_WDDELAY, tiva_poll_expiry, + 1, priv); } net_unlock(); @@ -1407,8 +1407,8 @@ static int tiva_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->ld_txpoll, TIVA_WDDELAY, tiva_poll_expiry, - 1, (uint32_t)priv); + wd_start(priv->ld_txpoll, TIVA_WDDELAY, tiva_poll_expiry, + 1, (uint32_t)priv); priv->ld_bifup = true; leave_critical_section(flags); @@ -1534,7 +1534,7 @@ static void tiva_txavail_work(void *arg) * for new Tx data */ - (void)devif_poll(&priv->ld_dev, tiva_txpoll); + devif_poll(&priv->ld_dev, tiva_txpoll); } net_unlock(); @@ -1735,7 +1735,7 @@ static inline int tiva_ethinitialize(int intf) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->ld_dev, NET_LL_ETHERNET); + netdev_register(&priv->ld_dev, NET_LL_ETHERNET); return OK; } @@ -1753,7 +1753,7 @@ static inline int tiva_ethinitialize(int intf) #if TIVA_NETHCONTROLLERS == 1 && !defined(CONFIG_NETDEV_LATEINIT) void up_netinitialize(void) { - (void)tiva_ethinitialize(0); + tiva_ethinitialize(0); } #endif diff --git a/arch/arm/src/tiva/tm4c/tm4c_ethernet.c b/arch/arm/src/tiva/tm4c/tm4c_ethernet.c index 87cc2d9d0e..8dee28cae3 100644 --- a/arch/arm/src/tiva/tm4c/tm4c_ethernet.c +++ b/arch/arm/src/tiva/tm4c/tm4c_ethernet.c @@ -1211,7 +1211,7 @@ static int tiva_transmit(FAR struct tiva_ethmac_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, TIVA_TXTIMEOUT, tiva_txtimeout_expiry, 1, (uint32_t)priv); + wd_start(priv->txtimeout, TIVA_TXTIMEOUT, tiva_txtimeout_expiry, 1, (uint32_t)priv); return OK; } @@ -1375,7 +1375,7 @@ static void tiva_dopoll(FAR struct tiva_ethmac_s *priv) if (dev->d_buf) { - (void)devif_poll(dev, tiva_txpoll); + devif_poll(dev, tiva_txpoll); /* We will, most likely end up with a buffer to be freed. But it * might not be the same one that we allocated above. @@ -2152,7 +2152,7 @@ static int tiva_interrupt(int irq, FAR void *context, FAR void *arg) if (priv->handler != NULL) { - (void)priv->handler(irq, context, priv->arg); + priv->handler(irq, context, priv->arg); } } #endif @@ -2283,7 +2283,7 @@ static void tiva_poll_work(FAR void *arg) /* Update TCP timing states and poll the network for new XMIT data. */ - (void)devif_timer(dev, TIVA_WDDELAY, tiva_txpoll); + devif_timer(dev, TIVA_WDDELAY, tiva_txpoll); /* We will, most likely end up with a buffer to be freed. But it * might not be the same one that we allocated above. @@ -2300,8 +2300,8 @@ static void tiva_poll_work(FAR void *arg) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, TIVA_WDDELAY, tiva_poll_expiry, - 1, (uint32_t)priv); + wd_start(priv->txpoll, TIVA_WDDELAY, tiva_poll_expiry, + 1, (uint32_t)priv); net_unlock(); } @@ -2376,8 +2376,8 @@ static int tiva_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, TIVA_WDDELAY, tiva_poll_expiry, - 1, (uint32_t)priv); + wd_start(priv->txpoll, TIVA_WDDELAY, tiva_poll_expiry, + 1, (uint32_t)priv); /* Enable the Ethernet interrupt */ @@ -2999,7 +2999,7 @@ static void tiva_phy_intenable(bool enable) if (ret == OK) { phyval |= EPHY_SCR_INTEN; - (void)tiva_phywrite(CONFIG_TIVA_PHYADDR, TIVA_EPHY_SCR, phyval); + tiva_phywrite(CONFIG_TIVA_PHYADDR, TIVA_EPHY_SCR, phyval); } } } @@ -3830,7 +3830,7 @@ static void tiva_ipv6multicast(FAR struct tiva_ethmac_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)tiva_addmac(dev, mac); + tiva_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -3838,7 +3838,7 @@ static void tiva_ipv6multicast(FAR struct tiva_ethmac_s *priv) * packets. */ - (void)tiva_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + tiva_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -3847,7 +3847,7 @@ static void tiva_ipv6multicast(FAR struct tiva_ethmac_s *priv) * packets. */ - (void)tiva_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + tiva_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -4163,7 +4163,7 @@ int tiva_ethinitialize(int intf) #if TIVA_NETHCONTROLLERS == 1 && !defined(CONFIG_NETDEV_LATEINIT) void up_netinitialize(void) { - (void)tiva_ethinitialize(0); + tiva_ethinitialize(0); } #endif diff --git a/arch/arm/src/tms570/tms570_irq.c b/arch/arm/src/tms570/tms570_irq.c index 87b7495267..2b1901c868 100644 --- a/arch/arm/src/tms570/tms570_irq.c +++ b/arch/arm/src/tms570/tms570_irq.c @@ -181,8 +181,8 @@ void up_irqinitialize(void) * an NMI. */ - (void)irq_attach(TMS570_REQ_ESMHIGH, tms570_esm_interrupt, NULL); - (void)irq_attach(TMS570_REQ_ESMLO, tms570_esm_interrupt, NULL); + irq_attach(TMS570_REQ_ESMHIGH, tms570_esm_interrupt, NULL); + irq_attach(TMS570_REQ_ESMLO, tms570_esm_interrupt, NULL); up_enable_irq(TMS570_REQ_ESMHIGH); up_enable_irq(TMS570_REQ_ESMLO); diff --git a/arch/arm/src/tms570/tms570_serial.c b/arch/arm/src/tms570/tms570_serial.c index 2313d4d142..3ab2808d98 100644 --- a/arch/arm/src/tms570/tms570_serial.c +++ b/arch/arm/src/tms570/tms570_serial.c @@ -870,14 +870,14 @@ void up_serialinit(void) /* Register the console */ - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all SCIs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif } diff --git a/arch/arm/src/xmc4/xmc4_irq.c b/arch/arm/src/xmc4/xmc4_irq.c index 061b12da7d..2f16a75e04 100644 --- a/arch/arm/src/xmc4/xmc4_irq.c +++ b/arch/arm/src/xmc4/xmc4_irq.c @@ -172,7 +172,7 @@ static void xmc4_dump_nvic(const char *msg, int irq) #ifdef CONFIG_DEBUG_FEATURES static int xmc4_nmi(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -180,7 +180,7 @@ static int xmc4_nmi(int irq, FAR void *context, FAR void *arg) static int xmc4_busfault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Bus fault received\n"); PANIC(); return 0; @@ -188,7 +188,7 @@ static int xmc4_busfault(int irq, FAR void *context, FAR void *arg) static int xmc4_usagefault(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -196,7 +196,7 @@ static int xmc4_usagefault(int irq, FAR void *context, FAR void *arg) static int xmc4_pendsv(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -204,7 +204,7 @@ static int xmc4_pendsv(int irq, FAR void *context, FAR void *arg) static int xmc4_dbgmonitor(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -212,7 +212,7 @@ static int xmc4_dbgmonitor(int irq, FAR void *context, FAR void *arg) static int xmc4_reserved(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/xmc4/xmc4_lowputc.c b/arch/arm/src/xmc4/xmc4_lowputc.c index e51cba1def..fc646d26a3 100644 --- a/arch/arm/src/xmc4/xmc4_lowputc.c +++ b/arch/arm/src/xmc4/xmc4_lowputc.c @@ -201,28 +201,28 @@ void xmc4_lowsetup(void) */ #ifdef HAVE_UART0 - (void)xmc4_gpio_config(GPIO_UART0_RXD); - (void)xmc4_gpio_config(GPIO_UART0_TXD); + xmc4_gpio_config(GPIO_UART0_RXD); + xmc4_gpio_config(GPIO_UART0_TXD); #endif #ifdef HAVE_UART1 - (void)xmc4_gpio_config(GPIO_UART1_RXD); - (void)xmc4_gpio_config(GPIO_UART1_TXD); + xmc4_gpio_config(GPIO_UART1_RXD); + xmc4_gpio_config(GPIO_UART1_TXD); #endif #ifdef HAVE_UART2 - (void)xmc4_gpio_config(GPIO_UART2_RXD); - (void)xmc4_gpio_config(GPIO_UART2_TXD); + xmc4_gpio_config(GPIO_UART2_RXD); + xmc4_gpio_config(GPIO_UART2_TXD); #endif #ifdef HAVE_UART3 - (void)xmc4_gpio_config(GPIO_UART3_RXD); - (void)xmc4_gpio_config(GPIO_UART3_TXD); + xmc4_gpio_config(GPIO_UART3_RXD); + xmc4_gpio_config(GPIO_UART3_TXD); #endif #ifdef HAVE_UART4 - (void)xmc4_gpio_config(GPIO_UART4_RXD); - (void)xmc4_gpio_config(GPIO_UART4_TXD); + xmc4_gpio_config(GPIO_UART4_RXD); + xmc4_gpio_config(GPIO_UART4_TXD); #endif #ifdef HAVE_UART5 - (void)xmc4_gpio_config(GPIO_UART5_RXD); - (void)xmc4_gpio_config(GPIO_UART5_TXD); + xmc4_gpio_config(GPIO_UART5_RXD); + xmc4_gpio_config(GPIO_UART5_TXD); #endif #ifdef HAVE_UART_CONSOLE diff --git a/arch/arm/src/xmc4/xmc4_serial.c b/arch/arm/src/xmc4/xmc4_serial.c index ecdb72b4ca..59ca8f9c0a 100644 --- a/arch/arm/src/xmc4/xmc4_serial.c +++ b/arch/arm/src/xmc4/xmc4_serial.c @@ -1083,26 +1083,26 @@ void up_serialinit(void) #ifdef HAVE_UART_CONSOLE /* Register the serial console */ - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif } diff --git a/arch/arm/src/xmc4/xmc4_spi.c b/arch/arm/src/xmc4/xmc4_spi.c index 1e84a52517..19ef76f627 100644 --- a/arch/arm/src/xmc4/xmc4_spi.c +++ b/arch/arm/src/xmc4/xmc4_spi.c @@ -957,7 +957,7 @@ static void spi_rxcallback(DMA_HANDLE handle, void *arg, int result) /* Cancel the watchdog timeout */ - (void)wd_cancel(spics->dmadog); + wd_cancel(spics->dmadog); /* Sample DMA registers at the time of the callback */ @@ -1067,26 +1067,11 @@ static int spi_lock(struct spi_dev_s *dev, bool lock) spiinfo("lock=%d\n", lock); if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&spi->spisem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&spi->spisem); } else { - (void)nxsem_post(&spi->spisem); - ret = OK; + ret = nxsem_post(&spi->spisem); } return ret; @@ -1680,17 +1665,15 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, /* Wait for the DMA complete */ - ret = nxsem_wait(&spics->dmawait); + ret = nxsem_wait_uninterruptible(&spics->dmawait); /* Cancel the watchdog timeout */ - (void)wd_cancel(spics->dmadog); + wd_cancel(spics->dmadog); - /* Check if we were awakened by an error of some kind. EINTR is not a - * failure. It simply means that the wait was awakened by a signal. - */ + /* Check if we were awakened by an error of some kind. */ - if (ret < 0 && ret != -EINTR) + if (ret < 0) { DEBUGPANIC(); return; @@ -1952,9 +1935,9 @@ struct spi_dev_s *xmc4_spibus_initialize(int channel) * select pins must be selected by board-specific logic. */ - (void)xmc4_gpio_config(GPIO_SPI0_MISO); - (void)xmc4_gpio_config(GPIO_SPI0_MOSI); - (void)xmc4_gpio_config(GPIO_SPI0_SCLK); + xmc4_gpio_config(GPIO_SPI0_MISO); + xmc4_gpio_config(GPIO_SPI0_MOSI); + xmc4_gpio_config(GPIO_SPI0_SCLK); } else #endif @@ -1965,9 +1948,9 @@ struct spi_dev_s *xmc4_spibus_initialize(int channel) * select pins must be selected by board-specific logic. */ - (void)xmc4_gpio_config(GPIO_SPI1_MISO); - (void)xmc4_gpio_config(GPIO_SPI1_MOSI); - (void)xmc4_gpio_config(GPIO_SPI1_SCLK); + xmc4_gpio_config(GPIO_SPI1_MISO); + xmc4_gpio_config(GPIO_SPI1_MOSI); + xmc4_gpio_config(GPIO_SPI1_SCLK); } else #endif @@ -1978,9 +1961,9 @@ struct spi_dev_s *xmc4_spibus_initialize(int channel) * select pins must be selected by board-specific logic. */ - (void)xmc4_gpio_config(GPIO_SPI2_MISO); - (void)xmc4_gpio_config(GPIO_SPI2_MOSI); - (void)xmc4_gpio_config(GPIO_SPI2_SCLK); + xmc4_gpio_config(GPIO_SPI2_MISO); + xmc4_gpio_config(GPIO_SPI2_MOSI); + xmc4_gpio_config(GPIO_SPI2_SCLK); } else #endif @@ -1991,9 +1974,9 @@ struct spi_dev_s *xmc4_spibus_initialize(int channel) * select pins must be selected by board-specific logic. */ - (void)xmc4_gpio_config(GPIO_SPI3_MISO); - (void)xmc4_gpio_config(GPIO_SPI3_MOSI); - (void)xmc4_gpio_config(GPIO_SPI3_SCLK); + xmc4_gpio_config(GPIO_SPI3_MISO); + xmc4_gpio_config(GPIO_SPI3_MOSI); + xmc4_gpio_config(GPIO_SPI3_SCLK); } else #endif @@ -2004,9 +1987,9 @@ struct spi_dev_s *xmc4_spibus_initialize(int channel) * select pins must be selected by board-specific logic. */ - (void)xmc4_gpio_config(GPIO_SPI4_MISO); - (void)xmc4_gpio_config(GPIO_SPI4_MOSI); - (void)xmc4_gpio_config(GPIO_SPI4_SCLK); + xmc4_gpio_config(GPIO_SPI4_MISO); + xmc4_gpio_config(GPIO_SPI4_MOSI); + xmc4_gpio_config(GPIO_SPI4_SCLK); } else #endif @@ -2017,9 +2000,9 @@ struct spi_dev_s *xmc4_spibus_initialize(int channel) * select pins must be selected by board-specific logic. */ - (void)xmc4_gpio_config(GPIO_SPI5_MISO); - (void)xmc4_gpio_config(GPIO_SPI5_MOSI); - (void)xmc4_gpio_config(GPIO_SPI5_SCLK); + xmc4_gpio_config(GPIO_SPI5_MISO); + xmc4_gpio_config(GPIO_SPI5_MOSI); + xmc4_gpio_config(GPIO_SPI5_SCLK); } else #endif diff --git a/arch/arm/src/xmc4/xmc4_timerisr.c b/arch/arm/src/xmc4/xmc4_timerisr.c index 086092813d..c4165c3445 100644 --- a/arch/arm/src/xmc4/xmc4_timerisr.c +++ b/arch/arm/src/xmc4/xmc4_timerisr.c @@ -161,7 +161,7 @@ void arm_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(XMC4_IRQ_SYSTICK, (xcpt_t)xmc4_timerisr, NULL); + irq_attach(XMC4_IRQ_SYSTICK, (xcpt_t)xmc4_timerisr, NULL); /* Enable SysTick interrupts */ diff --git a/arch/avr/src/at32uc3/at32uc3_irq.c b/arch/avr/src/at32uc3/at32uc3_irq.c index 179430640c..9e131f4baa 100644 --- a/arch/avr/src/at32uc3/at32uc3_irq.c +++ b/arch/avr/src/at32uc3/at32uc3_irq.c @@ -176,7 +176,7 @@ static int up_getgrp(unsigned int irq) static int avr32_xcptn(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _alert("PANIC!!! Exception IRQ: %d\n", irq); PANIC(); return 0; diff --git a/arch/avr/src/at32uc3/at32uc3_serial.c b/arch/avr/src/at32uc3/at32uc3_serial.c index db10ae31c4..25d3a61741 100644 --- a/arch/avr/src/at32uc3/at32uc3_serial.c +++ b/arch/avr/src/at32uc3/at32uc3_serial.c @@ -742,17 +742,17 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all USARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif } diff --git a/arch/avr/src/at32uc3/at32uc3_timerisr.c b/arch/avr/src/at32uc3/at32uc3_timerisr.c index c33cd89629..f0e103d787 100644 --- a/arch/avr/src/at32uc3/at32uc3_timerisr.c +++ b/arch/avr/src/at32uc3/at32uc3_timerisr.c @@ -219,7 +219,7 @@ void avr_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(AVR32_IRQ_RTC, (xcpt_t)at32uc3_timerisr, NULL); + irq_attach(AVR32_IRQ_RTC, (xcpt_t)at32uc3_timerisr, NULL); /* Enable RTC interrupts */ diff --git a/arch/avr/src/at90usb/at90usb_serial.c b/arch/avr/src/at90usb/at90usb_serial.c index 385211f97e..120c3f7d06 100644 --- a/arch/avr/src/at90usb/at90usb_serial.c +++ b/arch/avr/src/at90usb/at90usb_serial.c @@ -245,8 +245,8 @@ static int usart1_attach(struct uart_dev_s *dev) * written. */ - (void)irq_attach(AT90USB_IRQ_U1RX, usart1_rxinterrupt, NULL); - (void)irq_attach(AT90USB_IRQ_U1DRE, usart1_txinterrupt, NULL); + irq_attach(AT90USB_IRQ_U1RX, usart1_rxinterrupt, NULL); + irq_attach(AT90USB_IRQ_U1DRE, usart1_txinterrupt, NULL); //(void)irq_attach(AT90USB_IRQ_U1TX, usart1_txinterrupt, NULL); return OK; } @@ -269,8 +269,8 @@ static void usart1_detach(struct uart_dev_s *dev) /* Detach USART1 interrupts */ - (void)irq_detach(AT90USB_IRQ_U1RX); - (void)irq_detach(AT90USB_IRQ_U1DRE); + irq_detach(AT90USB_IRQ_U1RX); + irq_detach(AT90USB_IRQ_U1DRE); //(void)irq_detach(AT90USB_IRQ_U1TX); } @@ -552,12 +552,12 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &g_usart1port); + uart_register("/dev/console", &g_usart1port); #endif /* Register all USARTs */ - (void)uart_register("/dev/ttyS0", &g_usart1port); + uart_register("/dev/ttyS0", &g_usart1port); } /**************************************************************************** diff --git a/arch/avr/src/at90usb/at90usb_timerisr.c b/arch/avr/src/at90usb/at90usb_timerisr.c index e570a1cf60..e3ca902d64 100644 --- a/arch/avr/src/at90usb/at90usb_timerisr.c +++ b/arch/avr/src/at90usb/at90usb_timerisr.c @@ -168,7 +168,7 @@ void avr_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(AT90USB_IRQ_T1COMPA, (xcpt_t)at90usb_timerisr, NULL); + irq_attach(AT90USB_IRQ_T1COMPA, (xcpt_t)at90usb_timerisr, NULL); /* Enable the interrupt on compare match A */ diff --git a/arch/avr/src/at90usb/at90usb_usbdev.c b/arch/avr/src/at90usb/at90usb_usbdev.c index 74bf05db15..f9c7cc7388 100644 --- a/arch/avr/src/at90usb/at90usb_usbdev.c +++ b/arch/avr/src/at90usb/at90usb_usbdev.c @@ -1255,7 +1255,7 @@ static void avr_usbreset(void) /* EndPoint 0 initialization */ - (void)avr_ep0configure(); + avr_ep0configure(); /* Enable VBUS interrupts */ @@ -1845,7 +1845,7 @@ static inline void avr_epNinterrupt(void) /* Handle the IN request queue */ - (void)avr_epINqueue(privep); + avr_epINqueue(privep); } } else @@ -1862,7 +1862,7 @@ static inline void avr_epNinterrupt(void) /* Handle the OUT request queue */ - (void)avr_epOUTqueue(privep); + avr_epOUTqueue(privep); } } } @@ -2042,7 +2042,7 @@ static inline void avr_geneor(void) /* Configure endpoint 0 */ - (void)avr_ep0configure(); + avr_ep0configure(); /* Reset endpoint status */ diff --git a/arch/avr/src/atmega/atmega_serial.c b/arch/avr/src/atmega/atmega_serial.c index 7c49fab1c1..51171a57a9 100644 --- a/arch/avr/src/atmega/atmega_serial.c +++ b/arch/avr/src/atmega/atmega_serial.c @@ -388,8 +388,8 @@ static int usart0_attach(struct uart_dev_s *dev) * written. */ - (void)irq_attach(ATMEGA_IRQ_U0RX, usart0_rxinterrupt, NULL); - (void)irq_attach(ATMEGA_IRQ_U0DRE, usart0_txinterrupt, NULL); + irq_attach(ATMEGA_IRQ_U0RX, usart0_rxinterrupt, NULL); + irq_attach(ATMEGA_IRQ_U0DRE, usart0_txinterrupt, NULL); //(void)irq_attach(ATMEGA_IRQ_U0TX, usart0_txinterrupt, NULL); return OK; } @@ -410,8 +410,8 @@ static int usart1_attach(struct uart_dev_s *dev) * written. */ - (void)irq_attach(ATMEGA_IRQ_U1RX, usart1_rxinterrupt, NULL); - (void)irq_attach(ATMEGA_IRQ_U1DRE, usart1_txinterrupt, NULL); + irq_attach(ATMEGA_IRQ_U1RX, usart1_rxinterrupt, NULL); + irq_attach(ATMEGA_IRQ_U1DRE, usart1_txinterrupt, NULL); //(void)irq_attach(ATMEGA_IRQ_U1TX, usart1_txinterrupt, NULL); return OK; } @@ -436,8 +436,8 @@ static void usart0_detach(struct uart_dev_s *dev) /* Detach the USART0 IRQs */ - (void)irq_detach(ATMEGA_IRQ_U0RX); - (void)irq_detach(ATMEGA_IRQ_U0DRE); + irq_detach(ATMEGA_IRQ_U0RX); + irq_detach(ATMEGA_IRQ_U0DRE); // (void)irq_detach(ATMEGA_IRQ_U0TX); } #endif @@ -451,8 +451,8 @@ static void usart1_detach(struct uart_dev_s *dev) /* Detach the USART1 IRQs */ - (void)irq_detach(ATMEGA_IRQ_U1RX); - (void)irq_detach(ATMEGA_IRQ_U1DRE); + irq_detach(ATMEGA_IRQ_U1RX); + irq_detach(ATMEGA_IRQ_U1DRE); //(void)irq_detach(ATMEGA_IRQ_U1TX); } #endif @@ -935,14 +935,14 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all USARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif } diff --git a/arch/avr/src/atmega/atmega_timerisr.c b/arch/avr/src/atmega/atmega_timerisr.c index 0faf4d5121..de8181cdf8 100644 --- a/arch/avr/src/atmega/atmega_timerisr.c +++ b/arch/avr/src/atmega/atmega_timerisr.c @@ -169,9 +169,9 @@ void avr_timer_initialize(void) /* Attach the timer interrupt vector */ #if defined(ATMEGA_IRQ_T1COMPA) - (void)irq_attach(ATMEGA_IRQ_T1COMPA, (xcpt_t)atmega_timerisr, NULL); + irq_attach(ATMEGA_IRQ_T1COMPA, (xcpt_t)atmega_timerisr, NULL); #elif defined(ATMEGA_IRQ_TIM1_COMPA) - (void)irq_attach(ATMEGA_IRQ_TIM1_COMPA, (xcpt_t)atmega_timerisr, NULL); + irq_attach(ATMEGA_IRQ_TIM1_COMPA, (xcpt_t)atmega_timerisr, NULL); #else # error "Unable to find IRQ for timer" #endif diff --git a/arch/avr/src/avr/up_sigdeliver.c b/arch/avr/src/avr/up_sigdeliver.c index 0f309cdd49..c7c4ea48e2 100644 --- a/arch/avr/src/avr/up_sigdeliver.c +++ b/arch/avr/src/avr/up_sigdeliver.c @@ -105,7 +105,7 @@ void up_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/avr/src/avr/up_spi.c b/arch/avr/src/avr/up_spi.c index 91e0a13394..accc86d57f 100644 --- a/arch/avr/src/avr/up_spi.c +++ b/arch/avr/src/avr/up_spi.c @@ -150,24 +150,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -395,7 +382,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size spiinfo("nwords: %d\n", nwords); while (nwords-- > 0) { - (void)spi_send(dev, (uint16_t)*ptr++); + spi_send(dev, (uint16_t)*ptr++); } } diff --git a/arch/avr/src/avr32/up_blocktask.c b/arch/avr/src/avr32/up_blocktask.c index 1d41fb2913..548aaa307b 100644 --- a/arch/avr/src/avr32/up_blocktask.c +++ b/arch/avr/src/avr32/up_blocktask.c @@ -159,7 +159,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Reset scheduler parameters */ diff --git a/arch/avr/src/avr32/up_doirq.c b/arch/avr/src/avr32/up_doirq.c index db84ded148..8c967f1d68 100644 --- a/arch/avr/src/avr32/up_doirq.c +++ b/arch/avr/src/avr32/up_doirq.c @@ -114,7 +114,7 @@ uint32_t *up_doirq(int irq, uint32_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/avr/src/avr32/up_releasepending.c b/arch/avr/src/avr32/up_releasepending.c index 617c04cc3b..4f32774ad4 100644 --- a/arch/avr/src/avr32/up_releasepending.c +++ b/arch/avr/src/avr32/up_releasepending.c @@ -126,7 +126,7 @@ void up_release_pending(void) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/avr/src/avr32/up_reprioritizertr.c b/arch/avr/src/avr32/up_reprioritizertr.c index a40c623c55..67221078fa 100644 --- a/arch/avr/src/avr32/up_reprioritizertr.c +++ b/arch/avr/src/avr32/up_reprioritizertr.c @@ -180,7 +180,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/avr/src/avr32/up_sigdeliver.c b/arch/avr/src/avr32/up_sigdeliver.c index 758e0567a1..12c7e0799b 100644 --- a/arch/avr/src/avr32/up_sigdeliver.c +++ b/arch/avr/src/avr32/up_sigdeliver.c @@ -109,7 +109,7 @@ void up_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/avr/src/avr32/up_unblocktask.c b/arch/avr/src/avr32/up_unblocktask.c index 46c1172e1a..bafe777e89 100644 --- a/arch/avr/src/avr32/up_unblocktask.c +++ b/arch/avr/src/avr32/up_unblocktask.c @@ -142,7 +142,7 @@ void up_unblock_task(struct tcb_s *tcb) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/avr/src/common/up_assert.c b/arch/avr/src/common/up_assert.c index 785656ace9..ac5af18a9d 100644 --- a/arch/avr/src/common/up_assert.c +++ b/arch/avr/src/common/up_assert.c @@ -83,13 +83,13 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ if (g_current_regs || running_task()->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (; ; ) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -155,7 +155,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", @@ -169,7 +169,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); @@ -178,7 +178,7 @@ void up_assert(const uint8_t *filename, int lineno) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif _up_assert(EXIT_FAILURE); diff --git a/arch/avr/src/common/up_exit.c b/arch/avr/src/common/up_exit.c index d0c722dec7..695665a543 100644 --- a/arch/avr/src/common/up_exit.c +++ b/arch/avr/src/common/up_exit.c @@ -147,7 +147,7 @@ void _exit(int status) * The IRQ state will be restored when the next task is started. */ - (void)enter_critical_section(); + enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); @@ -162,7 +162,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. @@ -177,7 +177,7 @@ void _exit(int status) * the ready-to-run list. */ - (void)group_addrenv(tcb); + group_addrenv(tcb); #endif /* Reset scheduler parameters */ diff --git a/arch/avr/src/common/up_initialize.c b/arch/avr/src/common/up_initialize.c index 0f646b2efe..867d0eafc5 100644 --- a/arch/avr/src/common/up_initialize.c +++ b/arch/avr/src/common/up_initialize.c @@ -259,7 +259,7 @@ void up_initialize(void) #ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ - (void)ptmx_register(); + ptmx_register(); #endif /* Early initialization of the system logging device. Some SYSLOG channel @@ -288,19 +288,19 @@ void up_initialize(void) #ifdef CONFIG_NETDEV_LOOPBACK /* Initialize the local loopback device */ - (void)localhost_initialize(); + localhost_initialize(); #endif #ifdef CONFIG_NET_TUN /* Initialize the TUN device */ - (void)tun_initialize(); + tun_initialize(); #endif #ifdef CONFIG_NETDEV_TELNET /* Initialize the Telnet session factory */ - (void)telnet_initialize(); + telnet_initialize(); #endif /* Initialize USB */ diff --git a/arch/hc/src/common/up_blocktask.c b/arch/hc/src/common/up_blocktask.c index 63194f7ff2..bf3fcbe03e 100644 --- a/arch/hc/src/common/up_blocktask.c +++ b/arch/hc/src/common/up_blocktask.c @@ -161,7 +161,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Reset scheduler parameters */ diff --git a/arch/hc/src/common/up_doirq.c b/arch/hc/src/common/up_doirq.c index c72964ea96..a38cbab855 100644 --- a/arch/hc/src/common/up_doirq.c +++ b/arch/hc/src/common/up_doirq.c @@ -114,7 +114,7 @@ uint8_t *up_doirq(int irq, uint8_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/hc/src/common/up_exit.c b/arch/hc/src/common/up_exit.c index fe9054d7cb..649f7b54ee 100644 --- a/arch/hc/src/common/up_exit.c +++ b/arch/hc/src/common/up_exit.c @@ -147,7 +147,7 @@ void _exit(int status) * The IRQ state will be restored when the next task is started. */ - (void)enter_critical_section(); + enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); @@ -162,7 +162,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. @@ -177,7 +177,7 @@ void _exit(int status) * the ready-to-run list. */ - (void)group_addrenv(tcb); + group_addrenv(tcb); #endif /* Reset scheduler parameters */ diff --git a/arch/hc/src/common/up_initialize.c b/arch/hc/src/common/up_initialize.c index 6ec665393b..1b44f61444 100644 --- a/arch/hc/src/common/up_initialize.c +++ b/arch/hc/src/common/up_initialize.c @@ -181,7 +181,7 @@ void up_initialize(void) #ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ - (void)ptmx_register(); + ptmx_register(); #endif /* Early initialization of the system logging device. Some SYSLOG channel @@ -210,19 +210,19 @@ void up_initialize(void) #ifdef CONFIG_NETDEV_LOOPBACK /* Initialize the local loopback device */ - (void)localhost_initialize(); + localhost_initialize(); #endif #ifdef CONFIG_NET_TUN /* Initialize the TUN device */ - (void)tun_initialize(); + tun_initialize(); #endif #ifdef CONFIG_NETDEV_TELNET /* Initialize the Telnet session factory */ - (void)telnet_initialize(); + telnet_initialize(); #endif /* Initialize USB */ diff --git a/arch/hc/src/common/up_releasepending.c b/arch/hc/src/common/up_releasepending.c index f2afeabd79..bbbb4278a2 100644 --- a/arch/hc/src/common/up_releasepending.c +++ b/arch/hc/src/common/up_releasepending.c @@ -129,7 +129,7 @@ void up_release_pending(void) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/hc/src/common/up_reprioritizertr.c b/arch/hc/src/common/up_reprioritizertr.c index 1cd72b38d0..1bd8fa2762 100644 --- a/arch/hc/src/common/up_reprioritizertr.c +++ b/arch/hc/src/common/up_reprioritizertr.c @@ -183,7 +183,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/hc/src/common/up_unblocktask.c b/arch/hc/src/common/up_unblocktask.c index c79c0f1074..7f92980262 100644 --- a/arch/hc/src/common/up_unblocktask.c +++ b/arch/hc/src/common/up_unblocktask.c @@ -145,7 +145,7 @@ void up_unblock_task(struct tcb_s *tcb) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/hc/src/m9s12/m9s12_assert.c b/arch/hc/src/m9s12/m9s12_assert.c index eac7ef15c4..88b5e8e884 100644 --- a/arch/hc/src/m9s12/m9s12_assert.c +++ b/arch/hc/src/m9s12/m9s12_assert.c @@ -274,7 +274,7 @@ static void up_dumpstate(void) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif } #else @@ -290,13 +290,13 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ if (g_current_regs || (running_task())->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (;;) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -337,7 +337,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", @@ -351,7 +351,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); diff --git a/arch/hc/src/m9s12/m9s12_ethernet.c b/arch/hc/src/m9s12/m9s12_ethernet.c index daeb76a541..b5f1d8289e 100644 --- a/arch/hc/src/m9s12/m9s12_ethernet.c +++ b/arch/hc/src/m9s12/m9s12_ethernet.c @@ -183,7 +183,7 @@ static int emac_transmit(FAR struct emac_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->d_txtimeout, HCS12_TXTIMEOUT, emac_txtimeout, 1, (uint32_t)priv); + wd_start(priv->d_txtimeout, HCS12_TXTIMEOUT, emac_txtimeout, 1, (uint32_t)priv); return OK; } @@ -425,7 +425,7 @@ static void emac_txdone(FAR struct emac_driver_s *priv) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->d_dev, emac_txpoll); + devif_poll(&priv->d_dev, emac_txpoll); } /**************************************************************************** @@ -496,7 +496,7 @@ static void emac_txtimeout(int argc, uint32_t arg, ...) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->d_dev, emac_txpoll); + devif_poll(&priv->d_dev, emac_txpoll); } /**************************************************************************** @@ -530,11 +530,11 @@ static void emac_polltimer(int argc, uint32_t arg, ...) * we will missing TCP time state updates? */ - (void)devif_timer(&priv->d_dev, HCS12_WDDELAY, emac_txpoll); + devif_timer(&priv->d_dev, HCS12_WDDELAY, emac_txpoll); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->d_txpoll, HCS12_WDDELAY, emac_polltimer, 1, arg); + wd_start(priv->d_txpoll, HCS12_WDDELAY, emac_polltimer, 1, arg); } /**************************************************************************** @@ -566,7 +566,7 @@ static int emac_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->d_txpoll, HCS12_WDDELAY, emac_polltimer, 1, (uint32_t)priv); + wd_start(priv->d_txpoll, HCS12_WDDELAY, emac_polltimer, 1, (uint32_t)priv); /* Enable the Ethernet interrupt */ @@ -656,7 +656,7 @@ static int emac_txavail(struct net_driver_s *dev) /* If so, then poll the network for new XMIT data */ - (void)devif_poll(&priv->d_dev, emac_txpoll); + devif_poll(&priv->d_dev, emac_txpoll); } leave_critical_section(flags); @@ -788,7 +788,7 @@ int emac_initialize(int intf) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->d_dev, NET_LL_ETHERNET); + netdev_register(&priv->d_dev, NET_LL_ETHERNET); return OK; } diff --git a/arch/hc/src/m9s12/m9s12_serial.c b/arch/hc/src/m9s12/m9s12_serial.c index a6524534bd..ea59b83686 100644 --- a/arch/hc/src/m9s12/m9s12_serial.c +++ b/arch/hc/src/m9s12/m9s12_serial.c @@ -757,14 +757,14 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif } diff --git a/arch/hc/src/m9s12/m9s12_timerisr.c b/arch/hc/src/m9s12/m9s12_timerisr.c index 0eba088239..9cbcc9703b 100644 --- a/arch/hc/src/m9s12/m9s12_timerisr.c +++ b/arch/hc/src/m9s12/m9s12_timerisr.c @@ -171,7 +171,7 @@ void hc_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(HCS12_IRQ_VRTI, (xcpt_t)m9s12_timerisr, NULL); + irq_attach(HCS12_IRQ_VRTI, (xcpt_t)m9s12_timerisr, NULL); /* Enable RTI interrupt by setting the RTIE bit */ diff --git a/arch/mips/include/mips32/syscall.h b/arch/mips/include/mips32/syscall.h index 001b223da4..8107b5f61e 100644 --- a/arch/mips/include/mips32/syscall.h +++ b/arch/mips/include/mips32/syscall.h @@ -159,7 +159,7 @@ #define SYS_restore_context (1) #define up_fullcontextrestore(restoreregs) \ - (void)sys_call1(SYS_restore_context, (uintptr_t)restoreregs) + sys_call1(SYS_restore_context, (uintptr_t)restoreregs) /* SYS call 2: * @@ -168,7 +168,7 @@ #define SYS_switch_context (2) #define up_switchcontext(saveregs, restoreregs) \ - (void)sys_call2(SYS_switch_context, (uintptr_t)saveregs, (uintptr_t)restoreregs) + sys_call2(SYS_switch_context, (uintptr_t)saveregs, (uintptr_t)restoreregs) #ifdef CONFIG_BUILD_KERNEL /* SYS call 3: diff --git a/arch/mips/src/common/up_exit.c b/arch/mips/src/common/up_exit.c index 5f7e2f3e58..8fc968a0dd 100644 --- a/arch/mips/src/common/up_exit.c +++ b/arch/mips/src/common/up_exit.c @@ -149,7 +149,7 @@ void _exit(int status) * The IRQ state will be restored when the next task is started. */ - (void)enter_critical_section(); + enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); @@ -164,7 +164,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. @@ -179,7 +179,7 @@ void _exit(int status) * the ready-to-run list. */ - (void)group_addrenv(tcb); + group_addrenv(tcb); #endif /* Reset scheduler parameters */ diff --git a/arch/mips/src/common/up_initialize.c b/arch/mips/src/common/up_initialize.c index 006e725df8..682d3f006a 100644 --- a/arch/mips/src/common/up_initialize.c +++ b/arch/mips/src/common/up_initialize.c @@ -183,7 +183,7 @@ void up_initialize(void) #ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ - (void)ptmx_register(); + ptmx_register(); #endif /* Early initialization of the system logging device. Some SYSLOG channel @@ -212,19 +212,19 @@ void up_initialize(void) #ifdef CONFIG_NETDEV_LOOPBACK /* Initialize the local loopback device */ - (void)localhost_initialize(); + localhost_initialize(); #endif #ifdef CONFIG_NET_TUN /* Initialize the TUN device */ - (void)tun_initialize(); + tun_initialize(); #endif #ifdef CONFIG_NETDEV_TELNET /* Initialize the Telnet session factory */ - (void)telnet_initialize(); + telnet_initialize(); #endif /* Initialize USB -- device and/or host */ diff --git a/arch/mips/src/mips32/up_assert.c b/arch/mips/src/mips32/up_assert.c index fbd663f66c..8656f2977e 100644 --- a/arch/mips/src/mips32/up_assert.c +++ b/arch/mips/src/mips32/up_assert.c @@ -82,13 +82,13 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ if (g_current_regs || running_task()->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (; ; ) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -154,7 +154,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", @@ -168,12 +168,12 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif #ifdef CONFIG_BOARD_CRASHDUMP diff --git a/arch/mips/src/mips32/up_blocktask.c b/arch/mips/src/mips32/up_blocktask.c index e1f399ea9c..e9648f2388 100644 --- a/arch/mips/src/mips32/up_blocktask.c +++ b/arch/mips/src/mips32/up_blocktask.c @@ -159,7 +159,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Reset scheduler parameters */ diff --git a/arch/mips/src/mips32/up_doirq.c b/arch/mips/src/mips32/up_doirq.c index b653dd5731..afa17bf4a5 100644 --- a/arch/mips/src/mips32/up_doirq.c +++ b/arch/mips/src/mips32/up_doirq.c @@ -120,7 +120,7 @@ uint32_t *up_doirq(int irq, uint32_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/mips/src/mips32/up_releasepending.c b/arch/mips/src/mips32/up_releasepending.c index b7e1d8ce92..3adb1de04a 100644 --- a/arch/mips/src/mips32/up_releasepending.c +++ b/arch/mips/src/mips32/up_releasepending.c @@ -128,7 +128,7 @@ void up_release_pending(void) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/mips/src/mips32/up_reprioritizertr.c b/arch/mips/src/mips32/up_reprioritizertr.c index dacf98b823..addd44b42d 100644 --- a/arch/mips/src/mips32/up_reprioritizertr.c +++ b/arch/mips/src/mips32/up_reprioritizertr.c @@ -182,7 +182,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/mips/src/mips32/up_sigdeliver.c b/arch/mips/src/mips32/up_sigdeliver.c index 73b41664a4..43aa481705 100644 --- a/arch/mips/src/mips32/up_sigdeliver.c +++ b/arch/mips/src/mips32/up_sigdeliver.c @@ -108,7 +108,7 @@ void up_sigdeliver(void) sinfo("Resuming EPC: %08x STATUS: %08x\n", regs[REG_EPC], regs[REG_STATUS]); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/mips/src/mips32/up_unblocktask.c b/arch/mips/src/mips32/up_unblocktask.c index a79843d982..c5ca4794da 100644 --- a/arch/mips/src/mips32/up_unblocktask.c +++ b/arch/mips/src/mips32/up_unblocktask.c @@ -143,7 +143,7 @@ void up_unblock_task(struct tcb_s *tcb) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/mips/src/pic32mx/pic32mx-decodeirq.c b/arch/mips/src/pic32mx/pic32mx-decodeirq.c index a9fd338cf6..912cb3ce95 100644 --- a/arch/mips/src/pic32mx/pic32mx-decodeirq.c +++ b/arch/mips/src/pic32mx/pic32mx-decodeirq.c @@ -171,7 +171,7 @@ uint32_t *pic32mx_decodeirq(uint32_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/mips/src/pic32mx/pic32mx-ethernet.c b/arch/mips/src/pic32mx/pic32mx-ethernet.c index a5be54f309..3ecfe5efb6 100644 --- a/arch/mips/src/pic32mx/pic32mx-ethernet.c +++ b/arch/mips/src/pic32mx/pic32mx-ethernet.c @@ -1101,8 +1101,8 @@ static int pic32mx_transmit(struct pic32mx_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->pd_txtimeout, PIC32MX_TXTIMEOUT, - pic32mx_txtimeout_expiry, 1, (uint32_t)priv); + wd_start(priv->pd_txtimeout, PIC32MX_TXTIMEOUT, + pic32mx_txtimeout_expiry, 1, (uint32_t)priv); return OK; } @@ -1236,7 +1236,7 @@ static void pic32mx_poll(struct pic32mx_driver_s *priv) /* And perform the poll */ priv->pd_polling = true; - (void)devif_poll(&priv->pd_dev, pic32mx_txpoll); + devif_poll(&priv->pd_dev, pic32mx_txpoll); /* Free any buffer left attached after the poll */ @@ -1282,7 +1282,7 @@ static void pic32mx_timerpoll(struct pic32mx_driver_s *priv) /* And perform the poll */ priv->pd_polling = true; - (void)devif_timer(&priv->pd_dev, PIC32MX_WDDELAY, pic32mx_txpoll); + devif_timer(&priv->pd_dev, PIC32MX_WDDELAY, pic32mx_txpoll); /* Free any buffer left attached after the poll */ @@ -1956,7 +1956,7 @@ static void pic32mx_txtimeout_work(void *arg) * it back up. */ - (void)pic32mx_ifup(&priv->pd_dev); + pic32mx_ifup(&priv->pd_dev); /* Then poll the network for new XMIT data (We are guaranteed to have * a free buffer here). @@ -2046,8 +2046,8 @@ static void pic32mx_poll_work(void *arg) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->pd_txpoll, PIC32MX_WDDELAY, pic32mx_poll_expiry, - 1, priv); + wd_start(priv->pd_txpoll, PIC32MX_WDDELAY, pic32mx_poll_expiry, + 1, priv); net_unlock(); } @@ -2359,9 +2359,9 @@ static int pic32mx_ifup(struct net_driver_s *dev) #if defined(CONFIG_PIC32MX_ETH_PRIORITY) && defined(CONFIG_ARCH_IRQPRIO) #if CONFIG_PIC32MX_NINTERFACES > 1 - (void)up_prioritize_irq(priv->pd_irq, CONFIG_PIC32MX_ETH_PRIORITY); + up_prioritize_irq(priv->pd_irq, CONFIG_PIC32MX_ETH_PRIORITY); #else - (void)up_prioritize_irq(PIC32MX_IRQ_ETH, CONFIG_PIC32MX_ETH_PRIORITY); + up_prioritize_irq(PIC32MX_IRQ_ETH, CONFIG_PIC32MX_ETH_PRIORITY); #endif #endif @@ -2375,8 +2375,8 @@ static int pic32mx_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->pd_txpoll, PIC32MX_WDDELAY, pic32mx_poll_expiry, 1, - (uint32_t)priv); + wd_start(priv->pd_txpoll, PIC32MX_WDDELAY, pic32mx_poll_expiry, 1, + (uint32_t)priv); /* Finally, enable the Ethernet interrupt at the interrupt controller */ @@ -3425,7 +3425,7 @@ static inline int pic32mx_ethinitialize(int intf) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->pd_dev, NET_LL_ETHERNET); + netdev_register(&priv->pd_dev, NET_LL_ETHERNET); return OK; } @@ -3443,7 +3443,7 @@ static inline int pic32mx_ethinitialize(int intf) #if CONFIG_PIC32MX_NINTERFACES == 1 && !defined(CONFIG_NETDEV_LATEINIT) void up_netinitialize(void) { - (void)pic32mx_ethinitialize(0); + pic32mx_ethinitialize(0); } #endif #endif /* CHIP_NETHERNET > 0 */ diff --git a/arch/mips/src/pic32mx/pic32mx-irq.c b/arch/mips/src/pic32mx/pic32mx-irq.c index f19311889e..a45ccaf384 100644 --- a/arch/mips/src/pic32mx/pic32mx-irq.c +++ b/arch/mips/src/pic32mx/pic32mx-irq.c @@ -107,7 +107,7 @@ void up_irqinitialize(void) for (irq = 0; irq < NR_IRQS; irq++) { - (void)up_prioritize_irq(irq, (INT_IPC_MID_PRIORITY << 2)); + up_prioritize_irq(irq, (INT_IPC_MID_PRIORITY << 2)); } /* Set the BEV bit in the STATUS register */ diff --git a/arch/mips/src/pic32mx/pic32mx-serial.c b/arch/mips/src/pic32mx/pic32mx-serial.c index bc8e6327d8..e01214bbeb 100644 --- a/arch/mips/src/pic32mx/pic32mx-serial.c +++ b/arch/mips/src/pic32mx/pic32mx-serial.c @@ -868,14 +868,14 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif } diff --git a/arch/mips/src/pic32mx/pic32mx-spi.c b/arch/mips/src/pic32mx/pic32mx-spi.c index 02664c1202..aa14790758 100644 --- a/arch/mips/src/pic32mx/pic32mx-spi.c +++ b/arch/mips/src/pic32mx/pic32mx-spi.c @@ -440,24 +440,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; diff --git a/arch/mips/src/pic32mx/pic32mx-timerisr.c b/arch/mips/src/pic32mx/pic32mx-timerisr.c index bb7781c15f..a2c3352d2f 100644 --- a/arch/mips/src/pic32mx/pic32mx-timerisr.c +++ b/arch/mips/src/pic32mx/pic32mx-timerisr.c @@ -178,12 +178,12 @@ void mips_timer_initialize(void) up_clrpend_irq(PIC32MX_IRQSRC_T1); #ifdef CONFIG_ARCH_IRQPRIO - (void)up_prioritize_irq(PIC32MX_IRQ_T1, CONFIG_PIC32MX_T1PRIO); + up_prioritize_irq(PIC32MX_IRQ_T1, CONFIG_PIC32MX_T1PRIO); #endif /* Attach the timer interrupt vector */ - (void)irq_attach(PIC32MX_IRQ_T1, (xcpt_t)pc32mx_timerisr, NULL); + irq_attach(PIC32MX_IRQ_T1, (xcpt_t)pc32mx_timerisr, NULL); /* And enable the timer interrupt */ diff --git a/arch/mips/src/pic32mx/pic32mx-usbdev.c b/arch/mips/src/pic32mx/pic32mx-usbdev.c index a0bd850461..ea99c9a634 100644 --- a/arch/mips/src/pic32mx/pic32mx-usbdev.c +++ b/arch/mips/src/pic32mx/pic32mx-usbdev.c @@ -1013,7 +1013,7 @@ static void pic32mx_rqrestart(int argc, uint32_t arg1, ...) #ifndef CONFIG_USBDEV_NOWRITEAHEAD privreq->inflight[1] = 0; #endif - (void)pic32mx_wrrequest(priv, privep); + pic32mx_wrrequest(priv, privep); } } } @@ -1031,8 +1031,8 @@ static void pic32mx_delayedrestart(struct pic32mx_usbdev_s *priv, uint8_t epno) /* And start (or re-start) the watchdog timer */ - (void)wd_start(priv->wdog, RESTART_DELAY, pic32mx_rqrestart, 1, - (uint32_t)priv); + wd_start(priv->wdog, RESTART_DELAY, pic32mx_rqrestart, 1, + (uint32_t)priv); } /**************************************************************************** @@ -1283,7 +1283,7 @@ static int pic32mx_wrrequest(struct pic32mx_usbdev_s *priv, struct pic32mx_ep_s * queued */ - (void)pic32mx_wrstart(priv, privep); + pic32mx_wrstart(priv, privep); } #else UNUSED(ret); @@ -1757,7 +1757,7 @@ static void pic32mx_eptransfer(struct pic32mx_usbdev_s *priv, uint8_t epno, { /* If that succeeds, then try to set up another OUT transfer. */ - (void)pic32mx_rdrequest(priv, privep); + pic32mx_rdrequest(priv, privep); } #else UNUSED(ret); @@ -1777,7 +1777,7 @@ static void pic32mx_eptransfer(struct pic32mx_usbdev_s *priv, uint8_t epno, /* Handle additional queued write requests */ - (void)pic32mx_wrrequest(priv, privep); + pic32mx_wrrequest(priv, privep); } } @@ -2636,7 +2636,7 @@ static void pic32mx_ep0transfer(struct pic32mx_usbdev_s *priv, uint16_t ustat) /* Stall EP0 */ usbtrace(TRACE_DEVERROR(PIC32MX_TRACEERR_EP0SETUPSTALLED), priv->ctrlstate); - (void)pic32mx_epstall(&priv->eplist[EP0].ep, false); + pic32mx_epstall(&priv->eplist[EP0].ep, false); } } @@ -3417,7 +3417,7 @@ static int pic32mx_epsubmit(struct usbdev_ep_s *ep, struct usbdev_req_s *req) if (!privep->stalled) { - (void)pic32mx_wrrequest(priv, privep); + pic32mx_wrrequest(priv, privep); } } @@ -3436,7 +3436,7 @@ static int pic32mx_epsubmit(struct usbdev_ep_s *ep, struct usbdev_req_s *req) if (!privep->stalled) { - (void)pic32mx_rdrequest(priv, privep); + pic32mx_rdrequest(priv, privep); } } @@ -3776,7 +3776,7 @@ static void pic32mx_freeep(struct usbdev_s *dev, struct usbdev_ep_s *ep) /* Disable the endpoint */ - (void)pic32mx_epdisable(ep); + pic32mx_epdisable(ep); /* Mark the endpoint as available */ diff --git a/arch/mips/src/pic32mz/pic32mz-decodeirq.c b/arch/mips/src/pic32mz/pic32mz-decodeirq.c index a9e249be19..03712a4ee7 100644 --- a/arch/mips/src/pic32mz/pic32mz-decodeirq.c +++ b/arch/mips/src/pic32mz/pic32mz-decodeirq.c @@ -171,7 +171,7 @@ uint32_t *pic32mz_decodeirq(uint32_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/mips/src/pic32mz/pic32mz-dma.c b/arch/mips/src/pic32mz/pic32mz-dma.c index e3e84e2514..be4da4c8e4 100644 --- a/arch/mips/src/pic32mz/pic32mz-dma.c +++ b/arch/mips/src/pic32mz/pic32mz-dma.c @@ -213,21 +213,7 @@ static struct pic32mz_dmac_s g_dmac = static void pic32mz_dma_takesem(struct pic32mz_dmac_s *dmac) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&dmac->chsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&dmac->chsem); } /**************************************************************************** @@ -240,7 +226,7 @@ static void pic32mz_dma_takesem(struct pic32mz_dmac_s *dmac) static inline void pic32mz_dma_givesem(struct pic32mz_dmac_s *dmac) { - (void)nxsem_post(&dmac->chsem); + nxsem_post(&dmac->chsem); } /**************************************************************************** @@ -771,7 +757,7 @@ void weak_function up_dma_initialize(void) /* Attach DMA interrupt vectors. */ - (void)irq_attach(dmach->irq, pic32mz_dma_interrupt, NULL); + irq_attach(dmach->irq, pic32mz_dma_interrupt, NULL); /* Disable the DMA channel. */ diff --git a/arch/mips/src/pic32mz/pic32mz-ethernet.c b/arch/mips/src/pic32mz/pic32mz-ethernet.c index cf99a0b81f..d1547a8461 100644 --- a/arch/mips/src/pic32mz/pic32mz-ethernet.c +++ b/arch/mips/src/pic32mz/pic32mz-ethernet.c @@ -1215,8 +1215,8 @@ static int pic32mz_transmit(struct pic32mz_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->pd_txtimeout, PIC32MZ_TXTIMEOUT, - pic32mz_txtimeout_expiry, 1, (uint32_t)priv); + wd_start(priv->pd_txtimeout, PIC32MZ_TXTIMEOUT, + pic32mz_txtimeout_expiry, 1, (uint32_t)priv); return OK; } @@ -1350,7 +1350,7 @@ static void pic32mz_poll(struct pic32mz_driver_s *priv) /* And perform the poll */ priv->pd_polling = true; - (void)devif_poll(&priv->pd_dev, pic32mz_txpoll); + devif_poll(&priv->pd_dev, pic32mz_txpoll); /* Free any buffer left attached after the poll */ @@ -1396,7 +1396,7 @@ static void pic32mz_timerpoll(struct pic32mz_driver_s *priv) /* And perform the poll */ priv->pd_polling = true; - (void)devif_timer(&priv->pd_dev, PIC32MZ_WDDELAY, pic32mz_txpoll); + devif_timer(&priv->pd_dev, PIC32MZ_WDDELAY, pic32mz_txpoll); /* Free any buffer left attached after the poll */ @@ -2095,7 +2095,7 @@ static void pic32mz_txtimeout_work(void *arg) * it back up. */ - (void)pic32mz_ifup(&priv->pd_dev); + pic32mz_ifup(&priv->pd_dev); /* Then poll the network for new XMIT data (We are guaranteed to have * a free buffer here). @@ -2184,8 +2184,8 @@ static void pic32mz_poll_work(void *arg) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->pd_txpoll, PIC32MZ_WDDELAY, pic32mz_poll_expiry, - 1, priv); + wd_start(priv->pd_txpoll, PIC32MZ_WDDELAY, pic32mz_poll_expiry, + 1, priv); net_unlock(); } @@ -2508,9 +2508,9 @@ static int pic32mz_ifup(struct net_driver_s *dev) #if defined(CONFIG_PIC32MZ_ETH_PRIORITY) && defined(CONFIG_ARCH_IRQPRIO) #if CONFIG_PIC32MZ_NINTERFACES > 1 - (void)up_prioritize_irq(priv->pd_irq, CONFIG_PIC32MZ_ETH_PRIORITY); + up_prioritize_irq(priv->pd_irq, CONFIG_PIC32MZ_ETH_PRIORITY); #else - (void)up_prioritize_irq(PIC32MZ_IRQ_ETH, CONFIG_PIC32MZ_ETH_PRIORITY); + up_prioritize_irq(PIC32MZ_IRQ_ETH, CONFIG_PIC32MZ_ETH_PRIORITY); #endif #endif @@ -2524,8 +2524,8 @@ static int pic32mz_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->pd_txpoll, PIC32MZ_WDDELAY, pic32mz_poll_expiry, 1, - (uint32_t)priv); + wd_start(priv->pd_txpoll, PIC32MZ_WDDELAY, pic32mz_poll_expiry, 1, + (uint32_t)priv); /* Finally, enable the Ethernet interrupt at the interrupt controller */ @@ -3597,7 +3597,7 @@ static inline int pic32mz_ethinitialize(int intf) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->pd_dev, NET_LL_ETHERNET); + netdev_register(&priv->pd_dev, NET_LL_ETHERNET); return OK; } @@ -3615,7 +3615,7 @@ static inline int pic32mz_ethinitialize(int intf) #if CONFIG_PIC32MZ_NINTERFACES == 1 && !defined(CONFIG_NETDEV_LATEINIT) void up_netinitialize(void) { - (void)pic32mz_ethinitialize(0); + pic32mz_ethinitialize(0); } #endif #endif /* CHIP_NETHERNET > 0 */ diff --git a/arch/mips/src/pic32mz/pic32mz-i2c.c b/arch/mips/src/pic32mz/pic32mz-i2c.c index 7f411656e2..e9f38a7519 100644 --- a/arch/mips/src/pic32mz/pic32mz-i2c.c +++ b/arch/mips/src/pic32mz/pic32mz-i2c.c @@ -632,21 +632,7 @@ static inline void pic32mz_i2c_modifyreg(FAR struct pic32mz_i2c_priv_s *priv, static inline void pic32mz_i2c_sem_wait(FAR struct pic32mz_i2c_priv_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->sem_excl); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sem_excl); } /**************************************************************************** @@ -706,7 +692,7 @@ static inline int do { - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); /* Calculate a time in the future */ @@ -735,12 +721,11 @@ static inline int /* Wait until either the transfer is complete or the timeout expires */ - ret = nxsem_timedwait(&priv->sem_isr, &abstime); - if (ret < 0 && ret != -EINTR) + ret = nxsem_timedwait_uninterruptible(&priv->sem_isr, &abstime); + if (ret < 0) { /* Break out of the loop on irrecoverable errors. This would * include timeouts and mystery errors reported by nxsem_timedwait. - * NOTE that we try again if we are awakened by a signal (EINTR). */ break; diff --git a/arch/mips/src/pic32mz/pic32mz-irq.c b/arch/mips/src/pic32mz/pic32mz-irq.c index 9cceb5eac6..999e99a378 100644 --- a/arch/mips/src/pic32mz/pic32mz-irq.c +++ b/arch/mips/src/pic32mz/pic32mz-irq.c @@ -189,7 +189,7 @@ void up_irqinitialize(void) for (irq = 0; irq < NR_IRQS; irq++) { - (void)pic32mz_prioritize_irq(irq, (INT_IPC_MID_PRIORITY << 2)); + pic32mz_prioritize_irq(irq, (INT_IPC_MID_PRIORITY << 2)); } /* Set the BEV bit in the STATUS register */ diff --git a/arch/mips/src/pic32mz/pic32mz-oneshot.c b/arch/mips/src/pic32mz/pic32mz-oneshot.c index bd0b30f39b..de2932a5a4 100644 --- a/arch/mips/src/pic32mz/pic32mz-oneshot.c +++ b/arch/mips/src/pic32mz/pic32mz-oneshot.c @@ -309,7 +309,7 @@ int pic32mz_oneshot_start(struct pic32mz_oneshot_s *oneshot, /* Yes.. then cancel it */ tmrinfo("Already running... cancelling\n"); - (void)pic32mz_oneshot_cancel(oneshot, NULL); + pic32mz_oneshot_cancel(oneshot, NULL); } /* Save the new handler and its argument */ diff --git a/arch/mips/src/pic32mz/pic32mz-serial.c b/arch/mips/src/pic32mz/pic32mz-serial.c index f721b98b64..a960d4a562 100644 --- a/arch/mips/src/pic32mz/pic32mz-serial.c +++ b/arch/mips/src/pic32mz/pic32mz-serial.c @@ -1134,29 +1134,29 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif #ifdef TTYS6_DEV - (void)uart_register("/dev/ttyS6", &TTYS6_DEV); + uart_register("/dev/ttyS6", &TTYS6_DEV); #endif } diff --git a/arch/mips/src/pic32mz/pic32mz-spi.c b/arch/mips/src/pic32mz/pic32mz-spi.c index 0e1158fd2a..3c700da0dc 100644 --- a/arch/mips/src/pic32mz/pic32mz-spi.c +++ b/arch/mips/src/pic32mz/pic32mz-spi.c @@ -1193,24 +1193,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; diff --git a/arch/mips/src/pic32mz/pic32mz-timerisr.c b/arch/mips/src/pic32mz/pic32mz-timerisr.c index 7169a0e9ec..b9df52c555 100644 --- a/arch/mips/src/pic32mz/pic32mz-timerisr.c +++ b/arch/mips/src/pic32mz/pic32mz-timerisr.c @@ -179,7 +179,7 @@ void mips_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(PIC32MZ_IRQ_T1, (xcpt_t)pc32mz_timerisr, NULL); + irq_attach(PIC32MZ_IRQ_T1, (xcpt_t)pc32mz_timerisr, NULL); /* And enable the timer interrupt */ diff --git a/arch/misoc/include/lm32/syscall.h b/arch/misoc/include/lm32/syscall.h index d0816c7a21..8620d20833 100644 --- a/arch/misoc/include/lm32/syscall.h +++ b/arch/misoc/include/lm32/syscall.h @@ -87,7 +87,7 @@ #define SYS_restore_context (1) #define up_fullcontextrestore(restoreregs) \ - (void)sys_call1(SYS_restore_context, (uintptr_t)restoreregs) + sys_call1(SYS_restore_context, (uintptr_t)restoreregs) /* SYS call 2: * @@ -96,7 +96,7 @@ #define SYS_switch_context (2) #define up_switchcontext(saveregs, restoreregs) \ - (void)sys_call2(SYS_switch_context, (uintptr_t)saveregs, (uintptr_t)restoreregs) + sys_call2(SYS_switch_context, (uintptr_t)saveregs, (uintptr_t)restoreregs) #ifdef CONFIG_BUILD_KERNEL /* SYS call 3: diff --git a/arch/misoc/include/minerva/syscall.h b/arch/misoc/include/minerva/syscall.h index f4d34e10cf..e1f5fa81cb 100644 --- a/arch/misoc/include/minerva/syscall.h +++ b/arch/misoc/include/minerva/syscall.h @@ -88,7 +88,7 @@ #define SYS_restore_context (1) #define up_fullcontextrestore(restoreregs) \ - (void)sys_call1(SYS_restore_context, (uintptr_t)restoreregs) + sys_call1(SYS_restore_context, (uintptr_t)restoreregs) /* SYS call 2: * @@ -97,8 +97,8 @@ #define SYS_switch_context (2) #define up_switchcontext(saveregs, restoreregs) \ - (void)sys_call2(SYS_switch_context, (uintptr_t)saveregs, \ - (uintptr_t)restoreregs) + sys_call2(SYS_switch_context, (uintptr_t)saveregs, \ + (uintptr_t)restoreregs) #ifdef CONFIG_BUILD_KERNEL diff --git a/arch/misoc/src/common/misoc_net.c b/arch/misoc/src/common/misoc_net.c index e815b152b9..5f9dcb339c 100644 --- a/arch/misoc/src/common/misoc_net.c +++ b/arch/misoc/src/common/misoc_net.c @@ -269,8 +269,8 @@ static int misoc_net_transmit(FAR struct misoc_net_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->misoc_net_txtimeout, MISOC_NET_TXTIMEOUT, - misoc_net_txtimeout_expiry, 1, (wdparm_t)priv); + wd_start(priv->misoc_net_txtimeout, MISOC_NET_TXTIMEOUT, + misoc_net_txtimeout_expiry, 1, (wdparm_t)priv); return OK; } @@ -561,7 +561,7 @@ static void misoc_net_txdone(FAR struct misoc_net_driver_s *priv) /* In any event, poll the network for new TX data */ - (void)devif_poll(&priv->misoc_net_dev, misoc_net_txpoll); + devif_poll(&priv->misoc_net_dev, misoc_net_txpoll); } /**************************************************************************** @@ -694,7 +694,7 @@ static void misoc_net_txtimeout_work(FAR void *arg) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->misoc_net_dev, misoc_net_txpoll); + devif_poll(&priv->misoc_net_dev, misoc_net_txpoll); net_unlock(); } @@ -769,12 +769,12 @@ static void misoc_net_poll_work(FAR void *arg) * progress, we will missing TCP time state updates? */ - (void)devif_timer(&priv->misoc_net_dev, MISOC_NET_WDDELAY, misoc_net_txpoll); + devif_timer(&priv->misoc_net_dev, MISOC_NET_WDDELAY, misoc_net_txpoll); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->misoc_net_txpoll, MISOC_NET_WDDELAY, misoc_net_poll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->misoc_net_txpoll, MISOC_NET_WDDELAY, misoc_net_poll_expiry, 1, + (wdparm_t)priv); net_unlock(); } @@ -855,8 +855,8 @@ static int misoc_net_ifup(FAR struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->misoc_net_txpoll, MISOC_NET_WDDELAY, - misoc_net_poll_expiry, 1, (wdparm_t)priv); + wd_start(priv->misoc_net_txpoll, MISOC_NET_WDDELAY, + misoc_net_poll_expiry, 1, (wdparm_t)priv); priv->misoc_net_bifup = true; up_enable_irq(ETHMAC_INTERRUPT); @@ -948,7 +948,7 @@ static void misoc_net_txavail_work(FAR void *arg) { /* If so, then poll the network for new XMIT data */ - (void)devif_poll(&priv->misoc_net_dev, misoc_net_txpoll); + devif_poll(&priv->misoc_net_dev, misoc_net_txpoll); } } @@ -1104,7 +1104,7 @@ static void misoc_net_ipv6multicast(FAR struct misoc_net_driver_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)misoc_net_addmac(dev, mac); + misoc_net_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -1112,7 +1112,7 @@ static void misoc_net_ipv6multicast(FAR struct misoc_net_driver_s *priv) * packets. */ - (void)misoc_net_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + misoc_net_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -1121,7 +1121,7 @@ static void misoc_net_ipv6multicast(FAR struct misoc_net_driver_s *priv) * packets. */ - (void)misoc_net_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + misoc_net_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -1208,7 +1208,7 @@ int misoc_net_initialize(int intf) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->misoc_net_dev, NET_LL_ETHERNET); + netdev_register(&priv->misoc_net_dev, NET_LL_ETHERNET); return OK; } diff --git a/arch/misoc/src/common/misoc_serial.c b/arch/misoc/src/common/misoc_serial.c index 8909d690eb..75077d3496 100644 --- a/arch/misoc/src/common/misoc_serial.c +++ b/arch/misoc/src/common/misoc_serial.c @@ -313,7 +313,7 @@ static int misoc_attach(struct uart_dev_s *dev) { struct misoc_dev_s *priv = (struct misoc_dev_s *)dev->priv; - (void)irq_attach(priv->irq, misoc_uart_interrupt, dev); + irq_attach(priv->irq, misoc_uart_interrupt, dev); up_enable_irq(priv->irq); return OK; @@ -656,10 +656,10 @@ void misoc_serial_initialize(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #endif } diff --git a/arch/misoc/src/common/misoc_timerisr.c b/arch/misoc/src/common/misoc_timerisr.c index dfee4560ac..da9d38638f 100644 --- a/arch/misoc/src/common/misoc_timerisr.c +++ b/arch/misoc/src/common/misoc_timerisr.c @@ -139,7 +139,7 @@ void misoc_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(TIMER0_INTERRUPT, misoc_timer_isr, NULL); + irq_attach(TIMER0_INTERRUPT, misoc_timer_isr, NULL); /* And enable the timer interrupt */ diff --git a/arch/misoc/src/lm32/lm32_assert.c b/arch/misoc/src/lm32/lm32_assert.c index 5f57dc20f2..ccc49b35c4 100644 --- a/arch/misoc/src/lm32/lm32_assert.c +++ b/arch/misoc/src/lm32/lm32_assert.c @@ -83,7 +83,7 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? * NOTE: You cannot use the PID to determine if this is an IDLE task. In @@ -94,7 +94,7 @@ static void _up_assert(int errorcode) if (g_current_regs || running_task()->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (; ; ) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -160,7 +160,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", @@ -175,12 +175,12 @@ void up_assert(const uint8_t *filename, int lineno) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); diff --git a/arch/misoc/src/lm32/lm32_blocktask.c b/arch/misoc/src/lm32/lm32_blocktask.c index 158b5331a9..71c4039455 100644 --- a/arch/misoc/src/lm32/lm32_blocktask.c +++ b/arch/misoc/src/lm32/lm32_blocktask.c @@ -160,7 +160,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Reset scheduler parameters */ diff --git a/arch/misoc/src/lm32/lm32_doirq.c b/arch/misoc/src/lm32/lm32_doirq.c index cf42f4e699..5c39aa95d5 100644 --- a/arch/misoc/src/lm32/lm32_doirq.c +++ b/arch/misoc/src/lm32/lm32_doirq.c @@ -104,7 +104,7 @@ uint32_t *lm32_doirq(int irq, uint32_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/misoc/src/lm32/lm32_exit.c b/arch/misoc/src/lm32/lm32_exit.c index 0c38ebb2da..832b8ab1da 100644 --- a/arch/misoc/src/lm32/lm32_exit.c +++ b/arch/misoc/src/lm32/lm32_exit.c @@ -142,7 +142,7 @@ void _exit(int status) * The IRQ state will be restored when the next task is started. */ - (void)enter_critical_section(); + enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); @@ -157,7 +157,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. @@ -172,7 +172,7 @@ void _exit(int status) * the ready-to-run list. */ - (void)group_addrenv(tcb); + group_addrenv(tcb); #endif /* Reset scheduler parameters */ diff --git a/arch/misoc/src/lm32/lm32_irq.c b/arch/misoc/src/lm32/lm32_irq.c index 78bfa0b3df..f667d1bf55 100644 --- a/arch/misoc/src/lm32/lm32_irq.c +++ b/arch/misoc/src/lm32/lm32_irq.c @@ -71,7 +71,7 @@ void lm32_irq_initialize(void) /* Attach the software interrupt */ - (void)irq_attach(LM32_IRQ_SWINT, lm32_swint, NULL); + irq_attach(LM32_IRQ_SWINT, lm32_swint, NULL); /* Enable interrupts */ diff --git a/arch/misoc/src/lm32/lm32_releasepending.c b/arch/misoc/src/lm32/lm32_releasepending.c index e100dd96cc..f4620798b1 100644 --- a/arch/misoc/src/lm32/lm32_releasepending.c +++ b/arch/misoc/src/lm32/lm32_releasepending.c @@ -129,7 +129,7 @@ void up_release_pending(void) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/misoc/src/lm32/lm32_reprioritizertr.c b/arch/misoc/src/lm32/lm32_reprioritizertr.c index 3d33b1b008..b03a505853 100644 --- a/arch/misoc/src/lm32/lm32_reprioritizertr.c +++ b/arch/misoc/src/lm32/lm32_reprioritizertr.c @@ -182,7 +182,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/misoc/src/lm32/lm32_sigdeliver.c b/arch/misoc/src/lm32/lm32_sigdeliver.c index 5b51edd8fe..f32bdbf2c1 100644 --- a/arch/misoc/src/lm32/lm32_sigdeliver.c +++ b/arch/misoc/src/lm32/lm32_sigdeliver.c @@ -107,7 +107,7 @@ void lm32_sigdeliver(void) sinfo("Resuming EPC: %08x INT_CTX: %08x\n", regs[REG_EPC], regs[REG_INT_CTX]); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/misoc/src/lm32/lm32_swint.c b/arch/misoc/src/lm32/lm32_swint.c index a71225aad8..edab9a714d 100644 --- a/arch/misoc/src/lm32/lm32_swint.c +++ b/arch/misoc/src/lm32/lm32_swint.c @@ -320,7 +320,7 @@ int lm32_swint(int irq, FAR void *context, FAR void *arg) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/misoc/src/lm32/lm32_unblocktask.c b/arch/misoc/src/lm32/lm32_unblocktask.c index 4ebb0b9839..01d5eaf332 100644 --- a/arch/misoc/src/lm32/lm32_unblocktask.c +++ b/arch/misoc/src/lm32/lm32_unblocktask.c @@ -144,7 +144,7 @@ void up_unblock_task(struct tcb_s *tcb) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/misoc/src/minerva/minerva_assert.c b/arch/misoc/src/minerva/minerva_assert.c index 383f5cb590..a754f9f394 100644 --- a/arch/misoc/src/minerva/minerva_assert.c +++ b/arch/misoc/src/minerva/minerva_assert.c @@ -83,7 +83,7 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? NOTE: You cannot use the * PID to determine if this is an IDLE task. In the SMP case, there may be @@ -94,7 +94,7 @@ static void _up_assert(int errorcode) if (g_current_regs || running_task()->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (; ; ) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -160,7 +160,7 @@ void up_assert(const uint8_t * filename, int lineno) /* Flush any buffered SYSLOG data (prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", @@ -174,12 +174,12 @@ void up_assert(const uint8_t * filename, int lineno) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); diff --git a/arch/misoc/src/minerva/minerva_blocktask.c b/arch/misoc/src/minerva/minerva_blocktask.c index b4e9da07af..859caf964a 100644 --- a/arch/misoc/src/minerva/minerva_blocktask.c +++ b/arch/misoc/src/minerva/minerva_blocktask.c @@ -157,7 +157,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Reset scheduler parameters */ diff --git a/arch/misoc/src/minerva/minerva_doirq.c b/arch/misoc/src/minerva/minerva_doirq.c index daa32021bf..70ac6b67bd 100644 --- a/arch/misoc/src/minerva/minerva_doirq.c +++ b/arch/misoc/src/minerva/minerva_doirq.c @@ -103,7 +103,7 @@ uint32_t *minerva_doirq(int irq, uint32_t * regs) * the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); # endif } #endif diff --git a/arch/misoc/src/minerva/minerva_exit.c b/arch/misoc/src/minerva/minerva_exit.c index c825dfaca4..634ed08d8e 100644 --- a/arch/misoc/src/minerva/minerva_exit.c +++ b/arch/misoc/src/minerva/minerva_exit.c @@ -140,7 +140,7 @@ void _exit(int status) * IRQ state will be restored when the next task is started. */ - (void)enter_critical_section(); + enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); @@ -155,7 +155,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the head * of the list. @@ -170,7 +170,7 @@ void _exit(int status) * list. */ - (void)group_addrenv(tcb); + group_addrenv(tcb); #endif /* Reset scheduler parameters */ diff --git a/arch/misoc/src/minerva/minerva_irq.c b/arch/misoc/src/minerva/minerva_irq.c index f2d0bf1e51..a8da72b717 100644 --- a/arch/misoc/src/minerva/minerva_irq.c +++ b/arch/misoc/src/minerva/minerva_irq.c @@ -71,7 +71,7 @@ void minerva_irq_initialize(void) /* Attach the software interrupt */ - (void)irq_attach(MINERVA_IRQ_SWINT, minerva_swint, NULL); + irq_attach(MINERVA_IRQ_SWINT, minerva_swint, NULL); /* Enable interrupts */ diff --git a/arch/misoc/src/minerva/minerva_releasepending.c b/arch/misoc/src/minerva/minerva_releasepending.c index f950e765ba..bdd7d94444 100644 --- a/arch/misoc/src/minerva/minerva_releasepending.c +++ b/arch/misoc/src/minerva/minerva_releasepending.c @@ -128,7 +128,7 @@ void up_release_pending(void) * of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/misoc/src/minerva/minerva_reprioritizertr.c b/arch/misoc/src/minerva/minerva_reprioritizertr.c index 64d771a5d1..005e631b4c 100644 --- a/arch/misoc/src/minerva/minerva_reprioritizertr.c +++ b/arch/misoc/src/minerva/minerva_reprioritizertr.c @@ -180,7 +180,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/misoc/src/minerva/minerva_sigdeliver.c b/arch/misoc/src/minerva/minerva_sigdeliver.c index 6f342a1229..37c68fb8a3 100644 --- a/arch/misoc/src/minerva/minerva_sigdeliver.c +++ b/arch/misoc/src/minerva/minerva_sigdeliver.c @@ -119,7 +119,7 @@ void minerva_sigdeliver(void) sinfo("Resuming EPC: %08x INT_CTX: %08x\n", regs[REG_CSR_MEPC], regs[REG_CSR_MSTATUS]); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of execution. */ diff --git a/arch/misoc/src/minerva/minerva_swint.c b/arch/misoc/src/minerva/minerva_swint.c index 23a9ec7869..f95fa54311 100644 --- a/arch/misoc/src/minerva/minerva_swint.c +++ b/arch/misoc/src/minerva/minerva_swint.c @@ -309,7 +309,7 @@ int minerva_swint(int irq, FAR void *context, FAR void *arg) * the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/misoc/src/minerva/minerva_unblocktask.c b/arch/misoc/src/minerva/minerva_unblocktask.c index d28bc04a4b..d3e895a350 100644 --- a/arch/misoc/src/minerva/minerva_unblocktask.c +++ b/arch/misoc/src/minerva/minerva_unblocktask.c @@ -144,7 +144,7 @@ void up_unblock_task(struct tcb_s *tcb) * head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/or1k/src/common/up_assert.c b/arch/or1k/src/common/up_assert.c index 5eccc1458f..8a7a354804 100644 --- a/arch/or1k/src/common/up_assert.c +++ b/arch/or1k/src/common/up_assert.c @@ -352,7 +352,7 @@ static void up_dumpstate(void) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif } #else @@ -368,13 +368,13 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ if (CURRENT_REGS || running_task()->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (; ; ) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -415,7 +415,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", @@ -429,7 +429,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); diff --git a/arch/or1k/src/common/up_blocktask.c b/arch/or1k/src/common/up_blocktask.c index 77a28588af..8fac908d05 100644 --- a/arch/or1k/src/common/up_blocktask.c +++ b/arch/or1k/src/common/up_blocktask.c @@ -161,7 +161,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Reset scheduler parameters */ diff --git a/arch/or1k/src/common/up_exit.c b/arch/or1k/src/common/up_exit.c index 383cfaa508..ef77d6367a 100644 --- a/arch/or1k/src/common/up_exit.c +++ b/arch/or1k/src/common/up_exit.c @@ -147,7 +147,7 @@ void _exit(int status) * The IRQ state will be restored when the next task is started. */ - (void)enter_critical_section(); + enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); @@ -162,7 +162,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. @@ -177,7 +177,7 @@ void _exit(int status) * the ready-to-run list. */ - (void)group_addrenv(tcb); + group_addrenv(tcb); #endif /* Reset scheduler parameters */ diff --git a/arch/or1k/src/common/up_initialize.c b/arch/or1k/src/common/up_initialize.c index 109615d667..8c140e01d4 100644 --- a/arch/or1k/src/common/up_initialize.c +++ b/arch/or1k/src/common/up_initialize.c @@ -275,7 +275,7 @@ void up_initialize(void) #ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ - (void)ptmx_register(); + ptmx_register(); #endif /* Early initialization of the system logging device. Some SYSLOG channel @@ -308,19 +308,19 @@ void up_initialize(void) #ifdef CONFIG_NETDEV_LOOPBACK /* Initialize the local loopback device */ - (void)localhost_initialize(); + localhost_initialize(); #endif #ifdef CONFIG_NET_TUN /* Initialize the TUN device */ - (void)tun_initialize(); + tun_initialize(); #endif #ifdef CONFIG_NETDEV_TELNET /* Initialize the Telnet session factory */ - (void)telnet_initialize(); + telnet_initialize(); #endif /* Initialize USB -- device and/or host */ diff --git a/arch/or1k/src/common/up_releasepending.c b/arch/or1k/src/common/up_releasepending.c index 40f63c0012..4dd0937d44 100644 --- a/arch/or1k/src/common/up_releasepending.c +++ b/arch/or1k/src/common/up_releasepending.c @@ -130,7 +130,7 @@ void up_release_pending(void) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/or1k/src/common/up_reprioritizertr.c b/arch/or1k/src/common/up_reprioritizertr.c index 8cac15b816..76560c6b60 100644 --- a/arch/or1k/src/common/up_reprioritizertr.c +++ b/arch/or1k/src/common/up_reprioritizertr.c @@ -183,7 +183,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/or1k/src/common/up_unblocktask.c b/arch/or1k/src/common/up_unblocktask.c index 62134209fa..3d3f1986e3 100644 --- a/arch/or1k/src/common/up_unblocktask.c +++ b/arch/or1k/src/common/up_unblocktask.c @@ -146,7 +146,7 @@ void up_unblock_task(struct tcb_s *tcb) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/or1k/src/mor1kx/mor1kx_serial.c b/arch/or1k/src/mor1kx/mor1kx_serial.c index ca17b271ec..2966725cd3 100644 --- a/arch/or1k/src/mor1kx/mor1kx_serial.c +++ b/arch/or1k/src/mor1kx/mor1kx_serial.c @@ -108,7 +108,7 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all USARTs */ diff --git a/arch/renesas/src/common/up_assert.c b/arch/renesas/src/common/up_assert.c index b1cc8a2c4d..919c0ee7bf 100644 --- a/arch/renesas/src/common/up_assert.c +++ b/arch/renesas/src/common/up_assert.c @@ -84,13 +84,13 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ if (g_current_regs || running_task()->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (;;) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -156,7 +156,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", @@ -171,12 +171,12 @@ void up_assert(const uint8_t *filename, int lineno) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); diff --git a/arch/renesas/src/common/up_blocktask.c b/arch/renesas/src/common/up_blocktask.c index cd81b636a0..b93197b7e0 100644 --- a/arch/renesas/src/common/up_blocktask.c +++ b/arch/renesas/src/common/up_blocktask.c @@ -160,7 +160,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Reset scheduler parameters */ diff --git a/arch/renesas/src/common/up_doirq.c b/arch/renesas/src/common/up_doirq.c index 9ac9d99aa0..f3ed51b3a3 100644 --- a/arch/renesas/src/common/up_doirq.c +++ b/arch/renesas/src/common/up_doirq.c @@ -116,7 +116,7 @@ uint32_t *up_doirq(int irq, uint32_t* regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/renesas/src/common/up_exit.c b/arch/renesas/src/common/up_exit.c index 835ba9ba75..5ddd35305a 100644 --- a/arch/renesas/src/common/up_exit.c +++ b/arch/renesas/src/common/up_exit.c @@ -147,7 +147,7 @@ void _exit(int status) * The IRQ state will be restored when the next task is started. */ - (void)enter_critical_section(); + enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); @@ -162,7 +162,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. @@ -177,7 +177,7 @@ void _exit(int status) * the ready-to-run list. */ - (void)group_addrenv(tcb); + group_addrenv(tcb); #endif /* Reset scheduler parameters */ diff --git a/arch/renesas/src/common/up_initialize.c b/arch/renesas/src/common/up_initialize.c index 185eec3023..cf8e7617fe 100644 --- a/arch/renesas/src/common/up_initialize.c +++ b/arch/renesas/src/common/up_initialize.c @@ -167,7 +167,7 @@ void up_initialize(void) #ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ - (void)ptmx_register(); + ptmx_register(); #endif /* Early initialization of the system logging device. Some SYSLOG channel @@ -196,19 +196,19 @@ void up_initialize(void) #ifdef CONFIG_NETDEV_LOOPBACK /* Initialize the local loopback device */ - (void)localhost_initialize(); + localhost_initialize(); #endif #ifdef CONFIG_NET_TUN /* Initialize the TUN device */ - (void)tun_initialize(); + tun_initialize(); #endif #ifdef CONFIG_NETDEV_TELNET /* Initialize the Telnet session factory */ - (void)telnet_initialize(); + telnet_initialize(); #endif /* Initialize USB */ diff --git a/arch/renesas/src/common/up_releasepending.c b/arch/renesas/src/common/up_releasepending.c index 5c3f574821..6ef5939183 100644 --- a/arch/renesas/src/common/up_releasepending.c +++ b/arch/renesas/src/common/up_releasepending.c @@ -130,7 +130,7 @@ void up_release_pending(void) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/renesas/src/common/up_reprioritizertr.c b/arch/renesas/src/common/up_reprioritizertr.c index 463e9c8e9b..9940d675c8 100644 --- a/arch/renesas/src/common/up_reprioritizertr.c +++ b/arch/renesas/src/common/up_reprioritizertr.c @@ -183,7 +183,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/renesas/src/common/up_unblocktask.c b/arch/renesas/src/common/up_unblocktask.c index bc4c7ee303..3ca1e79e98 100644 --- a/arch/renesas/src/common/up_unblocktask.c +++ b/arch/renesas/src/common/up_unblocktask.c @@ -145,7 +145,7 @@ void up_unblock_task(struct tcb_s *tcb) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/renesas/src/m16c/m16c_serial.c b/arch/renesas/src/m16c/m16c_serial.c index 7d3bdeba5c..46b9fb9dee 100644 --- a/arch/renesas/src/m16c/m16c_serial.c +++ b/arch/renesas/src/m16c/m16c_serial.c @@ -720,7 +720,7 @@ static int up_attach(struct uart_dev_s *dev) { /* Detach the ERI interrupt on failure */ - (void)irq_detach(priv->rcvirq); + irq_detach(priv->rcvirq); } } @@ -747,8 +747,8 @@ static void up_detach(struct uart_dev_s *dev) /* Detach the UART interrupts */ - (void)irq_detach(priv->rcvirq); - (void)irq_detach(priv->xmtirq); + irq_detach(priv->rcvirq); + irq_detach(priv->xmtirq); } /**************************************************************************** @@ -1076,17 +1076,17 @@ void up_consoleinit(void) /* Register the console */ #ifdef HAVE_SERIALCONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #endif #endif diff --git a/arch/renesas/src/m16c/m16c_sigdeliver.c b/arch/renesas/src/m16c/m16c_sigdeliver.c index 577f6b6a1d..1616f0bae8 100644 --- a/arch/renesas/src/m16c/m16c_sigdeliver.c +++ b/arch/renesas/src/m16c/m16c_sigdeliver.c @@ -106,7 +106,7 @@ void up_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/renesas/src/rx65n/rx65n_eth.c b/arch/renesas/src/rx65n/rx65n_eth.c index de3adc48fc..742479ea11 100644 --- a/arch/renesas/src/rx65n/rx65n_eth.c +++ b/arch/renesas/src/rx65n/rx65n_eth.c @@ -1236,7 +1236,7 @@ static void rx65n_dopoll(FAR struct rx65n_ethmac_s *priv) if (dev->d_buf) { - (void)devif_poll(dev, rx65n_txpoll); + devif_poll(dev, rx65n_txpoll); /* We will, most likely end up with a buffer to be freed. But it * might not be the same one that we allocated above. @@ -2088,8 +2088,8 @@ static void rx65n_txtimeout_work(FAR void *arg) (priv->dev.d_statistics.tx_timeouts)++; #endif - (void)rx65n_ifdown(&priv->dev); - (void)rx65n_ifup(&priv->dev); + rx65n_ifdown(&priv->dev); + rx65n_ifup(&priv->dev); /* Then poll for new XMIT data */ @@ -2188,7 +2188,7 @@ static void rx65n_poll_work(FAR void *arg) /* Update TCP timing states and poll the network for new XMIT data. */ - (void)devif_timer(dev, CLK_TCK, rx65n_txpoll); + devif_timer(dev, CLK_TCK, rx65n_txpoll); /* We will, most likely end up with a buffer to be freed. But it * might not be the same one that we allocated above. @@ -4394,7 +4394,7 @@ int rx65n_ethinitialize(int intf) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->dev, NET_LL_ETHERNET); + netdev_register(&priv->dev, NET_LL_ETHERNET); return OK; } diff --git a/arch/renesas/src/rx65n/rx65n_serial.c b/arch/renesas/src/rx65n/rx65n_serial.c index 8b57508063..689d0237f0 100644 --- a/arch/renesas/src/rx65n/rx65n_serial.c +++ b/arch/renesas/src/rx65n/rx65n_serial.c @@ -1139,9 +1139,9 @@ static int up_attach(struct uart_dev_s *dev) return OK; } - (void)irq_detach(priv->recvirq); - (void)irq_detach(priv->xmitirq); - (void)irq_detach(priv->eriirq); + irq_detach(priv->recvirq); + irq_detach(priv->xmitirq); + irq_detach(priv->eriirq); return ret; } @@ -1169,8 +1169,8 @@ static void up_detach(struct uart_dev_s *dev) up_disable_irq(priv->recvirq); up_disable_irq(priv->xmitirq); - (void)irq_detach(priv->recvirq); - (void)irq_detach(priv->xmitirq); + irq_detach(priv->recvirq); + irq_detach(priv->xmitirq); } static int up_eriinterrupt(int irq, void *context, void *arg) @@ -1598,47 +1598,47 @@ void up_serialinit(void) #endif #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif #ifdef TTYS4_DEV - (void)uart_register("/dev/ttyS4", &TTYS4_DEV); + uart_register("/dev/ttyS4", &TTYS4_DEV); #endif #ifdef TTYS5_DEV - (void)uart_register("/dev/ttyS5", &TTYS5_DEV); + uart_register("/dev/ttyS5", &TTYS5_DEV); #endif #ifdef TTYS6_DEV - (void)uart_register("/dev/ttyS6", &TTYS6_DEV); + uart_register("/dev/ttyS6", &TTYS6_DEV); #endif #ifdef TTYS7_DEV - (void)uart_register("/dev/ttyS7", &TTYS7_DEV); + uart_register("/dev/ttyS7", &TTYS7_DEV); #endif #ifdef TTYS8_DEV - (void)uart_register("/dev/ttyS8", &TTYS8_DEV); + uart_register("/dev/ttyS8", &TTYS8_DEV); #endif #ifdef TTYS9_DEV - (void)uart_register("/dev/ttyS9", &TTYS9_DEV); + uart_register("/dev/ttyS9", &TTYS9_DEV); #endif #ifdef TTYS10_DEV - (void)uart_register("/dev/ttyS10", &TTYS10_DEV); + uart_register("/dev/ttyS10", &TTYS10_DEV); #endif #ifdef TTYS11_DEV - (void)uart_register("/dev/ttyS11", &TTYS11_DEV); + uart_register("/dev/ttyS11", &TTYS11_DEV); #endif #ifdef TTYS12_DEV - (void)uart_register("/dev/ttyS12", &TTYS12_DEV); + uart_register("/dev/ttyS12", &TTYS12_DEV); #endif /* Register the console */ #ifdef HAVE_CONSOLE up_setup(&CONSOLE_DEV); - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif } diff --git a/arch/renesas/src/rx65n/rx65n_sigdeliver.c b/arch/renesas/src/rx65n/rx65n_sigdeliver.c index 85fded0a57..862f97bb2a 100644 --- a/arch/renesas/src/rx65n/rx65n_sigdeliver.c +++ b/arch/renesas/src/rx65n/rx65n_sigdeliver.c @@ -118,7 +118,7 @@ void up_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of diff --git a/arch/renesas/src/sh1/sh1_serial.c b/arch/renesas/src/sh1/sh1_serial.c index c46d98e9ed..a314af965b 100644 --- a/arch/renesas/src/sh1/sh1_serial.c +++ b/arch/renesas/src/sh1/sh1_serial.c @@ -509,12 +509,12 @@ static int up_attach(struct uart_dev_s *dev) /* Detach the ERI interrupt on failure */ - (void)irq_detach(priv->irq + SH1_ERI_IRQ_OFFSET); + irq_detach(priv->irq + SH1_ERI_IRQ_OFFSET); } /* Detach the RXI interrupt on failure */ - (void)irq_detach(priv->irq + SH1_RXI_IRQ_OFFSET); + irq_detach(priv->irq + SH1_RXI_IRQ_OFFSET); } return ret; @@ -540,9 +540,9 @@ static void up_detach(struct uart_dev_s *dev) /* Detach the SCI interrupts */ - (void)irq_detach(priv->irq + SH1_RXI_IRQ_OFFSET); - (void)irq_detach(priv->irq + SH1_ERI_IRQ_OFFSET); - (void)irq_detach(priv->irq + SH1_RXI_IRQ_OFFSET); + irq_detach(priv->irq + SH1_RXI_IRQ_OFFSET); + irq_detach(priv->irq + SH1_ERI_IRQ_OFFSET); + irq_detach(priv->irq + SH1_RXI_IRQ_OFFSET); #ifdef CONFIG_ARCH_IRQPRIO /* Set the interrupt priority to zero (masking all SCI interrupts). NOTE @@ -865,15 +865,15 @@ void up_consoleinit(void) /* Register the console */ #ifdef HAVE_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all SCIs */ #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #endif } diff --git a/arch/renesas/src/sh1/sh1_sigdeliver.c b/arch/renesas/src/sh1/sh1_sigdeliver.c index a17e2d661d..fdb6483b89 100644 --- a/arch/renesas/src/sh1/sh1_sigdeliver.c +++ b/arch/renesas/src/sh1/sh1_sigdeliver.c @@ -106,7 +106,7 @@ void up_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/risc-v/include/rv32im/syscall.h b/arch/risc-v/include/rv32im/syscall.h index 5269b21e87..9a3f80623b 100644 --- a/arch/risc-v/include/rv32im/syscall.h +++ b/arch/risc-v/include/rv32im/syscall.h @@ -86,7 +86,7 @@ #define SYS_restore_context (1) #define up_fullcontextrestore(restoreregs) \ - (void)sys_call1(SYS_restore_context, (uintptr_t)restoreregs) + sys_call1(SYS_restore_context, (uintptr_t)restoreregs) /* SYS call 2: * @@ -95,7 +95,7 @@ #define SYS_switch_context (2) #define up_switchcontext(saveregs, restoreregs) \ - (void)sys_call2(SYS_switch_context, (uintptr_t)saveregs, (uintptr_t)restoreregs) + sys_call2(SYS_switch_context, (uintptr_t)saveregs, (uintptr_t)restoreregs) #ifdef CONFIG_BUILD_KERNEL /* SYS call 3: diff --git a/arch/risc-v/src/common/up_exit.c b/arch/risc-v/src/common/up_exit.c index 2102b849e5..7a3875918b 100644 --- a/arch/risc-v/src/common/up_exit.c +++ b/arch/risc-v/src/common/up_exit.c @@ -149,7 +149,7 @@ void _exit(int status) * The IRQ state will be restored when the next task is started. */ - (void)enter_critical_section(); + enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); @@ -164,7 +164,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. @@ -179,7 +179,7 @@ void _exit(int status) * the ready-to-run list. */ - (void)group_addrenv(tcb); + group_addrenv(tcb); #endif /* Reset scheduler parameters */ diff --git a/arch/risc-v/src/common/up_initialize.c b/arch/risc-v/src/common/up_initialize.c index a1f1bbabb5..33b590c8f9 100644 --- a/arch/risc-v/src/common/up_initialize.c +++ b/arch/risc-v/src/common/up_initialize.c @@ -166,7 +166,7 @@ void up_initialize(void) #ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ - (void)ptmx_register(); + ptmx_register(); #endif /* Early initialization of the system logging device. Some SYSLOG channel diff --git a/arch/risc-v/src/gap8/gap8_uart.c b/arch/risc-v/src/gap8/gap8_uart.c index 6b91f22886..e7a985830d 100644 --- a/arch/risc-v/src/gap8/gap8_uart.c +++ b/arch/risc-v/src/gap8/gap8_uart.c @@ -623,10 +623,10 @@ void up_earlyserialinit(void) void up_serialinit(void) { #ifdef CONFIG_UART_SERIAL_CONSOLE - (void)uart_register("/dev/console", &g_uart0port); + uart_register("/dev/console", &g_uart0port); #endif - (void)uart_register("/dev/ttyS0", &g_uart0port); + uart_register("/dev/ttyS0", &g_uart0port); } /**************************************************************************** diff --git a/arch/risc-v/src/nr5m100/nr5_irq_dispatch.c b/arch/risc-v/src/nr5m100/nr5_irq_dispatch.c index 2178cfdb66..17bd74729b 100644 --- a/arch/risc-v/src/nr5m100/nr5_irq_dispatch.c +++ b/arch/risc-v/src/nr5m100/nr5_irq_dispatch.c @@ -129,7 +129,7 @@ uint32_t * irq_dispatch_all(uint32_t *regs, uint32_t irqmask) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/risc-v/src/nr5m100/nr5_serial.c b/arch/risc-v/src/nr5m100/nr5_serial.c index 4f39dddaaa..ddbab210b6 100644 --- a/arch/risc-v/src/nr5m100/nr5_serial.c +++ b/arch/risc-v/src/nr5m100/nr5_serial.c @@ -773,14 +773,14 @@ void up_serialinit(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif } diff --git a/arch/risc-v/src/nr5m100/nr5_timerisr.c b/arch/risc-v/src/nr5m100/nr5_timerisr.c index 7e55a28c2a..0a0529acc1 100644 --- a/arch/risc-v/src/nr5m100/nr5_timerisr.c +++ b/arch/risc-v/src/nr5m100/nr5_timerisr.c @@ -147,7 +147,7 @@ void riscv_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(NR5_IRQ_SYSTICK, nr5m100_timerisr, NULL); + irq_attach(NR5_IRQ_SYSTICK, nr5m100_timerisr, NULL); /* Configure and enable SysTick to interrupt at the requested rate */ diff --git a/arch/risc-v/src/rv32im/up_assert.c b/arch/risc-v/src/rv32im/up_assert.c index 6ed3b73d51..0542b6c0ac 100644 --- a/arch/risc-v/src/rv32im/up_assert.c +++ b/arch/risc-v/src/rv32im/up_assert.c @@ -295,13 +295,13 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ if (g_current_regs || running_task()->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (; ; ) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -367,7 +367,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", @@ -386,12 +386,12 @@ void up_assert(const uint8_t *filename, int lineno) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); diff --git a/arch/risc-v/src/rv32im/up_blocktask.c b/arch/risc-v/src/rv32im/up_blocktask.c index 09e7cd7151..b8285e680b 100644 --- a/arch/risc-v/src/rv32im/up_blocktask.c +++ b/arch/risc-v/src/rv32im/up_blocktask.c @@ -159,7 +159,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Reset scheduler parameters */ diff --git a/arch/risc-v/src/rv32im/up_doirq.c b/arch/risc-v/src/rv32im/up_doirq.c index 70966d12f9..eb090c21d3 100644 --- a/arch/risc-v/src/rv32im/up_doirq.c +++ b/arch/risc-v/src/rv32im/up_doirq.c @@ -120,7 +120,7 @@ uint32_t *up_doirq(int irq, uint32_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/risc-v/src/rv32im/up_releasepending.c b/arch/risc-v/src/rv32im/up_releasepending.c index e3fa22d47e..814b1f3bda 100644 --- a/arch/risc-v/src/rv32im/up_releasepending.c +++ b/arch/risc-v/src/rv32im/up_releasepending.c @@ -128,7 +128,7 @@ void up_release_pending(void) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/risc-v/src/rv32im/up_reprioritizertr.c b/arch/risc-v/src/rv32im/up_reprioritizertr.c index f525ab4791..984855562e 100644 --- a/arch/risc-v/src/rv32im/up_reprioritizertr.c +++ b/arch/risc-v/src/rv32im/up_reprioritizertr.c @@ -182,7 +182,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/risc-v/src/rv32im/up_sigdeliver.c b/arch/risc-v/src/rv32im/up_sigdeliver.c index 24d63d6ee8..5423d428f8 100644 --- a/arch/risc-v/src/rv32im/up_sigdeliver.c +++ b/arch/risc-v/src/rv32im/up_sigdeliver.c @@ -113,7 +113,7 @@ void up_sigdeliver(void) sinfo("Resuming EPC: %08x INT_CTX: %08x\n", regs[REG_EPC], regs[REG_INT_CTX]); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/risc-v/src/rv32im/up_unblocktask.c b/arch/risc-v/src/rv32im/up_unblocktask.c index db56cd504d..ecb24f9df7 100644 --- a/arch/risc-v/src/rv32im/up_unblocktask.c +++ b/arch/risc-v/src/rv32im/up_unblocktask.c @@ -143,7 +143,7 @@ void up_unblock_task(struct tcb_s *tcb) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(nexttcb); + group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/sim/src/sim/up_critmon.c b/arch/sim/src/sim/up_critmon.c index 4937b873a8..abaa275eb4 100644 --- a/arch/sim/src/sim/up_critmon.c +++ b/arch/sim/src/sim/up_critmon.c @@ -87,7 +87,7 @@ uint32_t up_critmon_gettime(void) uint32_t up_critmon_gettime(void) { struct timespec ts; - (void)clock_gettime(CLOCK_MONOTONIC, &ts); + clock_gettime(CLOCK_MONOTONIC, &ts); return (uint32_t)ts.tv_nsec; } #endif diff --git a/arch/sim/src/sim/up_devconsole.c b/arch/sim/src/sim/up_devconsole.c index bd12f51a43..75c16c6837 100644 --- a/arch/sim/src/sim/up_devconsole.c +++ b/arch/sim/src/sim/up_devconsole.c @@ -163,7 +163,7 @@ static int devconsole_poll(FAR struct file *filep, FAR struct pollfd *fds, void up_devconsole(void) { - (void)register_driver("/dev/console", &devconsole_fops, 0666, NULL); + register_driver("/dev/console", &devconsole_fops, 0666, NULL); } /**************************************************************************** diff --git a/arch/sim/src/sim/up_deviceimage.c b/arch/sim/src/sim/up_deviceimage.c index 579a5d59b4..58a565f3fb 100644 --- a/arch/sim/src/sim/up_deviceimage.c +++ b/arch/sim/src/sim/up_deviceimage.c @@ -262,7 +262,7 @@ char *up_deviceimage(void) case Z_STREAM_ERROR: serr("ERROR: inflate FAILED: ret=%d msg=\"%s\"\n", ret, strm.msg ? strm.msg : "No message"); - (void)inflateEnd(&strm); + inflateEnd(&strm); kmm_free(pbuffer); return NULL; } @@ -310,7 +310,7 @@ char *up_deviceimage(void) } while (strm.avail_out == 0 && ret != Z_STREAM_END); - (void)inflateEnd(&strm); + inflateEnd(&strm); return pbuffer; } diff --git a/arch/sim/src/sim/up_exit.c b/arch/sim/src/sim/up_exit.c index e699d18c96..d9d36832c2 100644 --- a/arch/sim/src/sim/up_exit.c +++ b/arch/sim/src/sim/up_exit.c @@ -75,7 +75,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. diff --git a/arch/sim/src/sim/up_idle.c b/arch/sim/src/sim/up_idle.c index b55cf30b32..6e3ab02c69 100644 --- a/arch/sim/src/sim/up_idle.c +++ b/arch/sim/src/sim/up_idle.c @@ -176,7 +176,7 @@ void up_idle(void) * correct rate. */ - (void)up_hostusleep(1000000 / CLK_TCK); + up_hostusleep(1000000 / CLK_TCK); /* Handle X11-related events */ diff --git a/arch/sim/src/sim/up_initialize.c b/arch/sim/src/sim/up_initialize.c index 45d9b4a421..124cc39ecb 100644 --- a/arch/sim/src/sim/up_initialize.c +++ b/arch/sim/src/sim/up_initialize.c @@ -246,7 +246,7 @@ void up_initialize(void) #ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ - (void)ptmx_register(); + ptmx_register(); #endif /* Early initialization of the system logging device. Some SYSLOG channel @@ -277,19 +277,19 @@ void up_initialize(void) #ifdef CONFIG_NETDEV_LOOPBACK /* Initialize the local loopback device */ - (void)localhost_initialize(); + localhost_initialize(); #endif #ifdef CONFIG_NET_TUN /* Initialize the TUN device */ - (void)tun_initialize(); + tun_initialize(); #endif #ifdef CONFIG_NETDEV_TELNET /* Initialize the Telnet session factory */ - (void)telnet_initialize(); + telnet_initialize(); #endif #if defined(CONFIG_FS_SMARTFS) && (defined(CONFIG_SIM_SPIFLASH) || defined(CONFIG_SIM_QSPIFLASH)) diff --git a/arch/sim/src/sim/up_ioexpander.c b/arch/sim/src/sim/up_ioexpander.c index 4339bf21b1..138403845d 100644 --- a/arch/sim/src/sim/up_ioexpander.c +++ b/arch/sim/src/sim/up_ioexpander.c @@ -757,8 +757,8 @@ static void sim_interrupt_work(void *arg) { /* Yes.. perform the callback */ - (void)priv->cb[i].cbfunc(&priv->dev, match, - priv->cb[i].cbarg); + priv->cb[i].cbfunc(&priv->dev, match, + priv->cb[i].cbarg); } } } diff --git a/arch/sim/src/sim/up_netdev.c b/arch/sim/src/sim/up_netdev.c index ae868d2449..2df0d9abae 100644 --- a/arch/sim/src/sim/up_netdev.c +++ b/arch/sim/src/sim/up_netdev.c @@ -55,6 +55,6 @@ unsigned long up_getwalltime(void) { struct timeval tm; - (void)gettimeofday(&tm, NULL); + gettimeofday(&tm, NULL); return tm.tv_sec*1000 + tm.tv_usec/1000; } diff --git a/arch/sim/src/sim/up_netdriver.c b/arch/sim/src/sim/up_netdriver.c index 263e458e20..10e2ebe6b5 100644 --- a/arch/sim/src/sim/up_netdriver.c +++ b/arch/sim/src/sim/up_netdriver.c @@ -170,7 +170,7 @@ void netdriver_loop(void) /* Check for new frames. If so, then poll the network for new XMIT data */ net_lock(); - (void)devif_poll(&g_sim_dev, sim_txpoll); + devif_poll(&g_sim_dev, sim_txpoll); net_unlock(); /* netdev_read will return 0 on a timeout event and >0 on a data received event */ @@ -355,13 +355,13 @@ int netdriver_init(void) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&g_sim_dev, NET_LL_ETHERNET); + netdev_register(&g_sim_dev, NET_LL_ETHERNET); return OK; } int netdriver_setmacaddr(unsigned char *macaddr) { - (void)memcpy(g_sim_dev.d_mac.ether.ether_addr_octet, macaddr, IFHWADDRLEN); + memcpy(g_sim_dev.d_mac.ether.ether_addr_octet, macaddr, IFHWADDRLEN); return 0; } diff --git a/arch/sim/src/sim/up_simsmp.c b/arch/sim/src/sim/up_simsmp.c index 024394b277..1135ac91c3 100644 --- a/arch/sim/src/sim/up_simsmp.c +++ b/arch/sim/src/sim/up_simsmp.c @@ -203,7 +203,7 @@ static void *sim_idle_trampoline(void *arg) /* Let up_cpu_start() continue */ - (void)pthread_mutex_unlock(&cpuinfo->mutex); + pthread_mutex_unlock(&cpuinfo->mutex); /* Give control to the IDLE task via the nasty little sim_smp_hook(). * sim_smp_hook() is logically a part of this function but needs to be @@ -236,7 +236,7 @@ static void sim_handle_signal(int signo, siginfo_t *info, void *context) { int cpu = (int)((uintptr_t)pthread_getspecific(g_cpukey)); - (void)up_cpu_paused(cpu); + up_cpu_paused(cpu); } /**************************************************************************** @@ -329,7 +329,7 @@ void sim_cpu0_start(void) * wait just in case. */ - (void)pthread_join(g_sim_cputhread[0], &value); + pthread_join(g_sim_cputhread[0], &value); } } @@ -427,10 +427,10 @@ int up_cpu_start(int cpu) } errout_with_lock: - (void)pthread_mutex_unlock(&cpuinfo.mutex); + pthread_mutex_unlock(&cpuinfo.mutex); errout_with_mutex: - (void)pthread_mutex_destroy(&cpuinfo.mutex); + pthread_mutex_destroy(&cpuinfo.mutex); return ret; } diff --git a/arch/sim/src/sim/up_simuart.c b/arch/sim/src/sim/up_simuart.c index 0f58180ed1..ff4bd58b23 100644 --- a/arch/sim/src/sim/up_simuart.c +++ b/arch/sim/src/sim/up_simuart.c @@ -99,7 +99,7 @@ static void setrawmode(void) /* Get the current stdin terminal mode */ - (void)tcgetattr(0, &g_cooked); + tcgetattr(0, &g_cooked); /* Switch to raw mode */ @@ -111,7 +111,7 @@ static void setrawmode(void) raw.c_cflag &= ~(CSIZE | PARENB); raw.c_cflag |= CS8; - (void)tcsetattr(0, TCSANOW, &raw); + tcsetattr(0, TCSANOW, &raw); } /**************************************************************************** @@ -122,7 +122,7 @@ static void restoremode(void) { /* Restore the original terminal mode */ - (void)tcsetattr(0, TCSANOW, &g_cooked); + tcsetattr(0, TCSANOW, &g_cooked); } /**************************************************************************** @@ -232,7 +232,7 @@ void simuart_start(void) * checking. */ - (void)pthread_create(&tid, NULL, simuart_thread, NULL); + pthread_create(&tid, NULL, simuart_thread, NULL); } /**************************************************************************** diff --git a/arch/sim/src/sim/up_testset.c b/arch/sim/src/sim/up_testset.c index 9f3278c51c..ec185c1a20 100644 --- a/arch/sim/src/sim/up_testset.c +++ b/arch/sim/src/sim/up_testset.c @@ -94,7 +94,7 @@ spinlock_t up_testset(volatile spinlock_t *lock) * test and set is atomic. */ - (void)pthread_mutex_lock(&g_tsmutex); + pthread_mutex_lock(&g_tsmutex); #endif /* In the non-SMP case, the simulation is implemented with a single thread @@ -105,7 +105,7 @@ spinlock_t up_testset(volatile spinlock_t *lock) *lock = SP_LOCKED; #ifdef CONFIG_SMP - (void)pthread_mutex_unlock(&g_tsmutex); + pthread_mutex_unlock(&g_tsmutex); #endif return ret; } diff --git a/arch/sim/src/sim/up_touchscreen.c b/arch/sim/src/sim/up_touchscreen.c index adcce13899..bcfff4d7dc 100644 --- a/arch/sim/src/sim/up_touchscreen.c +++ b/arch/sim/src/sim/up_touchscreen.c @@ -303,11 +303,6 @@ static int up_waitsample(FAR struct up_dev_s *priv, if (ret < 0) { - /* If we are awakened by a signal, then we need to return - * the failure now. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } } @@ -395,9 +390,6 @@ static ssize_t up_read(FAR struct file *filep, FAR char *buffer, size_t len) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -493,9 +485,6 @@ static int up_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -536,9 +525,6 @@ static int up_poll(FAR struct file *filep, FAR struct pollfd *fds, ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -653,7 +639,7 @@ int sim_tsc_initialize(int minor) /* Register the device as an input device */ - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); iinfo("Registering %s\n", devname); ret = register_driver(devname, &up_fops, 0666, priv); @@ -699,17 +685,7 @@ void sim_tsc_uninitialize(void) /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Stop the event loop (Hmm.. the caller must be sure that there are no * open references to the touchscreen driver. This might better be @@ -720,7 +696,7 @@ void sim_tsc_uninitialize(void) /* Un-register the device */ - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->minor); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->minor); iinfo("Un-registering %s\n", devname); ret = unregister_driver(devname); diff --git a/arch/sim/src/sim/up_wpcap.c b/arch/sim/src/sim/up_wpcap.c index 4b12c2bf2d..5c754f45c3 100644 --- a/arch/sim/src/sim/up_wpcap.c +++ b/arch/sim/src/sim/up_wpcap.c @@ -233,7 +233,7 @@ static void set_ethaddr(struct in_addr addr) adapters->PhysicalAddress[2], adapters->PhysicalAddress[3], adapters->PhysicalAddress[4], adapters->PhysicalAddress[5]); - (void)netdriver_setmacaddr(adapters->PhysicalAddress); + netdriver_setmacaddr(adapters->PhysicalAddress); break; } } diff --git a/arch/sim/src/sim/up_x11framebuffer.c b/arch/sim/src/sim/up_x11framebuffer.c index 016d908c65..f3634accc3 100644 --- a/arch/sim/src/sim/up_x11framebuffer.c +++ b/arch/sim/src/sim/up_x11framebuffer.c @@ -135,13 +135,13 @@ static inline int up_x11createframe(void) /* Release queued events on the display */ #if defined(CONFIG_SIM_TOUCHSCREEN) || defined(CONFIG_SIM_AJOYSTICK) - (void)XAllowEvents(g_display, AsyncBoth, CurrentTime); + XAllowEvents(g_display, AsyncBoth, CurrentTime); /* Grab mouse button 1, enabling mouse-related events */ - (void)XGrabButton(g_display, Button1, AnyModifier, g_window, 1, - ButtonPressMask | ButtonReleaseMask | ButtonMotionMask, - GrabModeAsync, GrabModeAsync, None, None); + XGrabButton(g_display, Button1, AnyModifier, g_window, 1, + ButtonPressMask | ButtonReleaseMask | ButtonMotionMask, + GrabModeAsync, GrabModeAsync, None, None); #endif gcval.graphics_exposures = 0; diff --git a/arch/x86/src/common/up_assert.c b/arch/x86/src/common/up_assert.c index 4bcd3409b5..70db959223 100644 --- a/arch/x86/src/common/up_assert.c +++ b/arch/x86/src/common/up_assert.c @@ -235,7 +235,7 @@ static void up_dumpstate(void) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif } #else @@ -251,13 +251,13 @@ static void _up_assert(int errorcode) { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ if (g_current_regs || (running_task())->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (;;) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -298,7 +298,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", @@ -312,7 +312,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); diff --git a/arch/x86/src/common/up_blocktask.c b/arch/x86/src/common/up_blocktask.c index 24d918a3dc..7e360c9786 100644 --- a/arch/x86/src/common/up_blocktask.c +++ b/arch/x86/src/common/up_blocktask.c @@ -160,7 +160,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Reset scheduler parameters */ diff --git a/arch/x86/src/common/up_exit.c b/arch/x86/src/common/up_exit.c index 0aa1377915..80dd159897 100644 --- a/arch/x86/src/common/up_exit.c +++ b/arch/x86/src/common/up_exit.c @@ -147,7 +147,7 @@ void _exit(int status) * The IRQ state will be restored when the next task is started. */ - (void)enter_critical_section(); + enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); @@ -162,7 +162,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. @@ -177,7 +177,7 @@ void _exit(int status) * the ready-to-run list. */ - (void)group_addrenv(tcb); + group_addrenv(tcb); #endif /* Reset scheduler parameters */ diff --git a/arch/x86/src/common/up_initialize.c b/arch/x86/src/common/up_initialize.c index 1f45f3fb96..35498b64d5 100644 --- a/arch/x86/src/common/up_initialize.c +++ b/arch/x86/src/common/up_initialize.c @@ -183,7 +183,7 @@ void up_initialize(void) #ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ - (void)ptmx_register(); + ptmx_register(); #endif /* Early initialization of the system logging device. Some SYSLOG channel @@ -212,19 +212,19 @@ void up_initialize(void) #ifdef CONFIG_NETDEV_LOOPBACK /* Initialize the local loopback device */ - (void)localhost_initialize(); + localhost_initialize(); #endif #ifdef CONFIG_NET_TUN /* Initialize the TUN device */ - (void)tun_initialize(); + tun_initialize(); #endif #ifdef CONFIG_NETDEV_TELNET /* Initialize the Telnet session factory */ - (void)telnet_initialize(); + telnet_initialize(); #endif /* Initialize USB -- device and/or host */ diff --git a/arch/x86/src/common/up_releasepending.c b/arch/x86/src/common/up_releasepending.c index b0e8890db3..264e96549d 100644 --- a/arch/x86/src/common/up_releasepending.c +++ b/arch/x86/src/common/up_releasepending.c @@ -130,7 +130,7 @@ void up_release_pending(void) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/x86/src/common/up_reprioritizertr.c b/arch/x86/src/common/up_reprioritizertr.c index 92cd1f20bc..779dee7f87 100644 --- a/arch/x86/src/common/up_reprioritizertr.c +++ b/arch/x86/src/common/up_reprioritizertr.c @@ -183,7 +183,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/x86/src/common/up_unblocktask.c b/arch/x86/src/common/up_unblocktask.c index 61d22c241a..08be81d3b6 100644 --- a/arch/x86/src/common/up_unblocktask.c +++ b/arch/x86/src/common/up_unblocktask.c @@ -144,7 +144,7 @@ void up_unblock_task(struct tcb_s *tcb) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/x86/src/i486/up_sigdeliver.c b/arch/x86/src/i486/up_sigdeliver.c index 4a9b8e59ec..fb6ad54df3 100644 --- a/arch/x86/src/i486/up_sigdeliver.c +++ b/arch/x86/src/i486/up_sigdeliver.c @@ -106,7 +106,7 @@ void up_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/x86/src/qemu/qemu_handlers.c b/arch/x86/src/qemu/qemu_handlers.c index 610e4b2ee8..a9a8cfe88d 100644 --- a/arch/x86/src/qemu/qemu_handlers.c +++ b/arch/x86/src/qemu/qemu_handlers.c @@ -126,7 +126,7 @@ static uint32_t *common_handler(int irq, uint32_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/x86/src/qemu/qemu_keypad.c b/arch/x86/src/qemu/qemu_keypad.c index dc5286400a..0af9879d25 100644 --- a/arch/x86/src/qemu/qemu_keypad.c +++ b/arch/x86/src/qemu/qemu_keypad.c @@ -317,5 +317,5 @@ static ssize_t keypad_read(struct file *filep, FAR char *buf, size_t buflen) void qemu_keypad(void) { - (void)register_driver("/dev/keypad", &g_keypadops, 0444, NULL); + register_driver("/dev/keypad", &g_keypadops, 0444, NULL); } diff --git a/arch/x86/src/qemu/qemu_timerisr.c b/arch/x86/src/qemu/qemu_timerisr.c index 74de0ddfc0..aca0a2e082 100644 --- a/arch/x86/src/qemu/qemu_timerisr.c +++ b/arch/x86/src/qemu/qemu_timerisr.c @@ -123,7 +123,7 @@ void x86_timer_initialize(void) /* Attach to the timer interrupt handler */ - (void)irq_attach(IRQ0, (xcpt_t)qemu_timerisr, NULL); + irq_attach(IRQ0, (xcpt_t)qemu_timerisr, NULL); /* Send the command byte to configure counter 0 */ diff --git a/arch/x86/src/qemu/qemu_vga.c b/arch/x86/src/qemu/qemu_vga.c index f29b74abc4..903545e9fb 100644 --- a/arch/x86/src/qemu/qemu_vga.c +++ b/arch/x86/src/qemu/qemu_vga.c @@ -515,5 +515,5 @@ void qemu_vga(void) } memset(g_pscreen, g_bg_color, VGA_XRES * VGA_YRES); - (void)register_driver("/dev/lcd", &g_vgaops, 0666, NULL); + register_driver("/dev/lcd", &g_vgaops, 0666, NULL); } diff --git a/arch/xtensa/src/common/xtensa_assert.c b/arch/xtensa/src/common/xtensa_assert.c index 10086212a8..deb5742ee1 100644 --- a/arch/xtensa/src/common/xtensa_assert.c +++ b/arch/xtensa/src/common/xtensa_assert.c @@ -111,7 +111,7 @@ static void xtensa_assert(int errorcode) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif #ifdef CONFIG_BOARD_CRASHDUMP @@ -122,7 +122,7 @@ static void xtensa_assert(int errorcode) /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ @@ -130,7 +130,7 @@ static void xtensa_assert(int errorcode) { /* Blink the LEDs forever */ - (void)up_irq_save(); + up_irq_save(); for (; ; ) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -173,7 +173,7 @@ void up_assert(const uint8_t *filename, int lineno) /* Flush any buffered SYSLOG data (from prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", @@ -220,7 +220,7 @@ void xtensa_panic(int xptcode, uint32_t *regs) /* Flush any buffered SYSLOG data (from prior to the panic) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("Unhandled Exception %d task: %s\n", xptcode, rtcb->name); @@ -324,7 +324,7 @@ void xtensa_user(int exccause, uint32_t *regs) /* Flush any buffered SYSLOG data (from prior to the error) */ - (void)syslog_flush(); + syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 _alert("User Exception: EXCCAUSE=%04x task: %s\n", exccause, rtcb->name); diff --git a/arch/xtensa/src/common/xtensa_blocktask.c b/arch/xtensa/src/common/xtensa_blocktask.c index 5edfe674f4..c517c99714 100644 --- a/arch/xtensa/src/common/xtensa_blocktask.c +++ b/arch/xtensa/src/common/xtensa_blocktask.c @@ -176,7 +176,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Reset scheduler parameters */ diff --git a/arch/xtensa/src/common/xtensa_cpupause.c b/arch/xtensa/src/common/xtensa_cpupause.c index 370054d5c7..59de3ccbe5 100644 --- a/arch/xtensa/src/common/xtensa_cpupause.c +++ b/arch/xtensa/src/common/xtensa_cpupause.c @@ -190,7 +190,7 @@ int up_cpu_paused(int cpu) void xtensa_pause_handler(void) { - (void)up_cpu_paused(up_cpu_index()); + up_cpu_paused(up_cpu_index()); } /**************************************************************************** diff --git a/arch/xtensa/src/common/xtensa_exit.c b/arch/xtensa/src/common/xtensa_exit.c index 50ababe408..d743ed62bf 100644 --- a/arch/xtensa/src/common/xtensa_exit.c +++ b/arch/xtensa/src/common/xtensa_exit.c @@ -148,7 +148,7 @@ void _exit(int status) * The IRQ state will be restored when the next task is started. */ - (void)enter_critical_section(); + enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); @@ -169,7 +169,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. @@ -190,7 +190,7 @@ void _exit(int status) * the ready-to-run list. */ - (void)group_addrenv(tcb); + group_addrenv(tcb); #endif /* Reset scheduler parameters */ diff --git a/arch/xtensa/src/common/xtensa_initialize.c b/arch/xtensa/src/common/xtensa_initialize.c index a0b56ef4e3..75fd8b7ba6 100644 --- a/arch/xtensa/src/common/xtensa_initialize.c +++ b/arch/xtensa/src/common/xtensa_initialize.c @@ -191,7 +191,7 @@ void up_initialize(void) #ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ - (void)ptmx_register(); + ptmx_register(); #endif /* Early initialization of the system logging device. Some SYSLOG channel @@ -220,19 +220,19 @@ void up_initialize(void) #ifdef CONFIG_NETDEV_LOOPBACK /* Initialize the local loopback device */ - (void)localhost_initialize(); + localhost_initialize(); #endif #ifdef CONFIG_NET_TUN /* Initialize the TUN device */ - (void)tun_initialize(); + tun_initialize(); #endif #ifdef CONFIG_NETDEV_TELNET /* Initialize the Telnet session factory */ - (void)telnet_initialize(); + telnet_initialize(); #endif /* Initialize USB -- device and/or host */ diff --git a/arch/xtensa/src/common/xtensa_irqdispatch.c b/arch/xtensa/src/common/xtensa_irqdispatch.c index 813846e76e..169ae2c6ec 100644 --- a/arch/xtensa/src/common/xtensa_irqdispatch.c +++ b/arch/xtensa/src/common/xtensa_irqdispatch.c @@ -127,7 +127,7 @@ uint32_t *xtensa_irq_dispatch(int irq, uint32_t *regs) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); #endif } #endif diff --git a/arch/xtensa/src/common/xtensa_releasepending.c b/arch/xtensa/src/common/xtensa_releasepending.c index cae473243f..55c0fbd68a 100644 --- a/arch/xtensa/src/common/xtensa_releasepending.c +++ b/arch/xtensa/src/common/xtensa_releasepending.c @@ -145,7 +145,7 @@ void up_release_pending(void) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/xtensa/src/common/xtensa_reprioritizertr.c b/arch/xtensa/src/common/xtensa_reprioritizertr.c index a531c71448..18a2f4c9c1 100644 --- a/arch/xtensa/src/common/xtensa_reprioritizertr.c +++ b/arch/xtensa/src/common/xtensa_reprioritizertr.c @@ -198,7 +198,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/xtensa/src/common/xtensa_sigdeliver.c b/arch/xtensa/src/common/xtensa_sigdeliver.c index 415fec00e7..0f78a5ad5a 100644 --- a/arch/xtensa/src/common/xtensa_sigdeliver.c +++ b/arch/xtensa/src/common/xtensa_sigdeliver.c @@ -147,9 +147,9 @@ void xtensa_sig_deliver(void) */ #ifdef CONFIG_SMP - (void)enter_critical_section(); + enter_critical_section(); #else - (void)up_irq_save(); + up_irq_save(); #endif /* Restore the saved errno value */ @@ -182,7 +182,7 @@ void xtensa_sig_deliver(void) DEBUGASSERT(rtcb->irqcount == 1); while (rtcb->irqcount < saved_irqcount) { - (void)enter_critical_section(); + enter_critical_section(); } #endif diff --git a/arch/xtensa/src/common/xtensa_unblocktask.c b/arch/xtensa/src/common/xtensa_unblocktask.c index 2b9f44c7cb..08cbec989f 100644 --- a/arch/xtensa/src/common/xtensa_unblocktask.c +++ b/arch/xtensa/src/common/xtensa_unblocktask.c @@ -161,7 +161,7 @@ void up_unblock_task(struct tcb_s *tcb) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/xtensa/src/esp32/esp32_cpuint.c b/arch/xtensa/src/esp32/esp32_cpuint.c index fa2a7ee31d..6065a2af96 100644 --- a/arch/xtensa/src/esp32/esp32_cpuint.c +++ b/arch/xtensa/src/esp32/esp32_cpuint.c @@ -406,9 +406,9 @@ void up_disable_irq(int cpuint) #ifdef CONFIG_SMP cpu = up_cpu_index(); - (void)xtensa_disable_cpuint(&g_intenable[cpu], (1ul << cpuint)); + xtensa_disable_cpuint(&g_intenable[cpu], (1ul << cpuint)); #else - (void)xtensa_disable_cpuint(&g_intenable[0], (1ul << cpuint)); + xtensa_disable_cpuint(&g_intenable[0], (1ul << cpuint)); #endif } @@ -430,9 +430,9 @@ void up_enable_irq(int cpuint) #ifdef CONFIG_SMP cpu = up_cpu_index(); - (void)xtensa_enable_cpuint(&g_intenable[cpu], (1ul << cpuint)); + xtensa_enable_cpuint(&g_intenable[cpu], (1ul << cpuint)); #else - (void)xtensa_enable_cpuint(&g_intenable[0], (1ul << cpuint)); + xtensa_enable_cpuint(&g_intenable[0], (1ul << cpuint)); #endif } diff --git a/arch/xtensa/src/esp32/esp32_cpustart.c b/arch/xtensa/src/esp32/esp32_cpustart.c index cb233d29b8..9cb64394fc 100644 --- a/arch/xtensa/src/esp32/esp32_cpustart.c +++ b/arch/xtensa/src/esp32/esp32_cpustart.c @@ -115,7 +115,7 @@ static inline void xtensa_attach_fromcpu0_interrupt(void) /* Attach the inter-CPU interrupt. */ - (void)irq_attach(ESP32_IRQ_CPU_CPU0, (xcpt_t)esp32_fromcpu0_interrupt, NULL); + irq_attach(ESP32_IRQ_CPU_CPU0, (xcpt_t)esp32_fromcpu0_interrupt, NULL); /* Enable the inter 0 CPU interrupts. */ @@ -202,7 +202,7 @@ void xtensa_appcpu_start(void) /* Initialize CPU interrupts */ - (void)esp32_cpuint_initialize(); + esp32_cpuint_initialize(); /* Attach and emable internal interrupts */ diff --git a/arch/xtensa/src/esp32/esp32_irq.c b/arch/xtensa/src/esp32/esp32_irq.c index c5a43a3d55..d56a3a0dab 100644 --- a/arch/xtensa/src/esp32/esp32_irq.c +++ b/arch/xtensa/src/esp32/esp32_irq.c @@ -119,7 +119,7 @@ static inline void xtensa_attach_fromcpu1_interrupt(void) /* Attach the inter-CPU interrupt. */ - (void)irq_attach(ESP32_IRQ_CPU_CPU1, (xcpt_t)esp32_fromcpu1_interrupt, NULL); + irq_attach(ESP32_IRQ_CPU_CPU1, (xcpt_t)esp32_fromcpu1_interrupt, NULL); /* Enable the inter 0 CPU interrupt. */ @@ -139,7 +139,7 @@ void xtensa_irq_initialize(void) { /* Initialize CPU interrupts */ - (void)esp32_cpuint_initialize(); + esp32_cpuint_initialize(); #if defined(CONFIG_STACK_COLORATION) && defined(HAVE_INTERRUPTSTACK) /* Colorize the interrupt stack for debug purposes */ diff --git a/arch/xtensa/src/esp32/esp32_serial.c b/arch/xtensa/src/esp32/esp32_serial.c index 4c27dee8ee..64c5640dcc 100644 --- a/arch/xtensa/src/esp32/esp32_serial.c +++ b/arch/xtensa/src/esp32/esp32_serial.c @@ -1226,17 +1226,17 @@ void xtensa_serial_initialize(void) /* Register the console */ #ifdef HAVE_SERIAL_CONSOLE - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif /* Register all UARTs */ - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif } diff --git a/arch/xtensa/src/esp32/esp32_timerisr.c b/arch/xtensa/src/esp32/esp32_timerisr.c index 2fb82a84d2..e094c91dab 100644 --- a/arch/xtensa/src/esp32/esp32_timerisr.c +++ b/arch/xtensa/src/esp32/esp32_timerisr.c @@ -192,7 +192,7 @@ void xtensa_timer_initialize(void) /* Attach the timer interrupt */ - (void)irq_attach(XTENSA_IRQ_TIMER0, (xcpt_t)esp32_timerisr, NULL); + irq_attach(XTENSA_IRQ_TIMER0, (xcpt_t)esp32_timerisr, NULL); /* Enable the timer 0 CPU interrupt. */ diff --git a/arch/z16/src/common/up_assert.c b/arch/z16/src/common/up_assert.c index ee2aaa26a1..beeeb4caf9 100644 --- a/arch/z16/src/common/up_assert.c +++ b/arch/z16/src/common/up_assert.c @@ -83,13 +83,13 @@ static void _up_assert(int errorcode) /* noreturn_function */ { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ if (up_interrupt_context() || running_task()->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (;;) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -159,7 +159,7 @@ void up_assert(void) /* Flush any buffered SYSLOG data (from prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_HAVE_FILENAME #if CONFIG_TASK_NAME_SIZE > 0 @@ -183,12 +183,12 @@ void up_assert(void) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(up_getsp(), running_task(), filename, lineno); diff --git a/arch/z16/src/common/up_exit.c b/arch/z16/src/common/up_exit.c index 3fe1e4f392..26f81c6ba4 100644 --- a/arch/z16/src/common/up_exit.c +++ b/arch/z16/src/common/up_exit.c @@ -147,7 +147,7 @@ void _exit(int status) * The IRQ state will be restored when the next task is started. */ - (void)enter_critical_section(); + enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); @@ -162,7 +162,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. diff --git a/arch/z16/src/common/up_initialize.c b/arch/z16/src/common/up_initialize.c index 9184138f58..0e4e0ba67d 100644 --- a/arch/z16/src/common/up_initialize.c +++ b/arch/z16/src/common/up_initialize.c @@ -183,7 +183,7 @@ void up_initialize(void) #ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ - (void)ptmx_register(); + ptmx_register(); #endif /* Early initialization of the system logging device. Some SYSLOG channel @@ -212,19 +212,19 @@ void up_initialize(void) #ifdef CONFIG_NETDEV_LOOPBACK /* Initialize the local loopback device */ - (void)localhost_initialize(); + localhost_initialize(); #endif #ifdef CONFIG_NET_TUN /* Initialize the TUN device */ - (void)tun_initialize(); + tun_initialize(); #endif #ifdef CONFIG_NETDEV_TELNET /* Initialize the Telnet session factory */ - (void)telnet_initialize(); + telnet_initialize(); #endif board_autoled_on(LED_IRQSENABLED); diff --git a/arch/z16/src/common/up_sigdeliver.c b/arch/z16/src/common/up_sigdeliver.c index 8ef03ea431..c65415603e 100644 --- a/arch/z16/src/common/up_sigdeliver.c +++ b/arch/z16/src/common/up_sigdeliver.c @@ -107,7 +107,7 @@ void up_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/z16/src/z16f/z16f_espi.c b/arch/z16/src/z16f/z16f_espi.c index 2a590d9613..a04d9fe65e 100644 --- a/arch/z16/src/z16f/z16f_espi.c +++ b/arch/z16/src/z16f/z16f_espi.c @@ -340,7 +340,7 @@ static void spi_flush(FAR struct z16f_spi_s *priv) while ((spi_getreg8(priv, Z16F_ESPI_STAT) & Z16F_ESPI_STAT_RDRF) != 0) { - (void)spi_getreg8(priv, Z16F_ESPI_DATA); + spi_getreg8(priv, Z16F_ESPI_DATA); } } @@ -373,24 +373,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) spiinfo("lock=%d\n", lock); if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -847,7 +834,7 @@ FAR struct spi_dev_s *z16_spibus_initialize(int port) * the BRG for 400KHz operation. */ - (void)spi_setfrequency(&priv->spi, 400000); + spi_setfrequency(&priv->spi, 400000); spi_setmode(&priv->spi, SPIDEV_MODE0); spi_setbits(&priv->spi, 8); diff --git a/arch/z16/src/z16f/z16f_serial.c b/arch/z16/src/z16f/z16f_serial.c index f2f3e6d3ef..5210f7276b 100644 --- a/arch/z16/src/z16f/z16f_serial.c +++ b/arch/z16/src/z16f/z16f_serial.c @@ -400,7 +400,7 @@ static int z16f_setup(struct uart_dev_s *dev) static void z16f_shutdown(struct uart_dev_s *dev) { - (void)z16f_disableuartirq(dev); + z16f_disableuartirq(dev); } /**************************************************************************** @@ -734,11 +734,11 @@ void up_earlyserialinit(void) /* Disable UART interrupts */ #ifdef TTYS0_DEV - (void)z16f_disableuartirq(&TTYS0_DEV); + z16f_disableuartirq(&TTYS0_DEV); #endif #ifdef TTYS1_DEV - (void)z16f_disableuartirq(&TTYS1_DEV); + z16f_disableuartirq(&TTYS1_DEV); #endif /* Configuration any serial console */ @@ -761,13 +761,13 @@ void up_earlyserialinit(void) void up_serialinit(void) { #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #endif #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif } diff --git a/arch/z80/src/common/up_assert.c b/arch/z80/src/common/up_assert.c index 152d688224..273d1867d2 100644 --- a/arch/z80/src/common/up_assert.c +++ b/arch/z80/src/common/up_assert.c @@ -82,13 +82,13 @@ static void _up_assert(int errorcode) /* noreturn_function */ { /* Flush any buffered SYSLOG data */ - (void)syslog_flush(); + syslog_flush(); /* Are we in an interrupt handler or the idle task? */ if (up_interrupt_context() || running_task()->flink == NULL) { - (void)up_irq_save(); + up_irq_save(); for (;;) { #if CONFIG_BOARD_RESET_ON_ASSERT >= 1 @@ -158,7 +158,7 @@ void up_assert(void) /* Flush any buffered SYSLOG data (from prior to the assertion) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_HAVE_FILENAME #if CONFIG_TASK_NAME_SIZE > 0 @@ -182,12 +182,12 @@ void up_assert(void) #ifdef CONFIG_ARCH_USBDUMP /* Dump USB trace data */ - (void)usbtrace_enumerate(assert_tracecallback, NULL); + usbtrace_enumerate(assert_tracecallback, NULL); #endif /* Flush any buffered SYSLOG data (from the above) */ - (void)syslog_flush(); + syslog_flush(); #ifdef CONFIG_BOARD_CRASHDUMP board_crashdump(Z80_getsp(), running_task(), filename, lineno); diff --git a/arch/z80/src/common/up_blocktask.c b/arch/z80/src/common/up_blocktask.c index 90bf5b3d3f..6747034f7e 100644 --- a/arch/z80/src/common/up_blocktask.c +++ b/arch/z80/src/common/up_blocktask.c @@ -165,7 +165,7 @@ void up_block_task(FAR struct tcb_s *tcb, tstate_t task_state) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Reset scheduler parameters */ diff --git a/arch/z80/src/common/up_exit.c b/arch/z80/src/common/up_exit.c index dd240f61b3..d56291bf40 100644 --- a/arch/z80/src/common/up_exit.c +++ b/arch/z80/src/common/up_exit.c @@ -149,7 +149,7 @@ void _exit(int status) * The IRQ state will be restored when the next task is started. */ - (void)enter_critical_section(); + enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); @@ -164,7 +164,7 @@ void _exit(int status) /* Destroy the task at the head of the ready to run list. */ - (void)nxtask_exit(); + nxtask_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. @@ -180,7 +180,7 @@ void _exit(int status) * the ready-to-run list. */ - (void)group_addrenv(tcb); + group_addrenv(tcb); #endif /* Reset scheduler parameters */ diff --git a/arch/z80/src/common/up_initialize.c b/arch/z80/src/common/up_initialize.c index a1e829f660..4d42fa221a 100644 --- a/arch/z80/src/common/up_initialize.c +++ b/arch/z80/src/common/up_initialize.c @@ -127,7 +127,7 @@ void up_initialize(void) */ #ifdef CONFIG_ARCH_ADDRENV - (void)z80_mmu_initialize(); + z80_mmu_initialize(); #endif #ifdef CONFIG_MM_IOB @@ -188,7 +188,7 @@ void up_initialize(void) #ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ - (void)ptmx_register(); + ptmx_register(); #endif /* Early initialization of the system logging device. Some SYSLOG channel @@ -217,19 +217,19 @@ void up_initialize(void) #ifdef CONFIG_NETDEV_LOOPBACK /* Initialize the local loopback device */ - (void)localhost_initialize(); + localhost_initialize(); #endif #ifdef CONFIG_NET_TUN /* Initialize the TUN device */ - (void)tun_initialize(); + tun_initialize(); #endif #ifdef CONFIG_NETDEV_TELNET /* Initialize the Telnet session factory */ - (void)telnet_initialize(); + telnet_initialize(); #endif board_autoled_on(LED_IRQSENABLED); diff --git a/arch/z80/src/common/up_releasepending.c b/arch/z80/src/common/up_releasepending.c index 9902d5418c..f32f8b86ea 100644 --- a/arch/z80/src/common/up_releasepending.c +++ b/arch/z80/src/common/up_releasepending.c @@ -134,7 +134,7 @@ void up_release_pending(void) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/z80/src/common/up_reprioritizertr.c b/arch/z80/src/common/up_reprioritizertr.c index 1a5561f313..6c35389314 100644 --- a/arch/z80/src/common/up_reprioritizertr.c +++ b/arch/z80/src/common/up_reprioritizertr.c @@ -187,7 +187,7 @@ void up_reprioritize_rtr(FAR struct tcb_s *tcb, uint8_t priority) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/z80/src/common/up_unblocktask.c b/arch/z80/src/common/up_unblocktask.c index 029d17787a..259dd80d64 100644 --- a/arch/z80/src/common/up_unblocktask.c +++ b/arch/z80/src/common/up_unblocktask.c @@ -151,7 +151,7 @@ void up_unblock_task(FAR struct tcb_s *tcb) * thread at the head of the ready-to-run list. */ - (void)group_addrenv(rtcb); + group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/z80/src/common/z80_doirq.c b/arch/z80/src/common/z80_doirq.c index 86122f142d..5b53e3e421 100644 --- a/arch/z80/src/common/z80_doirq.c +++ b/arch/z80/src/common/z80_doirq.c @@ -99,7 +99,7 @@ FAR chipreg_t *z80_doirq(uint8_t irq, FAR chipreg_t *regs) * ready-to-run list. */ - (void)group_addrenv(NULL); + group_addrenv(NULL); } regs = newregs; diff --git a/arch/z80/src/ez80/ez80_emac.c b/arch/z80/src/ez80/ez80_emac.c index 8bb32ab5d5..ca6ad6f0a5 100644 --- a/arch/z80/src/ez80/ez80_emac.c +++ b/arch/z80/src/ez80/ez80_emac.c @@ -1100,8 +1100,8 @@ static int ez80emac_transmit(struct ez80emac_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, EMAC_TXTIMEOUT, - ez80emac_txtimeout_expiry, 1, (uint32_t)priv); + wd_start(priv->txtimeout, EMAC_TXTIMEOUT, + ez80emac_txtimeout_expiry, 1, (uint32_t)priv); return OK; } @@ -1679,7 +1679,7 @@ static void ez80emac_rxinterrupt_work(FAR void *arg) /* Process any RX packets pending the RX buffer */ - (void)ez80emac_receive(priv); + ez80emac_receive(priv); net_unlock(); /* Re-enable Ethernet Rx interrupts */ @@ -1884,7 +1884,7 @@ static void ez80emac_txtimeout_work(FAR void *arg) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->dev, ez80emac_txpoll); + devif_poll(&priv->dev, ez80emac_txpoll); net_unlock(); } @@ -1947,11 +1947,11 @@ static void ez80emac_poll_work(FAR void *arg) /* Poll the network for new XMIT data */ net_lock(); - (void)devif_timer(&priv->dev, EMAC_WDDELAY, ez80emac_txpoll); + devif_timer(&priv->dev, EMAC_WDDELAY, ez80emac_txpoll); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, EMAC_WDDELAY, ez80emac_poll_expiry, 1, priv); + wd_start(priv->txpoll, EMAC_WDDELAY, ez80emac_poll_expiry, 1, priv); net_unlock(); } @@ -1993,8 +1993,8 @@ static void ez80emac_poll_expiry(int argc, wdparm_t arg, ...) * cycle. */ - (void)wd_start(priv->txpoll, EMAC_WDDELAY, ez80emac_poll_expiry, - 1, arg); + wd_start(priv->txpoll, EMAC_WDDELAY, ez80emac_poll_expiry, + 1, arg); } } @@ -2081,8 +2081,8 @@ static int ez80emac_ifup(FAR struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, EMAC_WDDELAY, ez80emac_poll_expiry, - 1, (uint32_t)priv); + wd_start(priv->txpoll, EMAC_WDDELAY, ez80emac_poll_expiry, + 1, (uint32_t)priv); /* Enable the Ethernet interrupts */ @@ -2175,7 +2175,7 @@ static void ez80emac_txavail_work(FAR void *arg) /* If so, then poll the network for new XMIT data */ - (void)devif_poll(&priv->dev, ez80emac_txpoll); + devif_poll(&priv->dev, ez80emac_txpoll); } net_unlock(); @@ -2575,7 +2575,7 @@ int up_netinitialize(void) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->dev, NET_LL_ETHERNET); + netdev_register(&priv->dev, NET_LL_ETHERNET); return OK; errout: diff --git a/arch/z80/src/ez80/ez80_i2c.c b/arch/z80/src/ez80/ez80_i2c.c index b70ef73780..b5ef5adb07 100644 --- a/arch/z80/src/ez80/ez80_i2c.c +++ b/arch/z80/src/ez80/ez80_i2c.c @@ -140,21 +140,7 @@ const struct i2c_ops_s g_ops = static void ez80_i2c_semtake(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_i2csem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_i2csem); } #define ez80_i2c_semgive() nxsem_post(&g_i2csem) diff --git a/arch/z80/src/ez80/ez80_rtc.c b/arch/z80/src/ez80/ez80_rtc.c index b10ad21c7f..40d1564f3e 100644 --- a/arch/z80/src/ez80/ez80_rtc.c +++ b/arch/z80/src/ez80/ez80_rtc.c @@ -603,7 +603,7 @@ int up_rtc_settime(FAR const struct timespec *tp) * seconds) */ - (void)gmtime_r(&tp->tv_sec, &newtime); + gmtime_r(&tp->tv_sec, &newtime); return ez80_rtc_setdatetime(&newtime); } diff --git a/arch/z80/src/ez80/ez80_rtc_lowerhalf.c b/arch/z80/src/ez80/ez80_rtc_lowerhalf.c index 2c8150e059..60bf900792 100644 --- a/arch/z80/src/ez80/ez80_rtc_lowerhalf.c +++ b/arch/z80/src/ez80/ez80_rtc_lowerhalf.c @@ -455,7 +455,7 @@ static int ez80_setrelative(FAR struct rtc_lowerhalf_s *lower, /* And convert the time back to broken out format */ - (void)gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); + gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); /* The set the alarm using this absolute time */ diff --git a/arch/z80/src/ez80/ez80_serial.c b/arch/z80/src/ez80/ez80_serial.c index c3800d3a9a..6f37011adc 100644 --- a/arch/z80/src/ez80/ez80_serial.c +++ b/arch/z80/src/ez80/ez80_serial.c @@ -714,11 +714,11 @@ void z80_serial_initialize(void) /* Register console and tty devices */ #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif } diff --git a/arch/z80/src/ez80/ez80_sigdeliver.c b/arch/z80/src/ez80/ez80_sigdeliver.c index 4b17b4bf85..dea8ddb630 100644 --- a/arch/z80/src/ez80/ez80_sigdeliver.c +++ b/arch/z80/src/ez80/ez80_sigdeliver.c @@ -108,7 +108,7 @@ void z80_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/z80/src/ez80/ez80_spi.c b/arch/z80/src/ez80/ez80_spi.c index 749b0a44d1..1f64e1e37d 100644 --- a/arch/z80/src/ez80/ez80_spi.c +++ b/arch/z80/src/ez80/ez80_spi.c @@ -177,24 +177,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&g_exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR || ret == -ECANCELED); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&g_exclsem); } else { - (void)nxsem_post(&g_exclsem); - ret = OK; + ret = nxsem_post(&g_exclsem); } return ret; diff --git a/arch/z80/src/ez80/ez80_timerisr.c b/arch/z80/src/ez80/ez80_timerisr.c index 977c3d46b5..235697c461 100644 --- a/arch/z80/src/ez80/ez80_timerisr.c +++ b/arch/z80/src/ez80/ez80_timerisr.c @@ -67,11 +67,11 @@ static int ez80_timerisr(int irq, chipreg_t *regs, void *arg) /* Read the appropriate timer0 register to clear the interrupt */ #ifdef _EZ80F91 - (void)inp(EZ80_TMR0_IIR); + inp(EZ80_TMR0_IIR); #else /* _EZ80190, _EZ80L92, _EZ80F92, _EZ80F93 */ - (void)inp(EZ80_TMR0_CTL); + inp(EZ80_TMR0_CTL); #endif /* Process timer interrupt */ @@ -138,9 +138,9 @@ void z80_timer_initialize(void) /* Clear any pending timer interrupts */ #if defined(_EZ80F91) - (void)inp(EZ80_TMR0_IIR); + inp(EZ80_TMR0_IIR); #elif defined(_EZ80L92) || defined(_EZ80F92) ||defined(_EZ80F93) - (void)inp(EZ80_TMR0_CTL); + inp(EZ80_TMR0_CTL); #endif /* Configure and enable the timer */ diff --git a/arch/z80/src/z180/z180_scc.c b/arch/z80/src/z180/z180_scc.c index fc6e3b968f..2e2e6426c1 100644 --- a/arch/z80/src/z180/z180_scc.c +++ b/arch/z80/src/z180/z180_scc.c @@ -601,11 +601,11 @@ void z80_serial_initialize(void) /* Register console and tty devices */ #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif } diff --git a/arch/z80/src/z180/z180_sigdeliver.c b/arch/z80/src/z180/z180_sigdeliver.c index 8330f7f7cf..678d8c6e33 100644 --- a/arch/z80/src/z180/z180_sigdeliver.c +++ b/arch/z80/src/z180/z180_sigdeliver.c @@ -104,7 +104,7 @@ void z80_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/z80/src/z180/z180_timerisr.c b/arch/z80/src/z180/z180_timerisr.c index f6d4236562..1b65840fcc 100644 --- a/arch/z80/src/z180/z180_timerisr.c +++ b/arch/z80/src/z180/z180_timerisr.c @@ -91,9 +91,9 @@ static int z180_timerisr(int irq, chipreg_t *regs, void *arg) * the higher or lower byte of TMDR0 is read." */ - (void)inp(Z180_PRT_TCR); - (void)inp(Z180_PRT0_DRL); - (void)inp(Z180_PRT0_DRH); + inp(Z180_PRT_TCR); + inp(Z180_PRT0_DRL); + inp(Z180_PRT0_DRH); /* Process timer interrupt */ @@ -142,7 +142,7 @@ void z80_timer_initialize(void) /* Attach the timer interrupt vector */ - (void)irq_attach(Z180_PRT0, (xcpt_t)z180_timerisr, NULL); + irq_attach(Z180_PRT0, (xcpt_t)z180_timerisr, NULL); /* And enable the timer interrupt */ diff --git a/arch/z80/src/z8/z8_i2c.c b/arch/z80/src/z8/z8_i2c.c index d17cc92704..883e717775 100644 --- a/arch/z80/src/z8/z8_i2c.c +++ b/arch/z80/src/z8/z8_i2c.c @@ -140,21 +140,7 @@ const struct i2c_ops_s g_ops = static void z8_i2c_semtake(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_i2csem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_i2csem); } #define z8_i2c_semgive() nxsem_post(&g_i2csem) diff --git a/arch/z80/src/z8/z8_serial.c b/arch/z80/src/z8/z8_serial.c index c83ef22e4d..4bf7ed7f9d 100644 --- a/arch/z80/src/z8/z8_serial.c +++ b/arch/z80/src/z8/z8_serial.c @@ -424,7 +424,7 @@ static int z8_setup(FAR struct uart_dev_s *dev) static void z8_shutdown(FAR struct uart_dev_s *dev) { - (void)z8_disableuartirq(dev); + z8_disableuartirq(dev); } /**************************************************************************** @@ -712,8 +712,8 @@ void z80_serial_initialize(void) { /* Disable all UART interrupts */ - (void)z8_disableuartirq(&TTYS0_DEV); - (void)z8_disableuartirq(&TTYS1_DEV); + z8_disableuartirq(&TTYS0_DEV); + z8_disableuartirq(&TTYS1_DEV); /* Initialize the console for early use */ CONSOLE_DEV.isconsole = true; @@ -721,9 +721,9 @@ void z80_serial_initialize(void) /* Reigster console and tty devices */ - (void)uart_register("/dev/console", &CONSOLE_DEV); - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); } /**************************************************************************** diff --git a/arch/z80/src/z8/z8_sigdeliver.c b/arch/z80/src/z8/z8_sigdeliver.c index bf81707887..9e40e2c394 100644 --- a/arch/z80/src/z8/z8_sigdeliver.c +++ b/arch/z80/src/z8/z8_sigdeliver.c @@ -124,7 +124,7 @@ void z80_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/arch/z80/src/z80/z80_sigdeliver.c b/arch/z80/src/z80/z80_sigdeliver.c index bc787a0e88..3be2b5388b 100644 --- a/arch/z80/src/z80/z80_sigdeliver.c +++ b/arch/z80/src/z80/z80_sigdeliver.c @@ -105,7 +105,7 @@ void z80_sigdeliver(void) */ sinfo("Resuming\n"); - (void)up_irq_save(); + up_irq_save(); rtcb->pterrno = saved_errno; /* Modify the saved return state with the actual saved values in the diff --git a/audio/audio.c b/audio/audio.c index 6c1f018979..31e98d1c98 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -717,8 +717,8 @@ static inline void audio_dequeuebuffer(FAR struct audio_upperhalf_s *upper, msg.session = session; #endif apb->flags |= AUDIO_APB_DEQUEUED; - (void)nxmq_send(upper->usermq, (FAR const char *)&msg, sizeof(msg), - CONFIG_AUDIO_BUFFER_DEQUEUE_PRIO); + nxmq_send(upper->usermq, (FAR const char *)&msg, sizeof(msg), + CONFIG_AUDIO_BUFFER_DEQUEUE_PRIO); } } @@ -755,8 +755,8 @@ static inline void audio_complete(FAR struct audio_upperhalf_s *upper, #ifdef CONFIG_AUDIO_MULTI_SESSION msg.session = session; #endif - (void)nxmq_send(upper->usermq, (FAR const char *)&msg, sizeof(msg), - CONFIG_AUDIO_BUFFER_DEQUEUE_PRIO); + nxmq_send(upper->usermq, (FAR const char *)&msg, sizeof(msg), + CONFIG_AUDIO_BUFFER_DEQUEUE_PRIO); } } @@ -788,8 +788,8 @@ static inline void audio_message(FAR struct audio_upperhalf_s *upper, #ifdef CONFIG_AUDIO_MULTI_SESSION msg.session = session; #endif - (void)nxmq_send(upper->usermq, (FAR const char *)msg, sizeof(*msg), - CONFIG_AUDIO_BUFFER_DEQUEUE_PRIO); + nxmq_send(upper->usermq, (FAR const char *)msg, sizeof(*msg), + CONFIG_AUDIO_BUFFER_DEQUEUE_PRIO); } } diff --git a/binfmt/binfmt_exec.c b/binfmt/binfmt_exec.c index b150ead72d..8171d9463b 100644 --- a/binfmt/binfmt_exec.c +++ b/binfmt/binfmt_exec.c @@ -204,7 +204,7 @@ int exec(FAR const char *filename, FAR char * const *argv, errout_with_lock: sched_unlock(); - (void)unload_module(bin); + unload_module(bin); errout_with_argv: binfmt_freeargv(bin); errout_with_bin: diff --git a/binfmt/binfmt_execmodule.c b/binfmt/binfmt_execmodule.c index 2db8bf70cf..b091b20a98 100644 --- a/binfmt/binfmt_execmodule.c +++ b/binfmt/binfmt_execmodule.c @@ -296,7 +296,7 @@ errout_with_tcbinit: errout_with_addrenv: #if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_BUILD_KERNEL) - (void)up_addrenv_restore(&oldenv); + up_addrenv_restore(&oldenv); errout_with_tcb: #endif diff --git a/binfmt/builtin.c b/binfmt/builtin.c index f32145736f..c238dc4212 100644 --- a/binfmt/builtin.c +++ b/binfmt/builtin.c @@ -188,7 +188,7 @@ int builtin_initialize(void) void builtin_uninitialize(void) { - (void)unregister_binfmt(&g_builtin_binfmt); + unregister_binfmt(&g_builtin_binfmt); } #endif /* HAVE_BUILTIN_CONTEXT */ diff --git a/binfmt/elf.c b/binfmt/elf.c index 7aab94f57f..d9145db32e 100644 --- a/binfmt/elf.c +++ b/binfmt/elf.c @@ -354,7 +354,7 @@ int elf_initialize(void) void elf_uninitialize(void) { - (void)unregister_binfmt(&g_elfbinfmt); + unregister_binfmt(&g_elfbinfmt); } #endif /* CONFIG_ELF */ diff --git a/binfmt/libelf/libelf_bind.c b/binfmt/libelf/libelf_bind.c index 25685c0124..bd16c496c0 100644 --- a/binfmt/libelf/libelf_bind.c +++ b/binfmt/libelf/libelf_bind.c @@ -432,7 +432,7 @@ int elf_bind(FAR struct elf_loadinfo_s *loadinfo, */ #if 0 /* REVISIT... has some problems */ - (void)up_addrenv_coherent(&loadinfo->addrenv); + up_addrenv_coherent(&loadinfo->addrenv); #else up_coherent_dcache(loadinfo->textalloc, loadinfo->textsize); up_coherent_dcache(loadinfo->dataalloc, loadinfo->datasize); diff --git a/binfmt/libelf/libelf_load.c b/binfmt/libelf/libelf_load.c index 7b4dbae0ba..3bfe9c2e81 100644 --- a/binfmt/libelf/libelf_load.c +++ b/binfmt/libelf/libelf_load.c @@ -368,7 +368,7 @@ int elf_load(FAR struct elf_loadinfo_s *loadinfo) errout_with_addrenv: #ifdef CONFIG_ARCH_ADDRENV - (void)elf_addrenv_restore(loadinfo); + elf_addrenv_restore(loadinfo); #endif errout_with_buffers: diff --git a/binfmt/libnxflat/libnxflat_addrenv.c b/binfmt/libnxflat/libnxflat_addrenv.c index 9ca8add7cc..8f1ce530ed 100644 --- a/binfmt/libnxflat/libnxflat_addrenv.c +++ b/binfmt/libnxflat/libnxflat_addrenv.c @@ -169,7 +169,7 @@ int nxflat_addrenv_alloc(FAR struct nxflat_loadinfo_s *loadinfo, size_t envsize) return OK; errout_with_addrenv: - (void)up_addrenv_destroy(&loadinfo->addrenv); + up_addrenv_destroy(&loadinfo->addrenv); loadinfo->addrenv = 0; errout_with_dspace: diff --git a/binfmt/libnxflat/libnxflat_bind.c b/binfmt/libnxflat/libnxflat_bind.c index 71c3b8d57d..536ea9be56 100644 --- a/binfmt/libnxflat/libnxflat_bind.c +++ b/binfmt/libnxflat/libnxflat_bind.c @@ -475,7 +475,7 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo, { berr("Exported symbol \"%s\" not found\n", symname); #ifdef CONFIG_ARCH_ADDRENV - (void)nxflat_addrenv_restore(loadinfo); + nxflat_addrenv_restore(loadinfo); #endif return -ENOENT; } diff --git a/binfmt/libnxflat/libnxflat_load.c b/binfmt/libnxflat/libnxflat_load.c index c849daf7de..44ec2c7ae7 100644 --- a/binfmt/libnxflat/libnxflat_load.c +++ b/binfmt/libnxflat/libnxflat_load.c @@ -215,9 +215,9 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo) errout: #ifdef CONFIG_ARCH_ADDRENV - (void)nxflat_addrenv_restore(loadinfo); + nxflat_addrenv_restore(loadinfo); #endif - (void)nxflat_unload(loadinfo); + nxflat_unload(loadinfo); return ret; } diff --git a/binfmt/nxflat.c b/binfmt/nxflat.c index 3e54e5fc9b..5227a2ff23 100644 --- a/binfmt/nxflat.c +++ b/binfmt/nxflat.c @@ -315,7 +315,7 @@ int nxflat_initialize(void) void nxflat_uninitialize(void) { - (void)unregister_binfmt(&g_nxflatbinfmt); + unregister_binfmt(&g_nxflatbinfmt); } #endif /* CONFIG_NXFLAT */ diff --git a/boards/arm/a1x/pcduino-a10/src/a1x_buttons.c b/boards/arm/a1x/pcduino-a10/src/a1x_buttons.c index 333dff41a2..103e106794 100644 --- a/boards/arm/a1x/pcduino-a10/src/a1x_buttons.c +++ b/boards/arm/a1x/pcduino-a10/src/a1x_buttons.c @@ -122,7 +122,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Configure the interrupt */ a1x_pioirq(xxx); - (void)irq_attach(xxx, irqhandler, arg); + irq_attach(xxx, irqhandler, arg); a1x_pioirqenable(xxx); leave_critical_section(flags); diff --git a/boards/arm/am335x/beaglebone-black/src/am335x_buttons.c b/boards/arm/am335x/beaglebone-black/src/am335x_buttons.c index 6e8556e325..0d3c1b3c0b 100644 --- a/boards/arm/am335x/beaglebone-black/src/am335x_buttons.c +++ b/boards/arm/am335x/beaglebone-black/src/am335x_buttons.c @@ -122,7 +122,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Configure the interrupt */ am335x_gpioirq(xxx); - (void)irq_attach(xxx, irqhandler, arg); + irq_attach(xxx, irqhandler, arg); am335x_gpioirq_enable(xxx); leave_critical_section(flags); diff --git a/boards/arm/cxd56xx/common/src/cxd56_crashdump.c b/boards/arm/cxd56xx/common/src/cxd56_crashdump.c index b8409921e1..ca179bd6ce 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_crashdump.c +++ b/boards/arm/cxd56xx/common/src/cxd56_crashdump.c @@ -119,7 +119,7 @@ void board_crashdump(uintptr_t currentsp, FAR void *tcb, FAR struct tcb_s *rtcb; fullcontext_t *pdump; - (void)enter_critical_section(); + enter_critical_section(); rtcb = (FAR struct tcb_s *)tcb; #ifdef CONFIG_CXD56_BACKUPLOG diff --git a/boards/arm/cxd56xx/common/src/cxd56_gs2200m.c b/boards/arm/cxd56xx/common/src/cxd56_gs2200m.c index 691c2d6464..d2ed30eb69 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_gs2200m.c +++ b/boards/arm/cxd56xx/common/src/cxd56_gs2200m.c @@ -91,10 +91,10 @@ static volatile uint32_t _n_called; static int gs2200m_irq_attach(xcpt_t handler, FAR void *arg) { - (void)cxd56_gpioint_config(PIN_UART2_CTS, - GPIOINT_LEVEL_HIGH, - handler, - arg); + cxd56_gpioint_config(PIN_UART2_CTS, + GPIOINT_LEVEL_HIGH, + handler, + arg); return 0; } @@ -231,8 +231,8 @@ int board_gs2200m_initialize(FAR const char *devpath, int bus) /* Change UART2 to GPIO */ CXD56_PIN_CONFIGS(PINCONFS_UART2_GPIO); - (void)cxd56_gpio_config(PIN_UART2_CTS, true); - (void)cxd56_gpio_config(PIN_UART2_RTS, false); + cxd56_gpio_config(PIN_UART2_CTS, true); + cxd56_gpio_config(PIN_UART2_RTS, false); /* Initialize spi deivce */ diff --git a/boards/arm/cxd56xx/common/src/cxd56_ili9340.c b/boards/arm/cxd56xx/common/src/cxd56_ili9340.c index 8120ffab52..9a0e4e9e7f 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_ili9340.c +++ b/boards/arm/cxd56xx/common/src/cxd56_ili9340.c @@ -205,7 +205,7 @@ static int cxd56_ili93404ws_sendcmd(FAR struct ili9340_lcd_s *lcd, */ cxd56_gpio_write(DISPLAY_DC, false); /* Indicate CMD */ - (void) SPI_SEND(priv->spi, cmd); + SPI_SEND(priv->spi, cmd); cxd56_gpio_write(DISPLAY_DC, true); /* Indicate DATA */ return OK; @@ -232,7 +232,7 @@ static int cxd56_ili93404ws_sendparam(FAR struct ili9340_lcd_s *lcd, FAR struct ili93404ws_lcd_s *priv = (FAR struct ili93404ws_lcd_s *)lcd; cxd56_gpio_write(DISPLAY_DC, true); /* Indicate DATA */ - (void) SPI_SEND(priv->spi, param); + SPI_SEND(priv->spi, param); return OK; } @@ -261,7 +261,7 @@ static int cxd56_ili93404ws_sendgram(FAR struct ili9340_lcd_s *lcd, lcdinfo("lcd:%p, wd=%p, nwords=%d\n", lcd, wd, nwords); SPI_SETBITS(priv->spi, 16); - (void) SPI_SNDBLOCK(priv->spi, wd, nwords); + SPI_SNDBLOCK(priv->spi, wd, nwords); return OK; } @@ -359,8 +359,8 @@ int board_lcd_initialize(void) SPI_SETMODE(priv->spi, SPIDEV_MODE3); SPI_SETBITS(priv->spi, 8); - (void)SPI_HWFEATURES(priv->spi, 0); - (void)SPI_SETFREQUENCY(priv->spi, ILI9340_SPI_MAXFREQUENCY); + SPI_HWFEATURES(priv->spi, 0); + SPI_SETFREQUENCY(priv->spi, ILI9340_SPI_MAXFREQUENCY); /* Initialize ILI9340 driver with necessary methods */ diff --git a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c index 94b95f0743..80b358f93c 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c +++ b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c @@ -227,19 +227,12 @@ static char g_gcmdbuf[256] __attribute__ ((aligned(16))); static int ip_semtake(sem_t * id) { - while (sem_wait(id) != 0) - { - if (errno == EINTR) - { - return -EINTR; - } - } - return OK; + return nxsem_wait_uninterruptible(id); } static void ip_semgive(sem_t * id) { - sem_post(id); + nxsem_post(id); } static int intr_handler_ROT(int irq, FAR void *context, FAR void *arg) @@ -383,21 +376,21 @@ static void *set_halt_cmd(void *cmdbuf) void imageproc_initialize(void) { - sem_init (&g_rotexc, 0, 1); - sem_init (&g_rotwait, 0, 0); - sem_init (&g_geexc, 0, 1); - sem_setprotocol (&g_rotwait, SEM_PRIO_NONE); + nxsem_init(&g_rotexc, 0, 1); + nxsem_init(&g_rotwait, 0, 0); + nxsem_init(&g_geexc, 0, 1); + nxsem_setprotocol(&g_rotwait, SEM_PRIO_NONE); - cxd56_ge2dinitialize (GEDEVNAME); + cxd56_ge2dinitialize(GEDEVNAME); - g_gfd = open (GEDEVNAME, O_RDWR); + g_gfd = open(GEDEVNAME, O_RDWR); - putreg32 (1, ROT_INTR_CLEAR); - putreg32 (0, ROT_INTR_ENABLE); - putreg32 (1, ROT_INTR_DISABLE); + putreg32(1, ROT_INTR_CLEAR); + putreg32(0, ROT_INTR_ENABLE); + putreg32(1, ROT_INTR_DISABLE); - irq_attach (CXD56_IRQ_ROT, intr_handler_ROT, NULL); - up_enable_irq (CXD56_IRQ_ROT); + irq_attach(CXD56_IRQ_ROT, intr_handler_ROT, NULL); + up_enable_irq(CXD56_IRQ_ROT); } void imageproc_finalize(void) @@ -413,9 +406,9 @@ void imageproc_finalize(void) cxd56_ge2duninitialize(GEDEVNAME); - sem_destroy(&g_rotwait); - sem_destroy(&g_rotexc); - sem_destroy(&g_geexc); + nxsem_destroy(&g_rotwait); + nxsem_destroy(&g_rotexc); + nxsem_destroy(&g_geexc); } void imageproc_convert_yuv2rgb(uint8_t * ibuf, uint32_t hsize, uint32_t vsize) @@ -512,7 +505,7 @@ int imageproc_resize(uint8_t * ibuf, uint16_t ihsize, ret = ip_semtake(&g_geexc); if (ret) { - return ret; /* -EINTR */ + return ret; } /* Create descriptor to graphics engine */ @@ -613,7 +606,7 @@ int imageproc_clip_and_resize(uint8_t * ibuf, uint16_t ihsize, ret = ip_semtake(&g_geexc); if (ret) { - return ret; /* -EINTR */ + return ret; } /* Create descriptor to graphics engine */ diff --git a/boards/arm/cxd56xx/common/src/cxd56_lpm013m091a.c b/boards/arm/cxd56xx/common/src/cxd56_lpm013m091a.c index 78e70ac7f1..9a6baa86f9 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_lpm013m091a.c +++ b/boards/arm/cxd56xx/common/src/cxd56_lpm013m091a.c @@ -205,7 +205,7 @@ static int cxd56_lpm013m091a4ws_sendcmd(FAR struct lpm013m091a_lcd_s *lcd, */ cxd56_gpio_write(DISPLAY_DC, false); /* Indicate CMD */ - (void) SPI_SEND(priv->spi, cmd); + SPI_SEND(priv->spi, cmd); cxd56_gpio_write(DISPLAY_DC, true); /* Indicate DATA */ return OK; @@ -232,7 +232,7 @@ static int cxd56_lpm013m091a4ws_sendparam(FAR struct lpm013m091a_lcd_s *lcd, FAR struct lpm013m091a_lcd_s *priv = (FAR struct lpm013m091a_lcd_s *)lcd; cxd56_gpio_write(DISPLAY_DC, true); /* Indicate DATA */ - (void) SPI_SEND(priv->spi, param); + SPI_SEND(priv->spi, param); return OK; } @@ -261,7 +261,7 @@ static int cxd56_lpm013m091a4ws_sendgram(FAR struct lpm013m091a_lcd_s *lcd, lcdinfo("lcd:%p, wd=%p, nwords=%d\n", lcd, wd, nwords); SPI_SETBITS(priv->spi, 16); - (void) SPI_SNDBLOCK(priv->spi, wd, nwords); + SPI_SNDBLOCK(priv->spi, wd, nwords); return OK; } @@ -359,8 +359,8 @@ int board_lcd_initialize(void) SPI_SETMODE(priv->spi, SPIDEV_MODE3); SPI_SETBITS(priv->spi, 8); - (void)SPI_HWFEATURES(priv->spi, 0); - (void)SPI_SETFREQUENCY(priv->spi, LPM013M091A_SPI_MAXFREQUENCY); + SPI_HWFEATURES(priv->spi, 0); + SPI_SETFREQUENCY(priv->spi, LPM013M091A_SPI_MAXFREQUENCY); /* Initialize LPM013M091A driver with necessary methods */ diff --git a/boards/arm/cxd56xx/drivers/sensors/ak09912_scu.c b/boards/arm/cxd56xx/drivers/sensors/ak09912_scu.c index 5dcaa6b8a9..c446834fc4 100644 --- a/boards/arm/cxd56xx/drivers/sensors/ak09912_scu.c +++ b/boards/arm/cxd56xx/drivers/sensors/ak09912_scu.c @@ -391,7 +391,7 @@ static int ak09912_close(FAR struct file *filep) g_refcnt--; - (void) seq_ioctl(priv->seq, priv->id, SCUIOC_STOP, 0); + seq_ioctl(priv->seq, priv->id, SCUIOC_STOP, 0); if (g_refcnt == 0) { @@ -405,7 +405,7 @@ static int ak09912_close(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->id, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->id, SCUIOC_FREEFIFO, 0); } return OK; @@ -567,7 +567,7 @@ int ak09912_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_ak09912fops, 0666, priv); if (ret < 0) { diff --git a/boards/arm/cxd56xx/drivers/sensors/apds9930_scu.c b/boards/arm/cxd56xx/drivers/sensors/apds9930_scu.c index a8cbea5aeb..815ed0f68e 100644 --- a/boards/arm/cxd56xx/drivers/sensors/apds9930_scu.c +++ b/boards/arm/cxd56xx/drivers/sensors/apds9930_scu.c @@ -632,7 +632,7 @@ static int apds9930_close_als(FAR struct file *filep) g_als_refcnt--; - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); if (g_als_refcnt == 0) { @@ -643,7 +643,7 @@ static int apds9930_close_als(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); } return OK; @@ -665,7 +665,7 @@ static int apds9930_close_ps(FAR struct file *filep) g_ps_refcnt--; - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); if (g_ps_refcnt == 0) { @@ -679,7 +679,7 @@ static int apds9930_close_ps(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); } #endif @@ -975,7 +975,7 @@ int apds9930als_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_apds9930alsfops, 0666, priv); if (ret < 0) { @@ -1029,7 +1029,7 @@ int apds9930ps_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_apds9930psfops, 0666, priv); if (ret < 0) { diff --git a/boards/arm/cxd56xx/drivers/sensors/bh1721fvc_scu.c b/boards/arm/cxd56xx/drivers/sensors/bh1721fvc_scu.c index 5df8453927..3e8da2368a 100644 --- a/boards/arm/cxd56xx/drivers/sensors/bh1721fvc_scu.c +++ b/boards/arm/cxd56xx/drivers/sensors/bh1721fvc_scu.c @@ -236,7 +236,7 @@ static int bh1721fvc_close(FAR struct file *filep) g_refcnt--; - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); if (g_refcnt == 0) { @@ -247,7 +247,7 @@ static int bh1721fvc_close(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); } return OK; @@ -380,7 +380,7 @@ int bh1721fvc_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_bh1721fvcfops, 0666, priv); if (ret < 0) { diff --git a/boards/arm/cxd56xx/drivers/sensors/bh1745nuc_scu.c b/boards/arm/cxd56xx/drivers/sensors/bh1745nuc_scu.c index 24d8659348..845a7036c1 100644 --- a/boards/arm/cxd56xx/drivers/sensors/bh1745nuc_scu.c +++ b/boards/arm/cxd56xx/drivers/sensors/bh1745nuc_scu.c @@ -351,7 +351,7 @@ static int bh1745nuc_close(FAR struct file *filep) g_refcnt--; - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); if (g_refcnt == 0) { @@ -366,7 +366,7 @@ static int bh1745nuc_close(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); } return OK; @@ -517,7 +517,7 @@ int bh1745nuc_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_bh1745nucfops, 0666, priv); if (ret < 0) { diff --git a/boards/arm/cxd56xx/drivers/sensors/bm1383glv_scu.c b/boards/arm/cxd56xx/drivers/sensors/bm1383glv_scu.c index 298143ca05..5f65875b0a 100644 --- a/boards/arm/cxd56xx/drivers/sensors/bm1383glv_scu.c +++ b/boards/arm/cxd56xx/drivers/sensors/bm1383glv_scu.c @@ -380,7 +380,7 @@ static int bm1383glv_close(FAR struct file *filep) g_refcnt--; - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); if (g_refcnt == 0) { @@ -401,7 +401,7 @@ static int bm1383glv_close(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); } return OK; @@ -552,7 +552,7 @@ int bm1383glv_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_bm1383glvfops, 0666, priv); if (ret < 0) { diff --git a/boards/arm/cxd56xx/drivers/sensors/bm1422gmv_scu.c b/boards/arm/cxd56xx/drivers/sensors/bm1422gmv_scu.c index 4bb2373e2e..3dfa327ae0 100644 --- a/boards/arm/cxd56xx/drivers/sensors/bm1422gmv_scu.c +++ b/boards/arm/cxd56xx/drivers/sensors/bm1422gmv_scu.c @@ -373,7 +373,7 @@ static int bm1422gmv_close(FAR struct file *filep) g_refcnt--; - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); if (g_refcnt == 0) { @@ -388,7 +388,7 @@ static int bm1422gmv_close(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); } return OK; @@ -539,7 +539,7 @@ int bm1422gmv_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_bm1422gmvfops, 0666, priv); if (ret < 0) { diff --git a/boards/arm/cxd56xx/drivers/sensors/bmi160_scu.c b/boards/arm/cxd56xx/drivers/sensors/bmi160_scu.c index 867ecb7632..b6d5b8da14 100644 --- a/boards/arm/cxd56xx/drivers/sensors/bmi160_scu.c +++ b/boards/arm/cxd56xx/drivers/sensors/bmi160_scu.c @@ -636,7 +636,7 @@ static int bmi160_close_gyro(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->fifoid, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->fifoid, SCUIOC_FREEFIFO, 0); } return OK; @@ -664,7 +664,7 @@ static int bmi160_close_accel(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->fifoid, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->fifoid, SCUIOC_FREEFIFO, 0); } return OK; @@ -814,7 +814,7 @@ static int bmi160_devregister(FAR const char *devpath, FAR struct spi_dev_s *dev priv->fifoid = minor; #endif - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, fops, 0666, priv); if (ret < 0) { @@ -994,8 +994,8 @@ int bmi160_init(FAR struct spi_dev_s *dev) SPI_SETMODE(dev, SPIDEV_MODE3); SPI_SETBITS(dev, 8); - (void)SPI_HWFEATURES(dev, 0); - (void)SPI_SETFREQUENCY(dev, BMI160_SPI_MAXFREQUENCY); + SPI_HWFEATURES(dev, 0); + SPI_SETFREQUENCY(dev, BMI160_SPI_MAXFREQUENCY); /* BMI160 detects communication bus is SPI by rising edge of CS. */ diff --git a/boards/arm/cxd56xx/drivers/sensors/bmp280_scu.c b/boards/arm/cxd56xx/drivers/sensors/bmp280_scu.c index 1e5327ebc6..90b195ec32 100644 --- a/boards/arm/cxd56xx/drivers/sensors/bmp280_scu.c +++ b/boards/arm/cxd56xx/drivers/sensors/bmp280_scu.c @@ -658,7 +658,7 @@ static int bmp280_close_press(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->id, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->id, SCUIOC_FREEFIFO, 0); } g_refcnt_press--; @@ -695,7 +695,7 @@ static int bmp280_close_temp(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->id, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->id, SCUIOC_FREEFIFO, 0); } g_refcnt_temp--; @@ -934,7 +934,7 @@ int bmp280press_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_bmp280pressfops, 0666, priv); if (ret < 0) { @@ -985,7 +985,7 @@ int bmp280temp_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_bmp280tempfops, 0666, priv); if (ret < 0) { diff --git a/boards/arm/cxd56xx/drivers/sensors/kx022_scu.c b/boards/arm/cxd56xx/drivers/sensors/kx022_scu.c index 8a51c61aa5..87367df48e 100644 --- a/boards/arm/cxd56xx/drivers/sensors/kx022_scu.c +++ b/boards/arm/cxd56xx/drivers/sensors/kx022_scu.c @@ -349,7 +349,7 @@ static int kx022_close(FAR struct file *filep) g_refcnt--; - (void) seq_ioctl(priv->seq, priv->fifoid, SCUIOC_STOP, 0); + seq_ioctl(priv->seq, priv->fifoid, SCUIOC_STOP, 0); if (g_refcnt == 0) { @@ -365,7 +365,7 @@ static int kx022_close(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->fifoid, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->fifoid, SCUIOC_FREEFIFO, 0); } return OK; @@ -520,7 +520,7 @@ int kx022_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_kx022fops, 0666, priv); if (ret < 0) { diff --git a/boards/arm/cxd56xx/drivers/sensors/lt1pa01_scu.c b/boards/arm/cxd56xx/drivers/sensors/lt1pa01_scu.c index eb889c0081..34767809d6 100644 --- a/boards/arm/cxd56xx/drivers/sensors/lt1pa01_scu.c +++ b/boards/arm/cxd56xx/drivers/sensors/lt1pa01_scu.c @@ -497,7 +497,7 @@ static int lt1pa01_close_als(FAR struct file *filep) g_als_refcnt--; - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); if (g_als_refcnt == 0) { @@ -513,7 +513,7 @@ static int lt1pa01_close_als(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); } return OK; @@ -535,7 +535,7 @@ static int lt1pa01_close_prox(FAR struct file *filep) g_prox_refcnt--; - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); if (g_prox_refcnt == 0) { @@ -548,7 +548,7 @@ static int lt1pa01_close_prox(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); } #endif @@ -823,7 +823,7 @@ int lt1pa01als_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_lt1pa01alsfops, 0666, priv); if (ret < 0) { @@ -877,7 +877,7 @@ int lt1pa01prox_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_lt1pa01proxfops, 0666, priv); if (ret < 0) { diff --git a/boards/arm/cxd56xx/drivers/sensors/rpr0521rs_scu.c b/boards/arm/cxd56xx/drivers/sensors/rpr0521rs_scu.c index cd54a684de..a6b2c3ef90 100644 --- a/boards/arm/cxd56xx/drivers/sensors/rpr0521rs_scu.c +++ b/boards/arm/cxd56xx/drivers/sensors/rpr0521rs_scu.c @@ -583,7 +583,7 @@ static int rpr0521rs_close_als(FAR struct file *filep) g_als_refcnt--; - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); if (g_als_refcnt == 0) { @@ -594,7 +594,7 @@ static int rpr0521rs_close_als(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); } return OK; @@ -616,7 +616,7 @@ static int rpr0521rs_close_ps(FAR struct file *filep) g_ps_refcnt--; - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0); if (g_ps_refcnt == 0) { @@ -630,7 +630,7 @@ static int rpr0521rs_close_ps(FAR struct file *filep) } else { - (void) seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); + seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0); } #endif @@ -919,7 +919,7 @@ int rpr0521rsals_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_rpr0521rsalsfops, 0666, priv); if (ret < 0) { @@ -973,7 +973,7 @@ int rpr0521rsps_register(FAR const char *devpath, int minor, /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, minor); + snprintf(path, sizeof(path), "%s%d", devpath, minor); ret = register_driver(path, &g_rpr0521rspsfops, 0666, priv); if (ret < 0) { diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_power.c b/boards/arm/cxd56xx/spresense/src/cxd56_power.c index 7db199b30c..a706bc6058 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_power.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_power.c @@ -325,7 +325,7 @@ int board_xtal_power_control(bool en) /* Get exclusive access to the lna / tcxo power control */ - sem_wait(&g_ltsem); + nxsem_wait(&g_ltsem); if (en) { @@ -351,7 +351,7 @@ int board_xtal_power_control(bool en) g_used_tcxo = false; } - sem_post(&g_ltsem); + nxsem_post(&g_ltsem); return ret; } @@ -383,7 +383,7 @@ int board_lna_power_control(bool en) /* Get exclusive access to the lna / tcxo power control */ - sem_wait(&g_ltsem); + nxsem_wait(&g_ltsem); if (en) { @@ -409,7 +409,7 @@ int board_lna_power_control(bool en) g_used_lna = false; } - sem_post(&g_ltsem); + nxsem_post(&g_ltsem); return ret; } diff --git a/boards/arm/efm32/olimex-efm32g880f128-stk/src/efm32_buttons.c b/boards/arm/efm32/olimex-efm32g880f128-stk/src/efm32_buttons.c index a0cd149cf1..1cdfd6d861 100644 --- a/boards/arm/efm32/olimex-efm32g880f128-stk/src/efm32_buttons.c +++ b/boards/arm/efm32/olimex-efm32g880f128-stk/src/efm32_buttons.c @@ -110,7 +110,7 @@ void board_button_initialize(void) for (i = 0; i < NUM_BUTTONS; i++) { - (void)efm32_configgpio(g_button_boards[i]); + efm32_configgpio(g_button_boards[i]); } } @@ -186,7 +186,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Attach and enable the interrupt */ - (void)irq_attach(g_button_irqs[id], irqhandler, arg); + irq_attach(g_button_irqs[id], irqhandler, arg); efm32_gpioirqenable(g_button_irqs[id]); } else @@ -194,7 +194,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable and detach the interrupt */ efm32_gpioirqdisable(g_button_irqs[id]); - (void)irq_detach(g_button_irqs[id]); + irq_detach(g_button_irqs[id]); } leave_critical_section(flags); diff --git a/boards/arm/imx6/sabre-6quad/src/imx_boardinit.c b/boards/arm/imx6/sabre-6quad/src/imx_boardinit.c index 83b9017171..d107ade7d1 100644 --- a/boards/arm/imx6/sabre-6quad/src/imx_boardinit.c +++ b/boards/arm/imx6/sabre-6quad/src/imx_boardinit.c @@ -132,6 +132,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)imx_bringup(); + imx_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_boot.c b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_boot.c index 35a2a48a5c..25c0eb5524 100644 --- a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_boot.c +++ b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_boot.c @@ -87,6 +87,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)imxrt_bringup(); + imxrt_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_ethernet.c b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_ethernet.c index 3315f882af..91a963c106 100644 --- a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_ethernet.c +++ b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_ethernet.c @@ -260,12 +260,12 @@ int arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg, */ phyinfo("Attach IRQ%d\n", irq); - (void)irq_attach(irq, handler, arg); + irq_attach(irq, handler, arg); } else { phyinfo("Detach IRQ%d\n", irq); - (void)irq_detach(irq); + irq_detach(irq); enabler = NULL; } diff --git a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_gpio.c b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_gpio.c index 2149ce566e..dd36f86c2b 100644 --- a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_gpio.c +++ b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_gpio.c @@ -201,7 +201,7 @@ int imxrt_gpio_initialize(void) g_gpin[i].gpio.gp_ops = &gpin_ops; g_gpin[i].id = i; - (void)gpio_pin_register(&g_gpin[i].gpio, pincount); + gpio_pin_register(&g_gpin[i].gpio, pincount); /* Configure the pin that will be used as input */ @@ -220,7 +220,7 @@ int imxrt_gpio_initialize(void) g_gpout[i].gpio.gp_ops = &gpout_ops; g_gpout[i].id = i; - (void)gpio_pin_register(&g_gpout[i].gpio, pincount); + gpio_pin_register(&g_gpout[i].gpio, pincount); /* Configure the pin that will be used as output */ diff --git a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_spi.c b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_spi.c index 78eaef12ed..9c40569fab 100644 --- a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_spi.c +++ b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_spi.c @@ -72,11 +72,11 @@ void weak_function imxrt_spidev_initialize(void) { #ifdef CONFIG_IMXRT_LPSPI1 - (void)imxrt_config_gpio(GPIO_LPSPI1_CS); /* LPSPI1 chip select */ - (void)imxrt_config_gpio(GPIO_MMCSD_EN); + imxrt_config_gpio(GPIO_LPSPI1_CS); /* LPSPI1 chip select */ + imxrt_config_gpio(GPIO_MMCSD_EN); #endif #ifdef CONFIG_IMXRT_LPSPI3 - (void)imxrt_config_gpio(GPIO_LPSPI3_CS); /* LPSPI3 chip select */ + imxrt_config_gpio(GPIO_LPSPI3_CS); /* LPSPI3 chip select */ #endif } diff --git a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c index 0530970d69..60e7e48b7e 100644 --- a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c +++ b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c @@ -120,7 +120,7 @@ static int ehci_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_ehciconn, hport); + CONN_ENUMERATE(g_ehciconn, hport); } } diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_boot.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_boot.c index 94cddab21e..ee1fd01bb0 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_boot.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_boot.c @@ -87,6 +87,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)imxrt_bringup(); + imxrt_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_ethernet.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_ethernet.c index 83035bbcd7..e139dda119 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_ethernet.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_ethernet.c @@ -267,12 +267,12 @@ int arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg, */ phyinfo("Attach IRQ%d\n", irq); - (void)irq_attach(irq, handler, arg); + irq_attach(irq, handler, arg); } else { phyinfo("Detach IRQ%d\n", irq); - (void)irq_detach(irq); + irq_detach(irq); enabler = NULL; } diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_gpio.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_gpio.c index ebe2451c03..1f1da26ef9 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_gpio.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_gpio.c @@ -201,7 +201,7 @@ int imxrt_gpio_initialize(void) g_gpin[i].gpio.gp_ops = &gpin_ops; g_gpin[i].id = i; - (void)gpio_pin_register(&g_gpin[i].gpio, pincount); + gpio_pin_register(&g_gpin[i].gpio, pincount); /* Configure the pin that will be used as input */ @@ -220,7 +220,7 @@ int imxrt_gpio_initialize(void) g_gpout[i].gpio.gp_ops = &gpout_ops; g_gpout[i].id = i; - (void)gpio_pin_register(&g_gpout[i].gpio, pincount); + gpio_pin_register(&g_gpout[i].gpio, pincount); /* Configure the pin that will be used as output */ diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_spi.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_spi.c index 4c18499359..769da4821a 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_spi.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_spi.c @@ -73,11 +73,11 @@ void weak_function imxrt_spidev_initialize(void) { #ifdef CONFIG_IMXRT_LPSPI1 - (void)imxrt_config_gpio(GPIO_LPSPI1_CS); /* LPSPI1 chip select */ - (void)imxrt_config_gpio(GPIO_MMCSD_EN); + imxrt_config_gpio(GPIO_LPSPI1_CS); /* LPSPI1 chip select */ + imxrt_config_gpio(GPIO_MMCSD_EN); #endif #ifdef CONFIG_IMXRT_LPSPI3 - (void)imxrt_config_gpio(GPIO_LPSPI3_CS); /* LPSPI3 chip select */ + imxrt_config_gpio(GPIO_LPSPI3_CS); /* LPSPI3 chip select */ #endif } diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_boot.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_boot.c index 839542d2d0..46ecb80498 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_boot.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_boot.c @@ -88,6 +88,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)imxrt_bringup(); + imxrt_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_ethernet.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_ethernet.c index 1dbf21a408..63b00b3989 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_ethernet.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_ethernet.c @@ -261,12 +261,12 @@ int arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg, */ phyinfo("Attach IRQ%d\n", irq); - (void)irq_attach(irq, handler, arg); + irq_attach(irq, handler, arg); } else { phyinfo("Detach IRQ%d\n", irq); - (void)irq_detach(irq); + irq_detach(irq); enabler = NULL; } diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_ft5x06.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_ft5x06.c index 10dfb167ca..efefa4f928 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_ft5x06.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_ft5x06.c @@ -157,7 +157,7 @@ static void imxrt_ft5x06_enable(FAR const struct ft5x06_config_s *config, #ifndef CONFIG_FT5X06_POLLMODE static void imxrt_ft5x06_clear(FAR const struct ft5x06_config_s *config) { - (void)imxrt_gpio_ackedge(g_ft5x06_irq); + imxrt_gpio_ackedge(g_ft5x06_irq); } #endif diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_gpio.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_gpio.c index 0f9852b1a8..a50b13f699 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_gpio.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_gpio.c @@ -201,7 +201,7 @@ int imxrt_gpio_initialize(void) g_gpin[i].gpio.gp_ops = &gpin_ops; g_gpin[i].id = i; - (void)gpio_pin_register(&g_gpin[i].gpio, pincount); + gpio_pin_register(&g_gpin[i].gpio, pincount); /* Configure the pin that will be used as input */ @@ -220,7 +220,7 @@ int imxrt_gpio_initialize(void) g_gpout[i].gpio.gp_ops = &gpout_ops; g_gpout[i].id = i; - (void)gpio_pin_register(&g_gpout[i].gpio, pincount); + gpio_pin_register(&g_gpout[i].gpio, pincount); /* Configure the pin that will be used as output */ diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_spi.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_spi.c index 5c347c46c3..5433dfe35d 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_spi.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_spi.c @@ -74,11 +74,11 @@ void weak_function imxrt_spidev_initialize(void) { #ifdef CONFIG_IMXRT_LPSPI1 - (void)imxrt_config_gpio(GPIO_LPSPI1_CS); /* LPSPI1 chip select */ - (void)imxrt_config_gpio(GPIO_MMCSD_EN); + imxrt_config_gpio(GPIO_LPSPI1_CS); /* LPSPI1 chip select */ + imxrt_config_gpio(GPIO_MMCSD_EN); #endif #ifdef CONFIG_IMXRT_LPSPI3 - (void)imxrt_config_gpio(GPIO_LPSPI3_CS); /* LPSPI3 chip select */ + imxrt_config_gpio(GPIO_LPSPI3_CS); /* LPSPI3 chip select */ #endif } diff --git a/boards/arm/kinetis/freedom-k28f/src/k28_boot.c b/boards/arm/kinetis/freedom-k28f/src/k28_boot.c index fa9b73075e..82f4464531 100644 --- a/boards/arm/kinetis/freedom-k28f/src/k28_boot.c +++ b/boards/arm/kinetis/freedom-k28f/src/k28_boot.c @@ -99,6 +99,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)k28_bringup(); + k28_bringup(); } #endif diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_automount.c b/boards/arm/kinetis/freedom-k64f/src/k64_automount.c index 87e1f743e9..a80a4c22d6 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_automount.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_automount.c @@ -209,7 +209,7 @@ static void k64_enable(FAR const struct automount_lower_s *lower, if (state->handler) { bool inserted = k64_cardinserted(); - (void)state->handler(&config->lower, state->arg, inserted); + state->handler(&config->lower, state->arg, inserted); } state->pending = false; @@ -317,7 +317,7 @@ void k64_automount_event(bool inserted) { /* No.. forward the event to the handler */ - (void)state->handler(&config->lower, state->arg, inserted); + state->handler(&config->lower, state->arg, inserted); } } } diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_boot.c b/boards/arm/kinetis/freedom-k64f/src/k64_boot.c index 73d16184e2..5f7e5d080f 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_boot.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_boot.c @@ -112,7 +112,7 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)k64_bringup(); + k64_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_sdhc.c b/boards/arm/kinetis/freedom-k64f/src/k64_sdhc.c index be24c8b2d9..f583c86efc 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_sdhc.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_sdhc.c @@ -171,7 +171,7 @@ int k64_sdhc_initialize(void) /* Attached the card detect interrupt (but don't enable it yet) */ - (void)kinetis_pinirqattach(GPIO_SD_CARDDETECT, k64_cdinterrupt, NULL); + kinetis_pinirqattach(GPIO_SD_CARDDETECT, k64_cdinterrupt, NULL); /* Configure the write protect GPIO -- None */ diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_automount.c b/boards/arm/kinetis/freedom-k66f/src/k66_automount.c index 5b6c39b1dc..86e1cb14d1 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_automount.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_automount.c @@ -209,7 +209,7 @@ static void k66_enable(FAR const struct automount_lower_s *lower, bool enable) if (state->handler) { bool inserted = k66_cardinserted(); - (void)state->handler(&config->lower, state->arg, inserted); + state->handler(&config->lower, state->arg, inserted); } state->pending = false; @@ -317,7 +317,7 @@ void k66_automount_event(bool inserted) { /* No.. forward the event to the handler */ - (void)state->handler(&config->lower, state->arg, inserted); + state->handler(&config->lower, state->arg, inserted); } } } diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_boot.c b/boards/arm/kinetis/freedom-k66f/src/k66_boot.c index 96415f80bc..01b80bd547 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_boot.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_boot.c @@ -113,7 +113,7 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)k66_bringup(); + k66_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_sdhc.c b/boards/arm/kinetis/freedom-k66f/src/k66_sdhc.c index 35f5fe83c1..3212acfbe5 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_sdhc.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_sdhc.c @@ -170,7 +170,7 @@ int k66_sdhc_initialize(void) /* Attached the card detect interrupt (but don't enable it yet) */ - (void)kinetis_pinirqattach(GPIO_SD_CARDDETECT, k66_cdinterrupt, NULL); + kinetis_pinirqattach(GPIO_SD_CARDDETECT, k66_cdinterrupt, NULL); /* Configure the write protect GPIO -- None */ diff --git a/boards/arm/kinetis/kwikstik-k40/src/k40_appinit.c b/boards/arm/kinetis/kwikstik-k40/src/k40_appinit.c index 4d8f3af79e..e68b86037e 100644 --- a/boards/arm/kinetis/kwikstik-k40/src/k40_appinit.c +++ b/boards/arm/kinetis/kwikstik-k40/src/k40_appinit.c @@ -219,7 +219,7 @@ int board_app_initialize(uintptr_t arg) /* Attached the card detect interrupt (but don't enable it yet) */ kinetis_pinconfig(GPIO_SD_CARDDETECT); - (void)kinetis_pinirqattach(GPIO_SD_CARDDETECT, kinetis_cdinterrupt, NULL); + kinetis_pinirqattach(GPIO_SD_CARDDETECT, kinetis_cdinterrupt, NULL); /* Mount the SDHC-based MMC/SD block driver */ diff --git a/boards/arm/kinetis/twr-k60n512/src/k60_appinit.c b/boards/arm/kinetis/twr-k60n512/src/k60_appinit.c index d1193dd748..f19c03c4b2 100644 --- a/boards/arm/kinetis/twr-k60n512/src/k60_appinit.c +++ b/boards/arm/kinetis/twr-k60n512/src/k60_appinit.c @@ -228,7 +228,7 @@ int board_app_initialize(uintptr_t arg) /* Attached the card detect interrupt (but don't enable it yet) */ kinetis_pinconfig(GPIO_SD_CARDDETECT); - (void)kinetis_pinirqattach(GPIO_SD_CARDDETECT, kinetis_cdinterrupt, NULL); + kinetis_pinirqattach(GPIO_SD_CARDDETECT, kinetis_cdinterrupt, NULL); /* Configure the write protect GPIO */ diff --git a/boards/arm/kinetis/twr-k64f120m/src/k64_automount.c b/boards/arm/kinetis/twr-k64f120m/src/k64_automount.c index 94355414fc..6f66be12bd 100644 --- a/boards/arm/kinetis/twr-k64f120m/src/k64_automount.c +++ b/boards/arm/kinetis/twr-k64f120m/src/k64_automount.c @@ -196,7 +196,7 @@ static void k64_enable(FAR const struct automount_lower_s *lower, bool enable) if (state->handler) { bool inserted = k64_cardinserted(); - (void)state->handler(&config->lower, state->arg, inserted); + state->handler(&config->lower, state->arg, inserted); } state->pending = false; @@ -304,7 +304,7 @@ void k64_automount_event(bool inserted) { /* No.. forward the event to the handler */ - (void)state->handler(&config->lower, state->arg, inserted); + state->handler(&config->lower, state->arg, inserted); } } } diff --git a/boards/arm/kinetis/twr-k64f120m/src/k64_sdhc.c b/boards/arm/kinetis/twr-k64f120m/src/k64_sdhc.c index 71c1679cd4..4a51ca3a8f 100644 --- a/boards/arm/kinetis/twr-k64f120m/src/k64_sdhc.c +++ b/boards/arm/kinetis/twr-k64f120m/src/k64_sdhc.c @@ -167,7 +167,7 @@ int k64_sdhc_initialize(void) /* Attached the card detect interrupt (but don't enable it yet) */ - (void)kinetis_pinirqattach(GPIO_SD_CARDDETECT, k64_cdinterrupt, NULL); + kinetis_pinirqattach(GPIO_SD_CARDDETECT, k64_cdinterrupt, NULL); /* Configure the write protect GPIO -- None */ diff --git a/boards/arm/kl/freedom-kl25z/src/kl_adxl345.c b/boards/arm/kl/freedom-kl25z/src/kl_adxl345.c index 437864208c..43ac8fe795 100644 --- a/boards/arm/kl/freedom-kl25z/src/kl_adxl345.c +++ b/boards/arm/kl/freedom-kl25z/src/kl_adxl345.c @@ -215,14 +215,14 @@ static void adxl345_enable(FAR struct adxl345_config_s *state, bool enable) /* Configure the interrupt using the SAVED handler */ kl_configgpio(GPIO_ADXL345_INT1); - (void)kl_gpioirqattach(GPIO_ADXL345_INT1, adxl345_interrupt, NULL); + kl_gpioirqattach(GPIO_ADXL345_INT1, adxl345_interrupt, NULL); kl_gpioirqenable(GPIO_ADXL345_INT1); } else { /* Configure the interrupt with a NULL handler to disable it */ - (void)kl_gpioirqattach(GPIO_ADXL345_INT1, NULL, NULL); + kl_gpioirqattach(GPIO_ADXL345_INT1, NULL, NULL); kl_gpioirqdisable(GPIO_ADXL345_INT1); } @@ -272,7 +272,7 @@ int adxl345_archinitialize(int minor) /* Configure the ADXL345 interrupt pin as an input */ - (void)kl_configgpio(GPIO_ADXL345_INT1); + kl_configgpio(GPIO_ADXL345_INT1); /* Get an instance of the I2C interface */ diff --git a/boards/arm/kl/freedom-kl25z/src/kl_boardinitialize.c b/boards/arm/kl/freedom-kl25z/src/kl_boardinitialize.c index 54124b5695..44ac5e64ad 100644 --- a/boards/arm/kl/freedom-kl25z/src/kl_boardinitialize.c +++ b/boards/arm/kl/freedom-kl25z/src/kl_boardinitialize.c @@ -125,7 +125,7 @@ void board_late_initialize(void) */ #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) - (void)board_app_initialize(0); + board_app_initialize(0); #endif } #endif diff --git a/boards/arm/kl/freedom-kl25z/src/kl_tsi.c b/boards/arm/kl/freedom-kl25z/src/kl_tsi.c index a97ae8279b..c707d86ba0 100644 --- a/boards/arm/kl/freedom-kl25z/src/kl_tsi.c +++ b/boards/arm/kl/freedom-kl25z/src/kl_tsi.c @@ -257,7 +257,7 @@ void kl_tsi_initialize(void) /* And finally register the TSI character driver */ - (void)register_driver("/dev/tsi", &tsi_ops, 0444, NULL); + register_driver("/dev/tsi", &tsi_ops, 0444, NULL); } #endif /* CONFIG_KL_TSI */ diff --git a/boards/arm/kl/freedom-kl26z/src/kl_boardinitialize.c b/boards/arm/kl/freedom-kl26z/src/kl_boardinitialize.c index 99ea254d7c..8113567080 100644 --- a/boards/arm/kl/freedom-kl26z/src/kl_boardinitialize.c +++ b/boards/arm/kl/freedom-kl26z/src/kl_boardinitialize.c @@ -117,7 +117,7 @@ void board_late_initialize(void) */ #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) - (void)board_app_initialize(0); + board_app_initialize(0); #endif } #endif diff --git a/boards/arm/kl/freedom-kl26z/src/kl_tsi.c b/boards/arm/kl/freedom-kl26z/src/kl_tsi.c index a6484c668f..514df82a55 100644 --- a/boards/arm/kl/freedom-kl26z/src/kl_tsi.c +++ b/boards/arm/kl/freedom-kl26z/src/kl_tsi.c @@ -257,7 +257,7 @@ void kl_tsi_initialize(void) /* And finally register the TSI character driver */ - (void)register_driver("/dev/tsi", &tsi_ops, 0444, NULL); + register_driver("/dev/tsi", &tsi_ops, 0444, NULL); } #endif /* CONFIG_KL_TSI */ diff --git a/boards/arm/kl/teensy-lc/src/kl_boardinitialize.c b/boards/arm/kl/teensy-lc/src/kl_boardinitialize.c index 66ce79ff53..6ce537c742 100644 --- a/boards/arm/kl/teensy-lc/src/kl_boardinitialize.c +++ b/boards/arm/kl/teensy-lc/src/kl_boardinitialize.c @@ -137,7 +137,7 @@ void board_late_initialize(void) */ #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) - (void)board_app_initialize(0); + board_app_initialize(0); #endif } #endif diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_boot.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_boot.c index 03e9aa5fec..3bce8dde16 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_boot.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_boot.c @@ -67,7 +67,7 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)lc823450_bringup(); + lc823450_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_bringup.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_bringup.c index b6e02d7625..dbd6ed4d06 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_bringup.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_bringup.c @@ -88,7 +88,7 @@ int lc823450_bringup(void) #ifdef CONFIG_FS_PROCFS #ifdef CONFIG_DVFS - (void)dvfs_procfs_register(); + dvfs_procfs_register(); #endif /* Mount the procfs file system */ diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_st7565.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_st7565.c index 19047b8f39..22bed3ff69 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_st7565.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_st7565.c @@ -199,11 +199,11 @@ FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) { lcdinfo("SPI port 1 bound to LCD %d\n", lcddev); - (void)g_lcddev->setcontrast(g_lcddev, CONFIG_LCD_MAXCONTRAST); + g_lcddev->setcontrast(g_lcddev, CONFIG_LCD_MAXCONTRAST); /* And turn the LCD on (CONFIG_LCD_MAXPOWER should be 1) */ - (void)g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); + g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); return g_lcddev; } diff --git a/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_buttons.c b/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_buttons.c index 85d51da268..f457f44bde 100644 --- a/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_buttons.c +++ b/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_buttons.c @@ -196,7 +196,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { /* Attach then enable the new interrupt handler */ - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); up_enable_irq(irq); } else @@ -204,7 +204,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable then detach the old interrupt handler */ up_disable_irq(irq); - (void)irq_detach(irq); + irq_detach(irq); } leave_critical_section(flags); diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_boardinitialize.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_boardinitialize.c index 92b523c18b..11b4717cae 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_boardinitialize.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_boardinitialize.c @@ -138,6 +138,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)lpc4088_devkit_bringup(); + lpc4088_devkit_bringup(); } #endif diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c index 1be0e90f3d..af9687df7b 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c @@ -193,7 +193,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_buttons.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_buttons.c index 0c2063dc4a..93ac034184 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_buttons.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_buttons.c @@ -216,7 +216,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { /* Attach then enable the new interrupt handler */ - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); up_enable_irq(irq); } else @@ -224,7 +224,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable then detach the old interrupt handler */ up_disable_irq(irq); - (void)irq_detach(irq); + irq_detach(irq); } leave_critical_section(flags); diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_djoystick.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_djoystick.c index c0095f2416..88c0981b5a 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_djoystick.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_djoystick.c @@ -236,7 +236,7 @@ static void djoy_enable(FAR const struct djoy_lowerhalf_s *lower, irq = g_buttonirq[i]; if (irq > 0) { - (void)irq_attach(irq, djoy_interrupt, arg); + irq_attach(irq, djoy_interrupt, arg); up_enable_irq(irq); } } @@ -270,7 +270,7 @@ static void djoy_disable(void) if (irq > 0) { up_disable_irq(irq); - (void)irq_detach(irq); + irq_detach(irq); } } diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_sdraminitialize.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_sdraminitialize.c index 1b9a0ebdd4..5f6af1b85a 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_sdraminitialize.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_sdraminitialize.c @@ -212,9 +212,9 @@ void lpc4088_devkit_sdram_initialize(void) EMC_DYNAMICCONTROL_I_MODE, LPC17_40_EMC_DYNAMICCONTROL); #ifdef CONFIG_LPC17_40_SDRAM_16BIT - (void)getreg16(SDRAM_BASE | (0x33 << 12)); /* 8 burst, 3 CAS latency */ + getreg16(SDRAM_BASE | (0x33 << 12)); /* 8 burst, 3 CAS latency */ #elif defined CONFIG_LPC17_40_SDRAM_32BIT - (void)getreg32(SDRAM_BASE | (0x32 << 13)); /* 4 burst, 3 CAS latency */ + getreg32(SDRAM_BASE | (0x32 << 13)); /* 4 burst, 3 CAS latency */ #endif /* Issue NORMAL command */ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_touchscreen.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_touchscreen.c index d572b44009..21afdb1889 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_touchscreen.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_touchscreen.c @@ -169,7 +169,7 @@ static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t handler) { /* Attach then enable the touchscreen interrupt handler */ - (void)irq_attach(LPC17_40_IRQ_PENIRQ, handler, NULL); + irq_attach(LPC17_40_IRQ_PENIRQ, handler, NULL); return OK; } @@ -283,12 +283,12 @@ int lpc4088_devkit_tsc_setup(int minor) /* Configure and enable the XPT2046 PENIRQ pin as an interrupting input. */ - (void)lpc17_40_configgpio(GPIO_TC_PENIRQ); + lpc17_40_configgpio(GPIO_TC_PENIRQ); /* Configure the XPT2046 BUSY pin as a normal input. */ #ifndef XPT2046_NO_BUSY - (void)lpc17_40_configgpio(GPIO_TC_BUSY); + lpc17_40_configgpio(GPIO_TC_BUSY); #endif /* Get an instance of the SPI interface */ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_boardinitialize.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_boardinitialize.c index 002cd8250b..fa07988502 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_boardinitialize.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_boardinitialize.c @@ -128,6 +128,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)lpc4088_quickstart_bringup(); + lpc4088_quickstart_bringup(); } #endif diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c index 5a6eff27ad..fcc2a8eedb 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c @@ -199,7 +199,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } @@ -257,7 +257,7 @@ static int nsh_sdinitialize(void) * inserted or deleted. */ - (void)irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt, NULL); + irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt, NULL); up_enable_irq(LPC17_40_IRQ_P0p13); #endif diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_buttons.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_buttons.c index 8969e8f998..4758169c82 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_buttons.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_buttons.c @@ -205,7 +205,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { /* Attach then enable the new interrupt handler */ - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); up_enable_irq(irq); } else @@ -213,7 +213,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable then detach the old interrupt handler */ up_disable_irq(irq); - (void)irq_detach(irq); + irq_detach(irq); } leave_critical_section(flags); diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_sdraminitialize.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_sdraminitialize.c index 8d2355f7c3..ecd387adda 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_sdraminitialize.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_sdraminitialize.c @@ -210,9 +210,9 @@ void lpc4088_quickstart_sdram_initialize(void) EMC_DYNAMICCONTROL_I_MODE, LPC17_40_EMC_DYNAMICCONTROL); #ifdef CONFIG_LPC17_40_SDRAM_16BIT - (void)getreg16(SDRAM_BASE | (0x33 << 12)); /* 8 burst, 3 CAS latency */ + getreg16(SDRAM_BASE | (0x33 << 12)); /* 8 burst, 3 CAS latency */ #elif defined CONFIG_LPC17_40_SDRAM_32BIT - (void)getreg32(SDRAM_BASE | (0x32 << 13)); /* 4 burst, 3 CAS latency */ + getreg32(SDRAM_BASE | (0x32 << 13)); /* 4 burst, 3 CAS latency */ #endif /* Issue NORMAL command */ diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_oled.c b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_oled.c index 72cd151f9f..bc117c7008 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_oled.c +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_oled.c @@ -104,8 +104,8 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) oledcs_dumpgpio("board_graphics_setup: After OLED CS setup"); oleddc_dumpgpio("board_graphics_setup: On entry"); - (void)lpc17_40_configgpio(LPCXPRESSO_OLED_POWER); /* OLED 11V power */ - (void)lpc17_40_configgpio(LPCXPRESSO_OLED_DC); /* OLED Command/Data */ + lpc17_40_configgpio(LPCXPRESSO_OLED_POWER); /* OLED 11V power */ + lpc17_40_configgpio(LPCXPRESSO_OLED_DC); /* OLED Command/Data */ oleddc_dumpgpio("board_graphics_setup: After OLED Power/DC setup"); @@ -131,7 +131,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* And turn the OLED on (dim) */ - (void)dev->setpower(dev, UG_POWER_DIM); + dev->setpower(dev, UG_POWER_DIM); return dev; } } @@ -167,7 +167,7 @@ int lpc17_40_ssp1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) { /* Set GPIO to 1 for data, 0 for command */ - (void)lpc17_40_gpiowrite(LPCXPRESSO_OLED_DC, !cmd); + lpc17_40_gpiowrite(LPCXPRESSO_OLED_DC, !cmd); return OK; } return -ENODEV; @@ -197,6 +197,6 @@ int lpc17_40_ssp1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) void ug_power(unsigned int devno, bool on) { ginfo("power %s\n", on ? "ON" : "OFF"); - (void)lpc17_40_gpiowrite(LPCXPRESSO_OLED_POWER, on); + lpc17_40_gpiowrite(LPCXPRESSO_OLED_POWER, on); } #endif diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_ssp.c b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_ssp.c index 5777949855..4f2a4fc76d 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_ssp.c +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_ssp.c @@ -89,8 +89,8 @@ void weak_function lpcxpresso_sspdev_initialize(void) */ #ifdef CONFIG_LPC17_40_SSP1 - (void)lpc17_40_configgpio(LPCXPRESSO_SD_CS); - (void)lpc17_40_configgpio(LPCXPRESSO_SD_CD); + lpc17_40_configgpio(LPCXPRESSO_SD_CS); + lpc17_40_configgpio(LPCXPRESSO_SD_CD); /* Configure chip select for the OLED. * For the SPI interface, insert jumpers in J42, J43, J45 pin1-2 @@ -98,7 +98,7 @@ void weak_function lpcxpresso_sspdev_initialize(void) */ #ifdef CONFIG_NX_LCDDRIVER - (void)lpc17_40_configgpio(LPCXPRESSO_OLED_CS); + lpc17_40_configgpio(LPCXPRESSO_OLED_CS); #endif #endif @@ -164,14 +164,14 @@ void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, { /* Assert/de-assert the CS pin to the card */ - (void)lpc17_40_gpiowrite(LPCXPRESSO_SD_CS, !selected); + lpc17_40_gpiowrite(LPCXPRESSO_SD_CS, !selected); } #ifdef CONFIG_NX_LCDDRIVER else if (devid == SPIDEV_DISPLAY(0)) { /* Assert the CS pin to the OLED display */ - (void)lpc17_40_gpiowrite(LPCXPRESSO_OLED_CS, !selected); + lpc17_40_gpiowrite(LPCXPRESSO_OLED_CS, !selected); } #endif ssp_dumpgpio("lpc17_40_ssp1select() Exit"); diff --git a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_boardinitialize.c b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_boardinitialize.c index 9ab3ccee32..4277646c74 100644 --- a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_boardinitialize.c +++ b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_boardinitialize.c @@ -122,6 +122,6 @@ void board_initialize(void) { /* Perform board-specific initialization */ - (void)lx_cpu_bringup(); + lx_cpu_bringup(); } #endif diff --git a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_bringup.c index 7fa7b7590f..d975e32d7f 100644 --- a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_bringup.c @@ -198,7 +198,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } @@ -256,7 +256,7 @@ static int nsh_sdinitialize(void) * inserted or deleted. */ - (void)irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt, NULL); + irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt, NULL); up_enable_irq(LPC17_40_IRQ_P0p13); #endif #endif diff --git a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_nsh.c b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_nsh.c index f3e3455b3b..dad9565500 100644 --- a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_nsh.c +++ b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_nsh.c @@ -195,7 +195,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } @@ -253,7 +253,7 @@ static int nsh_sdinitialize(void) * inserted or deleted. */ - (void)irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt); + irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt); up_enable_irq(LPC17_40_IRQ_P0p13); #endif #endif diff --git a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_boot.c b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_boot.c index 897cf52139..c13c37c398 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_boot.c +++ b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_boot.c @@ -91,6 +91,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)mcb1700_bringup(); + mcb1700_bringup(); } #endif diff --git a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c index 47808dbb4a..e6d96af8ff 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c @@ -171,7 +171,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_boot.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_boot.c index c292f77a80..43843805b5 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_boot.c +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_boot.c @@ -112,6 +112,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization here if so configured */ - (void)lpc17_40_bringup(); + lpc17_40_bringup(); } #endif diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c index 40a129dac4..f72befecbc 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c @@ -170,7 +170,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_buttons.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_buttons.c index 26237ca46e..8f018bdb07 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_buttons.c +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_buttons.c @@ -198,7 +198,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { /* Attach then enable the new interrupt handler */ - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); up_enable_irq(irq); } else @@ -206,7 +206,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable then detach the old interrupt handler */ up_disable_irq(irq); - (void)irq_detach(irq); + irq_detach(irq); } leave_critical_section(flags); diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_ssp.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_ssp.c index 7aa7209af1..441a61978b 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_ssp.c +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_ssp.c @@ -144,7 +144,7 @@ static void ssp_cdirqsetup(int irq, xcpt_t irqhandler) { /* Attach then enable the new interrupt handler */ - (void)irq_attach(irq, irqhandler, NULL); + irq_attach(irq, irqhandler, NULL); up_enable_irq(irq); } else @@ -152,7 +152,7 @@ static void ssp_cdirqsetup(int irq, xcpt_t irqhandler) /* Disable then detach the old interrupt handler */ up_disable_irq(irq); - (void)irq_detach(irq); + irq_detach(irq); } leave_critical_section(flags); diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_boardinitialize.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_boardinitialize.c index f27f2ae87c..c5e3361d75 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_boardinitialize.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_boardinitialize.c @@ -138,6 +138,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)open1788_bringup(); + open1788_bringup(); } #endif diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c index 0d002ce765..47acf09045 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c @@ -198,7 +198,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } @@ -256,7 +256,7 @@ static int nsh_sdinitialize(void) * inserted or deleted. */ - (void)irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt, NULL); + irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt, NULL); up_enable_irq(LPC17_40_IRQ_P0p13); #endif diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_buttons.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_buttons.c index c3ad219dd3..d61e246332 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_buttons.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_buttons.c @@ -217,7 +217,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { /* Attach then enable the new interrupt handler */ - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); up_enable_irq(irq); } else @@ -225,7 +225,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable then detach the old interrupt handler */ up_disable_irq(irq); - (void)irq_detach(irq); + irq_detach(irq); } leave_critical_section(flags); diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_djoystick.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_djoystick.c index 7ef7cf4b71..9b954846ec 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_djoystick.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_djoystick.c @@ -238,7 +238,7 @@ static void djoy_enable(FAR const struct djoy_lowerhalf_s *lower, irq = g_buttonirq[i]; if (irq > 0) { - (void)irq_attach(irq, djoy_interrupt, arg); + irq_attach(irq, djoy_interrupt, arg); up_enable_irq(irq); } } @@ -272,7 +272,7 @@ static void djoy_disable(void) if (irq > 0) { up_disable_irq(irq); - (void)irq_detach(irq); + irq_detach(irq); } } diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_sdraminitialize.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_sdraminitialize.c index b387da0955..bc42da31be 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_sdraminitialize.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_sdraminitialize.c @@ -211,9 +211,9 @@ void open1788_sdram_initialize(void) EMC_DYNAMICCONTROL_I_MODE, LPC17_40_EMC_DYNAMICCONTROL); #ifdef CONFIG_LPC17_40_SDRAM_16BIT - (void)getreg16(SDRAM_BASE | (0x33 << 12)); /* 8 burst, 3 CAS latency */ + getreg16(SDRAM_BASE | (0x33 << 12)); /* 8 burst, 3 CAS latency */ #elif defined CONFIG_LPC17_40_SDRAM_32BIT - (void)getreg32(SDRAM_BASE | (0x32 << 13)); /* 4 burst, 3 CAS latency */ + getreg32(SDRAM_BASE | (0x32 << 13)); /* 4 burst, 3 CAS latency */ #endif /* Issue NORMAL command */ diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_touchscreen.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_touchscreen.c index 360b83644f..cc672d19ba 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_touchscreen.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_touchscreen.c @@ -169,7 +169,7 @@ static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t handler) { /* Attach then enable the touchscreen interrupt handler */ - (void)irq_attach(LPC17_40_IRQ_PENIRQ, handler, NULL); + irq_attach(LPC17_40_IRQ_PENIRQ, handler, NULL); return OK; } @@ -282,12 +282,12 @@ int open1788_tsc_setup(int minor) /* Configure and enable the XPT2046 PENIRQ pin as an interrupting input. */ - (void)lpc17_40_configgpio(GPIO_TC_PENIRQ); + lpc17_40_configgpio(GPIO_TC_PENIRQ); /* Configure the XPT2046 BUSY pin as a normal input. */ #ifndef XPT2046_NO_BUSY - (void)lpc17_40_configgpio(GPIO_TC_BUSY); + lpc17_40_configgpio(GPIO_TC_BUSY); #endif /* Get an instance of the SPI interface */ diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_boot.c b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_boot.c index 83e4b3db73..94e7f68cea 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_boot.c +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_boot.c @@ -91,6 +91,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)pnev5180b_bringup(); + pnev5180b_bringup(); } #endif diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ssp.c b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ssp.c index f673795bbf..2f4a626311 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ssp.c +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ssp.c @@ -87,8 +87,8 @@ void weak_function c027_sspdev_initialize(void) /* Configure card detect and chip select for the SD slot. */ #if defined(CONFIG_LPC17_40_SSP0) && defined(CONFIG_MMCSD_SPI) - (void)lpc17_40_configgpio(C027_SD_CS); - (void)lpc17_40_configgpio(C027_SD_CD); + lpc17_40_configgpio(C027_SD_CS); + lpc17_40_configgpio(C027_SD_CD); #endif ssp_dumpgpio("c027_sspdev_initialize() Exit"); @@ -153,14 +153,14 @@ void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, { /* Assert/de-assert the CS pin to the card */ - (void)lpc17_40_gpiowrite(C027_SD_CS, !selected); + lpc17_40_gpiowrite(C027_SD_CS, !selected); } #ifdef CONFIG_NX_LCDDRIVER else if (devid == SPIDEV_DISPLAY(0)) { /* Assert the CS pin to the OLED display */ - (void)lpc17_40_gpiowrite(C027_OLED_CS, !selected); + lpc17_40_gpiowrite(C027_OLED_CS, !selected); } #endif ssp_dumpgpio("lpc17_40_ssp1select() Exit"); diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ubxmdm.c b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ubxmdm.c index 445d2f1c8c..7937d4353c 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ubxmdm.c +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ubxmdm.c @@ -306,5 +306,5 @@ void lpc17_40_ubxmdm_init(bool usb_used) lpc17_40_poweroff((FAR struct ubxmdm_lower*) priv); - (void) ubxmdm_register("/dev/ubxmdm", (FAR struct ubxmdm_lower*) priv); + ubxmdm_register("/dev/ubxmdm", (FAR struct ubxmdm_lower*) priv); } diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_buttons.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_buttons.c index 5c9651b6d7..402ae7d55d 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_buttons.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_buttons.c @@ -189,7 +189,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable the interrupt and detach the handler */ up_disable_irq(ZKITARM_KEY5_IRQ); - (void)irq_detach(ZKITARM_KEY5_IRQ); + irq_detach(ZKITARM_KEY5_IRQ); /* Configure KEY5 as a non-interrupting input */ diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_lcd.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_lcd.c index 177fbfc55e..6a89b98e5f 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_lcd.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_lcd.c @@ -117,7 +117,7 @@ FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) /* And turn the OLCD on (CONFIG_LCD_MAXPOWER should be 1) */ - (void)g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); + g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); return g_lcddev; } diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_spi.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_spi.c index 51c15d7ec8..f0297f7591 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_spi.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_spi.c @@ -92,8 +92,8 @@ void weak_function zkit_spidev_initialize(void) /* Configure card detect and chip select for the SD slot. */ - (void)lpc17_40_configgpio(ZKITARM_SD_CS); - (void)lpc17_40_configgpio(ZKITARM_SD_CD); + lpc17_40_configgpio(ZKITARM_SD_CS); + lpc17_40_configgpio(ZKITARM_SD_CD); spi_dumpgpio("zkit_spidev_initialize() Exit"); } @@ -136,7 +136,7 @@ void lpc17_40_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, { /* Assert/de-assert the CS pin to the card */ - (void)lpc17_40_gpiowrite(ZKITARM_SD_CS, !selected); + lpc17_40_gpiowrite(ZKITARM_SD_CS, !selected); } spi_dumpgpio("lpc17_40_spiselect() Exit"); diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_ssp.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_ssp.c index a67ce5c9bb..1361995792 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_ssp.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_ssp.c @@ -93,7 +93,7 @@ void weak_function zkit_sspdev_initialize(void) #ifdef CONFIG_LPC17_40_SSP0 #ifdef CONFIG_NX_LCDDRIVER - (void)lpc17_40_configgpio(ZKITARM_OLED_CS); + lpc17_40_configgpio(ZKITARM_OLED_CS); #endif #endif /* CONFIG_LPC17_40_SSP0 */ @@ -176,7 +176,7 @@ void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, { /* Assert the CS pin to the OLED display */ - (void)lpc17_40_gpiowrite(ZKITARM_OLED_CS, !selected); + lpc17_40_gpiowrite(ZKITARM_OLED_CS, !selected); } #endif diff --git a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c index 12ac2e089c..4973d603b2 100644 --- a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c +++ b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c @@ -180,24 +180,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&g_exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&g_exclsem); } else { - (void)nxsem_post(&g_exclsem); - ret = OK; + ret = nxsem_post(&g_exclsem); } return ret; @@ -257,7 +244,7 @@ static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, do { - (void)getreg16(LPC214X_SPI1_DR); + getreg16(LPC214X_SPI1_DR); } while (getreg8(LPC214X_SPI1_SR) & LPC214X_SPI1SR_RNE); } @@ -450,7 +437,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, { /* Yes.. Read and discard */ - (void)getreg16(LPC214X_SPI1_DR); + getreg16(LPC214X_SPI1_DR); } /* There is a race condition where TFE may go true just before @@ -611,7 +598,7 @@ FAR struct spi_dev_s *lpc214x_spibus_initialize(int port) for (i = 0; i < 8; i++) { - (void)getreg16(LPC214X_SPI1_DR); + getreg16(LPC214X_SPI1_DR); } return &g_spidev; diff --git a/boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c b/boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c index 62196bb358..642c174a10 100644 --- a/boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c +++ b/boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c @@ -183,24 +183,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&g_exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&g_exclsem); } else { - (void)nxsem_post(&g_exclsem); - ret = OK; + ret= nxsem_post(&g_exclsem); } return ret; @@ -272,7 +259,7 @@ static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, do { - (void)getreg16(LPC214X_SPI1_DR); + getreg16(LPC214X_SPI1_DR); } while (getreg8(LPC214X_SPI1_SR) & LPC214X_SPI1SR_RNE); } @@ -496,7 +483,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, { /* Yes.. Read and discard */ - (void)getreg16(LPC214X_SPI1_DR); + getreg16(LPC214X_SPI1_DR); } /* There is a race condition where TFE may go true just before @@ -673,7 +660,7 @@ FAR struct spi_dev_s *lpc214x_spibus_initialize(int port) for (i = 0; i < 8; i++) { - (void)getreg16(LPC214X_SPI1_DR); + getreg16(LPC214X_SPI1_DR); } return &g_spidev; diff --git a/boards/arm/lpc214x/zp214xpa/src/lpc2148_ug2864ambag01.c b/boards/arm/lpc214x/zp214xpa/src/lpc2148_ug2864ambag01.c index 4fce79c550..46dd14e69b 100644 --- a/boards/arm/lpc214x/zp214xpa/src/lpc2148_ug2864ambag01.c +++ b/boards/arm/lpc214x/zp214xpa/src/lpc2148_ug2864ambag01.c @@ -170,7 +170,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* And turn the OLED on */ - (void)dev->setpower(dev, CONFIG_LCD_MAXPOWER); + dev->setpower(dev, CONFIG_LCD_MAXPOWER); return dev; } } diff --git a/boards/arm/lpc31xx/ea3131/src/lpc31_mem.c b/boards/arm/lpc31xx/ea3131/src/lpc31_mem.c index 9ab81af937..d7ff3876f8 100644 --- a/boards/arm/lpc31xx/ea3131/src/lpc31_mem.c +++ b/boards/arm/lpc31xx/ea3131/src/lpc31_mem.c @@ -268,7 +268,7 @@ static void lpc31_sdraminitialize(void) * 16bit mode */ - (void)getreg32(LPC31_EXTSDRAM0_VSECTION | (0x23 << 13)); + getreg32(LPC31_EXTSDRAM0_VSECTION | (0x23 << 13)); putreg32((MPMC_DYNCONFIG0_MDSDRAM | MPMC_DYNCONFIG_HP16_32MX16), LPC31_MPMC_DYNCONFIG0); diff --git a/boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c b/boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c index eb42c74412..e5238536cc 100644 --- a/boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c +++ b/boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c @@ -115,7 +115,7 @@ static int ehci_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_ehciconn, hport); + CONN_ENUMERATE(g_ehciconn, hport); } } diff --git a/boards/arm/lpc31xx/ea3152/src/lpc31_mem.c b/boards/arm/lpc31xx/ea3152/src/lpc31_mem.c index 2203cec54a..653dc8e39f 100644 --- a/boards/arm/lpc31xx/ea3152/src/lpc31_mem.c +++ b/boards/arm/lpc31xx/ea3152/src/lpc31_mem.c @@ -268,7 +268,7 @@ static void lpc31_sdraminitialize(void) * 16bit mode */ - (void)getreg32(LPC31_EXTSDRAM0_VSECTION | (0x23 << 13)); + getreg32(LPC31_EXTSDRAM0_VSECTION | (0x23 << 13)); putreg32((MPMC_DYNCONFIG0_MDSDRAM | MPMC_DYNCONFIG_HP16_32MX16), LPC31_MPMC_DYNCONFIG0); diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mem.c b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mem.c index 9dcb47da30..8bfa13d736 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mem.c +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mem.c @@ -257,7 +257,7 @@ static inline void lpc31_sdraminitialize(void) * 16bit mode */ - (void)getreg32(LPC31_EXTSDRAM0_VSECTION | (0x23 << 12)); + getreg32(LPC31_EXTSDRAM0_VSECTION | (0x23 << 12)); /* Select normal operating mode */ diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c index 2e3889f199..e3cc917c42 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c @@ -121,7 +121,7 @@ static int ehci_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_ehciconn, hport); + CONN_ENUMERATE(g_ehciconn, hport); } } diff --git a/boards/arm/lpc43xx/bambino-200e/src/lpc43_appinit.c b/boards/arm/lpc43xx/bambino-200e/src/lpc43_appinit.c index f89eec850a..43a3ccaa8e 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/lpc43_appinit.c +++ b/boards/arm/lpc43xx/bambino-200e/src/lpc43_appinit.c @@ -175,7 +175,7 @@ int board_app_initialize(uintptr_t arg) /* Initialize the SPIFI block device */ - (void)nsh_spifi_initialize(); + nsh_spifi_initialize(); #ifdef HAVE_MMCSD /* Get an instance of the SDIO interface */ diff --git a/boards/arm/lpc43xx/bambino-200e/src/lpc43_buttons.c b/boards/arm/lpc43xx/bambino-200e/src/lpc43_buttons.c index 7cc695585f..6d7a851102 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/lpc43_buttons.c +++ b/boards/arm/lpc43xx/bambino-200e/src/lpc43_buttons.c @@ -190,7 +190,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { /* Attach then enable the new interrupt handler */ - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); up_enable_irq(irq); } else @@ -198,7 +198,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable then detach the old interrupt handler */ up_disable_irq(irq); - (void)irq_detach(irq); + irq_detach(irq); } leave_critical_section(flags); diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_buttons.c b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_buttons.c index e59e2a8dd2..8b8ea1c18b 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_buttons.c +++ b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_buttons.c @@ -197,7 +197,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { /* Attach then enable the new interrupt handler */ - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); up_enable_irq(irq); } else @@ -205,7 +205,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable then detach the old interrupt handler */ up_disable_irq(irq); - (void)irq_detach(irq); + irq_detach(irq); } leave_critical_section(flags); diff --git a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_buttons.c b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_buttons.c index c29d147a29..62791e20e2 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_buttons.c +++ b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_buttons.c @@ -205,7 +205,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { /* Attach then enable the new interrupt handler */ - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); up_enable_irq(irq); } else @@ -213,7 +213,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable then detach the old interrupt handler */ up_disable_irq(irq); - (void)irq_detach(irq); + irq_detach(irq); } leave_critical_section(flags); diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_boot.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_boot.c index 95b76f9960..edc32943e3 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_boot.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_boot.c @@ -98,6 +98,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)lpc54_bringup(); + lpc54_bringup(); } #endif diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_buttons.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_buttons.c index 5551dc35dc..ba361cb4f7 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_buttons.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_buttons.c @@ -83,7 +83,7 @@ static int board_button_interrupt(int irq, FAR void *context, FAR void *arg) { /* Acknowledge the button interrupt */ - (void)lpc54_gpio_ackedge(irq); + lpc54_gpio_ackedge(irq); /* Transfer control to the attached interrupt handler */ @@ -125,7 +125,7 @@ void board_button_initialize(void) */ g_button_irq = lpc54_gpio_irqno(GPIO_BUTTON_USER); - (void)irq_attach(g_button_irq, board_button_interrupt, NULL); + irq_attach(g_button_irq, board_button_interrupt, NULL); #endif } } diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_ft5x06.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_ft5x06.c index 85ade24ce2..859d865eb2 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_ft5x06.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_ft5x06.c @@ -149,7 +149,7 @@ static void lpc54_ft5x06_enable(FAR const struct ft5x06_config_s *config, #ifndef CONFIG_FT5X06_POLLMODE static void lpc54_ft5x06_clear(FAR const struct ft5x06_config_s *config) { - (void)lpc54_gpio_ackedge(g_ft5x06_irq); + lpc54_gpio_ackedge(g_ft5x06_irq); } #endif diff --git a/boards/arm/max326xx/max32660-evsys/src/max326_boot.c b/boards/arm/max326xx/max32660-evsys/src/max326_boot.c index 6cd197dca4..68ed91b089 100644 --- a/boards/arm/max326xx/max32660-evsys/src/max326_boot.c +++ b/boards/arm/max326xx/max32660-evsys/src/max326_boot.c @@ -100,6 +100,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)max326_bringup(); + max326_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/max326xx/max32660-evsys/src/max326_button.c b/boards/arm/max326xx/max32660-evsys/src/max326_button.c index f0c3774267..d77e4a0475 100644 --- a/boards/arm/max326xx/max32660-evsys/src/max326_button.c +++ b/boards/arm/max326xx/max32660-evsys/src/max326_button.c @@ -72,7 +72,7 @@ void board_button_initialize(void) { - (void)max326_gpio_config(GPIO_BUTTON); + max326_gpio_config(GPIO_BUTTON); } /**************************************************************************** @@ -127,7 +127,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { /* Configure the interrupt */ - (void)irq_attach(BUTTON_IRQ, irqhandler, arg); + irq_attach(BUTTON_IRQ, irqhandler, arg); up_enable_irq(BUTTON_IRQ); } else @@ -135,7 +135,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable and detach the interrupt */ up_disable_irq(BUTTON_IRQ); - (void)irq_detach(BUTTON_IRQ); + irq_detach(BUTTON_IRQ); } spin_unlock_irqrestore(flags); diff --git a/boards/arm/nrf52/nrf52-feather/src/nrf52_boot.c b/boards/arm/nrf52/nrf52-feather/src/nrf52_boot.c index f12ce6f34c..bf4572678d 100644 --- a/boards/arm/nrf52/nrf52-feather/src/nrf52_boot.c +++ b/boards/arm/nrf52/nrf52-feather/src/nrf52_boot.c @@ -91,6 +91,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)nrf52_bringup(); + nrf52_bringup(); } #endif diff --git a/boards/arm/s32k1xx/s32k118evb/src/s32k118_boot.c b/boards/arm/s32k1xx/s32k118evb/src/s32k118_boot.c index afe427cdd4..8cec185de3 100644 --- a/boards/arm/s32k1xx/s32k118evb/src/s32k118_boot.c +++ b/boards/arm/s32k1xx/s32k118evb/src/s32k118_boot.c @@ -96,6 +96,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)s32k118_bringup(); + s32k118_bringup(); } #endif diff --git a/boards/arm/s32k1xx/s32k146evb/src/s32k146_boot.c b/boards/arm/s32k1xx/s32k146evb/src/s32k146_boot.c index cfffed406e..4f6c29b3dd 100644 --- a/boards/arm/s32k1xx/s32k146evb/src/s32k146_boot.c +++ b/boards/arm/s32k1xx/s32k146evb/src/s32k146_boot.c @@ -96,6 +96,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)s32k146_bringup(); + s32k146_bringup(); } #endif diff --git a/boards/arm/s32k1xx/s32k148evb/src/s32k148_boot.c b/boards/arm/s32k1xx/s32k148evb/src/s32k148_boot.c index 3fd67cafa4..2032df7923 100644 --- a/boards/arm/s32k1xx/s32k148evb/src/s32k148_boot.c +++ b/boards/arm/s32k1xx/s32k148evb/src/s32k148_boot.c @@ -96,6 +96,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)s32k148_bringup(); + s32k148_bringup(); } #endif diff --git a/boards/arm/sam34/arduino-due/src/sam_boot.c b/boards/arm/sam34/arduino-due/src/sam_boot.c index b7ecf41c34..9ace2c5d74 100644 --- a/boards/arm/sam34/arduino-due/src/sam_boot.c +++ b/boards/arm/sam34/arduino-due/src/sam_boot.c @@ -87,6 +87,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)sam_bringup(); + sam_bringup(); } #endif diff --git a/boards/arm/sam34/arduino-due/src/sam_touchscreen.c b/boards/arm/sam34/arduino-due/src/sam_touchscreen.c index 506bfaa092..5c1f101235 100644 --- a/boards/arm/sam34/arduino-due/src/sam_touchscreen.c +++ b/boards/arm/sam34/arduino-due/src/sam_touchscreen.c @@ -364,7 +364,7 @@ int sam_tsc_setup(int minor) /* Configure and enable the XPT2046 interrupt pin as an input */ - (void)sam_configgpio(GPIO_TSC_IRQ); + sam_configgpio(GPIO_TSC_IRQ); /* Configure the PIO interrupt */ diff --git a/boards/arm/sam34/flipnclick-sam3x/src/sam_boot.c b/boards/arm/sam34/flipnclick-sam3x/src/sam_boot.c index 02b5e6c4d1..be012463d5 100644 --- a/boards/arm/sam34/flipnclick-sam3x/src/sam_boot.c +++ b/boards/arm/sam34/flipnclick-sam3x/src/sam_boot.c @@ -88,6 +88,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)sam_bringup(); + sam_bringup(); } #endif diff --git a/boards/arm/sam34/flipnclick-sam3x/src/sam_ssd1306.c b/boards/arm/sam34/flipnclick-sam3x/src/sam_ssd1306.c index 62b0489797..6553435ed1 100644 --- a/boards/arm/sam34/flipnclick-sam3x/src/sam_ssd1306.c +++ b/boards/arm/sam34/flipnclick-sam3x/src/sam_ssd1306.c @@ -137,7 +137,7 @@ FAR struct lcd_dev_s *sam_graphics_setup(unsigned int devno) /* And turn the OLED on */ - (void)dev->setpower(dev, CONFIG_LCD_MAXPOWER); + dev->setpower(dev, CONFIG_LCD_MAXPOWER); #if defined(CONFIG_VIDEO_FB) && defined(CONFIG_LCD_FRAMEBUFFER) diff --git a/boards/arm/sam34/sam3u-ek/src/sam_buttons.c b/boards/arm/sam34/sam3u-ek/src/sam_buttons.c index 64422d3a40..defb2efbee 100644 --- a/boards/arm/sam34/sam3u-ek/src/sam_buttons.c +++ b/boards/arm/sam34/sam3u-ek/src/sam_buttons.c @@ -85,14 +85,14 @@ static int board_button_irqx(gpio_pinset_t pinset, int irq, xcpt_t irqhandler, /* Configure the interrupt */ sam_gpioirq(pinset); - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); sam_gpioirqenable(irq); } else { /* Detach and disable the interrupt */ - (void)irq_detach(irq); + irq_detach(irq); sam_gpioirqdisable(irq); } @@ -118,8 +118,8 @@ static int board_button_irqx(gpio_pinset_t pinset, int irq, xcpt_t irqhandler, void board_button_initialize(void) { - (void)sam_configgpio(GPIO_BUTTON1); - (void)sam_configgpio(GPIO_BUTTON2); + sam_configgpio(GPIO_BUTTON1); + sam_configgpio(GPIO_BUTTON2); } /**************************************************************************** diff --git a/boards/arm/sam34/sam3u-ek/src/sam_leds.c b/boards/arm/sam34/sam3u-ek/src/sam_leds.c index 1ea9d3ab21..f3572be032 100644 --- a/boards/arm/sam34/sam3u-ek/src/sam_leds.c +++ b/boards/arm/sam34/sam3u-ek/src/sam_leds.c @@ -156,9 +156,9 @@ static void sam_setleds(uint8_t state) void board_autoled_initialize(void) { - (void)sam_configgpio(GPIO_LED0); - (void)sam_configgpio(GPIO_LED1); - (void)sam_configgpio(GPIO_LED2); + sam_configgpio(GPIO_LED0); + sam_configgpio(GPIO_LED1); + sam_configgpio(GPIO_LED2); } /**************************************************************************** diff --git a/boards/arm/sam34/sam3u-ek/src/sam_touchscreen.c b/boards/arm/sam34/sam3u-ek/src/sam_touchscreen.c index 05316c289a..a10061dca0 100644 --- a/boards/arm/sam34/sam3u-ek/src/sam_touchscreen.c +++ b/boards/arm/sam34/sam3u-ek/src/sam_touchscreen.c @@ -243,8 +243,8 @@ int sam_tsc_setup(int minor) /* Configure and enable the ADS7843E interrupt pin as an input */ - (void)sam_configgpio(GPIO_TCS_BUSY); - (void)sam_configgpio(GPIO_TCS_IRQ); + sam_configgpio(GPIO_TCS_BUSY); + sam_configgpio(GPIO_TCS_IRQ); /* Configure the PIO interrupt */ diff --git a/boards/arm/sam34/sam4cmp-db/src/sam_boot.c b/boards/arm/sam34/sam4cmp-db/src/sam_boot.c index 4cb8deab7f..56b5cd8b77 100644 --- a/boards/arm/sam34/sam4cmp-db/src/sam_boot.c +++ b/boards/arm/sam34/sam4cmp-db/src/sam_boot.c @@ -83,6 +83,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)sam_bringup(); + sam_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/sam34/sam4e-ek/src/sam_ads7843e.c b/boards/arm/sam34/sam4e-ek/src/sam_ads7843e.c index a94d01efbc..e432fd46a0 100644 --- a/boards/arm/sam34/sam4e-ek/src/sam_ads7843e.c +++ b/boards/arm/sam34/sam4e-ek/src/sam_ads7843e.c @@ -240,8 +240,8 @@ int sam_tsc_setup(int minor) /* Configure and enable the ADS7843E interrupt pin as an input */ - (void)sam_configgpio(GPIO_TCS_BUSY); - (void)sam_configgpio(GPIO_TCS_IRQ); + sam_configgpio(GPIO_TCS_BUSY); + sam_configgpio(GPIO_TCS_IRQ); /* Configure the PIO interrupt */ diff --git a/boards/arm/sam34/sam4e-ek/src/sam_boot.c b/boards/arm/sam34/sam4e-ek/src/sam_boot.c index 682394ba48..c7fa7901c5 100644 --- a/boards/arm/sam34/sam4e-ek/src/sam_boot.c +++ b/boards/arm/sam34/sam4e-ek/src/sam_boot.c @@ -67,9 +67,9 @@ static inline void board_config_usart1(void) { #if defined(CONFIG_USART1_RS485) - (void)sam_configgpio(GPIO_RS485_ENABLE); + sam_configgpio(GPIO_RS485_ENABLE); #else /* if defined(CONFIG_USART1_SERIALDRIVER) */ - (void)sam_configgpio(GPIO_RS232_ENABLE); + sam_configgpio(GPIO_RS232_ENABLE); #endif } #else @@ -149,7 +149,7 @@ void board_late_initialize(void) */ #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) - (void)board_app_initialize(0); + board_app_initialize(0); #endif } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/sam34/sam4e-ek/src/sam_buttons.c b/boards/arm/sam34/sam4e-ek/src/sam_buttons.c index fe7341383f..0b577d5e79 100644 --- a/boards/arm/sam34/sam4e-ek/src/sam_buttons.c +++ b/boards/arm/sam34/sam4e-ek/src/sam_buttons.c @@ -85,14 +85,14 @@ static int board_button_irqx(gpio_pinset_t pinset, int irq, xcpt_t irqhandler, /* Configure the interrupt */ sam_gpioirq(pinset); - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); sam_gpioirqenable(irq); } else { /* Detach and disable the interrupt */ - (void)irq_detach(irq); + irq_detach(irq); sam_gpioirqdisable(irq); } @@ -118,10 +118,10 @@ static int board_button_irqx(gpio_pinset_t pinset, int irq, xcpt_t irqhandler, void board_button_initialize(void) { - (void)sam_configgpio(GPIO_SCROLLUP); - (void)sam_configgpio(GPIO_SCROLLDWN); - (void)sam_configgpio(GPIO_WAKU); - (void)sam_configgpio(GPIO_TAMP); + sam_configgpio(GPIO_SCROLLUP); + sam_configgpio(GPIO_SCROLLDWN); + sam_configgpio(GPIO_WAKU); + sam_configgpio(GPIO_TAMP); } /**************************************************************************** diff --git a/boards/arm/sam34/sam4e-ek/src/sam_ethernet.c b/boards/arm/sam34/sam4e-ek/src/sam_ethernet.c index ce22f1be6e..1465d7e56d 100644 --- a/boards/arm/sam34/sam4e-ek/src/sam_ethernet.c +++ b/boards/arm/sam34/sam4e-ek/src/sam_ethernet.c @@ -228,12 +228,12 @@ int arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg, sam_gpioirq(pinset); phyinfo("Attach IRQ%d\n", irq); - (void)irq_attach(irq, handler, arg); + irq_attach(irq, handler, arg); } else { phyinfo("Detach IRQ%d\n", irq); - (void)irq_detach(irq); + irq_detach(irq); enabler = NULL; } diff --git a/boards/arm/sam34/sam4e-ek/src/sam_hsmci.c b/boards/arm/sam34/sam4e-ek/src/sam_hsmci.c index a41dbf9a46..0867d23356 100644 --- a/boards/arm/sam34/sam4e-ek/src/sam_hsmci.c +++ b/boards/arm/sam34/sam4e-ek/src/sam_hsmci.c @@ -162,7 +162,7 @@ int sam_hsmci_initialize(int minor) /* Configure card detect interrupts */ sam_gpioirq(GPIO_MCI_CD); - (void)irq_attach(MCI_CD_IRQ, sam_hsmci_cardetect, NULL); + irq_attach(MCI_CD_IRQ, sam_hsmci_cardetect, NULL); /* Then inform the HSMCI driver if there is or is not a card in the slot. */ diff --git a/boards/arm/sam34/sam4e-ek/src/sam_leds.c b/boards/arm/sam34/sam4e-ek/src/sam_leds.c index 9bc15463fd..840eab4e79 100644 --- a/boards/arm/sam34/sam4e-ek/src/sam_leds.c +++ b/boards/arm/sam34/sam4e-ek/src/sam_leds.c @@ -178,9 +178,9 @@ static void sam_setleds(uint8_t state) void board_autoled_initialize(void) { - (void)sam_configgpio(GPIO_D3); - (void)sam_configgpio(GPIO_D2); - (void)sam_configgpio(GPIO_D4); + sam_configgpio(GPIO_D3); + sam_configgpio(GPIO_D2); + sam_configgpio(GPIO_D4); } /**************************************************************************** diff --git a/boards/arm/sam34/sam4l-xplained/src/sam_autoleds.c b/boards/arm/sam34/sam4l-xplained/src/sam_autoleds.c index c2f2c67885..cfd5c33731 100644 --- a/boards/arm/sam34/sam4l-xplained/src/sam_autoleds.c +++ b/boards/arm/sam34/sam4l-xplained/src/sam_autoleds.c @@ -87,7 +87,7 @@ void board_autoled_initialize(void) { - (void)sam_configgpio(GPIO_LED0); + sam_configgpio(GPIO_LED0); } /**************************************************************************** diff --git a/boards/arm/sam34/sam4l-xplained/src/sam_buttons.c b/boards/arm/sam34/sam4l-xplained/src/sam_buttons.c index 02c234239a..1a13f02618 100644 --- a/boards/arm/sam34/sam4l-xplained/src/sam_buttons.c +++ b/boards/arm/sam34/sam4l-xplained/src/sam_buttons.c @@ -70,7 +70,7 @@ void board_button_initialize(void) { - (void)sam_configgpio(GPIO_SW0); + sam_configgpio(GPIO_SW0); } /**************************************************************************** @@ -128,14 +128,14 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Configure the interrupt */ sam_gpioirq(GPIO_SW0); - (void)irq_attach(IRQ_SW0, irqhandler, arg); + irq_attach(IRQ_SW0, irqhandler, arg); sam_gpioirqenable(IRQ_SW0); } else { /* Detach and disable the interrupt */ - (void)irq_detach(IRQ_SW0); + irq_detach(IRQ_SW0); sam_gpioirqdisable(IRQ_SW0); } diff --git a/boards/arm/sam34/sam4l-xplained/src/sam_spi.c b/boards/arm/sam34/sam4l-xplained/src/sam_spi.c index 6111a659ab..3ad66cebaf 100644 --- a/boards/arm/sam34/sam4l-xplained/src/sam_spi.c +++ b/boards/arm/sam34/sam4l-xplained/src/sam_spi.c @@ -243,7 +243,7 @@ int sam_spic0mddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) * Low: the inputs are transferred to the command registers. */ - (void)sam_gpiowrite(GPIO_OLED_DATA, !cmd); + sam_gpiowrite(GPIO_OLED_DATA, !cmd); } #endif return OK; diff --git a/boards/arm/sam34/sam4l-xplained/src/sam_ug2832hsweg04.c b/boards/arm/sam34/sam4l-xplained/src/sam_ug2832hsweg04.c index 495b3d065b..135d7af26d 100644 --- a/boards/arm/sam34/sam4l-xplained/src/sam_ug2832hsweg04.c +++ b/boards/arm/sam34/sam4l-xplained/src/sam_ug2832hsweg04.c @@ -135,7 +135,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) * putting the OLED into reset state. */ - (void)sam_configgpio(GPIO_OLED_RST); + sam_configgpio(GPIO_OLED_RST); /* Wait a bit then release the OLED from the reset state */ @@ -164,7 +164,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* And turn the OLED on */ - (void)dev->setpower(dev, CONFIG_LCD_MAXPOWER); + dev->setpower(dev, CONFIG_LCD_MAXPOWER); return dev; } } diff --git a/boards/arm/sam34/sam4l-xplained/src/sam_userleds.c b/boards/arm/sam34/sam4l-xplained/src/sam_userleds.c index 57364074f6..f38d9a6eef 100644 --- a/boards/arm/sam34/sam4l-xplained/src/sam_userleds.c +++ b/boards/arm/sam34/sam4l-xplained/src/sam_userleds.c @@ -79,7 +79,7 @@ void board_userled_initialize(void) { - (void)sam_configgpio(GPIO_LED0); + sam_configgpio(GPIO_LED0); } /**************************************************************************** diff --git a/boards/arm/sam34/sam4s-xplained-pro/src/sam_buttons.c b/boards/arm/sam34/sam4s-xplained-pro/src/sam_buttons.c index 3d8c52d4ec..7ee1011053 100644 --- a/boards/arm/sam34/sam4s-xplained-pro/src/sam_buttons.c +++ b/boards/arm/sam34/sam4s-xplained-pro/src/sam_buttons.c @@ -72,7 +72,7 @@ void board_button_initialize(void) { - (void)sam_configgpio(GPIO_SW0); + sam_configgpio(GPIO_SW0); } /**************************************************************************** @@ -130,14 +130,14 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Configure the interrupt */ sam_gpioirq(GPIO_SW0); - (void)irq_attach(IRQ_SW0, irqhandler, arg); + irq_attach(IRQ_SW0, irqhandler, arg); sam_gpioirqenable(IRQ_SW0); } else { /* Detach and disable the interrupt */ - (void)irq_detach(IRQ_SW0); + irq_detach(IRQ_SW0); sam_gpioirqdisable(IRQ_SW0); } diff --git a/boards/arm/sam34/sam4s-xplained-pro/src/sam_hsmci.c b/boards/arm/sam34/sam4s-xplained-pro/src/sam_hsmci.c index e5c9f8ea20..9da56850fb 100644 --- a/boards/arm/sam34/sam4s-xplained-pro/src/sam_hsmci.c +++ b/boards/arm/sam34/sam4s-xplained-pro/src/sam_hsmci.c @@ -170,7 +170,7 @@ int sam_hsmci_initialize(void) /* Configure card detect interrupts */ sam_gpioirq(GPIO_MCI_CD); - (void)irq_attach(MCI_CD_IRQ, sam_hsmci_cardetect_int, NULL); + irq_attach(MCI_CD_IRQ, sam_hsmci_cardetect_int, NULL); g_hsmci.inserted = sam_cardinserted(0); #else g_hsmci.inserted = true; /* An assumption? */ diff --git a/boards/arm/sam34/sam4s-xplained/src/sam_buttons.c b/boards/arm/sam34/sam4s-xplained/src/sam_buttons.c index 0e350487d5..24207e1001 100644 --- a/boards/arm/sam34/sam4s-xplained/src/sam_buttons.c +++ b/boards/arm/sam34/sam4s-xplained/src/sam_buttons.c @@ -71,7 +71,7 @@ void board_button_initialize(void) { - (void)sam_configgpio(GPIO_BP2); + sam_configgpio(GPIO_BP2); } /**************************************************************************** @@ -129,14 +129,14 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Configure the interrupt */ sam_gpioirq(GPIO_BP2); - (void)irq_attach(IRQ_BP2, irqhandler, arg); + irq_attach(IRQ_BP2, irqhandler, arg); sam_gpioirqenable(IRQ_BP2); } else { /* Detach and disable the interrupt */ - (void)irq_detach(IRQ_BP2); + irq_detach(IRQ_BP2); sam_gpioirqdisable(IRQ_BP2); } diff --git a/boards/arm/sama5/sama5d2-xult/src/sam_boot.c b/boards/arm/sama5/sama5d2-xult/src/sam_boot.c index 34720525b3..86335a7012 100644 --- a/boards/arm/sama5/sama5d2-xult/src/sam_boot.c +++ b/boards/arm/sama5/sama5d2-xult/src/sam_boot.c @@ -95,6 +95,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)sam_bringup(); + sam_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/sama5/sama5d2-xult/src/sam_buttons.c b/boards/arm/sama5/sama5d2-xult/src/sam_buttons.c index b7e6b5a584..afe1d92218 100644 --- a/boards/arm/sama5/sama5d2-xult/src/sam_buttons.c +++ b/boards/arm/sama5/sama5d2-xult/src/sam_buttons.c @@ -83,7 +83,7 @@ void board_button_initialize(void) { - (void)sam_configpio(PIO_BTN_USER); + sam_configpio(PIO_BTN_USER); } /**************************************************************************** @@ -139,7 +139,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Configure the interrupt */ sam_pioirq(PIO_BTN_USER); - (void)irq_attach(IRQ_BTN_USER, irqhandler, arg); + irq_attach(IRQ_BTN_USER, irqhandler, arg); sam_pioirqenable(IRQ_BTN_USER); } else @@ -147,7 +147,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable and detach the interrupt */ sam_pioirqdisable(IRQ_BTN_USER); - (void)irq_detach(IRQ_BTN_USER); + irq_detach(IRQ_BTN_USER); } leave_critical_section(flags); diff --git a/boards/arm/sama5/sama5d3-xplained/src/sam_ajoystick.c b/boards/arm/sama5/sama5d3-xplained/src/sam_ajoystick.c index cb065f812e..1a2efba189 100644 --- a/boards/arm/sama5/sama5d3-xplained/src/sam_ajoystick.c +++ b/boards/arm/sama5/sama5d3-xplained/src/sam_ajoystick.c @@ -429,7 +429,7 @@ int sam_ajoy_initialization(void) */ sam_pioirq(g_joypio[i]); - (void)irq_attach(g_joyirq[i], ajoy_interrupt, NULL); + irq_attach(g_joyirq[i], ajoy_interrupt, NULL); sam_pioirqdisable(g_joyirq[i]); } diff --git a/boards/arm/sama5/sama5d3-xplained/src/sam_boot.c b/boards/arm/sama5/sama5d3-xplained/src/sam_boot.c index 8e61e35f30..7ae4185087 100644 --- a/boards/arm/sama5/sama5d3-xplained/src/sam_boot.c +++ b/boards/arm/sama5/sama5d3-xplained/src/sam_boot.c @@ -154,7 +154,7 @@ void board_late_initialize(void) */ #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) - (void)board_app_initialize(0); + board_app_initialize(0); #endif } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/sama5/sama5d3-xplained/src/sam_buttons.c b/boards/arm/sama5/sama5d3-xplained/src/sam_buttons.c index 3232cb2fde..8c6d592825 100644 --- a/boards/arm/sama5/sama5d3-xplained/src/sam_buttons.c +++ b/boards/arm/sama5/sama5d3-xplained/src/sam_buttons.c @@ -87,7 +87,7 @@ void board_button_initialize(void) { - (void)sam_configpio(PIO_USER); + sam_configpio(PIO_USER); } /**************************************************************************** @@ -143,7 +143,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Configure the interrupt */ sam_pioirq(PIO_USER); - (void)irq_attach(IRQ_USER1, irqhandler, arg); + irq_attach(IRQ_USER1, irqhandler, arg); sam_pioirqenable(IRQ_USER1); } else @@ -151,7 +151,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable and detach the interrupt */ sam_pioirqdisable(IRQ_USER1); - (void)irq_detach(IRQ_USER1); + irq_detach(IRQ_USER1); } leave_critical_section(flags); diff --git a/boards/arm/sama5/sama5d3-xplained/src/sam_ethernet.c b/boards/arm/sama5/sama5d3-xplained/src/sam_ethernet.c index 6d76f714fc..1a5dd5182c 100644 --- a/boards/arm/sama5/sama5d3-xplained/src/sam_ethernet.c +++ b/boards/arm/sama5/sama5d3-xplained/src/sam_ethernet.c @@ -313,12 +313,12 @@ int arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg, sam_pioirq(pinset); phyinfo("Attach IRQ%d\n", irq); - (void)irq_attach(irq, handler, arg); + irq_attach(irq, handler, arg); } else { phyinfo("Detach IRQ%d\n", irq); - (void)irq_detach(irq); + irq_detach(irq); enabler = NULL; } diff --git a/boards/arm/sama5/sama5d3-xplained/src/sam_hsmci.c b/boards/arm/sama5/sama5d3-xplained/src/sam_hsmci.c index df7d5b30cd..f55d9a9110 100644 --- a/boards/arm/sama5/sama5d3-xplained/src/sam_hsmci.c +++ b/boards/arm/sama5/sama5d3-xplained/src/sam_hsmci.c @@ -287,7 +287,7 @@ int sam_hsmci_initialize(int slotno, int minor) /* Configure card detect interrupts */ sam_pioirq(state->pincfg); - (void)irq_attach(state->irq, state->handler, NULL); + irq_attach(state->irq, state->handler, NULL); /* Then inform the HSMCI driver if there is or is not a card in the slot. */ diff --git a/boards/arm/sama5/sama5d3-xplained/src/sam_usb.c b/boards/arm/sama5/sama5d3-xplained/src/sam_usb.c index 2fa6d92654..621a0cc788 100644 --- a/boards/arm/sama5/sama5d3-xplained/src/sam_usb.c +++ b/boards/arm/sama5/sama5d3-xplained/src/sam_usb.c @@ -132,7 +132,7 @@ static int usbhost_waiter(struct usbhost_connection_s *dev) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(dev, hport); + CONN_ENUMERATE(dev, hport); } } @@ -523,7 +523,7 @@ xcpt_t sam_setup_overcurrent(xcpt_t handler) /* Configure the interrupt */ sam_pioirq(PIO_USBBC_VBUS_OVERCURRENT); - (void)irq_attach(IRQ_USBBC_VBUS_OVERCURRENT, handler, NULL); + irq_attach(IRQ_USBBC_VBUS_OVERCURRENT, handler, NULL); sam_pioirqenable(IRQ_USBBC_VBUS_OVERCURRENT); /* Return the old handler (so that it can be restored) */ diff --git a/boards/arm/sama5/sama5d3x-ek/src/nor_main.c b/boards/arm/sama5/sama5d3x-ek/src/nor_main.c index 647777711e..f132505ed6 100644 --- a/boards/arm/sama5/sama5d3x-ek/src/nor_main.c +++ b/boards/arm/sama5/sama5d3x-ek/src/nor_main.c @@ -141,7 +141,7 @@ int nor_main(int argc, char *argv) * will hang when the interrupts are disabled! */ - (void)up_irq_save(); + up_irq_save(); /* Disable MATRIX write protection */ diff --git a/boards/arm/sama5/sama5d3x-ek/src/sam_boot.c b/boards/arm/sama5/sama5d3x-ek/src/sam_boot.c index 63f6d83aee..620c0e708b 100644 --- a/boards/arm/sama5/sama5d3x-ek/src/sam_boot.c +++ b/boards/arm/sama5/sama5d3x-ek/src/sam_boot.c @@ -158,7 +158,7 @@ void board_late_initialize(void) */ #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) - (void)board_app_initialize(0); + board_app_initialize(0); #endif } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/sama5/sama5d3x-ek/src/sam_buttons.c b/boards/arm/sama5/sama5d3x-ek/src/sam_buttons.c index 217f74726a..a10446cf38 100644 --- a/boards/arm/sama5/sama5d3x-ek/src/sam_buttons.c +++ b/boards/arm/sama5/sama5d3x-ek/src/sam_buttons.c @@ -86,7 +86,7 @@ void board_button_initialize(void) { - (void)sam_configpio(PIO_USER1); + sam_configpio(PIO_USER1); } /**************************************************************************** @@ -142,7 +142,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Configure the interrupt */ sam_pioirq(PIO_USER1); - (void)irq_attach(IRQ_USER1, irqhandler, arg); + irq_attach(IRQ_USER1, irqhandler, arg); sam_pioirqenable(IRQ_USER1); } else @@ -150,7 +150,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable and detach the interrupt */ sam_pioirqdisable(IRQ_USER1); - (void)irq_detach(IRQ_USER1); + irq_detach(IRQ_USER1); } leave_critical_section(flags); diff --git a/boards/arm/sama5/sama5d3x-ek/src/sam_ethernet.c b/boards/arm/sama5/sama5d3x-ek/src/sam_ethernet.c index c32a54f90d..f557c55f89 100644 --- a/boards/arm/sama5/sama5d3x-ek/src/sam_ethernet.c +++ b/boards/arm/sama5/sama5d3x-ek/src/sam_ethernet.c @@ -313,12 +313,12 @@ int arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg, sam_pioirq(pinset); phyinfo("Attach IRQ%d\n", irq); - (void)irq_attach(irq, handler, arg); + irq_attach(irq, handler, arg); } else { phyinfo("Detach IRQ%d\n", irq); - (void)irq_detach(irq); + irq_detach(irq); enabler = NULL; } diff --git a/boards/arm/sama5/sama5d3x-ek/src/sam_hsmci.c b/boards/arm/sama5/sama5d3x-ek/src/sam_hsmci.c index a1f53003bd..8b1beb4b26 100644 --- a/boards/arm/sama5/sama5d3x-ek/src/sam_hsmci.c +++ b/boards/arm/sama5/sama5d3x-ek/src/sam_hsmci.c @@ -288,7 +288,7 @@ int sam_hsmci_initialize(int slotno, int minor) /* Configure card detect interrupts */ sam_pioirq(state->pincfg); - (void)irq_attach(state->irq, state->handler, NULL); + irq_attach(state->irq, state->handler, NULL); /* Then inform the HSMCI driver if there is or is not a card in the slot. */ diff --git a/boards/arm/sama5/sama5d3x-ek/src/sam_usb.c b/boards/arm/sama5/sama5d3x-ek/src/sam_usb.c index 33d71c4ada..1d6cbb6254 100644 --- a/boards/arm/sama5/sama5d3x-ek/src/sam_usb.c +++ b/boards/arm/sama5/sama5d3x-ek/src/sam_usb.c @@ -132,7 +132,7 @@ static int usbhost_waiter(struct usbhost_connection_s *dev) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(dev, hport); + CONN_ENUMERATE(dev, hport); } } @@ -516,7 +516,7 @@ xcpt_t sam_setup_overcurrent(xcpt_t handler) /* Configure the interrupt */ sam_pioirq(PIO_USBBC_VBUS_OVERCURRENT); - (void)irq_attach(IRQ_USBBC_VBUS_OVERCURRENT, handler, NULL); + irq_attach(IRQ_USBBC_VBUS_OVERCURRENT, handler, NULL); sam_pioirqenable(IRQ_USBBC_VBUS_OVERCURRENT); /* Return the old handler (so that it can be restored) */ diff --git a/boards/arm/sama5/sama5d3x-ek/src/sam_wm8904.c b/boards/arm/sama5/sama5d3x-ek/src/sam_wm8904.c index 09ab0eb403..5557abf15d 100644 --- a/boards/arm/sama5/sama5d3x-ek/src/sam_wm8904.c +++ b/boards/arm/sama5/sama5d3x-ek/src/sam_wm8904.c @@ -165,7 +165,7 @@ static int wm8904_attach(FAR const struct wm8904_lower_s *lower, else { audinfo("Detaching %p\n", g_wm8904info.handler); - (void)wm8904_enable(lower, false); + wm8904_enable(lower, false); g_wm8904info.handler = NULL; g_wm8904info.arg = NULL; } @@ -267,7 +267,7 @@ int sam_wm8904_initialize(int minor) { /* Configure the WM8904 interrupt pin */ - (void)sam_configpio(PIO_INT_WM8904); + sam_configpio(PIO_INT_WM8904); /* Get an instance of the I2C interface for the WM8904 chip select */ @@ -299,11 +299,11 @@ int sam_wm8904_initialize(int minor) * The slow clock was enabled in sam_boot.c if needed. */ - (void)sam_pck_configure(PCK0, PCKSRC_SCK, BOARD_SLOWCLK_FREQUENCY); + sam_pck_configure(PCK0, PCKSRC_SCK, BOARD_SLOWCLK_FREQUENCY); #else /* Drive the DAC with the main clock (12 MHz) */ - (void)sam_pck_configure(PCK0, PCKSRC_MAINCK, BOARD_MAINCK_FREQUENCY); + sam_pck_configure(PCK0, PCKSRC_MAINCK, BOARD_MAINCK_FREQUENCY); #endif /* Enable the DAC master clock */ diff --git a/boards/arm/sama5/sama5d4-ek/src/dram_main.c b/boards/arm/sama5/sama5d4-ek/src/dram_main.c index 4d86740d44..619b93369f 100644 --- a/boards/arm/sama5/sama5d4-ek/src/dram_main.c +++ b/boards/arm/sama5/sama5d4-ek/src/dram_main.c @@ -153,7 +153,7 @@ int dram_main(int argc, char *argv) * hang when the interrupts are disabled! */ - (void)up_irq_save(); + up_irq_save(); /* Disable the caches and the MMU. Disabling the MMU should be safe here * because there is a 1-to-1 identity mapping between the physical and diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_automount.c b/boards/arm/sama5/sama5d4-ek/src/sam_automount.c index 66a5601027..be8c9041b2 100644 --- a/boards/arm/sama5/sama5d4-ek/src/sam_automount.c +++ b/boards/arm/sama5/sama5d4-ek/src/sam_automount.c @@ -232,7 +232,7 @@ static void sam_enable(FAR const struct automount_lower_s *lower, bool enable) if (state->handler) { bool inserted = sam_cardinserted(config->hsmci); - (void)state->handler(&config->lower, state->arg, inserted); + state->handler(&config->lower, state->arg, inserted); } state->pending = false; @@ -389,7 +389,7 @@ void sam_automount_event(int slotno, bool inserted) { /* No.. forward the event to the handler */ - (void)state->handler(&config->lower, state->arg, inserted); + state->handler(&config->lower, state->arg, inserted); } } } diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_boot.c b/boards/arm/sama5/sama5d4-ek/src/sam_boot.c index 1909b4bd4b..7acf35b218 100644 --- a/boards/arm/sama5/sama5d4-ek/src/sam_boot.c +++ b/boards/arm/sama5/sama5d4-ek/src/sam_boot.c @@ -154,6 +154,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)sam_bringup(); + sam_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_buttons.c b/boards/arm/sama5/sama5d4-ek/src/sam_buttons.c index 3ac0eb6bf6..21e778156c 100644 --- a/boards/arm/sama5/sama5d4-ek/src/sam_buttons.c +++ b/boards/arm/sama5/sama5d4-ek/src/sam_buttons.c @@ -82,7 +82,7 @@ void board_button_initialize(void) { - (void)sam_configpio(PIO_BTN_USER); + sam_configpio(PIO_BTN_USER); } /**************************************************************************** @@ -138,7 +138,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Configure the interrupt */ sam_pioirq(PIO_BTN_USER); - (void)irq_attach(IRQ_BTN_USER, irqhandler, arg); + irq_attach(IRQ_BTN_USER, irqhandler, arg); sam_pioirqenable(IRQ_BTN_USER); } else @@ -146,7 +146,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Disable and detach the interrupt */ sam_pioirqdisable(IRQ_BTN_USER); - (void)irq_detach(IRQ_BTN_USER); + irq_detach(IRQ_BTN_USER); } leave_critical_section(flags); diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_ethernet.c b/boards/arm/sama5/sama5d4-ek/src/sam_ethernet.c index de2249f18f..8acfc9cb09 100644 --- a/boards/arm/sama5/sama5d4-ek/src/sam_ethernet.c +++ b/boards/arm/sama5/sama5d4-ek/src/sam_ethernet.c @@ -281,12 +281,12 @@ int arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg, sam_pioirq(pinset); phyinfo("Attach IRQ%d\n", irq); - (void)irq_attach(irq, handler, arg); + irq_attach(irq, handler, arg); } else { phyinfo("Detach IRQ%d\n", irq); - (void)irq_detach(irq); + irq_detach(irq); enabler = NULL; } diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_hsmci.c b/boards/arm/sama5/sama5d4-ek/src/sam_hsmci.c index 3b0cdf53b0..7b50fbcef1 100644 --- a/boards/arm/sama5/sama5d4-ek/src/sam_hsmci.c +++ b/boards/arm/sama5/sama5d4-ek/src/sam_hsmci.c @@ -339,7 +339,7 @@ int sam_hsmci_initialize(int slotno, int minor) /* Configure card detect interrupts */ sam_pioirq(state->cdcfg); - (void)irq_attach(state->irq, state->handler, NULL); + irq_attach(state->irq, state->handler, NULL); /* Then inform the HSMCI driver if there is or is not a card in the slot. */ diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_maxtouch.c b/boards/arm/sama5/sama5d4-ek/src/sam_maxtouch.c index d9d971b07d..68d1a18411 100644 --- a/boards/arm/sama5/sama5d4-ek/src/sam_maxtouch.c +++ b/boards/arm/sama5/sama5d4-ek/src/sam_maxtouch.c @@ -247,7 +247,7 @@ int sam_tsc_setup(int minor) /* Configure the maXTouch CHG interrupt pin */ - (void)sam_configpio(PIO_CHG_MXT); + sam_configpio(PIO_CHG_MXT); /* Get an instance of the I2C interface for the touchscreen chip select */ @@ -261,7 +261,7 @@ int sam_tsc_setup(int minor) /* Configure maXTouch CHG interrupts */ sam_pioirq(PIO_CHG_MXT); - (void)irq_attach(IRQ_CHG_MXT, mxt_interrupt, NULL); + irq_attach(IRQ_CHG_MXT, mxt_interrupt, NULL); /* Initialize and register the I2C touchscreen device */ diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_pmic.c b/boards/arm/sama5/sama5d4-ek/src/sam_pmic.c index 4c7497f54f..d4cc9e190d 100644 --- a/boards/arm/sama5/sama5d4-ek/src/sam_pmic.c +++ b/boards/arm/sama5/sama5d4-ek/src/sam_pmic.c @@ -94,15 +94,15 @@ void sam_pmic_initialize(void) buffer[0] = 0x0b; buffer[1] = 0xee; - (void)i2c_write(i2c, &config, buffer, 2); + i2c_write(i2c, &config, buffer, 2); buffer[0] = 0x02; buffer[1] = 0x0f; - (void)i2c_write(i2c, &config, buffer, 2); + i2c_write(i2c, &config, buffer, 2); buffer[0] = 0x03; buffer[1] = 0x0f; - (void)i2c_write(i2c, &config, buffer, 2); + i2c_write(i2c, &config, buffer, 2); } } diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_usb.c b/boards/arm/sama5/sama5d4-ek/src/sam_usb.c index 93d36b6db0..b3e1a20e82 100644 --- a/boards/arm/sama5/sama5d4-ek/src/sam_usb.c +++ b/boards/arm/sama5/sama5d4-ek/src/sam_usb.c @@ -132,7 +132,7 @@ static int usbhost_waiter(struct usbhost_connection_s *dev) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(dev, hport); + CONN_ENUMERATE(dev, hport); } } @@ -516,7 +516,7 @@ xcpt_t sam_setup_overcurrent(xcpt_t handler) /* Configure the interrupt */ sam_pioirq(PIO_USBBC_VBUS_OVERCURRENT); - (void)irq_attach(IRQ_USBBC_VBUS_OVERCURRENT, handler, NULL); + irq_attach(IRQ_USBBC_VBUS_OVERCURRENT, handler, NULL); sam_pioirqenable(IRQ_USBBC_VBUS_OVERCURRENT); /* Return the old handler (so that it can be restored) */ diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_wm8904.c b/boards/arm/sama5/sama5d4-ek/src/sam_wm8904.c index 6e40649934..8b5843ee83 100644 --- a/boards/arm/sama5/sama5d4-ek/src/sam_wm8904.c +++ b/boards/arm/sama5/sama5d4-ek/src/sam_wm8904.c @@ -164,7 +164,7 @@ static int wm8904_attach(FAR const struct wm8904_lower_s *lower, else { audinfo("Detaching %p\n", g_wm8904info.handler); - (void)wm8904_enable(lower, false); + wm8904_enable(lower, false); g_wm8904info.handler = NULL; g_wm8904info.arg = NULL; } @@ -266,7 +266,7 @@ int sam_wm8904_initialize(int minor) { /* Configure the WM8904 interrupt pin */ - (void)sam_configpio(PIO_INT_WM8904); + sam_configpio(PIO_INT_WM8904); /* Get an instance of the I2C interface for the WM8904 chip select */ @@ -297,11 +297,11 @@ int sam_wm8904_initialize(int minor) * enabled in sam_boot.c if needed. */ - (void)sam_pck_configure(PCK2, PCKSRC_SCK, BOARD_SLOWCLK_FREQUENCY); + sam_pck_configure(PCK2, PCKSRC_SCK, BOARD_SLOWCLK_FREQUENCY); #else /* Drive the DAC with the main clock (12 MHz) */ - (void)sam_pck_configure(PCK2, PCKSRC_MAINCK, BOARD_MAINCK_FREQUENCY); + sam_pck_configure(PCK2, PCKSRC_MAINCK, BOARD_MAINCK_FREQUENCY); #endif /* Enable the DAC master clock */ diff --git a/boards/arm/samd2l2/arduino-m0/src/sam_autoleds.c b/boards/arm/samd2l2/arduino-m0/src/sam_autoleds.c index 9ec42a2ac2..e16f34243d 100644 --- a/boards/arm/samd2l2/arduino-m0/src/sam_autoleds.c +++ b/boards/arm/samd2l2/arduino-m0/src/sam_autoleds.c @@ -82,7 +82,7 @@ void board_autoled_initialize(void) { - (void)sam_configport(PORT_STATUS_LED); + sam_configport(PORT_STATUS_LED); } /**************************************************************************** diff --git a/boards/arm/samd2l2/arduino-m0/src/sam_userleds.c b/boards/arm/samd2l2/arduino-m0/src/sam_userleds.c index 6dcffcc964..7cae4a3bd3 100644 --- a/boards/arm/samd2l2/arduino-m0/src/sam_userleds.c +++ b/boards/arm/samd2l2/arduino-m0/src/sam_userleds.c @@ -77,7 +77,7 @@ void board_userled_initialize(void) { - (void)sam_configport(PORT_STATUS_LED); + sam_configport(PORT_STATUS_LED); } /**************************************************************************** diff --git a/boards/arm/samd2l2/samd20-xplained/src/sam_autoleds.c b/boards/arm/samd2l2/samd20-xplained/src/sam_autoleds.c index 083a5b46b7..2f288312cf 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/sam_autoleds.c +++ b/boards/arm/samd2l2/samd20-xplained/src/sam_autoleds.c @@ -88,7 +88,7 @@ void board_autoled_initialize(void) { - (void)sam_configport(PORT_STATUS_LED); + sam_configport(PORT_STATUS_LED); } /**************************************************************************** diff --git a/boards/arm/samd2l2/samd20-xplained/src/sam_buttons.c b/boards/arm/samd2l2/samd20-xplained/src/sam_buttons.c index a36ff79ec1..fdeaca1020 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/sam_buttons.c +++ b/boards/arm/samd2l2/samd20-xplained/src/sam_buttons.c @@ -71,7 +71,7 @@ void board_button_initialize(void) { - (void)sam_configport(PORT_SW0); + sam_configport(PORT_SW0); } /**************************************************************************** @@ -127,7 +127,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Configure the interrupt */ sam_portirq(IRQ_SW0); - (void)irq_attach(IRQ_SW0, irqhandler, arg); + irq_attach(IRQ_SW0, irqhandler, arg); sam_portirqenable(IRQ_SW0); leave_critical_section(flags); diff --git a/boards/arm/samd2l2/samd20-xplained/src/sam_spi.c b/boards/arm/samd2l2/samd20-xplained/src/sam_spi.c index 82fb11b7a9..a5d94959ee 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/sam_spi.c +++ b/boards/arm/samd2l2/samd20-xplained/src/sam_spi.c @@ -359,7 +359,7 @@ int sam_spi0cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) * Low: the inputs are transferred to the command registers. */ - (void)sam_portwrite(PORT_OLED_DATA, !cmd); + sam_portwrite(PORT_OLED_DATA, !cmd); } #endif @@ -380,7 +380,7 @@ int sam_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) * Low: the inputs are transferred to the command registers. */ - (void)sam_portwrite(PORT_OLED_DATA, !cmd); + sam_portwrite(PORT_OLED_DATA, !cmd); } #endif diff --git a/boards/arm/samd2l2/samd20-xplained/src/sam_ug2832hsweg04.c b/boards/arm/samd2l2/samd20-xplained/src/sam_ug2832hsweg04.c index 0878ac5105..216fc20d2f 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/sam_ug2832hsweg04.c +++ b/boards/arm/samd2l2/samd20-xplained/src/sam_ug2832hsweg04.c @@ -167,7 +167,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) * putting the OLED into reset state. */ - (void)sam_configport(PORT_OLED_RST); + sam_configport(PORT_OLED_RST); /* Wait a bit then release the OLED from the reset state */ @@ -196,7 +196,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* And turn the OLED on */ - (void)dev->setpower(dev, CONFIG_LCD_MAXPOWER); + dev->setpower(dev, CONFIG_LCD_MAXPOWER); return dev; } } diff --git a/boards/arm/samd2l2/samd20-xplained/src/sam_userleds.c b/boards/arm/samd2l2/samd20-xplained/src/sam_userleds.c index fbe6278d02..409095ad29 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/sam_userleds.c +++ b/boards/arm/samd2l2/samd20-xplained/src/sam_userleds.c @@ -80,7 +80,7 @@ void board_userled_initialize(void) { - (void)sam_configport(PORT_STATUS_LED); + sam_configport(PORT_STATUS_LED); } /**************************************************************************** diff --git a/boards/arm/samd2l2/samd21-xplained/src/sam_autoleds.c b/boards/arm/samd2l2/samd21-xplained/src/sam_autoleds.c index c48875b065..09cfc6f258 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/sam_autoleds.c +++ b/boards/arm/samd2l2/samd21-xplained/src/sam_autoleds.c @@ -88,7 +88,7 @@ void board_autoled_initialize(void) { - (void)sam_configport(PORT_STATUS_LED); + sam_configport(PORT_STATUS_LED); } /**************************************************************************** diff --git a/boards/arm/samd2l2/samd21-xplained/src/sam_buttons.c b/boards/arm/samd2l2/samd21-xplained/src/sam_buttons.c index 698b0f466c..d12d2d0a9c 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/sam_buttons.c +++ b/boards/arm/samd2l2/samd21-xplained/src/sam_buttons.c @@ -71,7 +71,7 @@ void board_button_initialize(void) { - (void)sam_configport(PORT_SW0); + sam_configport(PORT_SW0); } /**************************************************************************** @@ -127,7 +127,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Configure the interrupt */ sam_portirq(IRQ_SW0); - (void)irq_attach(IRQ_SW0, irqhandler, arg); + irq_attach(IRQ_SW0, irqhandler, arg); sam_portirqenable(IRQ_SW0); leave_critical_section(flags); diff --git a/boards/arm/samd2l2/samd21-xplained/src/sam_spi.c b/boards/arm/samd2l2/samd21-xplained/src/sam_spi.c index b0c9214c8b..e6d70c1675 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/sam_spi.c +++ b/boards/arm/samd2l2/samd21-xplained/src/sam_spi.c @@ -359,7 +359,7 @@ int sam_spi0cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) * Low: the inputs are transferred to the command registers. */ - (void)sam_portwrite(PORT_OLED_DATA, !cmd); + sam_portwrite(PORT_OLED_DATA, !cmd); } #endif @@ -380,7 +380,7 @@ int sam_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) * Low: the inputs are transferred to the command registers. */ - (void)sam_portwrite(PORT_OLED_DATA, !cmd); + sam_portwrite(PORT_OLED_DATA, !cmd); } #endif diff --git a/boards/arm/samd2l2/samd21-xplained/src/sam_ug2832hsweg04.c b/boards/arm/samd2l2/samd21-xplained/src/sam_ug2832hsweg04.c index 5c79ccba05..0130af91b9 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/sam_ug2832hsweg04.c +++ b/boards/arm/samd2l2/samd21-xplained/src/sam_ug2832hsweg04.c @@ -167,7 +167,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) * putting the OLED into reset state. */ - (void)sam_configport(PORT_OLED_RST); + sam_configport(PORT_OLED_RST); /* Wait a bit then release the OLED from the reset state */ @@ -196,7 +196,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* And turn the OLED on */ - (void)dev->setpower(dev, CONFIG_LCD_MAXPOWER); + dev->setpower(dev, CONFIG_LCD_MAXPOWER); return dev; } } diff --git a/boards/arm/samd2l2/samd21-xplained/src/sam_userleds.c b/boards/arm/samd2l2/samd21-xplained/src/sam_userleds.c index 5b35f07d2d..7429bb4e2e 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/sam_userleds.c +++ b/boards/arm/samd2l2/samd21-xplained/src/sam_userleds.c @@ -80,7 +80,7 @@ void board_userled_initialize(void) { - (void)sam_configport(PORT_STATUS_LED); + sam_configport(PORT_STATUS_LED); } /**************************************************************************** diff --git a/boards/arm/samd2l2/saml21-xplained/src/sam_autoleds.c b/boards/arm/samd2l2/saml21-xplained/src/sam_autoleds.c index c557ac301a..38a8f55eba 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/sam_autoleds.c +++ b/boards/arm/samd2l2/saml21-xplained/src/sam_autoleds.c @@ -87,7 +87,7 @@ void board_autoled_initialize(void) { - (void)sam_configport(PORT_STATUS_LED); + sam_configport(PORT_STATUS_LED); } /**************************************************************************** diff --git a/boards/arm/samd2l2/saml21-xplained/src/sam_buttons.c b/boards/arm/samd2l2/saml21-xplained/src/sam_buttons.c index c2311b7449..301104e259 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/sam_buttons.c +++ b/boards/arm/samd2l2/saml21-xplained/src/sam_buttons.c @@ -71,7 +71,7 @@ void board_button_initialize(void) { - (void)sam_configport(PORT_SW0); + sam_configport(PORT_SW0); } /**************************************************************************** @@ -126,7 +126,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Configure the interrupt */ sam_portirq(IRQ_SW0); - (void)irq_attach(IRQ_SW0, irqhandler, arg); + irq_attach(IRQ_SW0, irqhandler, arg); sam_portirqenable(IRQ_SW0); leave_critical_section(flags); diff --git a/boards/arm/samd2l2/saml21-xplained/src/sam_spi.c b/boards/arm/samd2l2/saml21-xplained/src/sam_spi.c index 5cf38be4c8..6af4ada61a 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/sam_spi.c +++ b/boards/arm/samd2l2/saml21-xplained/src/sam_spi.c @@ -359,7 +359,7 @@ int sam_spi0cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) * Low: the inputs are transferred to the command registers. */ - (void)sam_portwrite(PORT_OLED_DATA, !cmd); + sam_portwrite(PORT_OLED_DATA, !cmd); } #endif @@ -380,7 +380,7 @@ int sam_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) * Low: the inputs are transferred to the command registers. */ - (void)sam_portwrite(PORT_OLED_DATA, !cmd); + sam_portwrite(PORT_OLED_DATA, !cmd); } #endif diff --git a/boards/arm/samd2l2/saml21-xplained/src/sam_ug2832hsweg04.c b/boards/arm/samd2l2/saml21-xplained/src/sam_ug2832hsweg04.c index 4b34da2116..4885e77e9d 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/sam_ug2832hsweg04.c +++ b/boards/arm/samd2l2/saml21-xplained/src/sam_ug2832hsweg04.c @@ -167,7 +167,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) * putting the OLED into reset state. */ - (void)sam_configport(PORT_OLED_RST); + sam_configport(PORT_OLED_RST); /* Wait a bit then release the OLED from the reset state */ @@ -196,7 +196,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* And turn the OLED on */ - (void)dev->setpower(dev, CONFIG_LCD_MAXPOWER); + dev->setpower(dev, CONFIG_LCD_MAXPOWER); return dev; } } diff --git a/boards/arm/samd2l2/saml21-xplained/src/sam_userleds.c b/boards/arm/samd2l2/saml21-xplained/src/sam_userleds.c index b06e5b499f..d12608384d 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/sam_userleds.c +++ b/boards/arm/samd2l2/saml21-xplained/src/sam_userleds.c @@ -80,7 +80,7 @@ void board_userled_initialize(void) { - (void)sam_configport(PORT_STATUS_LED); + sam_configport(PORT_STATUS_LED); } /**************************************************************************** diff --git a/boards/arm/samd5e5/metro-m4/src/sam_autoleds.c b/boards/arm/samd5e5/metro-m4/src/sam_autoleds.c index 401d6dc64c..69529e049a 100644 --- a/boards/arm/samd5e5/metro-m4/src/sam_autoleds.c +++ b/boards/arm/samd5e5/metro-m4/src/sam_autoleds.c @@ -203,7 +203,7 @@ static int led_pm_prepare(struct pm_callback_s *cb, int domain, void board_autoled_initialize(void) { - (void)sam_portconfig(PORT_RED_LED); + sam_portconfig(PORT_RED_LED); } /**************************************************************************** diff --git a/boards/arm/samd5e5/metro-m4/src/sam_boot.c b/boards/arm/samd5e5/metro-m4/src/sam_boot.c index 1d46dd4bec..5c734b2742 100644 --- a/boards/arm/samd5e5/metro-m4/src/sam_boot.c +++ b/boards/arm/samd5e5/metro-m4/src/sam_boot.c @@ -89,6 +89,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)sam_bringup(); + sam_bringup(); } #endif diff --git a/boards/arm/samd5e5/metro-m4/src/sam_userleds.c b/boards/arm/samd5e5/metro-m4/src/sam_userleds.c index d068384914..34582d7157 100644 --- a/boards/arm/samd5e5/metro-m4/src/sam_userleds.c +++ b/boards/arm/samd5e5/metro-m4/src/sam_userleds.c @@ -184,7 +184,7 @@ static int led_pm_prepare(struct pm_callback_s *cb, int domain, void board_userled_initialize(void) { - (void)sam_portconfig(PORT_STATUS_LED); + sam_portconfig(PORT_STATUS_LED); } /**************************************************************************** diff --git a/boards/arm/samv7/same70-xplained/src/sam_at24config.c b/boards/arm/samv7/same70-xplained/src/sam_at24config.c index 96c9f49c87..2accf14d85 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_at24config.c +++ b/boards/arm/samv7/same70-xplained/src/sam_at24config.c @@ -85,7 +85,7 @@ int sam_at24config(void) if (!at24) { ferr("ERROR: Failed to initialize the AT24 driver\n"); - (void)sam_i2cbus_uninitialize(i2c); + sam_i2cbus_uninitialize(i2c); return -ENODEV; } @@ -103,7 +103,7 @@ int sam_at24config(void) if (ret < 0) { ferr("ERROR: Failed to bind AT24 driver to the MTD config device\n"); - (void)sam_i2cbus_uninitialize(i2c); + sam_i2cbus_uninitialize(i2c); } return ret; diff --git a/boards/arm/samv7/same70-xplained/src/sam_boot.c b/boards/arm/samv7/same70-xplained/src/sam_boot.c index 9d085871e3..9837a9e07a 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_boot.c +++ b/boards/arm/samv7/same70-xplained/src/sam_boot.c @@ -98,7 +98,7 @@ void sam_boardinitialize(void) /* Enable PCK6 */ - (void)sam_pck_enable(PCK6, true); + sam_pck_enable(PCK6, true); #endif #ifdef CONFIG_SAMV7_SDRAMC @@ -154,6 +154,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)sam_bringup(); + sam_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/samv7/same70-xplained/src/sam_buttons.c b/boards/arm/samv7/same70-xplained/src/sam_buttons.c index 61a39ead63..bc46c0b4b5 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_buttons.c +++ b/boards/arm/samv7/same70-xplained/src/sam_buttons.c @@ -98,14 +98,14 @@ static int board_button_irqx(gpio_pinset_t pinset, int irq, /* Configure the interrupt */ sam_gpioirq(pinset); - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); sam_gpioirqenable(irq); } else { /* Detach and disable the interrupt */ - (void)irq_detach(irq); + irq_detach(irq); sam_gpioirqdisable(irq); } @@ -133,7 +133,7 @@ void board_button_initialize(void) { /* Configure button PIOs */ - (void)sam_configgpio(GPIO_SW0); + sam_configgpio(GPIO_SW0); } /**************************************************************************** diff --git a/boards/arm/samv7/same70-xplained/src/sam_ethernet.c b/boards/arm/samv7/same70-xplained/src/sam_ethernet.c index 79a308a063..2b5bf20d26 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_ethernet.c +++ b/boards/arm/samv7/same70-xplained/src/sam_ethernet.c @@ -170,7 +170,7 @@ int sam_emac0_setmac(void) if (!at24) { nerr("ERROR: Failed to initialize the AT24 driver\n"); - (void)sam_i2cbus_uninitialize(i2c); + sam_i2cbus_uninitialize(i2c); return -ENODEV; } @@ -180,7 +180,7 @@ int sam_emac0_setmac(void) if (ret < 0) { nerr("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); - (void)sam_i2cbus_uninitialize(i2c); + sam_i2cbus_uninitialize(i2c); return ret; } @@ -191,7 +191,7 @@ int sam_emac0_setmac(void) { nerr("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread); - (void)sam_i2cbus_uninitialize(i2c); + sam_i2cbus_uninitialize(i2c); return (int)nread; } @@ -333,12 +333,12 @@ int arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg, sam_gpioirq(pinset); phyinfo("Attach IRQ%d\n", irq); - (void)irq_attach(irq, handler, arg); + irq_attach(irq, handler, arg); } else { phyinfo("Detach IRQ%d\n", irq); - (void)irq_detach(irq); + irq_detach(irq); enabler = NULL; } diff --git a/boards/arm/samv7/same70-xplained/src/sam_hsmci.c b/boards/arm/samv7/same70-xplained/src/sam_hsmci.c index d04d9d78ff..47c5028aa2 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_hsmci.c +++ b/boards/arm/samv7/same70-xplained/src/sam_hsmci.c @@ -264,7 +264,7 @@ int sam_hsmci_initialize(int slotno, int minor) /* Configure card detect interrupts */ sam_gpioirq(state->cdcfg); - (void)irq_attach(state->irq, state->handler, NULL); + irq_attach(state->irq, state->handler, NULL); /* Then inform the HSMCI driver if there is or is not a card in the slot. */ diff --git a/boards/arm/samv7/same70-xplained/src/sam_mrf24j40.c b/boards/arm/samv7/same70-xplained/src/sam_mrf24j40.c index 9c96eb29d3..3ba4be9458 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_mrf24j40.c +++ b/boards/arm/samv7/same70-xplained/src/sam_mrf24j40.c @@ -233,13 +233,13 @@ static int sam_mrf24j40_devsetup(FAR struct sam_priv_s *priv) * NOTE: Not necessary. The RST# input is pulled high on the BEE. */ - (void)sam_configgpio(priv->rstcfg); + sam_configgpio(priv->rstcfg); sam_gpiowrite(priv->rstcfg, true); #endif /* Configure the interrupt pin */ - (void)sam_configgpio(priv->intcfg); + sam_configgpio(priv->intcfg); sam_gpioirq(priv->intcfg); /* Initialize the SPI bus and get an instance of the SPI interface */ diff --git a/boards/arm/samv7/same70-xplained/src/sam_spi.c b/boards/arm/samv7/same70-xplained/src/sam_spi.c index a65d58b042..aa08fb89d4 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_spi.c +++ b/boards/arm/samv7/same70-xplained/src/sam_spi.c @@ -73,13 +73,13 @@ void sam_spidev_initialize(void) #ifdef CONFIG_SAME70XPLAINED_MB1_SPI /* Enable chip select for mikroBUS1 */ - (void)sam_configgpio(CLICK_MB1_CS); + sam_configgpio(CLICK_MB1_CS); #endif #ifdef CONFIG_SAME70XPLAINED_MB2_SPI /* Enable chip select for mikroBUS2 */ - (void)sam_configgpio(CLICK_MB2_CS); + sam_configgpio(CLICK_MB2_CS); #endif #endif diff --git a/boards/arm/samv7/samv71-xult/src/sam_at24config.c b/boards/arm/samv7/samv71-xult/src/sam_at24config.c index 34319d4592..37aa940ad9 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_at24config.c +++ b/boards/arm/samv7/samv71-xult/src/sam_at24config.c @@ -85,7 +85,7 @@ int sam_at24config(void) if (!at24) { ferr("ERROR: Failed to initialize the AT24 driver\n"); - (void)sam_i2cbus_uninitialize(i2c); + sam_i2cbus_uninitialize(i2c); return -ENODEV; } @@ -103,7 +103,7 @@ int sam_at24config(void) if (ret < 0) { ferr("ERROR: Failed to bind AT24 driver to the MTD config device\n"); - (void)sam_i2cbus_uninitialize(i2c); + sam_i2cbus_uninitialize(i2c); } return ret; diff --git a/boards/arm/samv7/samv71-xult/src/sam_boot.c b/boards/arm/samv7/samv71-xult/src/sam_boot.c index 4adccb5a05..125a8350cc 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_boot.c +++ b/boards/arm/samv7/samv71-xult/src/sam_boot.c @@ -98,7 +98,7 @@ void sam_boardinitialize(void) /* Enable PCK6 */ - (void)sam_pck_enable(PCK6, true); + sam_pck_enable(PCK6, true); #endif #ifdef CONFIG_SAMV7_SDRAMC @@ -154,6 +154,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)sam_bringup(); + sam_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/samv7/samv71-xult/src/sam_buttons.c b/boards/arm/samv7/samv71-xult/src/sam_buttons.c index 2adf81c7e2..353605bdba 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_buttons.c +++ b/boards/arm/samv7/samv71-xult/src/sam_buttons.c @@ -102,14 +102,14 @@ static int board_button_irqx(gpio_pinset_t pinset, int irq, xcpt_t irqhandler, /* Configure the interrupt */ sam_gpioirq(pinset); - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); sam_gpioirqenable(irq); } else { /* Detach and disable the interrupt */ - (void)irq_detach(irq); + irq_detach(irq); sam_gpioirqdisable(irq); } @@ -148,8 +148,8 @@ void board_button_initialize(void) /* Configure button GPIOs */ - (void)sam_configgpio(GPIO_SW0); - (void)sam_configgpio(GPIO_SW1); + sam_configgpio(GPIO_SW0); + sam_configgpio(GPIO_SW1); } /**************************************************************************** diff --git a/boards/arm/samv7/samv71-xult/src/sam_ethernet.c b/boards/arm/samv7/samv71-xult/src/sam_ethernet.c index e4d971d3ed..3f1c125524 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_ethernet.c +++ b/boards/arm/samv7/samv71-xult/src/sam_ethernet.c @@ -174,7 +174,7 @@ int sam_emac0_setmac(void) if (!at24) { nerr("ERROR: Failed to initialize the AT24 driver\n"); - (void)sam_i2cbus_uninitialize(i2c); + sam_i2cbus_uninitialize(i2c); return -ENODEV; } @@ -184,7 +184,7 @@ int sam_emac0_setmac(void) if (ret < 0) { nerr("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); - (void)sam_i2cbus_uninitialize(i2c); + sam_i2cbus_uninitialize(i2c); return ret; } @@ -195,7 +195,7 @@ int sam_emac0_setmac(void) { nerr("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread); - (void)sam_i2cbus_uninitialize(i2c); + sam_i2cbus_uninitialize(i2c); return (int)nread; } @@ -338,12 +338,12 @@ int arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg, sam_gpioirq(pinset); phyinfo("Attach IRQ%d\n", irq); - (void)irq_attach(irq, handler, arg); + irq_attach(irq, handler, arg); } else { phyinfo("Detach IRQ%d\n", irq); - (void)irq_detach(irq); + irq_detach(irq); enabler = NULL; } diff --git a/boards/arm/samv7/samv71-xult/src/sam_hsmci.c b/boards/arm/samv7/samv71-xult/src/sam_hsmci.c index 7c0712bd80..57d754c5b3 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_hsmci.c +++ b/boards/arm/samv7/samv71-xult/src/sam_hsmci.c @@ -265,7 +265,7 @@ int sam_hsmci_initialize(int slotno, int minor) /* Configure card detect interrupts */ sam_gpioirq(state->cdcfg); - (void)irq_attach(state->irq, state->handler, NULL); + irq_attach(state->irq, state->handler, NULL); /* Then inform the HSMCI driver if there is or is not a card in the slot. */ diff --git a/boards/arm/samv7/samv71-xult/src/sam_ili9488.c b/boards/arm/samv7/samv71-xult/src/sam_ili9488.c index 25bac2f15c..c1c0a02e51 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_ili9488.c +++ b/boards/arm/samv7/samv71-xult/src/sam_ili9488.c @@ -909,7 +909,7 @@ static void sam_lcd_endwait(struct sam_dev_s *priv, int result) { /* Save the result and cancel the watchdog timeout */ - (void)wd_cancel(priv->dmadog); + wd_cancel(priv->dmadog); priv->result = result; /* Wake up the waiting thread */ @@ -994,11 +994,7 @@ static int sam_lcd_dmawait(FAR struct sam_dev_s *priv, uint32_t timeout) * incremented and there will be no wait. */ - ret = nxsem_wait(&priv->waitsem); - - /* The only expected failure is EINTR */ - - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } /* Dump the collect DMA sample data */ diff --git a/boards/arm/samv7/samv71-xult/src/sam_maxtouch.c b/boards/arm/samv7/samv71-xult/src/sam_maxtouch.c index 7bd3da6b4c..a87afcbe87 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_maxtouch.c +++ b/boards/arm/samv7/samv71-xult/src/sam_maxtouch.c @@ -246,7 +246,7 @@ int sam_tsc_setup(int minor) /* Configure the maXTouch CHG interrupt pin */ - (void)sam_configgpio(GPIO_MXT_CHG); + sam_configgpio(GPIO_MXT_CHG); /* Get an instance of the I2C interface for the touchscreen chip select */ @@ -260,7 +260,7 @@ int sam_tsc_setup(int minor) /* Configure maXTouch CHG interrupts */ sam_gpioirq(GPIO_MXT_CHG); - (void)irq_attach(IRQ_MXT_CHG, mxt_interrupt, NULL); + irq_attach(IRQ_MXT_CHG, mxt_interrupt, NULL); /* Initialize and register the I2C touchscreen device */ diff --git a/boards/arm/samv7/samv71-xult/src/sam_mrf24j40.c b/boards/arm/samv7/samv71-xult/src/sam_mrf24j40.c index 30f8c37bce..8648b6c734 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_mrf24j40.c +++ b/boards/arm/samv7/samv71-xult/src/sam_mrf24j40.c @@ -233,13 +233,13 @@ static int sam_mrf24j40_devsetup(FAR struct sam_priv_s *priv) * NOTE: Not necessary. The RST# input is pulled high on the BEE. */ - (void)sam_configgpio(priv->rstcfg); + sam_configgpio(priv->rstcfg); sam_gpiowrite(priv->rstcfg, true); #endif /* Configure the interrupt pin */ - (void)sam_configgpio(priv->intcfg); + sam_configgpio(priv->intcfg); sam_gpioirq(priv->intcfg); /* Initialize the SPI bus and get an instance of the SPI interface */ diff --git a/boards/arm/samv7/samv71-xult/src/sam_spi.c b/boards/arm/samv7/samv71-xult/src/sam_spi.c index 7c792cd00d..31d69afc28 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_spi.c +++ b/boards/arm/samv7/samv71-xult/src/sam_spi.c @@ -72,18 +72,18 @@ void sam_spidev_initialize(void) #ifdef CONFIG_SAMV7_SPI0_MASTER /* Make sure that the EDBG DIGI_SPI CS is high so that it does not interfere */ - (void)sam_configgpio(CLICK_EDBG_CS); + sam_configgpio(CLICK_EDBG_CS); #ifdef CONFIG_SAMV71XULT_MB1_SPI /* Enable chip select for mikroBUS1 */ - (void)sam_configgpio(CLICK_MB1_CS); + sam_configgpio(CLICK_MB1_CS); #endif #ifdef CONFIG_SAMV71XULT_MB2_SPI /* Enable chip select for mikroBUS2 */ - (void)sam_configgpio(CLICK_MB2_CS); + sam_configgpio(CLICK_MB2_CS); #endif #endif /* CONFIG_SAMV7_SPI0_MASTER */ diff --git a/boards/arm/samv7/samv71-xult/src/sam_wm8904.c b/boards/arm/samv7/samv71-xult/src/sam_wm8904.c index b86d4c083c..2ec90a4c1a 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_wm8904.c +++ b/boards/arm/samv7/samv71-xult/src/sam_wm8904.c @@ -165,7 +165,7 @@ static int wm8904_attach(FAR const struct wm8904_lower_s *lower, else { audinfo("Detaching %p\n", g_wm8904info.handler); - (void)wm8904_enable(lower, false); + wm8904_enable(lower, false); g_wm8904info.handler = NULL; g_wm8904info.arg = NULL; } @@ -267,7 +267,7 @@ int sam_wm8904_initialize(int minor) { /* Configure the WM8904 interrupt pin */ - (void)sam_configgpio(GPIO_INT_WM8904); + sam_configgpio(GPIO_INT_WM8904); /* Get an instance of the I2C interface for the WM8904 chip select */ @@ -299,11 +299,11 @@ int sam_wm8904_initialize(int minor) * enabled in sam_boot.c if needed. */ - (void)sam_pck_configure(PCK2, PCKSRC_SCK, BOARD_SLOWCLK_FREQUENCY); + sam_pck_configure(PCK2, PCKSRC_SCK, BOARD_SLOWCLK_FREQUENCY); #else /* Drive the DAC with the main clock (12 MHz) */ - (void)sam_pck_configure(PCK2, PCKSRC_MAINCK, BOARD_MAINCK_FREQUENCY); + sam_pck_configure(PCK2, PCKSRC_MAINCK, BOARD_MAINCK_FREQUENCY); #endif /* Enable the DAC master clock */ diff --git a/boards/arm/stm32/axoloti/src/stm32_boot.c b/boards/arm/stm32/axoloti/src/stm32_boot.c index 748d3731fe..45fef1f1c1 100644 --- a/boards/arm/stm32/axoloti/src/stm32_boot.c +++ b/boards/arm/stm32/axoloti/src/stm32_boot.c @@ -109,6 +109,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/axoloti/src/stm32_sdio.c b/boards/arm/stm32/axoloti/src/stm32_sdio.c index 962eb0f11d..d602429b32 100644 --- a/boards/arm/stm32/axoloti/src/stm32_sdio.c +++ b/boards/arm/stm32/axoloti/src/stm32_sdio.c @@ -125,8 +125,8 @@ int stm32_sdio_initialize(void) /* Register an interrupt handler for the card detect pin */ - (void)stm32_gpiosetevent(GPIO_SDIO_NCD, true, true, true, - stm32_ncd_interrupt, NULL); + stm32_gpiosetevent(GPIO_SDIO_NCD, true, true, true, + stm32_ncd_interrupt, NULL); #endif diff --git a/boards/arm/stm32/axoloti/src/stm32_usbhost.c b/boards/arm/stm32/axoloti/src/stm32_usbhost.c index e35b22a401..2ff8720036 100644 --- a/boards/arm/stm32/axoloti/src/stm32_usbhost.c +++ b/boards/arm/stm32/axoloti/src/stm32_usbhost.c @@ -117,7 +117,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/clicker2-stm32/src/stm32_automount.c b/boards/arm/stm32/clicker2-stm32/src/stm32_automount.c index 1a3a238628..8dea55688e 100644 --- a/boards/arm/stm32/clicker2-stm32/src/stm32_automount.c +++ b/boards/arm/stm32/clicker2-stm32/src/stm32_automount.c @@ -224,7 +224,7 @@ static void stm32_enable(FAR const struct automount_lower_s *lower, bool enable) if (state->handler) { bool inserted = stm32_cardinserted(config->mmcsd); - (void)state->handler(&config->lower, state->arg, inserted); + state->handler(&config->lower, state->arg, inserted); } state->pending = false; @@ -383,7 +383,7 @@ void stm32_automount_event(int slotno, bool inserted) { /* No.. forward the event to the handler */ - (void)state->handler(&config->lower, state->arg, inserted); + state->handler(&config->lower, state->arg, inserted); } } } diff --git a/boards/arm/stm32/clicker2-stm32/src/stm32_boot.c b/boards/arm/stm32/clicker2-stm32/src/stm32_boot.c index 5c17512081..e70262c727 100644 --- a/boards/arm/stm32/clicker2-stm32/src/stm32_boot.c +++ b/boards/arm/stm32/clicker2-stm32/src/stm32_boot.c @@ -115,6 +115,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization here if so configured */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/clicker2-stm32/src/stm32_mrf24j40.c b/boards/arm/stm32/clicker2-stm32/src/stm32_mrf24j40.c index 40d3e3cc0d..36c8f146a7 100644 --- a/boards/arm/stm32/clicker2-stm32/src/stm32_mrf24j40.c +++ b/boards/arm/stm32/clicker2-stm32/src/stm32_mrf24j40.c @@ -201,13 +201,13 @@ static void stm32_enable_irq(FAR const struct mrf24j40_lower_s *lower, if (state) { - (void)stm32_gpiosetevent(priv->intcfg, false, true, true, - priv->handler, priv->arg); + stm32_gpiosetevent(priv->intcfg, false, true, true, + priv->handler, priv->arg); } else { - (void)stm32_gpiosetevent(priv->intcfg, false, false, false, - NULL, NULL); + stm32_gpiosetevent(priv->intcfg, false, false, false, + NULL, NULL); } } diff --git a/boards/arm/stm32/clicker2-stm32/src/stm32_spi.c b/boards/arm/stm32/clicker2-stm32/src/stm32_spi.c index c45d221dac..ee37bc651e 100644 --- a/boards/arm/stm32/clicker2-stm32/src/stm32_spi.c +++ b/boards/arm/stm32/clicker2-stm32/src/stm32_spi.c @@ -72,12 +72,12 @@ void weak_function stm32_spidev_initialize(void) #if defined(CONFIG_STM32_SPI3) && defined(CONFIG_CLICKER2_STM32_MB1_SPI) /* Enable chip select for mikroBUS1 */ - (void)stm32_configgpio(GPIO_MB1_CS); + stm32_configgpio(GPIO_MB1_CS); #endif #if defined(CONFIG_STM32_SPI2) && defined(CONFIG_CLICKER2_STM32_MB2_SPI) /* Enable chip select for mikroBUS2 */ - (void)stm32_configgpio(GPIO_MB2_CS); + stm32_configgpio(GPIO_MB2_CS); #endif } diff --git a/boards/arm/stm32/clicker2-stm32/src/stm32_xbee.c b/boards/arm/stm32/clicker2-stm32/src/stm32_xbee.c index 3f834e4c87..a2bcaa27a2 100644 --- a/boards/arm/stm32/clicker2-stm32/src/stm32_xbee.c +++ b/boards/arm/stm32/clicker2-stm32/src/stm32_xbee.c @@ -252,13 +252,13 @@ static void stm32_enable_attn(FAR const struct xbee_lower_s *lower, if (state) { - (void)stm32_gpiosetevent(priv->attncfg, false, true, true, - priv->handler, priv->arg); + stm32_gpiosetevent(priv->attncfg, false, true, true, + priv->handler, priv->arg); } else { - (void)stm32_gpiosetevent(priv->attncfg, false, false, false, - NULL, NULL); + stm32_gpiosetevent(priv->attncfg, false, false, false, + NULL, NULL); } } diff --git a/boards/arm/stm32/cloudctrl/src/stm32_usb.c b/boards/arm/stm32/cloudctrl/src/stm32_usb.c index 5184683b3a..c581a5a849 100644 --- a/boards/arm/stm32/cloudctrl/src/stm32_usb.c +++ b/boards/arm/stm32/cloudctrl/src/stm32_usb.c @@ -122,7 +122,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/fire-stm32v2/src/stm32_enc28j60.c b/boards/arm/stm32/fire-stm32v2/src/stm32_enc28j60.c index f139ed5e2f..86de6d3b60 100644 --- a/boards/arm/stm32/fire-stm32v2/src/stm32_enc28j60.c +++ b/boards/arm/stm32/fire-stm32v2/src/stm32_enc28j60.c @@ -164,8 +164,8 @@ static void up_enable(FAR const struct enc_lower_s *lower) FAR struct stm32_lower_s *priv = (FAR struct stm32_lower_s *)lower; DEBUGASSERT(priv->handler); - (void)stm32_gpiosetevent(GPIO_ENC28J60_INTR, false, true, true, - priv->handler, priv->arg); + stm32_gpiosetevent(GPIO_ENC28J60_INTR, false, true, true, + priv->handler, priv->arg); } /* REVISIT: Since the interrupt is completely torn down, not just disabled, @@ -175,8 +175,8 @@ static void up_enable(FAR const struct enc_lower_s *lower) static void up_disable(FAR const struct enc_lower_s *lower) { - (void)stm32_gpiosetevent(GPIO_ENC28J60_INTR, false, true, true, - NULL, NULL); + stm32_gpiosetevent(GPIO_ENC28J60_INTR, false, true, true, + NULL, NULL); } /**************************************************************************** diff --git a/boards/arm/stm32/hymini-stm32v/src/stm32_appinit.c b/boards/arm/stm32/hymini-stm32v/src/stm32_appinit.c index 10bee4bd95..7ef71f7d57 100644 --- a/boards/arm/stm32/hymini-stm32v/src/stm32_appinit.c +++ b/boards/arm/stm32/hymini-stm32v/src/stm32_appinit.c @@ -183,7 +183,7 @@ int board_app_initialize(uintptr_t arg) /* Register an interrupt handler for the card detect pin */ - (void)stm32_gpiosetevent(GPIO_SD_CD, true, true, true, nsh_cdinterrupt, NULL); + stm32_gpiosetevent(GPIO_SD_CD, true, true, true, nsh_cdinterrupt, NULL); /* Mount the SDIO-based MMC/SD block driver */ diff --git a/boards/arm/stm32/hymini-stm32v/src/stm32_r61505u.c b/boards/arm/stm32/hymini-stm32v/src/stm32_r61505u.c index 898a2ad355..9bb7d3441a 100644 --- a/boards/arm/stm32/hymini-stm32v/src/stm32_r61505u.c +++ b/boards/arm/stm32/hymini-stm32v/src/stm32_r61505u.c @@ -493,7 +493,7 @@ static int lcd_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, /* dummy read */ - (void)read_data(); + read_data(); for (i = 0; i < npixels; i++) { diff --git a/boards/arm/stm32/hymini-stm32v/src/stm32_ts.c b/boards/arm/stm32/hymini-stm32v/src/stm32_ts.c index 31439f2961..cbcc85066b 100644 --- a/boards/arm/stm32/hymini-stm32v/src/stm32_ts.c +++ b/boards/arm/stm32/hymini-stm32v/src/stm32_ts.c @@ -99,7 +99,7 @@ static int hymini_ts_irq_attach(FAR struct ads7843e_config_s *state, xcpt_t isr) iinfo("hymini_ts_irq_attach\n"); tc_isr = isr; - (void)stm32_gpiosetevent(GPIO_TS_IRQ, true, true, true, isr, NULL); + stm32_gpiosetevent(GPIO_TS_IRQ, true, true, true, isr, NULL); return OK; } @@ -110,8 +110,8 @@ static void hymini_ts_irq_enable(FAR struct ads7843e_config_s *state, { iinfo("%d\n", enable); - (void)stm32_gpiosetevent(GPIO_TS_IRQ, true, true, true, - enable ? tc_isr : NULL, NULL); + stm32_gpiosetevent(GPIO_TS_IRQ, true, true, true, + enable ? tc_isr : NULL, NULL); } /* Acknowledge/clear any pending GPIO interrupt */ diff --git a/boards/arm/stm32/mikroe-stm32f4/src/stm32_boot.c b/boards/arm/stm32/mikroe-stm32f4/src/stm32_boot.c index feb9e3b9fb..74eb9cc404 100644 --- a/boards/arm/stm32/mikroe-stm32f4/src/stm32_boot.c +++ b/boards/arm/stm32/mikroe-stm32f4/src/stm32_boot.c @@ -73,7 +73,7 @@ void stm32_boardinitialize(void) /* First reset the VS1053 since it tends to produce noise out of power on reset */ #ifdef CONFIG_AUDIO_VS1053 - (void)stm32_configgpio(GPIO_VS1053_RST); + stm32_configgpio(GPIO_VS1053_RST); #endif /* Configure GPIOs for controlling the LCD */ diff --git a/boards/arm/stm32/mikroe-stm32f4/src/stm32_idle.c b/boards/arm/stm32/mikroe-stm32f4/src/stm32_idle.c index 4c9cbc2f72..3107dc9b9a 100644 --- a/boards/arm/stm32/mikroe-stm32f4/src/stm32_idle.c +++ b/boards/arm/stm32/mikroe-stm32f4/src/stm32_idle.c @@ -136,7 +136,7 @@ static void up_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); /* No state change... */ @@ -203,7 +203,7 @@ static void up_idlepm(void) * of standby is via the reset path. */ - (void)stm32_pmstandby(); + stm32_pmstandby(); } break; diff --git a/boards/arm/stm32/mikroe-stm32f4/src/stm32_spi.c b/boards/arm/stm32/mikroe-stm32f4/src/stm32_spi.c index e63d9116fb..db4e960a66 100644 --- a/boards/arm/stm32/mikroe-stm32f4/src/stm32_spi.c +++ b/boards/arm/stm32/mikroe-stm32f4/src/stm32_spi.c @@ -76,21 +76,21 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI3 #ifdef CONFIG_MTD_M25P - (void)stm32_configgpio(GPIO_CS_FLASH); /* FLASH chip select */ + stm32_configgpio(GPIO_CS_FLASH); /* FLASH chip select */ #endif #if defined(CONFIG_MMCSD) - (void)stm32_configgpio(GPIO_CS_MMCSD); /* MMC/SD chip select */ - (void)stm32_configgpio(GPIO_SD_CD); /* MMC/SD card detect */ + stm32_configgpio(GPIO_CS_MMCSD); /* MMC/SD chip select */ + stm32_configgpio(GPIO_SD_CD); /* MMC/SD card detect */ #endif #ifdef CONFIG_AUDIO_VS1053 - (void)stm32_configgpio(GPIO_CS_MP3_DATA); /* MP3 codec chip select for DATA */ - (void)stm32_configgpio(GPIO_CS_MP3_CMD); /* MP3 codec chip select for CMD */ + stm32_configgpio(GPIO_CS_MP3_DATA); /* MP3 codec chip select for DATA */ + stm32_configgpio(GPIO_CS_MP3_CMD); /* MP3 codec chip select for CMD */ #endif /* Configure the EXP I/O cs for SPI3 */ - (void)stm32_configgpio(GPIO_CS_EXP_SPI3); /* Expander chip select */ + stm32_configgpio(GPIO_CS_EXP_SPI3); /* Expander chip select */ #endif } diff --git a/boards/arm/stm32/mikroe-stm32f4/src/stm32_touchscreen.c b/boards/arm/stm32/mikroe-stm32f4/src/stm32_touchscreen.c index 1f8d5dcc72..44924d78ad 100644 --- a/boards/arm/stm32/mikroe-stm32f4/src/stm32_touchscreen.c +++ b/boards/arm/stm32/mikroe-stm32f4/src/stm32_touchscreen.c @@ -704,12 +704,7 @@ static int tc_waitsample(FAR struct tc_dev_s *priv, if (ret < 0) { - /* If we are awakened by a signal, then we need to return - * the failure now. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - goto errout; + goto errout; } } @@ -1119,9 +1114,6 @@ static int tc_open(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1174,9 +1166,6 @@ static int tc_close(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1231,9 +1220,6 @@ static ssize_t tc_read(FAR struct file *filep, FAR char *buffer, size_t len) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1343,9 +1329,6 @@ static int tc_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1389,9 +1372,6 @@ static int tc_poll(FAR struct file *filep, FAR struct pollfd *fds, ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1532,7 +1512,7 @@ int stm32_tsc_setup(int minor) /* Register the device as an input device */ - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); iinfo("Registering %s\n", devname); ret = register_driver(devname, &tc_fops, 0666, priv); diff --git a/boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c b/boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c index a2d9e90cb1..16fd33f594 100644 --- a/boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c +++ b/boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c @@ -121,7 +121,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/mikroe-stm32f4/src/stm32_vs1053.c b/boards/arm/stm32/mikroe-stm32f4/src/stm32_vs1053.c index 8e29402929..4ae7fd5e9e 100644 --- a/boards/arm/stm32/mikroe-stm32f4/src/stm32_vs1053.c +++ b/boards/arm/stm32/mikroe-stm32f4/src/stm32_vs1053.c @@ -138,13 +138,13 @@ static void up_enable(FAR const struct vs1053_lower_s *lower) FAR struct stm32_lower_s *priv = (FAR struct stm32_lower_s *)lower; DEBUGASSERT(priv->handler); - (void)stm32_gpiosetevent(GPIO_VS1053_DREQ, true, false, false, - priv->handler, priv->arg); + stm32_gpiosetevent(GPIO_VS1053_DREQ, true, false, false, + priv->handler, priv->arg); } static void up_disable(FAR const struct vs1053_lower_s *lower) { - (void)stm32_gpiosetevent(GPIO_VS1053_DREQ, false, false, false, NULL, NULL); + stm32_gpiosetevent(GPIO_VS1053_DREQ, false, false, false, NULL, NULL); } static void up_reset(FAR const struct vs1053_lower_s *lower, bool state) @@ -186,7 +186,7 @@ void up_vs1053initialize(FAR struct spi_dev_s* spi) /* Initialize the VS1053 DREQ GPIO line */ - (void)stm32_configgpio(GPIO_VS1053_DREQ); + stm32_configgpio(GPIO_VS1053_DREQ); /* Bind the SPI port to the VS1053 driver */ diff --git a/boards/arm/stm32/nucleo-f207zg/src/stm32_boot.c b/boards/arm/stm32/nucleo-f207zg/src/stm32_boot.c index b0e66f7764..27efc4ae16 100644 --- a/boards/arm/stm32/nucleo-f207zg/src/stm32_boot.c +++ b/boards/arm/stm32/nucleo-f207zg/src/stm32_boot.c @@ -96,7 +96,7 @@ void board_late_initialize(void) #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) /* Perform board bring-up here instead of from the board_app_initialize(). */ - (void)stm32_bringup(); + stm32_bringup(); #endif } #endif diff --git a/boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c b/boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c index 8a8008f629..fa6f7dfb6f 100644 --- a/boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c +++ b/boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c @@ -118,7 +118,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/nucleo-f303re/src/stm32_spi.c b/boards/arm/stm32/nucleo-f303re/src/stm32_spi.c index 334f40a241..3d76a8d4ef 100644 --- a/boards/arm/stm32/nucleo-f303re/src/stm32_spi.c +++ b/boards/arm/stm32/nucleo-f303re/src/stm32_spi.c @@ -71,8 +71,8 @@ void weak_function stm32_spidev_initialize(void) { #if defined(CONFIG_LCD_SSD1351) - (void)stm32_configgpio(GPIO_OLED_CS); /* OLED chip select */ - (void)stm32_configgpio(GPIO_OLED_DC); /* OLED Command/Data */ + stm32_configgpio(GPIO_OLED_CS); /* OLED chip select */ + stm32_configgpio(GPIO_OLED_DC); /* OLED Command/Data */ #endif } @@ -178,7 +178,7 @@ int stm32_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, #ifdef CONFIG_LCD_SSD1351 if (devid == SPIDEV_DISPLAY(0)) { - (void)stm32_gpiowrite(GPIO_OLED_DC, !cmd); + stm32_gpiowrite(GPIO_OLED_DC, !cmd); return OK; } #endif diff --git a/boards/arm/stm32/nucleo-f303re/src/stm32_ssd1351.c b/boards/arm/stm32/nucleo-f303re/src/stm32_ssd1351.c index 67aad1555f..1851e443bd 100644 --- a/boards/arm/stm32/nucleo-f303re/src/stm32_ssd1351.c +++ b/boards/arm/stm32/nucleo-f303re/src/stm32_ssd1351.c @@ -92,7 +92,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) * putting the OLED into reset state. */ - (void)stm32_configgpio(GPIO_OLED_RESET); + stm32_configgpio(GPIO_OLED_RESET); /* Wait a bit then release the OLED from the reset state */ @@ -121,7 +121,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* And turn the OLED on */ - (void)dev->setpower(dev, LCD_FULL_ON); + dev->setpower(dev, LCD_FULL_ON); return dev; } } diff --git a/boards/arm/stm32/nucleo-f303ze/src/stm32_boot.c b/boards/arm/stm32/nucleo-f303ze/src/stm32_boot.c index f9e41318da..285f224c5a 100644 --- a/boards/arm/stm32/nucleo-f303ze/src/stm32_boot.c +++ b/boards/arm/stm32/nucleo-f303ze/src/stm32_boot.c @@ -90,7 +90,7 @@ void board_late_initialize(void) #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) /* Perform board bring-up here instead of from the board_app_initialize(). */ - (void)stm32_bringup(); + stm32_bringup(); #endif } #endif diff --git a/boards/arm/stm32/nucleo-f303ze/src/stm32_ssd1306.c b/boards/arm/stm32/nucleo-f303ze/src/stm32_ssd1306.c index 9b08edccd4..b0dc3617d9 100644 --- a/boards/arm/stm32/nucleo-f303ze/src/stm32_ssd1306.c +++ b/boards/arm/stm32/nucleo-f303ze/src/stm32_ssd1306.c @@ -107,7 +107,7 @@ FAR struct lcd_dev_s *board_lcd_getdev(int devno) /* And turn the OLED on */ - (void)g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); + g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); return g_lcddev; } diff --git a/boards/arm/stm32/nucleo-f410rb/src/stm32_boot.c b/boards/arm/stm32/nucleo-f410rb/src/stm32_boot.c index f9757b9579..523cfbe160 100644 --- a/boards/arm/stm32/nucleo-f410rb/src/stm32_boot.c +++ b/boards/arm/stm32/nucleo-f410rb/src/stm32_boot.c @@ -104,7 +104,7 @@ void board_late_initialize(void) #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); #endif } #endif diff --git a/boards/arm/stm32/nucleo-f446re/src/stm32_ajoystick.c b/boards/arm/stm32/nucleo-f446re/src/stm32_ajoystick.c index 2b4e0bf041..e568bfffb2 100644 --- a/boards/arm/stm32/nucleo-f446re/src/stm32_ajoystick.c +++ b/boards/arm/stm32/nucleo-f446re/src/stm32_ajoystick.c @@ -376,8 +376,8 @@ static void ajoy_enable(FAR const struct ajoy_lowerhalf_s *lower, iinfo("GPIO %d: rising: %d falling: %d\n", i, rising, falling); - (void)stm32_gpiosetevent(g_joygpio[i], rising, falling, - true, ajoy_interrupt, NULL); + stm32_gpiosetevent(g_joygpio[i], rising, falling, + true, ajoy_interrupt, NULL); } } } @@ -403,7 +403,7 @@ static void ajoy_disable(void) flags = enter_critical_section(); for (i = 0; i < AJOY_NGPIOS; i++) { - (void)stm32_gpiosetevent(g_joygpio[i], false, false, false, NULL, NULL); + stm32_gpiosetevent(g_joygpio[i], false, false, false, NULL, NULL); } leave_critical_section(flags); diff --git a/boards/arm/stm32/nucleo-f4x1re/src/stm32_ajoystick.c b/boards/arm/stm32/nucleo-f4x1re/src/stm32_ajoystick.c index 5eb41d3129..2333d0dda3 100644 --- a/boards/arm/stm32/nucleo-f4x1re/src/stm32_ajoystick.c +++ b/boards/arm/stm32/nucleo-f4x1re/src/stm32_ajoystick.c @@ -375,8 +375,8 @@ static void ajoy_enable(FAR const struct ajoy_lowerhalf_s *lower, iinfo("GPIO %d: rising: %d falling: %d\n", i, rising, falling); - (void)stm32_gpiosetevent(g_joygpio[i], rising, falling, - true, ajoy_interrupt, NULL); + stm32_gpiosetevent(g_joygpio[i], rising, falling, + true, ajoy_interrupt, NULL); } } } @@ -402,7 +402,7 @@ static void ajoy_disable(void) flags = enter_critical_section(); for (i = 0; i < AJOY_NGPIOS; i++) { - (void)stm32_gpiosetevent(g_joygpio[i], false, false, false, NULL, NULL); + stm32_gpiosetevent(g_joygpio[i], false, false, false, NULL, NULL); } leave_critical_section(flags); diff --git a/boards/arm/stm32/nucleo-f4x1re/src/stm32_boot.c b/boards/arm/stm32/nucleo-f4x1re/src/stm32_boot.c index 07fb0bdd98..240baf561b 100644 --- a/boards/arm/stm32/nucleo-f4x1re/src/stm32_boot.c +++ b/boards/arm/stm32/nucleo-f4x1re/src/stm32_boot.c @@ -110,6 +110,6 @@ void board_late_initialize(void) { /* Perform board initialization here instead of from the board_app_initialize(). */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/nucleo-f4x1re/src/stm32_bringup.c b/boards/arm/stm32/nucleo-f4x1re/src/stm32_bringup.c index aaa0e2f0ca..a30f82e272 100644 --- a/boards/arm/stm32/nucleo-f4x1re/src/stm32_bringup.c +++ b/boards/arm/stm32/nucleo-f4x1re/src/stm32_bringup.c @@ -94,7 +94,7 @@ int stm32_bringup(void) #ifdef CONFIG_CAN_MCP2515 #ifdef CONFIG_STM32_SPI1 - (void)stm32_configgpio(GPIO_MCP2515_CS); /* MEMS chip select */ + stm32_configgpio(GPIO_MCP2515_CS); /* MEMS chip select */ #endif /* Configure and initialize the MCP2515 CAN device */ diff --git a/boards/arm/stm32/nucleo-f4x1re/src/stm32_mcp2515.c b/boards/arm/stm32/nucleo-f4x1re/src/stm32_mcp2515.c index 68e82ceadf..f915db2664 100644 --- a/boards/arm/stm32/nucleo-f4x1re/src/stm32_mcp2515.c +++ b/boards/arm/stm32/nucleo-f4x1re/src/stm32_mcp2515.c @@ -161,8 +161,8 @@ static int mcp2515_attach(FAR struct mcp2515_config_s *state, /* Configure the interrupt for falling edge */ - (void)stm32_gpiosetevent(GPIO_MCP2515_IRQ, false, true, false, - mcp2515_interrupt, priv); + stm32_gpiosetevent(GPIO_MCP2515_IRQ, false, true, false, + mcp2515_interrupt, priv); leave_critical_section(flags); @@ -202,7 +202,7 @@ int stm32_mcp2515initialize(FAR const char *devpath) /* Configure the MCP2515 interrupt pin as an input */ - (void)stm32_configgpio(GPIO_MCP2515_IRQ); + stm32_configgpio(GPIO_MCP2515_IRQ); spi = stm32_spibus_initialize(MCP2515_SPI_PORTNO); diff --git a/boards/arm/stm32/olimex-stm32-e407/src/stm32_boot.c b/boards/arm/stm32/olimex-stm32-e407/src/stm32_boot.c index 09fb832ca7..42a0b05aff 100644 --- a/boards/arm/stm32/olimex-stm32-e407/src/stm32_boot.c +++ b/boards/arm/stm32/olimex-stm32-e407/src/stm32_boot.c @@ -112,6 +112,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/olimex-stm32-e407/src/stm32_mrf24j40.c b/boards/arm/stm32/olimex-stm32-e407/src/stm32_mrf24j40.c index eac8673590..efafb29e4d 100644 --- a/boards/arm/stm32/olimex-stm32-e407/src/stm32_mrf24j40.c +++ b/boards/arm/stm32/olimex-stm32-e407/src/stm32_mrf24j40.c @@ -165,13 +165,13 @@ static void stm32_enable_irq(FAR const struct mrf24j40_lower_s *lower, if (state) { - (void)stm32_gpiosetevent(priv->intcfg, false, true, true, - priv->handler, priv->arg); + stm32_gpiosetevent(priv->intcfg, false, true, true, + priv->handler, priv->arg); } else { - (void)stm32_gpiosetevent(priv->intcfg, false, false, false, - NULL, NULL); + stm32_gpiosetevent(priv->intcfg, false, false, false, + NULL, NULL); } } diff --git a/boards/arm/stm32/olimex-stm32-e407/src/stm32_spi.c b/boards/arm/stm32/olimex-stm32-e407/src/stm32_spi.c index dc98bbf891..beedc3e2ed 100644 --- a/boards/arm/stm32/olimex-stm32-e407/src/stm32_spi.c +++ b/boards/arm/stm32/olimex-stm32-e407/src/stm32_spi.c @@ -77,31 +77,31 @@ void stm32_spidev_initialize(void) */ #ifdef CONFIG_MTD_W25 - (void)stm32_configgpio(FLASH_SPI1_CS); /* FLASH chip select */ + stm32_configgpio(FLASH_SPI1_CS); /* FLASH chip select */ #endif #ifdef CONFIG_CAN_MCP2515 - (void)stm32_configgpio(GPIO_MCP2515_CS); /* MCP2515 chip select */ + stm32_configgpio(GPIO_MCP2515_CS); /* MCP2515 chip select */ #endif #ifdef CONFIG_CL_MFRC522 - (void)stm32_configgpio(GPIO_CS_MFRC522); /* MFRC522 chip select */ + stm32_configgpio(GPIO_CS_MFRC522); /* MFRC522 chip select */ #endif #if defined(CONFIG_SENSORS_MAX6675) - (void)stm32_configgpio(GPIO_MAX6675_CS); /* MAX6675 chip select */ + stm32_configgpio(GPIO_MAX6675_CS); /* MAX6675 chip select */ #endif #ifdef CONFIG_LCD_MAX7219 - (void)stm32_configgpio(STM32_LCD_CS); /* MAX7219 chip select */ + stm32_configgpio(STM32_LCD_CS); /* MAX7219 chip select */ #endif #ifdef CONFIG_LCD_ST7567 - (void)stm32_configgpio(STM32_LCD_CS); /* ST7567 chip select */ + stm32_configgpio(STM32_LCD_CS); /* ST7567 chip select */ #endif #ifdef CONFIG_LCD_PCD8544 - (void)stm32_configgpio(STM32_LCD_CS); /* ST7567 chip select */ + stm32_configgpio(STM32_LCD_CS); /* ST7567 chip select */ #endif #ifdef CONFIG_WL_NRF24L01 @@ -291,7 +291,7 @@ int stm32_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, * data bits are data or a command. */ - (void)stm32_gpiowrite(STM32_LCD_RS, !cmd); + stm32_gpiowrite(STM32_LCD_RS, !cmd); return OK; } @@ -304,7 +304,7 @@ int stm32_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, * data bits are data or a command. */ - (void)stm32_gpiowrite(STM32_LCD_CD, !cmd); + stm32_gpiowrite(STM32_LCD_CD, !cmd); return OK; } diff --git a/boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c b/boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c index 9bb99e78c3..3f5b9889e1 100644 --- a/boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c +++ b/boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c @@ -117,7 +117,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/olimex-stm32-h407/src/stm32_sdio.c b/boards/arm/stm32/olimex-stm32-h407/src/stm32_sdio.c index dcc8ed82f0..bbd422523d 100644 --- a/boards/arm/stm32/olimex-stm32-h407/src/stm32_sdio.c +++ b/boards/arm/stm32/olimex-stm32-h407/src/stm32_sdio.c @@ -128,8 +128,8 @@ int stm32_sdio_initialize(void) /* Register an interrupt handler for the card detect pin */ - (void)stm32_gpiosetevent(GPIO_SDIO_NCD, true, true, true, - stm32_ncd_interrupt, NULL); + stm32_gpiosetevent(GPIO_SDIO_NCD, true, true, true, + stm32_ncd_interrupt, NULL); #endif /* Mount the SDIO-based MMC/SD block driver */ diff --git a/boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c b/boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c index b5153f1972..f3862ac7a7 100644 --- a/boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c +++ b/boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c @@ -118,7 +118,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/olimex-stm32-p107/src/stm32_encx24j600.c b/boards/arm/stm32/olimex-stm32-p107/src/stm32_encx24j600.c index 520a734a68..1df66f6a93 100644 --- a/boards/arm/stm32/olimex-stm32-p107/src/stm32_encx24j600.c +++ b/boards/arm/stm32/olimex-stm32-p107/src/stm32_encx24j600.c @@ -156,8 +156,8 @@ static void up_enable(FAR const struct enc_lower_s *lower) FAR struct stm32_lower_s *priv = (FAR struct stm32_lower_s *)lower; DEBUGASSERT(priv->handler != NULL); - (void)stm32_gpiosetevent(GPIO_ENCX24J600_INTR, false, true, true, - priv->handler, priv->arg); + stm32_gpiosetevent(GPIO_ENCX24J600_INTR, false, true, true, + priv->handler, priv->arg); } /* REVISIT: Since the interrupt is torn down completely, any interrupts @@ -166,8 +166,8 @@ static void up_enable(FAR const struct enc_lower_s *lower) static void up_disable(FAR const struct enc_lower_s *lower) { - (void)stm32_gpiosetevent(GPIO_ENCX24J600_INTR, false, true, true, - NULL, NULL); + stm32_gpiosetevent(GPIO_ENCX24J600_INTR, false, true, true, + NULL, NULL); } /**************************************************************************** diff --git a/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c b/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c index c9e794e7a3..3bf8041dfc 100644 --- a/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c +++ b/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c @@ -120,7 +120,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/olimex-stm32-p407/src/stm32_boot.c b/boards/arm/stm32/olimex-stm32-p407/src/stm32_boot.c index a8af123190..b679191685 100644 --- a/boards/arm/stm32/olimex-stm32-p407/src/stm32_boot.c +++ b/boards/arm/stm32/olimex-stm32-p407/src/stm32_boot.c @@ -110,6 +110,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization here if so configured */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c b/boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c index 4bf6bd91a9..6e9f004181 100644 --- a/boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c +++ b/boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c @@ -117,7 +117,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/olimexino-stm32/src/stm32_usbdev.c b/boards/arm/stm32/olimexino-stm32/src/stm32_usbdev.c index 86c533fab5..ea2d87e3b8 100644 --- a/boards/arm/stm32/olimexino-stm32/src/stm32_usbdev.c +++ b/boards/arm/stm32/olimexino-stm32/src/stm32_usbdev.c @@ -77,7 +77,7 @@ void stm32_usb_set_pwr_callback(xcpt_t pwr_changed_handler) { - (void)stm32_gpiosetevent(GPIO_USB_VBUS, true, true, true, pwr_changed_handler, NULL); + stm32_gpiosetevent(GPIO_USB_VBUS, true, true, true, pwr_changed_handler, NULL); } /**************************************************************************** diff --git a/boards/arm/stm32/omnibusf4/src/stm32_boot.c b/boards/arm/stm32/omnibusf4/src/stm32_boot.c index 37de061c59..38efa5e335 100644 --- a/boards/arm/stm32/omnibusf4/src/stm32_boot.c +++ b/boards/arm/stm32/omnibusf4/src/stm32_boot.c @@ -147,6 +147,6 @@ void board_initialize(void) { /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/omnibusf4/src/stm32_idle.c b/boards/arm/stm32/omnibusf4/src/stm32_idle.c index c9f5ca68f5..14b073b103 100644 --- a/boards/arm/stm32/omnibusf4/src/stm32_idle.c +++ b/boards/arm/stm32/omnibusf4/src/stm32_idle.c @@ -135,7 +135,7 @@ static void stm32_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); /* No state change... */ @@ -202,7 +202,7 @@ static void stm32_idlepm(void) * of standby is via the reset path. */ - (void)stm32_pmstandby(); + stm32_pmstandby(); } break; diff --git a/boards/arm/stm32/omnibusf4/src/stm32_spi.c b/boards/arm/stm32/omnibusf4/src/stm32_spi.c index 1c816df3c9..b00bc59f24 100644 --- a/boards/arm/stm32/omnibusf4/src/stm32_spi.c +++ b/boards/arm/stm32/omnibusf4/src/stm32_spi.c @@ -80,8 +80,8 @@ void weak_function stm32_spidev_initialize(void) stm32_configgpio(GPIO_CS_MAX7456); #endif #if defined(CONFIG_MMCSD_SPI) - (void)stm32_configgpio(GPIO_MMCSD_NCD); /* SD_DET */ - (void)stm32_configgpio(GPIO_MMCSD_NSS); /* CS */ + stm32_configgpio(GPIO_MMCSD_NCD); /* SD_DET */ + stm32_configgpio(GPIO_MMCSD_NSS); /* CS */ #endif } diff --git a/boards/arm/stm32/omnibusf4/src/stm32_usb.c b/boards/arm/stm32/omnibusf4/src/stm32_usb.c index dd2633e31a..c2e092901c 100644 --- a/boards/arm/stm32/omnibusf4/src/stm32_usb.c +++ b/boards/arm/stm32/omnibusf4/src/stm32_usb.c @@ -119,7 +119,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/photon/src/stm32_boot.c b/boards/arm/stm32/photon/src/stm32_boot.c index 957757c0f2..bd0226c5b9 100644 --- a/boards/arm/stm32/photon/src/stm32_boot.c +++ b/boards/arm/stm32/photon/src/stm32_boot.c @@ -110,6 +110,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/stm32/photon/src/stm32_rgbled.c b/boards/arm/stm32/photon/src/stm32_rgbled.c index 769ac53136..c6680c87fa 100644 --- a/boards/arm/stm32/photon/src/stm32_rgbled.c +++ b/boards/arm/stm32/photon/src/stm32_rgbled.c @@ -173,7 +173,7 @@ int stm32_rgbled_setup(void) /* Initialize led off */ - (void)nx_write(fd, "#000000", 8); + nx_write(fd, "#000000", 8); close(fd); /* Now we are initialized */ diff --git a/boards/arm/stm32/photon/src/stm32_wdt.c b/boards/arm/stm32/photon/src/stm32_wdt.c index 101a8d5880..2cba167d8f 100644 --- a/boards/arm/stm32/photon/src/stm32_wdt.c +++ b/boards/arm/stm32/photon/src/stm32_wdt.c @@ -145,7 +145,7 @@ int photon_watchdog_initialize(void) /* Close watchdog as it is not needed here anymore */ - (void)file_close(&filestruct); + file_close(&filestruct); if (ret < 0) { diff --git a/boards/arm/stm32/shenzhou/src/stm32_touchscreen.c b/boards/arm/stm32/shenzhou/src/stm32_touchscreen.c index d11427dbcf..04ba4b3860 100644 --- a/boards/arm/stm32/shenzhou/src/stm32_touchscreen.c +++ b/boards/arm/stm32/shenzhou/src/stm32_touchscreen.c @@ -184,13 +184,13 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable) iinfo("enable:%d\n", enable); if (enable) { - (void)stm32_gpiosetevent(GPIO_TP_INT, true, true, false, - priv->handler, NULL); + stm32_gpiosetevent(GPIO_TP_INT, true, true, false, + priv->handler, NULL); } else { - (void)stm32_gpiosetevent(GPIO_TP_INT, false, false, false, - NULL, NULL); + stm32_gpiosetevent(GPIO_TP_INT, false, false, false, + NULL, NULL); } } @@ -256,7 +256,7 @@ int stm32_tsc_setup(int minor) /* Configure and enable the ADS7843E interrupt pin as an input. */ - (void)stm32_configgpio(GPIO_TP_INT); + stm32_configgpio(GPIO_TP_INT); /* Get an instance of the SPI interface */ diff --git a/boards/arm/stm32/shenzhou/src/stm32_usb.c b/boards/arm/stm32/shenzhou/src/stm32_usb.c index 82772452bd..d0748d0770 100644 --- a/boards/arm/stm32/shenzhou/src/stm32_usb.c +++ b/boards/arm/stm32/shenzhou/src/stm32_usb.c @@ -121,7 +121,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/stm3210e-eval/src/stm32_boot.c b/boards/arm/stm32/stm3210e-eval/src/stm32_boot.c index a95768ab68..be22826207 100644 --- a/boards/arm/stm32/stm3210e-eval/src/stm32_boot.c +++ b/boards/arm/stm32/stm3210e-eval/src/stm32_boot.c @@ -125,6 +125,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/stm3210e-eval/src/stm32_djoystick.c b/boards/arm/stm32/stm3210e-eval/src/stm32_djoystick.c index dcb1bc81a9..6f2046f53f 100644 --- a/boards/arm/stm32/stm3210e-eval/src/stm32_djoystick.c +++ b/boards/arm/stm32/stm3210e-eval/src/stm32_djoystick.c @@ -212,8 +212,8 @@ static void djoy_enable(FAR const struct djoy_lowerhalf_s *lower, iinfo("GPIO %d: rising: %d falling: %d\n", i, rising, falling); - (void)stm32_gpiosetevent(g_joygpio[i], rising, falling, - true, djoy_interrupt, NULL); + stm32_gpiosetevent(g_joygpio[i], rising, falling, + true, djoy_interrupt, NULL); } } } @@ -239,7 +239,7 @@ static void djoy_disable(void) flags = enter_critical_section(); for (i = 0; i < DJOY_NGPIOS; i++) { - (void)stm32_gpiosetevent(g_joygpio[i], false, false, false, NULL, NULL); + stm32_gpiosetevent(g_joygpio[i], false, false, false, NULL, NULL); } leave_critical_section(flags); diff --git a/boards/arm/stm32/stm3210e-eval/src/stm32_idle.c b/boards/arm/stm32/stm3210e-eval/src/stm32_idle.c index 898b26fee5..58a8c37dbd 100644 --- a/boards/arm/stm32/stm3210e-eval/src/stm32_idle.c +++ b/boards/arm/stm32/stm3210e-eval/src/stm32_idle.c @@ -177,7 +177,7 @@ static int stm32_alarm_exti(int irq, FAR void *context, FAR void *arg) #if defined(CONFIG_PM) && defined(CONFIG_RTC_ALARM) static void stm32_exti_cancel(void) { - (void)stm32_exti_alarm(false, false, false, NULL, NULL); + stm32_exti_alarm(false, false, false, NULL, NULL); } #endif @@ -201,12 +201,12 @@ static int stm32_rtc_alarm(time_t tv_sec, time_t tv_nsec, bool exti) { /* TODO: Make sure that that is no pending EXTI interrupt */ - (void)stm32_exti_alarm(true, true, true, stm32_alarm_exti, NULL); + stm32_exti_alarm(true, true, true, stm32_alarm_exti, NULL); } /* Configure the RTC alarm to Auto Wake the system */ - (void)up_rtc_gettime(&alarmtime); + up_rtc_gettime(&alarmtime); alarmtime.tv_sec += tv_sec; alarmtime.tv_nsec += tv_nsec; @@ -301,7 +301,7 @@ static void stm32_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); /* No state change... */ @@ -354,7 +354,7 @@ static void stm32_idlepm(void) /* Enter the STM32 stop mode */ - (void)stm32_pmstop(false); + stm32_pmstop(false); /* We have been re-awakened by some even: A button press? * An alarm? Cancel any pending alarm and resume the normal @@ -393,7 +393,7 @@ static void stm32_idlepm(void) /* Enter the STM32 standby mode */ - (void)stm32_pmstandby(); + stm32_pmstandby(); } break; diff --git a/boards/arm/stm32/stm3210e-eval/src/stm32_lcd.c b/boards/arm/stm32/stm3210e-eval/src/stm32_lcd.c index a488790d13..05018d5b33 100644 --- a/boards/arm/stm32/stm3210e-eval/src/stm32_lcd.c +++ b/boards/arm/stm32/stm3210e-eval/src/stm32_lcd.c @@ -1223,7 +1223,7 @@ static void stm3210e_pm_notify(struct pm_callback_s *cb, int domain, } else { - (void)stm3210e_poweroff(); + stm3210e_poweroff(); } } break; diff --git a/boards/arm/stm32/stm3210e-eval/src/stm32_lm75.c b/boards/arm/stm32/stm3210e-eval/src/stm32_lm75.c index 6c66585863..3694884cbb 100644 --- a/boards/arm/stm32/stm3210e-eval/src/stm32_lm75.c +++ b/boards/arm/stm32/stm3210e-eval/src/stm32_lm75.c @@ -92,7 +92,7 @@ int stm32_lm75initialize(FAR const char *devpath) ret = lm75_register(devpath, i2c, 0x48); if (ret < 0) { - (void)stm32_i2cbus_uninitialize(i2c); + stm32_i2cbus_uninitialize(i2c); } return ret; @@ -115,7 +115,7 @@ int stm32_lm75initialize(FAR const char *devpath) int stm32_lm75attach(xcpt_t irqhandler, void *arg) { - (void)stm32_gpiosetevent(GPIO_LM75_OSINT, true, true, true, irqhandler, arg); + stm32_gpiosetevent(GPIO_LM75_OSINT, true, true, true, irqhandler, arg); return OK; } diff --git a/boards/arm/stm32/stm3220g-eval/src/stm32_stmpe811.c b/boards/arm/stm32/stm3220g-eval/src/stm32_stmpe811.c index 3ba5a6bcb0..d0e12097b0 100644 --- a/boards/arm/stm32/stm3220g-eval/src/stm32_stmpe811.c +++ b/boards/arm/stm32/stm3220g-eval/src/stm32_stmpe811.c @@ -241,15 +241,15 @@ static void stmpe811_enable(FAR struct stmpe811_config_s *state, bool enable) { /* Configure the EXTI interrupt using the SAVED handler */ - (void)stm32_gpiosetevent(GPIO_IO_EXPANDER, true, true, true, - priv->handler, priv->arg); + stm32_gpiosetevent(GPIO_IO_EXPANDER, true, true, true, + priv->handler, priv->arg); } else { /* Configure the EXTI interrupt with a NULL handler to disable it */ - (void)stm32_gpiosetevent(GPIO_IO_EXPANDER, false, false, false, - NULL, NULL); + stm32_gpiosetevent(GPIO_IO_EXPANDER, false, false, false, + NULL, NULL); } leave_critical_section(flags); @@ -298,7 +298,7 @@ int stm32_tsc_setup(int minor) /* Configure the STMPE811 interrupt pin as an input */ - (void)stm32_configgpio(GPIO_IO_EXPANDER); + stm32_configgpio(GPIO_IO_EXPANDER); /* Get an instance of the I2C interface */ diff --git a/boards/arm/stm32/stm3220g-eval/src/stm32_usb.c b/boards/arm/stm32/stm3220g-eval/src/stm32_usb.c index 9df417c1fe..25987e0b98 100644 --- a/boards/arm/stm32/stm3220g-eval/src/stm32_usb.c +++ b/boards/arm/stm32/stm3220g-eval/src/stm32_usb.c @@ -121,7 +121,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/stm3240g-eval/src/stm32_boot.c b/boards/arm/stm32/stm3240g-eval/src/stm32_boot.c index 0b544b8229..9e9a20d245 100644 --- a/boards/arm/stm32/stm3240g-eval/src/stm32_boot.c +++ b/boards/arm/stm32/stm3240g-eval/src/stm32_boot.c @@ -123,6 +123,6 @@ void board_late_initialize(void) * the start-up thread. */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/stm3240g-eval/src/stm32_stmpe811.c b/boards/arm/stm32/stm3240g-eval/src/stm32_stmpe811.c index de1a2fc498..0306d2da29 100644 --- a/boards/arm/stm32/stm3240g-eval/src/stm32_stmpe811.c +++ b/boards/arm/stm32/stm3240g-eval/src/stm32_stmpe811.c @@ -240,15 +240,15 @@ static void stmpe811_enable(FAR struct stmpe811_config_s *state, bool enable) { /* Configure the EXTI interrupt using the SAVED handler */ - (void)stm32_gpiosetevent(GPIO_IO_EXPANDER, true, true, true, - priv->handler, priv->arg); + stm32_gpiosetevent(GPIO_IO_EXPANDER, true, true, true, + priv->handler, priv->arg); } else { /* Configure the EXTI interrupt with a NULL handler to disable it */ - (void)stm32_gpiosetevent(GPIO_IO_EXPANDER, false, false, false, - NULL, NULL); + stm32_gpiosetevent(GPIO_IO_EXPANDER, false, false, false, + NULL, NULL); } leave_critical_section(flags); @@ -297,7 +297,7 @@ int stm32_tsc_setup(int minor) /* Configure the STMPE811 interrupt pin as an input */ - (void)stm32_configgpio(GPIO_IO_EXPANDER); + stm32_configgpio(GPIO_IO_EXPANDER); /* Get an instance of the I2C interface */ diff --git a/boards/arm/stm32/stm3240g-eval/src/stm32_usb.c b/boards/arm/stm32/stm3240g-eval/src/stm32_usb.c index 1b6bf72669..00f2936439 100644 --- a/boards/arm/stm32/stm3240g-eval/src/stm32_usb.c +++ b/boards/arm/stm32/stm3240g-eval/src/stm32_usb.c @@ -121,7 +121,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/stm32_tiny/src/stm32_nrf24l01.c b/boards/arm/stm32/stm32_tiny/src/stm32_nrf24l01.c index 88e645ec39..4366fe26f8 100644 --- a/boards/arm/stm32/stm32_tiny/src/stm32_nrf24l01.c +++ b/boards/arm/stm32/stm32_tiny/src/stm32_nrf24l01.c @@ -83,7 +83,7 @@ static int stm32tiny_wl_irq_attach(xcpt_t isr, FAR void *arg) _info("Attach IRQ\n"); g_isr = isr; g_arg = arg; - (void)stm32_gpiosetevent(GPIO_NRF24L01_IRQ, false, true, false, g_isr, g_arg); + stm32_gpiosetevent(GPIO_NRF24L01_IRQ, false, true, false, g_isr, g_arg); return OK; } diff --git a/boards/arm/stm32/stm32butterfly2/src/stm32_mmcsd.c b/boards/arm/stm32/stm32butterfly2/src/stm32_mmcsd.c index 97244f6ae6..4480266ea3 100644 --- a/boards/arm/stm32/stm32butterfly2/src/stm32_mmcsd.c +++ b/boards/arm/stm32/stm32butterfly2/src/stm32_mmcsd.c @@ -98,8 +98,6 @@ static sem_t g_cdsem; static void *stm32_cd_thread(void *arg) { - (void)arg; - spiinfo("INFO: Runnig card detect thread\n"); while (1) { @@ -199,7 +197,7 @@ int stm32_mmcsd_initialize(int minor) return rv; } - (void)stm32_gpiosetevent(GPIO_SD_CD, true, true, true, stm32_cd, NULL); + stm32_gpiosetevent(GPIO_SD_CD, true, true, true, stm32_cd, NULL); nxsem_init(&g_cdsem, 0, 0); pthread_attr_init(&pattr); diff --git a/boards/arm/stm32/stm32butterfly2/src/stm32_usbhost.c b/boards/arm/stm32/stm32butterfly2/src/stm32_usbhost.c index 9d002312c7..0f6f10f46c 100644 --- a/boards/arm/stm32/stm32butterfly2/src/stm32_usbhost.c +++ b/boards/arm/stm32/stm32butterfly2/src/stm32_usbhost.c @@ -81,7 +81,6 @@ static struct usbhost_connection_s *g_usbconn; static void* usbhost_detect(void *arg) { - (void)arg; struct usbhost_hubport_s *hport; uinfo("INFO: Starting usb detect thread\n"); diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_apds9960.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_apds9960.c index 9a83894f89..2c225fae0a 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_apds9960.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_apds9960.c @@ -119,7 +119,7 @@ static int apds9960_irq_attach(FAR struct apds9960_config_s *state, xcpt_t isr, /* Setup interrupt for Falling Edge */ - (void)stm32_gpiosetevent(GPIO_APDS9960_INT, false, true, true, isr, arg); + stm32_gpiosetevent(GPIO_APDS9960_INT, false, true, true, isr, arg); leave_critical_section(flags); diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_boot.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_boot.c index fa1f0c2385..a02b51f9f4 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_boot.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_boot.c @@ -107,7 +107,7 @@ void board_late_initialize(void) #ifndef CONFIG_LIB_BOARDCTL /* Perform board initialization here instead of from the board_app_initialize(). */ - (void)stm32_bringup(); + stm32_bringup(); #endif } #endif diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_gpio.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_gpio.c index ce29a7f66c..1d01a592f6 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_gpio.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_gpio.c @@ -220,8 +220,8 @@ static int gpint_attach(FAR struct gpio_dev_s *dev, /* Make sure the interrupt is disabled */ - (void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], false, - false, false, NULL, NULL); + stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], false, + false, false, NULL, NULL); gpioinfo("Attach %p\n", callback); stm32gpint->callback = callback; @@ -240,17 +240,17 @@ static int gpint_enable(FAR struct gpio_dev_s *dev, bool enable) /* Configure the interrupt for rising edge */ - (void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], - true, false, false, stm32gpio_interrupt, - &g_gpint[stm32gpint->stm32gpio.id]); + stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], + true, false, false, stm32gpio_interrupt, + &g_gpint[stm32gpint->stm32gpio.id]); } } else { gpioinfo("Disable the interrupt\n"); - (void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], - false, false, false, NULL, NULL); + stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], + false, false, false, NULL, NULL); } return OK; @@ -281,7 +281,7 @@ int stm32_gpio_initialize(void) g_gpin[i].gpio.gp_pintype = GPIO_INPUT_PIN; g_gpin[i].gpio.gp_ops = &gpin_ops; g_gpin[i].id = i; - (void)gpio_pin_register(&g_gpin[i].gpio, pincount); + gpio_pin_register(&g_gpin[i].gpio, pincount); /* Configure the pin that will be used as input */ @@ -299,7 +299,7 @@ int stm32_gpio_initialize(void) g_gpout[i].gpio.gp_pintype = GPIO_OUTPUT_PIN; g_gpout[i].gpio.gp_ops = &gpout_ops; g_gpout[i].id = i; - (void)gpio_pin_register(&g_gpout[i].gpio, pincount); + gpio_pin_register(&g_gpout[i].gpio, pincount); /* Configure the pin that will be used as output */ stm32_gpiowrite(g_gpiooutputs[i], 0); @@ -317,7 +317,7 @@ int stm32_gpio_initialize(void) g_gpint[i].stm32gpio.gpio.gp_pintype = GPIO_INTERRUPT_PIN; g_gpint[i].stm32gpio.gpio.gp_ops = &gpint_ops; g_gpint[i].stm32gpio.id = i; - (void)gpio_pin_register(&g_gpint[i].stm32gpio.gpio, pincount); + gpio_pin_register(&g_gpint[i].stm32gpio.gpio, pincount); /* Configure the pin that will be used as interrupt input */ diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_hcsr04.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_hcsr04.c index 28bd97bfe0..ea808b500a 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_hcsr04.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_hcsr04.c @@ -150,8 +150,8 @@ static int hcsr04_irq_attach(FAR struct hcsr04_config_s *state, xcpt_t isr, priv->isr = isr; priv->arg = arg; - (void)stm32_gpiosetevent(GPIO_HCSR04_INT, priv->rising, priv->falling, true, - isr, arg); + stm32_gpiosetevent(GPIO_HCSR04_INT, priv->rising, priv->falling, true, + isr, arg); leave_critical_section(flags); @@ -187,8 +187,8 @@ static void hcsr04_irq_enable(FAR const struct hcsr04_config_s *state, iinfo("%d\n", enable); - (void)stm32_gpiosetevent(GPIO_HCSR04_INT, priv->rising, priv->falling, true, - enable ? priv->isr : NULL, priv->arg); + stm32_gpiosetevent(GPIO_HCSR04_INT, priv->rising, priv->falling, true, + enable ? priv->isr : NULL, priv->arg); } /* Acknowledge/clear any pending GPIO interrupt */ @@ -202,7 +202,7 @@ static void hcsr04_irq_clear(FAR const struct hcsr04_config_s *state) static void hcsr04_set_trigger(FAR const struct hcsr04_config_s *state, bool on) { - (void)stm32_gpiowrite(GPIO_HCSR04_TRIG, on); + stm32_gpiowrite(GPIO_HCSR04_TRIG, on); } /* Return the current Free Running clock tick */ diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_lcd.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_lcd.c index 0f7c9c1ee3..d6b30f2db1 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_lcd.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_lcd.c @@ -129,11 +129,11 @@ FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) /* And turn the LCD on (CONFIG_LCD_MAXPOWER should be 1) */ - (void)g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); + g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); /* Set contrast to right value, otherwise background too dark */ - (void)g_lcddev->setcontrast(g_lcddev, CONFIG_LCD_CONTRAST); + g_lcddev->setcontrast(g_lcddev, CONFIG_LCD_CONTRAST); return g_lcddev; } diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_lm75.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_lm75.c index 779495dcc9..5b57a5d437 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_lm75.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_lm75.c @@ -92,7 +92,7 @@ int stm32_lm75initialize(FAR const char *devpath) ret = lm75_register(devpath, i2c, 0x48); if (ret < 0) { - (void)stm32_i2cbus_uninitialize(i2c); + stm32_i2cbus_uninitialize(i2c); } return ret; @@ -115,7 +115,7 @@ int stm32_lm75initialize(FAR const char *devpath) int stm32_lm75attach(xcpt_t irqhandler, void *arg) { - (void)stm32_gpiosetevent(GPIO_LM75_OSINT, true, true, true, irqhandler, arg); + stm32_gpiosetevent(GPIO_LM75_OSINT, true, true, true, irqhandler, arg); return OK; } diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_mcp2515.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_mcp2515.c index d7679fa992..92d9e19ca7 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_mcp2515.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_mcp2515.c @@ -161,8 +161,8 @@ static int mcp2515_attach(FAR struct mcp2515_config_s *state, /* Configure the interrupt for falling edge*/ - (void)stm32_gpiosetevent(GPIO_MCP2515_IRQ, false, true, false, - mcp2515_interrupt, priv); + stm32_gpiosetevent(GPIO_MCP2515_IRQ, false, true, false, + mcp2515_interrupt, priv); leave_critical_section(flags); @@ -202,7 +202,7 @@ int stm32_mcp2515initialize(FAR const char *devpath) /* Configure the MCP2515 interrupt pin as an input */ - (void)stm32_configgpio(GPIO_MCP2515_IRQ); + stm32_configgpio(GPIO_MCP2515_IRQ); spi = stm32_spibus_initialize(MCP2515_SPI_PORTNO); diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_nrf24l01.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_nrf24l01.c index ec3139053e..c606a2141f 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_nrf24l01.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_nrf24l01.c @@ -85,7 +85,7 @@ static int stm32tiny_wl_irq_attach(xcpt_t isr, FAR void *arg) wlinfo("Attach IRQ\n"); g_isr = isr; g_arg = arg; - (void)stm32_gpiosetevent(GPIO_NRF24L01_IRQ, false, true, false, g_isr, g_arg); + stm32_gpiosetevent(GPIO_NRF24L01_IRQ, false, true, false, g_isr, g_arg); return OK; } diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_pcd8544.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_pcd8544.c index 36189b50f1..dc239a1818 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_pcd8544.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_pcd8544.c @@ -121,11 +121,11 @@ FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) /* And turn the LCD on (CONFIG_LCD_MAXPOWER should be 1) */ - (void)g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); + g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); /* Set contrast to right value, otherwise background too dark */ - (void)g_lcddev->setcontrast(g_lcddev, CONFIG_LCD_CONTRAST); + g_lcddev->setcontrast(g_lcddev, CONFIG_LCD_CONTRAST); return g_lcddev; } diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_spi.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_spi.c index 38dfbaf473..985ff32866 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_spi.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_spi.c @@ -75,31 +75,31 @@ void stm32_spidev_initialize(void) */ #ifdef CONFIG_MTD_W25 - (void)stm32_configgpio(FLASH_SPI1_CS); /* FLASH chip select */ + stm32_configgpio(FLASH_SPI1_CS); /* FLASH chip select */ #endif #ifdef CONFIG_CAN_MCP2515 - (void)stm32_configgpio(GPIO_MCP2515_CS); /* MCP2515 chip select */ + stm32_configgpio(GPIO_MCP2515_CS); /* MCP2515 chip select */ #endif #ifdef CONFIG_CL_MFRC522 - (void)stm32_configgpio(GPIO_CS_MFRC522); /* MFRC522 chip select */ + stm32_configgpio(GPIO_CS_MFRC522); /* MFRC522 chip select */ #endif #if defined(CONFIG_SENSORS_MAX6675) - (void)stm32_configgpio(GPIO_MAX6675_CS); /* MAX6675 chip select */ + stm32_configgpio(GPIO_MAX6675_CS); /* MAX6675 chip select */ #endif #ifdef CONFIG_LCD_MAX7219 - (void)stm32_configgpio(STM32_LCD_CS); /* MAX7219 chip select */ + stm32_configgpio(STM32_LCD_CS); /* MAX7219 chip select */ #endif #ifdef CONFIG_LCD_ST7567 - (void)stm32_configgpio(STM32_LCD_CS); /* ST7567 chip select */ + stm32_configgpio(STM32_LCD_CS); /* ST7567 chip select */ #endif #ifdef CONFIG_LCD_PCD8544 - (void)stm32_configgpio(STM32_LCD_CS); /* ST7567 chip select */ + stm32_configgpio(STM32_LCD_CS); /* ST7567 chip select */ #endif #ifdef CONFIG_WL_NRF24L01 @@ -271,7 +271,7 @@ int stm32_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, * data bits are data or a command. */ - (void)stm32_gpiowrite(STM32_LCD_RS, !cmd); + stm32_gpiowrite(STM32_LCD_RS, !cmd); return OK; } @@ -284,7 +284,7 @@ int stm32_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, * data bits are data or a command. */ - (void)stm32_gpiowrite(STM32_LCD_CD, !cmd); + stm32_gpiowrite(STM32_LCD_CD, !cmd); return OK; } diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_ssd1306.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_ssd1306.c index 4810e1bae9..585207b19a 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_ssd1306.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_ssd1306.c @@ -113,7 +113,7 @@ FAR struct lcd_dev_s *board_lcd_getdev(int devno) /* And turn the OLED on */ - (void)g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); + g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); return g_lcddev; } diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_zerocross.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_zerocross.c index 8b076783ae..0b2e8d696b 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_zerocross.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_zerocross.c @@ -110,8 +110,8 @@ static void zcross_enable(FAR const struct zc_lowerhalf_s *lower, g_zcrossarg = arg; } - (void)stm32_gpiosetevent(GPIO_ZEROCROSS, rising, falling, - true, zcross_interrupt, NULL); + stm32_gpiosetevent(GPIO_ZEROCROSS, rising, falling, + true, zcross_interrupt, NULL); leave_critical_section(flags); } @@ -132,7 +132,7 @@ static void zcross_disable(void) flags = enter_critical_section(); - (void)stm32_gpiosetevent(GPIO_ZEROCROSS, false, false, false, NULL, NULL); + stm32_gpiosetevent(GPIO_ZEROCROSS, false, false, false, NULL, NULL); leave_critical_section(flags); diff --git a/boards/arm/stm32/stm32f3discovery/src/stm32_boot.c b/boards/arm/stm32/stm32f3discovery/src/stm32_boot.c index e83f5d99d2..81f0ac4c27 100644 --- a/boards/arm/stm32/stm32f3discovery/src/stm32_boot.c +++ b/boards/arm/stm32/stm32f3discovery/src/stm32_boot.c @@ -112,6 +112,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/stm32f3discovery/src/stm32_spi.c b/boards/arm/stm32/stm32f3discovery/src/stm32_spi.c index 123820653e..5c048f6caf 100644 --- a/boards/arm/stm32/stm32f3discovery/src/stm32_spi.c +++ b/boards/arm/stm32/stm32f3discovery/src/stm32_spi.c @@ -69,9 +69,9 @@ void weak_function stm32_spidev_initialize(void) { #ifdef CONFIG_STM32_SPI1 - (void)stm32_configgpio(GPIO_MEMS_CS); /* MEMS chip select */ - (void)stm32_configgpio(GPIO_MEMS_INT1); /* MEMS interrupts */ - (void)stm32_configgpio(GPIO_MEMS_INT2); + stm32_configgpio(GPIO_MEMS_CS); /* MEMS chip select */ + stm32_configgpio(GPIO_MEMS_INT1); /* MEMS interrupts */ + stm32_configgpio(GPIO_MEMS_INT2); #endif } diff --git a/boards/arm/stm32/stm32f411e-disco/src/stm32_boot.c b/boards/arm/stm32/stm32f411e-disco/src/stm32_boot.c index d96d8bb18e..5d80fc87d6 100644 --- a/boards/arm/stm32/stm32f411e-disco/src/stm32_boot.c +++ b/boards/arm/stm32/stm32f411e-disco/src/stm32_boot.c @@ -108,6 +108,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c b/boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c index 0ec0379137..2b54612044 100644 --- a/boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c +++ b/boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c @@ -117,7 +117,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/stm32f429i-disco/src/stm32_boot.c b/boards/arm/stm32/stm32f429i-disco/src/stm32_boot.c index 539bfdfdc5..5111add767 100644 --- a/boards/arm/stm32/stm32f429i-disco/src/stm32_boot.c +++ b/boards/arm/stm32/stm32f429i-disco/src/stm32_boot.c @@ -125,6 +125,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/stm32f429i-disco/src/stm32_idle.c b/boards/arm/stm32/stm32f429i-disco/src/stm32_idle.c index 6ca33e5cee..b2a9f92775 100644 --- a/boards/arm/stm32/stm32f429i-disco/src/stm32_idle.c +++ b/boards/arm/stm32/stm32f429i-disco/src/stm32_idle.c @@ -136,7 +136,7 @@ static void stm32_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); /* No state change... */ @@ -203,7 +203,7 @@ static void stm32_idlepm(void) * of standby is via the reset path. */ - (void)stm32_pmstandby(); + stm32_pmstandby(); } break; diff --git a/boards/arm/stm32/stm32f429i-disco/src/stm32_ili93414ws.c b/boards/arm/stm32/stm32f429i-disco/src/stm32_ili93414ws.c index 67351abe5d..c96edcb9fb 100644 --- a/boards/arm/stm32/stm32f429i-disco/src/stm32_ili93414ws.c +++ b/boards/arm/stm32/stm32f429i-disco/src/stm32_ili93414ws.c @@ -312,7 +312,7 @@ static void stm32_ili93414ws_spirecvmode(void) * broken transfer. */ - (void)getreg16(ILI93414WS_SPI_DR); + getreg16(ILI93414WS_SPI_DR); } /**************************************************************************** @@ -692,7 +692,7 @@ static int stm32_ili93414ws_recvblock(FAR struct ili93414ws_lcd_s *lcd, /* Dummy read to discard the first 8 bit. */ - (void)stm32_ili93414ws_recvword(); + stm32_ili93414ws_recvword(); while (nwords--) { @@ -864,7 +864,7 @@ static inline void stm32_ili93414ws_cmddata( static inline void stm32_ili93414ws_cmddata( FAR struct ili9341_lcd_s *lcd, bool cmd) { - (void)stm32_gpiowrite(GPIO_LCD_DC, !cmd); + stm32_gpiowrite(GPIO_LCD_DC, !cmd); } #endif @@ -926,7 +926,7 @@ static void stm32_ili93414ws_select(FAR struct ili9341_lcd_s *lcd) { /* We own the spi bus, so just select the chip */ - (void)stm32_gpiowrite(GPIO_CS_LCD, false); + stm32_gpiowrite(GPIO_CS_LCD, false); /* Disable spi */ @@ -980,7 +980,7 @@ static void stm32_ili93414ws_deselect(FAR struct ili9341_lcd_s *lcd) #else static void stm32_ili93414ws_deselect(FAR struct ili9341_lcd_s *lcd) { - (void)stm32_gpiowrite(GPIO_CS_LCD, true); + stm32_gpiowrite(GPIO_CS_LCD, true); } #endif @@ -1200,11 +1200,11 @@ FAR struct ili9341_lcd_s *stm32_ili93414ws_initialize(void) /* Configure gpios */ - (void)stm32_configgpio(GPIO_CS_LCD); /* LCD chip select */ - (void)stm32_configgpio(GPIO_LCD_DC); /* LCD Data/Command select */ - (void)stm32_configgpio(GPIO_LCD_ENABLE); /* LCD enable select */ - (void)stm32_configgpio(GPIO_SPI5_SCK); /* SPI clock */ - (void)stm32_configgpio(GPIO_SPI5_MOSI); /* SPI MOSI */ + stm32_configgpio(GPIO_CS_LCD); /* LCD chip select */ + stm32_configgpio(GPIO_LCD_DC); /* LCD Data/Command select */ + stm32_configgpio(GPIO_LCD_ENABLE); /* LCD enable select */ + stm32_configgpio(GPIO_SPI5_SCK); /* SPI clock */ + stm32_configgpio(GPIO_SPI5_MOSI); /* SPI MOSI */ /* Initialize structure */ diff --git a/boards/arm/stm32/stm32f429i-disco/src/stm32_spi.c b/boards/arm/stm32/stm32f429i-disco/src/stm32_spi.c index b5e7576031..08474f8ccd 100644 --- a/boards/arm/stm32/stm32f429i-disco/src/stm32_spi.c +++ b/boards/arm/stm32/stm32f429i-disco/src/stm32_spi.c @@ -79,13 +79,13 @@ FAR struct spi_dev_s *g_spidev5 = NULL; void weak_function stm32_spidev_initialize(void) { #ifdef CONFIG_STM32_SPI5 - (void)stm32_configgpio(GPIO_CS_MEMS); /* MEMS chip select */ - (void)stm32_configgpio(GPIO_CS_LCD); /* LCD chip select */ - (void)stm32_configgpio(GPIO_LCD_DC); /* LCD Data/Command select */ - (void)stm32_configgpio(GPIO_LCD_ENABLE); /* LCD enable select */ + stm32_configgpio(GPIO_CS_MEMS); /* MEMS chip select */ + stm32_configgpio(GPIO_CS_LCD); /* LCD chip select */ + stm32_configgpio(GPIO_LCD_DC); /* LCD Data/Command select */ + stm32_configgpio(GPIO_LCD_ENABLE); /* LCD enable select */ #endif #if defined(CONFIG_STM32_SPI4) && defined(CONFIG_MTD_SST25XX) - (void)stm32_configgpio(GPIO_CS_SST25); /* SST25 FLASH chip select */ + stm32_configgpio(GPIO_CS_SST25); /* SST25 FLASH chip select */ #endif } @@ -253,7 +253,7 @@ int stm32_spi5cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) * data bits are data or a command. */ - (void)stm32_gpiowrite(GPIO_LCD_DC, !cmd); + stm32_gpiowrite(GPIO_LCD_DC, !cmd); return OK; } diff --git a/boards/arm/stm32/stm32f429i-disco/src/stm32_stmpe811.c b/boards/arm/stm32/stm32f429i-disco/src/stm32_stmpe811.c index 1c0b6ad2d6..299e31a84d 100644 --- a/boards/arm/stm32/stm32f429i-disco/src/stm32_stmpe811.c +++ b/boards/arm/stm32/stm32f429i-disco/src/stm32_stmpe811.c @@ -243,15 +243,15 @@ static void stmpe811_enable(FAR struct stmpe811_config_s *state, bool enable) { /* Configure the EXTI interrupt using the SAVED handler */ - (void)stm32_gpiosetevent(GPIO_IO_EXPANDER, true, true, true, - priv->handler, priv->arg); + stm32_gpiosetevent(GPIO_IO_EXPANDER, true, true, true, + priv->handler, priv->arg); } else { /* Configure the EXTI interrupt with a NULL handler to disable it */ - (void)stm32_gpiosetevent(GPIO_IO_EXPANDER, false, false, false, - NULL, NULL); + stm32_gpiosetevent(GPIO_IO_EXPANDER, false, false, false, + NULL, NULL); } leave_critical_section(flags); @@ -300,7 +300,7 @@ int stm32_tsc_setup(int minor) /* Configure the STMPE811 interrupt pin as an input */ - (void)stm32_configgpio(GPIO_IO_EXPANDER); + stm32_configgpio(GPIO_IO_EXPANDER); /* Get an instance of the I2C interface */ diff --git a/boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c b/boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c index 9624a7652f..3ef18663dc 100644 --- a/boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c +++ b/boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c @@ -117,7 +117,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_boot.c b/boards/arm/stm32/stm32f4discovery/src/stm32_boot.c index c604bb7454..113eb738e1 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_boot.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_boot.c @@ -139,6 +139,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_cs43l22.c b/boards/arm/stm32/stm32f4discovery/src/stm32_cs43l22.c index cda2594479..d66eabe1f3 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_cs43l22.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_cs43l22.c @@ -163,7 +163,7 @@ static int cs43l22_attach(FAR const struct cs43l22_lower_s *lower, else { audinfo("Detaching %p\n", g_cs43l22info.handler); - (void)cs43l22_enable(lower, false); + cs43l22_enable(lower, false); g_cs43l22info.handler = NULL; g_cs43l22info.arg = NULL; } diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_ethernet.c b/boards/arm/stm32/stm32f4discovery/src/stm32_ethernet.c index a661ef6b30..17ffffdbd3 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_ethernet.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_ethernet.c @@ -113,15 +113,15 @@ static void stm32_emac0_phy_enable(bool enable) { /* Attach and enable GPIO interrupt (and event) on the falling edge */ - (void)stm32_gpiosetevent(GPIO_EMAC_NINT, false, true, true, - g_ethmac_handler, g_ethmac_arg); + stm32_gpiosetevent(GPIO_EMAC_NINT, false, true, true, + g_ethmac_handler, g_ethmac_arg); } else { /* Detach and disable GPIO interrupt */ - (void)stm32_gpiosetevent(GPIO_EMAC_NINT, false, false, false, - NULL, NULL); + stm32_gpiosetevent(GPIO_EMAC_NINT, false, false, false, + NULL, NULL); } } #endif diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_gs2200m.c b/boards/arm/stm32/stm32f4discovery/src/stm32_gs2200m.c index 1ae481f408..876cbdc7cf 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_gs2200m.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_gs2200m.c @@ -140,8 +140,8 @@ static void gs2200m_irq_enable(void) /* NOTE: stm32 does not support level-triggered irq */ - (void)stm32_gpiosetevent(GPIO_GS2200M_INT, true, false, - true, g_irq_handler, g_irq_arg); + stm32_gpiosetevent(GPIO_GS2200M_INT, true, false, + true, g_irq_handler, g_irq_arg); } spin_unlock_irqrestore(flags); @@ -169,8 +169,8 @@ static void gs2200m_irq_disable(void) if (0 == _enable_count) { - (void)stm32_gpiosetevent(GPIO_GS2200M_INT, false, false, - false, NULL, NULL); + stm32_gpiosetevent(GPIO_GS2200M_INT, false, false, + false, NULL, NULL); } spin_unlock_irqrestore(flags); diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_idle.c b/boards/arm/stm32/stm32f4discovery/src/stm32_idle.c index 65f6a2814a..bc948ac7c7 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_idle.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_idle.c @@ -133,7 +133,7 @@ static void stm32_idlepm(void) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); + pm_changestate(PM_IDLE_DOMAIN, oldstate); /* No state change... */ @@ -200,7 +200,7 @@ static void stm32_idlepm(void) * of standby is via the reset path. */ - (void)stm32_pmstandby(); + stm32_pmstandby(); } break; diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_pmbuttons.c b/boards/arm/stm32/stm32f4discovery/src/stm32_pmbuttons.c index e09e291ed2..8a286ab5be 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_pmbuttons.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_pmbuttons.c @@ -130,7 +130,7 @@ void stm32_pm_buttons(void) board_button_initialize(); #ifdef CONFIG_ARCH_IRQBUTTONS - (void)board_button_irq(0, button_handler, NULL); + board_button_irq(0, button_handler, NULL); #endif } diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_sdio.c b/boards/arm/stm32/stm32f4discovery/src/stm32_sdio.c index 5bcfedb811..d00c0c6f08 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_sdio.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_sdio.c @@ -128,8 +128,8 @@ int stm32_sdio_initialize(void) /* Register an interrupt handler for the card detect pin */ - (void)stm32_gpiosetevent(GPIO_SDIO_NCD, true, true, true, - stm32_ncd_interrupt, NULL); + stm32_gpiosetevent(GPIO_SDIO_NCD, true, true, true, + stm32_ncd_interrupt, NULL); #endif /* Mount the SDIO-based MMC/SD block driver */ diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_spi.c b/boards/arm/stm32/stm32f4discovery/src/stm32_spi.c index 48ce578e26..ffd092fa49 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_spi.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_spi.c @@ -70,28 +70,28 @@ void weak_function stm32_spidev_initialize(void) { #ifdef CONFIG_STM32_SPI1 - (void)stm32_configgpio(GPIO_CS_MEMS); /* MEMS chip select */ + stm32_configgpio(GPIO_CS_MEMS); /* MEMS chip select */ #endif #if defined(CONFIG_STM32_SPI2) && defined(CONFIG_SENSORS_MAX31855) - (void)stm32_configgpio(GPIO_MAX31855_CS); /* MAX31855 chip select */ + stm32_configgpio(GPIO_MAX31855_CS); /* MAX31855 chip select */ #endif #if defined(CONFIG_LCD_MAX7219) || defined(CONFIG_LEDS_MAX7219) - (void)stm32_configgpio(GPIO_MAX7219_CS); /* MAX7219 chip select */ + stm32_configgpio(GPIO_MAX7219_CS); /* MAX7219 chip select */ #endif #if defined(CONFIG_LCD_ST7567) - (void)stm32_configgpio(STM32_LCD_CS); /* ST7567 chip select */ + stm32_configgpio(STM32_LCD_CS); /* ST7567 chip select */ #endif #if defined(CONFIG_STM32_SPI2) && defined(CONFIG_SENSORS_MAX6675) - (void)stm32_configgpio(GPIO_MAX6675_CS); /* MAX6675 chip select */ + stm32_configgpio(GPIO_MAX6675_CS); /* MAX6675 chip select */ #endif #if defined(CONFIG_LCD_UG2864AMBAG01) || defined(CONFIG_LCD_UG2864HSWEG01) || \ defined(CONFIG_LCD_SSD1351) - (void)stm32_configgpio(GPIO_OLED_CS); /* OLED chip select */ + stm32_configgpio(GPIO_OLED_CS); /* OLED chip select */ # if defined(CONFIG_LCD_UG2864AMBAG01) - (void)stm32_configgpio(GPIO_OLED_A0); /* OLED Command/Data */ + stm32_configgpio(GPIO_OLED_A0); /* OLED Command/Data */ # endif # if defined(CONFIG_LCD_UG2864HSWEG01) || defined(CONFIG_LCD_SSD1351) - (void)stm32_configgpio(GPIO_OLED_DC); /* OLED Command/Data */ + stm32_configgpio(GPIO_OLED_DC); /* OLED Command/Data */ # endif #endif } @@ -251,7 +251,7 @@ int stm32_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) * data bits are data or a command. */ - (void)stm32_gpiowrite(STM32_LCD_RS, !cmd); + stm32_gpiowrite(STM32_LCD_RS, !cmd); return OK; } @@ -269,10 +269,10 @@ int stm32_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) */ # if defined(CONFIG_LCD_UG2864AMBAG01) - (void)stm32_gpiowrite(GPIO_OLED_A0, !cmd); + stm32_gpiowrite(GPIO_OLED_A0, !cmd); # endif # if defined(CONFIG_LCD_UG2864HSWEG01) || defined(CONFIG_LCD_SSD1351) - (void)stm32_gpiowrite(GPIO_OLED_DC, !cmd); + stm32_gpiowrite(GPIO_OLED_DC, !cmd); # endif return OK; } diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_ssd1351.c b/boards/arm/stm32/stm32f4discovery/src/stm32_ssd1351.c index f638148448..9c27fe2669 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_ssd1351.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_ssd1351.c @@ -92,7 +92,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) * putting the OLED into reset state. */ - (void)stm32_configgpio(GPIO_OLED_RESET); + stm32_configgpio(GPIO_OLED_RESET); /* Wait a bit then release the OLED from the reset state */ @@ -121,7 +121,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* And turn the OLED on */ - (void)dev->setpower(dev, LCD_FULL_ON); + dev->setpower(dev, LCD_FULL_ON); return dev; } } diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_st7567.c b/boards/arm/stm32/stm32f4discovery/src/stm32_st7567.c index 389dd382e7..e936cbf32a 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_st7567.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_st7567.c @@ -129,11 +129,11 @@ FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) /* And turn the LCD on (CONFIG_LCD_MAXPOWER should be 1) */ - (void)g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); + g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); /* Set contrast to right value, otherwise background too dark */ - (void)g_lcddev->setcontrast(g_lcddev, CONFIG_LCD_CONTRAST); + g_lcddev->setcontrast(g_lcddev, CONFIG_LCD_CONTRAST); return g_lcddev; } diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_ug2864ambag01.c b/boards/arm/stm32/stm32f4discovery/src/stm32_ug2864ambag01.c index 91e9c2eade..1d064d4686 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_ug2864ambag01.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_ug2864ambag01.c @@ -114,7 +114,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) * putting the OLED into reset state. */ - (void)stm32_configgpio(GPIO_OLED_RESET); + stm32_configgpio(GPIO_OLED_RESET); /* Wait a bit then release the OLED from the reset state */ @@ -143,7 +143,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* And turn the OLED on */ - (void)dev->setpower(dev, CONFIG_LCD_MAXPOWER); + dev->setpower(dev, CONFIG_LCD_MAXPOWER); return dev; } } diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_ug2864hsweg01.c b/boards/arm/stm32/stm32f4discovery/src/stm32_ug2864hsweg01.c index cf42a54743..53764e3506 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_ug2864hsweg01.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_ug2864hsweg01.c @@ -114,7 +114,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) * putting the OLED into reset state. */ - (void)stm32_configgpio(GPIO_OLED_RESET); + stm32_configgpio(GPIO_OLED_RESET); /* Wait a bit then release the OLED from the reset state */ @@ -143,7 +143,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* And turn the OLED on */ - (void)dev->setpower(dev, CONFIG_LCD_MAXPOWER); + dev->setpower(dev, CONFIG_LCD_MAXPOWER); return dev; } } diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_usb.c b/boards/arm/stm32/stm32f4discovery/src/stm32_usb.c index a71cb384ed..d05ef4fadb 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_usb.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_usb.c @@ -117,7 +117,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_xen1210.c b/boards/arm/stm32/stm32f4discovery/src/stm32_xen1210.c index ac65129531..4224fbe01c 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_xen1210.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_xen1210.c @@ -210,15 +210,15 @@ static void xen1210_enable(FAR struct xen1210_config_s *state, bool enable) /* Configure the interrupt using the SAVED handler */ stm32_configgpio(GPIO_XEN1210_INT); - (void)stm32_gpiosetevent(GPIO_XEN1210_INT, false, true, - true, xen1210_interrupt, NULL); + stm32_gpiosetevent(GPIO_XEN1210_INT, false, true, + true, xen1210_interrupt, NULL); } else { /* Configure the interrupt with a NULL handler to disable it */ - (void)stm32_gpiosetevent(GPIO_XEN1210_INT, false, false, false, - NULL, NULL); + stm32_gpiosetevent(GPIO_XEN1210_INT, false, false, false, + NULL, NULL); } leave_critical_section(flags); @@ -315,11 +315,11 @@ int xen1210_archinitialize(int minor) * We are using PWM on TIM1 CH1 to do it! */ - (void)xen1210_pwm_setup(); + xen1210_pwm_setup(); /* Configure the XEN1210 interrupt pin as an input */ - (void)stm32_configgpio(GPIO_XEN1210_INT); + stm32_configgpio(GPIO_XEN1210_INT); /* Get an instance of the I2C interface */ diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_zerocross.c b/boards/arm/stm32/stm32f4discovery/src/stm32_zerocross.c index baba88b433..69499716d7 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_zerocross.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_zerocross.c @@ -111,8 +111,8 @@ static void zcross_enable(FAR const struct zc_lowerhalf_s *lower, g_zcrossarg = arg; } - (void)stm32_gpiosetevent(GPIO_ZEROCROSS, rising, falling, - true, zcross_interrupt, NULL); + stm32_gpiosetevent(GPIO_ZEROCROSS, rising, falling, + true, zcross_interrupt, NULL); leave_critical_section(flags); } @@ -134,7 +134,7 @@ static void zcross_disable(void) flags = enter_critical_section(); - (void)stm32_gpiosetevent(GPIO_ZEROCROSS, false, false, false, NULL); + stm32_gpiosetevent(GPIO_ZEROCROSS, false, false, false, NULL); leave_critical_section(flags); diff --git a/boards/arm/stm32/stm32ldiscovery/src/stm32_boot.c b/boards/arm/stm32/stm32ldiscovery/src/stm32_boot.c index c0c7301fd5..f54b2479e3 100644 --- a/boards/arm/stm32/stm32ldiscovery/src/stm32_boot.c +++ b/boards/arm/stm32/stm32ldiscovery/src/stm32_boot.c @@ -108,7 +108,7 @@ void board_late_initialize(void) #ifndef CONFIG_LIB_BOARDCTL /* Perform board initialization here instead of from the board_app_initialize(). */ - (void)stm32_bringup(); + stm32_bringup(); #endif } #endif diff --git a/boards/arm/stm32/stm32ldiscovery/src/stm32_spi.c b/boards/arm/stm32/stm32ldiscovery/src/stm32_spi.c index e8b5b21798..083ecca856 100644 --- a/boards/arm/stm32/stm32ldiscovery/src/stm32_spi.c +++ b/boards/arm/stm32/stm32ldiscovery/src/stm32_spi.c @@ -70,9 +70,9 @@ void weak_function stm32_spidev_initialize(void) { #ifdef CONFIG_STM32_SPI1 - (void)stm32_configgpio(GPIO_MEMS_CS); /* MEMS chip select */ - (void)stm32_configgpio(GPIO_MEMS_INT1); /* MEMS interrupts */ - (void)stm32_configgpio(GPIO_MEMS_INT2); + stm32_configgpio(GPIO_MEMS_CS); /* MEMS chip select */ + stm32_configgpio(GPIO_MEMS_INT1); /* MEMS interrupts */ + stm32_configgpio(GPIO_MEMS_INT2); #endif } diff --git a/boards/arm/stm32/stm32vldiscovery/src/stm32_boot.c b/boards/arm/stm32/stm32vldiscovery/src/stm32_boot.c index a9c90c7166..e59965634f 100644 --- a/boards/arm/stm32/stm32vldiscovery/src/stm32_boot.c +++ b/boards/arm/stm32/stm32vldiscovery/src/stm32_boot.c @@ -89,6 +89,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/viewtool-stm32f107/src/stm32_ads7843e.c b/boards/arm/stm32/viewtool-stm32f107/src/stm32_ads7843e.c index 28cb8b2a10..1f5037e40a 100644 --- a/boards/arm/stm32/viewtool-stm32f107/src/stm32_ads7843e.c +++ b/boards/arm/stm32/viewtool-stm32f107/src/stm32_ads7843e.c @@ -201,8 +201,8 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable) { /* Configure the EXTI interrupt using the saved handler */ - (void)stm32_gpiosetevent(GPIO_LCDTP_IRQ, true, true, true, - priv->handler, NULL); + stm32_gpiosetevent(GPIO_LCDTP_IRQ, true, true, true, + priv->handler, NULL); } else { @@ -212,8 +212,8 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable) * the EXTI is de-configured will not pend but will be lost. */ - (void)stm32_gpiosetevent(GPIO_LCDTP_IRQ, false, false, false, - NULL, NULL); + stm32_gpiosetevent(GPIO_LCDTP_IRQ, false, false, false, + NULL, NULL); } leave_critical_section(flags); @@ -269,7 +269,7 @@ int stm32_tsc_setup(int minor) /* Configure the XPT2046 interrupt pin as an input */ - (void)stm32_configgpio(GPIO_LCDTP_IRQ); + stm32_configgpio(GPIO_LCDTP_IRQ); /* Get an instance of the SPI interface for the touchscreen chip select */ diff --git a/boards/arm/stm32/viewtool-stm32f107/src/stm32_boot.c b/boards/arm/stm32/viewtool-stm32f107/src/stm32_boot.c index e11f247876..5c4ad350a9 100644 --- a/boards/arm/stm32/viewtool-stm32f107/src/stm32_boot.c +++ b/boards/arm/stm32/viewtool-stm32f107/src/stm32_boot.c @@ -106,6 +106,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32/viewtool-stm32f107/src/stm32_ft80x.c b/boards/arm/stm32/viewtool-stm32f107/src/stm32_ft80x.c index b1a201a59c..e3c260f304 100644 --- a/boards/arm/stm32/viewtool-stm32f107/src/stm32_ft80x.c +++ b/boards/arm/stm32/viewtool-stm32f107/src/stm32_ft80x.c @@ -208,8 +208,8 @@ static void ft80x_enable(FAR const struct ft80x_config_s *lower, { /* Configure the EXTI interrupt using the saved handler */ - (void)stm32_gpiosetevent(GPIO_FT80X_INT, true, true, true, - priv->handler, priv->arg); + stm32_gpiosetevent(GPIO_FT80X_INT, true, true, true, + priv->handler, priv->arg); } else { @@ -219,8 +219,8 @@ static void ft80x_enable(FAR const struct ft80x_config_s *lower, * the EXTI is de-configured will not pend but will be lost. */ - (void)stm32_gpiosetevent(GPIO_FT80X_INT, false, false, false, - NULL, NULL); + stm32_gpiosetevent(GPIO_FT80X_INT, false, false, false, + NULL, NULL); } leave_critical_section(flags); @@ -282,8 +282,8 @@ int stm32_ft80x_setup(void) * output. Device is initially powered down. */ - (void)stm32_configgpio(GPIO_FT80X_INT); - (void)stm32_configgpio(GPIO_FT80_PD); + stm32_configgpio(GPIO_FT80X_INT); + stm32_configgpio(GPIO_FT80_PD); /* Get an instance of the SPI interface for the touchscreen chip select */ diff --git a/boards/arm/stm32/viewtool-stm32f107/src/stm32_max3421e.c b/boards/arm/stm32/viewtool-stm32f107/src/stm32_max3421e.c index 6130897f1f..e61d9937d7 100644 --- a/boards/arm/stm32/viewtool-stm32f107/src/stm32_max3421e.c +++ b/boards/arm/stm32/viewtool-stm32f107/src/stm32_max3421e.c @@ -205,8 +205,8 @@ static void max3421e_enable(FAR const struct max3421e_lowerhalf_s *lower, * event is also generated (but not used). */ - (void)stm32_gpiosetevent(GPIO_MAX3421E_INT, false, true, true, - priv->handler, priv->arg); + stm32_gpiosetevent(GPIO_MAX3421E_INT, false, true, true, + priv->handler, priv->arg); } else { @@ -216,8 +216,8 @@ static void max3421e_enable(FAR const struct max3421e_lowerhalf_s *lower, * the EXTI is de-configured will not pend but will be lost. */ - (void)stm32_gpiosetevent(GPIO_MAX3421E_INT, false, false, false, - NULL, NULL); + stm32_gpiosetevent(GPIO_MAX3421E_INT, false, false, false, + NULL, NULL); } leave_critical_section(flags); @@ -295,14 +295,14 @@ int stm32_max3421e_setup(void) * provided. */ - (void)stm32_configgpio(GPIO_MAX3421E_INT); + stm32_configgpio(GPIO_MAX3421E_INT); #ifdef CONFIG_VIEWTOOL_MAX3421E_RST - (void)stm32_configgpio(GPIO_MAX3421E_RST); + stm32_configgpio(GPIO_MAX3421E_RST); #endif #ifdef CONFIG_VIEWTOOL_MAX3421E_PWR - (void)stm32_configgpio(GPIO_MAX3421E_PWR); + stm32_configgpio(GPIO_MAX3421E_PWR); #endif /* Get an instance of the SPI interface for the touchscreen chip select */ diff --git a/boards/arm/stm32/viewtool-stm32f107/src/stm32_spi.c b/boards/arm/stm32/viewtool-stm32f107/src/stm32_spi.c index 38880faaf1..ec96baa6e1 100644 --- a/boards/arm/stm32/viewtool-stm32f107/src/stm32_spi.c +++ b/boards/arm/stm32/viewtool-stm32f107/src/stm32_spi.c @@ -77,25 +77,25 @@ void weak_function stm32_spidev_initialize(void) #if defined(CONFIG_STM32_SPI2) && defined(CONFIG_INPUT_ADS7843E) /* Configure the XPT2046 SPI2 CS pin as an output */ - (void)stm32_configgpio(GPIO_LCDTP_CS); + stm32_configgpio(GPIO_LCDTP_CS); #endif #if defined(CONFIG_STM32_SPI3) && defined(CONFIG_SENSORS_MPL115A) /* Configure the MPL115A SPI3 CS pin as an output */ - (void)stm32_configgpio(GPIO_MPL115A_CS); + stm32_configgpio(GPIO_MPL115A_CS); #endif #if defined(CONFIG_VIEWTOOL_FT80X_SPI1) || defined(CONFIG_VIEWTOOL_FT80X_SPI2) /* Configure the FT80x CS pin as an input */ - (void)stm32_configgpio(GPIO_FT80X_CS); + stm32_configgpio(GPIO_FT80X_CS); #endif #if defined(CONFIG_VIEWTOOL_MAX3421E_SPI1) || defined(CONFIG_VIEWTOOL_MAX3421E_SPI2) /* Configure the MAX3421E CS pin as an input */ - (void)stm32_configgpio(GPIO_MAX3421E_CS); + stm32_configgpio(GPIO_MAX3421E_CS); #endif } diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_boot.c b/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_boot.c index 6642e06af6..478c7ab694 100644 --- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_boot.c +++ b/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_boot.c @@ -110,7 +110,7 @@ void board_late_initialize(void) #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) /* Perform board bring-up here instead of from the board_app_initialize(). */ - (void)stm32_bringup(); + stm32_bringup(); #endif } #endif diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_ssd1306.c b/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_ssd1306.c index edbe0e3c99..13ec53f4c1 100644 --- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_ssd1306.c +++ b/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_ssd1306.c @@ -107,7 +107,7 @@ FAR struct lcd_dev_s *board_lcd_getdev(int devno) /* And turn the OLED on */ - (void)g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); + g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); return g_lcddev; } diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_sx127x.c b/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_sx127x.c index 7e104e5420..423049f3eb 100644 --- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_sx127x.c +++ b/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_sx127x.c @@ -104,7 +104,7 @@ static int sx127x_irq0_attach(xcpt_t isr, FAR void *arg) /* IRQ on rising edge */ - (void)stm32_gpiosetevent(GPIO_SX127X_DIO0, true, false, false, isr, arg); + stm32_gpiosetevent(GPIO_SX127X_DIO0, true, false, false, isr, arg); return OK; } diff --git a/boards/arm/stm32f0l0g0/nucleo-f072rb/src/stm32_boot.c b/boards/arm/stm32f0l0g0/nucleo-f072rb/src/stm32_boot.c index d6d28c5aab..cfade7de30 100644 --- a/boards/arm/stm32f0l0g0/nucleo-f072rb/src/stm32_boot.c +++ b/boards/arm/stm32f0l0g0/nucleo-f072rb/src/stm32_boot.c @@ -89,6 +89,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization here if so configured */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32f0l0g0/nucleo-f091rc/src/stm32_boot.c b/boards/arm/stm32f0l0g0/nucleo-f091rc/src/stm32_boot.c index 213b7e05f7..0f41ff7b3c 100644 --- a/boards/arm/stm32f0l0g0/nucleo-f091rc/src/stm32_boot.c +++ b/boards/arm/stm32f0l0g0/nucleo-f091rc/src/stm32_boot.c @@ -95,6 +95,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization here if so configured */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32f0l0g0/nucleo-f091rc/src/stm32_sx127x.c b/boards/arm/stm32f0l0g0/nucleo-f091rc/src/stm32_sx127x.c index 6b08b21145..be99319582 100644 --- a/boards/arm/stm32f0l0g0/nucleo-f091rc/src/stm32_sx127x.c +++ b/boards/arm/stm32f0l0g0/nucleo-f091rc/src/stm32_sx127x.c @@ -103,7 +103,7 @@ static int sx127x_irq0_attach(xcpt_t isr, FAR void *arg) /* IRQ on rising edge */ - (void)stm32_gpiosetevent(GPIO_SX127X_DIO0, true, false, false, isr, arg); + stm32_gpiosetevent(GPIO_SX127X_DIO0, true, false, false, isr, arg); return OK; } diff --git a/boards/arm/stm32f0l0g0/nucleo-g070rb/src/stm32_boot.c b/boards/arm/stm32f0l0g0/nucleo-g070rb/src/stm32_boot.c index 24c84c5a22..266e9d3696 100644 --- a/boards/arm/stm32f0l0g0/nucleo-g070rb/src/stm32_boot.c +++ b/boards/arm/stm32f0l0g0/nucleo-g070rb/src/stm32_boot.c @@ -96,6 +96,6 @@ void board_late_initialize(void) { /* Perform board bring-up here instead of from the board_app_initialize(). */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32f0l0g0/nucleo-g070rb/src/stm32_gpio.c b/boards/arm/stm32f0l0g0/nucleo-g070rb/src/stm32_gpio.c index fce147b3b5..75e1915bb5 100644 --- a/boards/arm/stm32f0l0g0/nucleo-g070rb/src/stm32_gpio.c +++ b/boards/arm/stm32f0l0g0/nucleo-g070rb/src/stm32_gpio.c @@ -245,8 +245,8 @@ static int gpint_attach(FAR struct gpio_dev_s *dev, /* Make sure the interrupt is disabled */ - (void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], false, - false, false, NULL, NULL); + stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], false, + false, false, NULL, NULL); gpioinfo("Attach %p\n", callback); stm32gpint->callback = callback; @@ -270,16 +270,16 @@ static int gpint_enable(FAR struct gpio_dev_s *dev, bool enable) /* Configure the interrupt for rising edge */ - (void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], - true, false, false, stm32gpio_interrupt, - &g_gpint[stm32gpint->stm32gpio.id]); + stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], + true, false, false, stm32gpio_interrupt, + &g_gpint[stm32gpint->stm32gpio.id]); } } else { gpioinfo("Disable the interrupt\n"); - (void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], - false, false, false, NULL, NULL); + stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], + false, false, false, NULL, NULL); } return OK; @@ -313,7 +313,7 @@ int stm32_gpio_initialize(void) g_gpin[i].gpio.gp_pintype = GPIO_INPUT_PIN; g_gpin[i].gpio.gp_ops = &gpin_ops; g_gpin[i].id = i; - (void)gpio_pin_register(&g_gpin[i].gpio, pincount); + gpio_pin_register(&g_gpin[i].gpio, pincount); /* Configure the pin that will be used as input */ @@ -331,7 +331,7 @@ int stm32_gpio_initialize(void) g_gpout[i].gpio.gp_pintype = GPIO_OUTPUT_PIN; g_gpout[i].gpio.gp_ops = &gpout_ops; g_gpout[i].id = i; - (void)gpio_pin_register(&g_gpout[i].gpio, pincount); + gpio_pin_register(&g_gpout[i].gpio, pincount); /* Configure the pin that will be used as output */ @@ -350,7 +350,7 @@ int stm32_gpio_initialize(void) g_gpint[i].stm32gpio.gpio.gp_pintype = GPIO_INTERRUPT_PIN; g_gpint[i].stm32gpio.gpio.gp_ops = &gpint_ops; g_gpint[i].stm32gpio.id = i; - (void)gpio_pin_register(&g_gpint[i].stm32gpio.gpio, pincount); + gpio_pin_register(&g_gpint[i].stm32gpio.gpio, pincount); /* Configure the pin that will be used as interrupt input */ diff --git a/boards/arm/stm32f0l0g0/nucleo-g071rb/src/stm32_boot.c b/boards/arm/stm32f0l0g0/nucleo-g071rb/src/stm32_boot.c index 8fe94470af..b14c2100e8 100644 --- a/boards/arm/stm32f0l0g0/nucleo-g071rb/src/stm32_boot.c +++ b/boards/arm/stm32f0l0g0/nucleo-g071rb/src/stm32_boot.c @@ -93,7 +93,7 @@ void board_late_initialize(void) #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) /* Perform board bring-up here instead of from the board_app_initialize(). */ - (void)stm32_bringup(); + stm32_bringup(); #endif } #endif diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_boot.c b/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_boot.c index f1696f1dec..e8420145ae 100644 --- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_boot.c +++ b/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_boot.c @@ -109,7 +109,7 @@ void board_late_initialize(void) #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) /* Perform board bring-up here instead of from the board_app_initialize(). */ - (void)stm32_bringup(); + stm32_bringup(); #endif } #endif diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_nrf24l01.c b/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_nrf24l01.c index 5c7309ec28..5eedb1dac0 100644 --- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_nrf24l01.c +++ b/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_nrf24l01.c @@ -88,7 +88,7 @@ static int nrf24l01_irq_attach(xcpt_t isr, FAR void *arg) wlinfo("Attach IRQ\n"); g_isr = isr; g_arg = arg; - (void)stm32_gpiosetevent(GPIO_NRF24L01_IRQ, false, true, false, g_isr, g_arg); + stm32_gpiosetevent(GPIO_NRF24L01_IRQ, false, true, false, g_isr, g_arg); return OK; } diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_spi.c b/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_spi.c index bf61de4ea7..639c6af60d 100644 --- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_spi.c +++ b/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_spi.c @@ -118,7 +118,7 @@ void stm32_spidev_initialize(void) /* Configure the SPI-based MFRC522 chip select GPIO */ # ifdef CONFIG_CL_MFRC522 - (void)stm32_configgpio(GPIO_MFRC522_CS); + stm32_configgpio(GPIO_MFRC522_CS); # endif #endif /* CONFIG_STM32F0L0G0_SPI2 */ diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_sx127x.c b/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_sx127x.c index 11f0bb6bca..4a989b6854 100644 --- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_sx127x.c +++ b/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_sx127x.c @@ -103,7 +103,7 @@ static int sx127x_irq0_attach(xcpt_t isr, FAR void *arg) /* IRQ on rising edge */ - (void)stm32_gpiosetevent(GPIO_SX127X_DIO0, true, false, false, isr, arg); + stm32_gpiosetevent(GPIO_SX127X_DIO0, true, false, false, isr, arg); return OK; } diff --git a/boards/arm/stm32f0l0g0/stm32f051-discovery/src/stm32_boot.c b/boards/arm/stm32f0l0g0/stm32f051-discovery/src/stm32_boot.c index 7f100b6302..e3638338cf 100644 --- a/boards/arm/stm32f0l0g0/stm32f051-discovery/src/stm32_boot.c +++ b/boards/arm/stm32f0l0g0/stm32f051-discovery/src/stm32_boot.c @@ -89,7 +89,7 @@ void board_late_initialize(void) { /* Perform board-specific initialization here if so configured */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32f0l0g0/stm32f072-discovery/src/stm32_boot.c b/boards/arm/stm32f0l0g0/stm32f072-discovery/src/stm32_boot.c index b7e6a8e068..3339fbdf37 100644 --- a/boards/arm/stm32f0l0g0/stm32f072-discovery/src/stm32_boot.c +++ b/boards/arm/stm32f0l0g0/stm32f072-discovery/src/stm32_boot.c @@ -89,7 +89,7 @@ void board_late_initialize(void) { /* Perform board-specific initialization here if so configured */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32f7/nucleo-144/src/stm32_appinitialize.c b/boards/arm/stm32f7/nucleo-144/src/stm32_appinitialize.c index f588263015..48a4c308e8 100644 --- a/boards/arm/stm32f7/nucleo-144/src/stm32_appinitialize.c +++ b/boards/arm/stm32f7/nucleo-144/src/stm32_appinitialize.c @@ -141,7 +141,7 @@ int board_app_initialize(uintptr_t arg) #ifdef CONFIG_STM32F7_BBSRAM /* Initialize battery-backed RAM */ - (void)stm32_bbsram_int(); + stm32_bbsram_int(); #endif #if defined(CONFIG_FAT_DMAMEMORY) diff --git a/boards/arm/stm32f7/nucleo-144/src/stm32_bbsram.c b/boards/arm/stm32f7/nucleo-144/src/stm32_bbsram.c index 27d805819a..53134eb628 100644 --- a/boards/arm/stm32f7/nucleo-144/src/stm32_bbsram.c +++ b/boards/arm/stm32f7/nucleo-144/src/stm32_bbsram.c @@ -304,7 +304,7 @@ static int hardfault_get_desc(struct bbsramd_s *desc) { ret = file_ioctl(&filestruct, STM32F7_BBSRAM_GETDESC_IOCTL, (unsigned long)((uintptr_t)desc)); - (void)file_close(&filestruct); + file_close(&filestruct); if (ret < 0) { @@ -399,7 +399,7 @@ void board_crashdump(uintptr_t currentsp, FAR void *tcb, FAR struct tcb_s *rtcb; int rv; - (void)enter_critical_section(); + enter_critical_section(); rtcb = (FAR struct tcb_s *)tcb; diff --git a/boards/arm/stm32f7/nucleo-144/src/stm32_boot.c b/boards/arm/stm32f7/nucleo-144/src/stm32_boot.c index 2a581c9b3c..e474195fc7 100644 --- a/boards/arm/stm32f7/nucleo-144/src/stm32_boot.c +++ b/boards/arm/stm32f7/nucleo-144/src/stm32_boot.c @@ -103,7 +103,7 @@ void board_late_initialize(void) * but the initialization function must run in kernel space. */ - (void)board_app_initialize(0); + board_app_initialize(0); #endif } #endif diff --git a/boards/arm/stm32f7/nucleo-144/src/stm32_gpio.c b/boards/arm/stm32f7/nucleo-144/src/stm32_gpio.c index ec87c0db44..00035f7826 100644 --- a/boards/arm/stm32f7/nucleo-144/src/stm32_gpio.c +++ b/boards/arm/stm32f7/nucleo-144/src/stm32_gpio.c @@ -228,8 +228,8 @@ static int gpint_attach(FAR struct gpio_dev_s *dev, /* Make sure the interrupt is disabled */ - (void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], false, - false, false, NULL, NULL); + stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], false, + false, false, NULL, NULL); gpioinfo("Attach %p\n", callback); stm32gpint->callback = callback; @@ -249,16 +249,16 @@ static int gpint_enable(FAR struct gpio_dev_s *dev, bool enable) /* Configure the interrupt for rising edge */ - (void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], - true, false, false, stm32gpio_interrupt, - &g_gpint[stm32gpint->stm32gpio.id]); + stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], + true, false, false, stm32gpio_interrupt, + &g_gpint[stm32gpint->stm32gpio.id]); } } else { gpioinfo("Disable the interrupt\n"); - (void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], - false, false, false, NULL, NULL); + stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], + false, false, false, NULL, NULL); } return OK; @@ -289,7 +289,7 @@ int stm32_gpio_initialize(void) g_gpin[i].gpio.gp_pintype = GPIO_INPUT_PIN; g_gpin[i].gpio.gp_ops = &gpin_ops; g_gpin[i].id = i; - (void)gpio_pin_register(&g_gpin[i].gpio, pincount); + gpio_pin_register(&g_gpin[i].gpio, pincount); /* Configure the pin that will be used as input */ @@ -307,7 +307,7 @@ int stm32_gpio_initialize(void) g_gpout[i].gpio.gp_pintype = GPIO_OUTPUT_PIN; g_gpout[i].gpio.gp_ops = &gpout_ops; g_gpout[i].id = i; - (void)gpio_pin_register(&g_gpout[i].gpio, pincount); + gpio_pin_register(&g_gpout[i].gpio, pincount); /* Configure the pin that will be used as output */ @@ -326,7 +326,7 @@ int stm32_gpio_initialize(void) g_gpint[i].stm32gpio.gpio.gp_pintype = GPIO_INTERRUPT_PIN; g_gpint[i].stm32gpio.gpio.gp_ops = &gpint_ops; g_gpint[i].stm32gpio.id = i; - (void)gpio_pin_register(&g_gpint[i].stm32gpio.gpio, pincount); + gpio_pin_register(&g_gpint[i].stm32gpio.gpio, pincount); /* Configure the pin that will be used as interrupt input */ diff --git a/boards/arm/stm32f7/nucleo-144/src/stm32_sdio.c b/boards/arm/stm32f7/nucleo-144/src/stm32_sdio.c index 77d8c7f287..d53da74217 100644 --- a/boards/arm/stm32f7/nucleo-144/src/stm32_sdio.c +++ b/boards/arm/stm32f7/nucleo-144/src/stm32_sdio.c @@ -132,8 +132,8 @@ int stm32_sdio_initialize(void) /* Register an interrupt handler for the card detect pin */ - (void)stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, - stm32_ncd_interrupt, NULL); + stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, + stm32_ncd_interrupt, NULL); #endif /* Mount the SDIO-based MMC/SD block driver */ diff --git a/boards/arm/stm32f7/nucleo-144/src/stm32_usb.c b/boards/arm/stm32f7/nucleo-144/src/stm32_usb.c index 1169ec91cd..d9d7506f60 100644 --- a/boards/arm/stm32f7/nucleo-144/src/stm32_usb.c +++ b/boards/arm/stm32f7/nucleo-144/src/stm32_usb.c @@ -119,7 +119,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32f7/stm32f746-ws/src/stm32_boot.c b/boards/arm/stm32f7/stm32f746-ws/src/stm32_boot.c index be0f3eb516..97449df28e 100644 --- a/boards/arm/stm32f7/stm32f746-ws/src/stm32_boot.c +++ b/boards/arm/stm32f7/stm32f746-ws/src/stm32_boot.c @@ -99,7 +99,7 @@ void board_late_initialize(void) * but the initialization function must run in kernel space. */ - (void)board_app_initialize(); + board_app_initialize(); #endif } #endif diff --git a/boards/arm/stm32f7/stm32f746-ws/src/stm32_sdmmc.c b/boards/arm/stm32f7/stm32f746-ws/src/stm32_sdmmc.c index bb199ec557..39d9e0db75 100644 --- a/boards/arm/stm32f7/stm32f746-ws/src/stm32_sdmmc.c +++ b/boards/arm/stm32f7/stm32f746-ws/src/stm32_sdmmc.c @@ -127,8 +127,8 @@ int stm32_sdio_initialize(void) /* Register an interrupt handler for the card detect pin */ - (void)stm32_gpiosetevent(GPIO_SDIO_NCD, true, true, true, - stm32_ncd_interrupt, NULL); + stm32_gpiosetevent(GPIO_SDIO_NCD, true, true, true, + stm32_ncd_interrupt, NULL); #endif /* Mount the SDIO-based MMC/SD block driver */ diff --git a/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c b/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c index e3e72eaed7..7973e19871 100644 --- a/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c +++ b/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c @@ -117,7 +117,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32f7/stm32f746g-disco/src/stm32_boot.c b/boards/arm/stm32f7/stm32f746g-disco/src/stm32_boot.c index 584171ceae..bad708167a 100644 --- a/boards/arm/stm32f7/stm32f746g-disco/src/stm32_boot.c +++ b/boards/arm/stm32f7/stm32f746g-disco/src/stm32_boot.c @@ -113,6 +113,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32f7/stm32f746g-disco/src/stm32_bringup.c b/boards/arm/stm32f7/stm32f746g-disco/src/stm32_bringup.c index 49104f0c3c..ed2eb41fa1 100644 --- a/boards/arm/stm32f7/stm32f746g-disco/src/stm32_bringup.c +++ b/boards/arm/stm32f7/stm32f746g-disco/src/stm32_bringup.c @@ -83,7 +83,7 @@ int stm32_bringup(void) * mounted. */ - (void)ccm_procfs_register(); + ccm_procfs_register(); #endif /* Mount the procfs file system */ diff --git a/boards/arm/stm32f7/stm32f746g-disco/src/stm32_touchscreen.c b/boards/arm/stm32f7/stm32f746g-disco/src/stm32_touchscreen.c index 054a31bcfe..0cec3e7d89 100644 --- a/boards/arm/stm32f7/stm32f746g-disco/src/stm32_touchscreen.c +++ b/boards/arm/stm32f7/stm32f746g-disco/src/stm32_touchscreen.c @@ -190,15 +190,15 @@ static void stm32_ft5x06_enable(FAR const struct ft5x06_config_s *config, { /* Configure the EXTI interrupt using the SAVED handler */ - (void)stm32_gpiosetevent(GPIO_TP_INT, true, false, true, - g_priv_config.handler, g_priv_config.arg); + stm32_gpiosetevent(GPIO_TP_INT, true, false, true, + g_priv_config.handler, g_priv_config.arg); } else { /* Configure the EXTI interrupt with a NULL handler to disable it */ - (void)stm32_gpiosetevent(GPIO_TP_INT, false, false, false, - NULL, NULL); + stm32_gpiosetevent(GPIO_TP_INT, false, false, false, + NULL, NULL); } leave_critical_section(flags); @@ -283,7 +283,7 @@ int stm32_tsc_setup(int minor) /* Configure the FT5X06 interrupt pin as an input */ - (void)stm32_configgpio(GPIO_TP_INT); + stm32_configgpio(GPIO_TP_INT); /* Get an instance of the I2C interface */ diff --git a/boards/arm/stm32f7/stm32f769i-disco/src/stm32_boot.c b/boards/arm/stm32f7/stm32f769i-disco/src/stm32_boot.c index 8b027d6d08..81429d0d50 100644 --- a/boards/arm/stm32f7/stm32f769i-disco/src/stm32_boot.c +++ b/boards/arm/stm32f7/stm32f769i-disco/src/stm32_boot.c @@ -117,6 +117,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32f7/stm32f769i-disco/src/stm32_bringup.c b/boards/arm/stm32f7/stm32f769i-disco/src/stm32_bringup.c index b5d6964081..e9c70f3378 100644 --- a/boards/arm/stm32f7/stm32f769i-disco/src/stm32_bringup.c +++ b/boards/arm/stm32f7/stm32f769i-disco/src/stm32_bringup.c @@ -76,7 +76,7 @@ int stm32_bringup(void) * mounted. */ - (void)ccm_procfs_register(); + ccm_procfs_register(); #endif /* Mount the procfs file system */ diff --git a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_boot.c b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_boot.c index 6f32918f34..64439ca832 100644 --- a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_boot.c +++ b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_boot.c @@ -103,7 +103,7 @@ void board_late_initialize(void) #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) /* Perform board bring-up here instead of from the board_app_initialize(). */ - (void)stm32_bringup(); + stm32_bringup(); #endif } #endif diff --git a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c index 966facc4d9..eb14baf55c 100644 --- a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c +++ b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c @@ -156,7 +156,7 @@ int stm32_bringup(void) * mounted. */ - (void)ccm_procfs_register(); + ccm_procfs_register(); #endif /* CONFIG_STM32_CCM_PROCFS */ /* Mount the procfs file system */ diff --git a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_gpio.c b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_gpio.c index c0c394e66a..442403a079 100644 --- a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_gpio.c +++ b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_gpio.c @@ -228,8 +228,8 @@ static int gpint_attach(FAR struct gpio_dev_s *dev, /* Make sure the interrupt is disabled */ - (void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], false, - false, false, NULL, NULL); + stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], false, + false, false, NULL, NULL); gpioinfo("Attach %p\n", callback); stm32gpint->callback = callback; @@ -249,16 +249,16 @@ static int gpint_enable(FAR struct gpio_dev_s *dev, bool enable) /* Configure the interrupt for rising edge */ - (void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], - true, false, false, stm32gpio_interrupt, - &g_gpint[stm32gpint->stm32gpio.id]); + stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], + true, false, false, stm32gpio_interrupt, + &g_gpint[stm32gpint->stm32gpio.id]); } } else { gpioinfo("Disable the interrupt\n"); - (void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], - false, false, false, NULL, NULL); + stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], + false, false, false, NULL, NULL); } return OK; @@ -289,7 +289,7 @@ int stm32_gpio_initialize(void) g_gpin[i].gpio.gp_pintype = GPIO_INPUT_PIN; g_gpin[i].gpio.gp_ops = &gpin_ops; g_gpin[i].id = i; - (void)gpio_pin_register(&g_gpin[i].gpio, pincount); + gpio_pin_register(&g_gpin[i].gpio, pincount); /* Configure the pin that will be used as input */ @@ -307,7 +307,7 @@ int stm32_gpio_initialize(void) g_gpout[i].gpio.gp_pintype = GPIO_OUTPUT_PIN; g_gpout[i].gpio.gp_ops = &gpout_ops; g_gpout[i].id = i; - (void)gpio_pin_register(&g_gpout[i].gpio, pincount); + gpio_pin_register(&g_gpout[i].gpio, pincount); /* Configure the pin that will be used as output */ @@ -326,7 +326,7 @@ int stm32_gpio_initialize(void) g_gpint[i].stm32gpio.gpio.gp_pintype = GPIO_INTERRUPT_PIN; g_gpint[i].stm32gpio.gpio.gp_ops = &gpint_ops; g_gpint[i].stm32gpio.id = i; - (void)gpio_pin_register(&g_gpint[i].stm32gpio.gpio, pincount); + gpio_pin_register(&g_gpint[i].stm32gpio.gpio, pincount); /* Configure the pin that will be used as interrupt input */ diff --git a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_nrf24l01.c b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_nrf24l01.c index 31b271e31d..87a9078685 100644 --- a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_nrf24l01.c +++ b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_nrf24l01.c @@ -88,7 +88,7 @@ static int nrf24l01_irq_attach(xcpt_t isr, FAR void *arg) wlinfo("Attach IRQ\n"); g_isr = isr; g_arg = arg; - (void)stm32_gpiosetevent(GPIO_NRF24L01_IRQ, false, true, false, g_isr, g_arg); + stm32_gpiosetevent(GPIO_NRF24L01_IRQ, false, true, false, g_isr, g_arg); return OK; } diff --git a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_ssd1306.c b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_ssd1306.c index 3041570de4..cfb2186234 100644 --- a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_ssd1306.c +++ b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_ssd1306.c @@ -107,7 +107,7 @@ FAR struct lcd_dev_s *board_lcd_getdev(int devno) /* And turn the OLED on */ - (void)g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); + g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); return g_lcddev; } diff --git a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c index 800c7bf723..4569fac203 100644 --- a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c +++ b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c @@ -118,7 +118,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32l4/b-l475e-iot01a/src/stm32_boot.c b/boards/arm/stm32l4/b-l475e-iot01a/src/stm32_boot.c index 4a7992656a..491c00e627 100644 --- a/boards/arm/stm32l4/b-l475e-iot01a/src/stm32_boot.c +++ b/boards/arm/stm32l4/b-l475e-iot01a/src/stm32_boot.c @@ -98,6 +98,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)stm32l4_bringup(); + stm32l4_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/stm32l4/b-l475e-iot01a/src/stm32_spirit.c b/boards/arm/stm32l4/b-l475e-iot01a/src/stm32_spirit.c index b74a5cff9e..79ab9e51f8 100644 --- a/boards/arm/stm32l4/b-l475e-iot01a/src/stm32_spirit.c +++ b/boards/arm/stm32l4/b-l475e-iot01a/src/stm32_spirit.c @@ -196,15 +196,15 @@ static void stm32l4_enable_irq(FAR const struct spirit_lower_s *lower, { /* Enable interrupts on falling edge (active low) */ - (void)stm32l4_gpiosetevent(priv->intcfg, false, true, false, - priv->handler, priv->arg); + stm32l4_gpiosetevent(priv->intcfg, false, true, false, + priv->handler, priv->arg); } else { /* Disable interrupts */ - (void)stm32l4_gpiosetevent(priv->intcfg, false, false, false, - NULL, NULL); + stm32l4_gpiosetevent(priv->intcfg, false, false, false, + NULL, NULL); } } diff --git a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_appinit.c b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_appinit.c index 9d0321934c..ee18aab349 100644 --- a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_appinit.c +++ b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_appinit.c @@ -130,9 +130,7 @@ int board_app_initialize(uintptr_t arg) int index; char buf[9]; #endif - int ret; - - (void)ret; + int ret = OK; #ifdef HAVE_PROC /* Mount the proc filesystem */ @@ -377,8 +375,7 @@ int board_app_initialize(uintptr_t arg) #endif - UNUSED(ret); - return OK; + return ret; } #ifdef CONFIG_BOARDCTL_IOCTL diff --git a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_dac7571.c b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_dac7571.c index edf0118c61..a3f0435a1d 100644 --- a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_dac7571.c +++ b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_dac7571.c @@ -123,7 +123,7 @@ int stm32_dac7571initialize(FAR const char *devpath) return OK; error: - (void)stm32l4_i2cbus_uninitialize(i2c); + stm32l4_i2cbus_uninitialize(i2c); return ret; } diff --git a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_gpio.c b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_gpio.c index bd9b91a23e..db92f3cf16 100644 --- a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_gpio.c +++ b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_gpio.c @@ -235,8 +235,8 @@ static int gpint_attach(FAR struct gpio_dev_s *dev, /* Make sure the interrupt is disabled */ - (void)stm32l4_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], false, - false, false, NULL, NULL); + stm32l4_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], false, + false, false, NULL, NULL); gpioinfo("Attach %p\n", callback); stm32gpint->callback = callback; @@ -256,16 +256,16 @@ static int gpint_enable(FAR struct gpio_dev_s *dev, bool enable) /* Configure the interrupt for rising edge */ - (void)stm32l4_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], - true, false, false, stm32gpio_interrupt, - &g_gpint[stm32gpint->stm32gpio.id]); + stm32l4_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], + true, false, false, stm32gpio_interrupt, + &g_gpint[stm32gpint->stm32gpio.id]); } } else { gpioinfo("Disable the interrupt\n"); - (void)stm32l4_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], - false, false, false, NULL, NULL); + stm32l4_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], + false, false, false, NULL, NULL); } return OK; @@ -297,7 +297,7 @@ int stm32l4_gpio_initialize(void) g_gpin[i].gpio.gp_pintype = GPIO_INPUT_PIN; g_gpin[i].gpio.gp_ops = &gpin_ops; g_gpin[i].id = i; - (void)gpio_pin_register(&g_gpin[i].gpio, pincount); + gpio_pin_register(&g_gpin[i].gpio, pincount); /* Configure the pin that will be used as input */ @@ -315,7 +315,7 @@ int stm32l4_gpio_initialize(void) g_gpout[i].gpio.gp_pintype = GPIO_OUTPUT_PIN; g_gpout[i].gpio.gp_ops = &gpout_ops; g_gpout[i].id = i; - (void)gpio_pin_register(&g_gpout[i].gpio, pincount); + gpio_pin_register(&g_gpout[i].gpio, pincount); /* Configure the pin that will be used as output */ @@ -334,7 +334,7 @@ int stm32l4_gpio_initialize(void) g_gpint[i].stm32gpio.gpio.gp_pintype = GPIO_INTERRUPT_PIN; g_gpint[i].stm32gpio.gpio.gp_ops = &gpint_ops; g_gpint[i].stm32gpio.id = i; - (void)gpio_pin_register(&g_gpint[i].stm32gpio.gpio, pincount); + gpio_pin_register(&g_gpint[i].stm32gpio.gpio, pincount); /* Configure the pin that will be used as interrupt input */ diff --git a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina219.c b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina219.c index 9578912f2c..ab3e5c7d06 100644 --- a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina219.c +++ b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina219.c @@ -127,7 +127,7 @@ int stm32_ina219initialize(FAR const char *devpath) return OK; error: - (void)stm32l4_i2cbus_uninitialize(i2c); + stm32l4_i2cbus_uninitialize(i2c); return ret; } diff --git a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c index 99848e15b5..fbe9723150 100644 --- a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c +++ b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c @@ -127,7 +127,7 @@ int stm32_ina226initialize(FAR const char *devpath) return OK; error: - (void)stm32l4_i2cbus_uninitialize(i2c); + stm32l4_i2cbus_uninitialize(i2c); return ret; } diff --git a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_spi.c b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_spi.c index e74f176796..562d139d0c 100644 --- a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_spi.c +++ b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_spi.c @@ -98,7 +98,7 @@ void stm32l4_spiinitialize(void) /* Setup CS, EN & IRQ line IOs */ #ifdef CONFIG_MTD_AT45DB - (void)stm32l4_configgpio(AT45DB_SPI1_CS); /* FLASH chip select */ + stm32l4_configgpio(AT45DB_SPI1_CS); /* FLASH chip select */ #endif #endif diff --git a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_zerocross.c b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_zerocross.c index a737278582..b5febbb821 100644 --- a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_zerocross.c +++ b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_zerocross.c @@ -110,8 +110,8 @@ static void zcross_enable(FAR const struct zc_lowerhalf_s *lower, g_zcrossarg = arg; } - (void)stm32l4_gpiosetevent(GPIO_ZEROCROSS, rising, falling, - true, zcross_interrupt, NULL); + stm32l4_gpiosetevent(GPIO_ZEROCROSS, rising, falling, + true, zcross_interrupt, NULL); leave_critical_section(flags); } @@ -132,7 +132,7 @@ static void zcross_disable(void) flags = enter_critical_section(); - (void)stm32l4_gpiosetevent(GPIO_ZEROCROSS, false, false, false, NULL, NULL); + stm32l4_gpiosetevent(GPIO_ZEROCROSS, false, false, false, NULL, NULL); leave_critical_section(flags); diff --git a/boards/arm/stm32l4/nucleo-l452re/src/stm32_boot.c b/boards/arm/stm32l4/nucleo-l452re/src/stm32_boot.c index b4b003dd28..6dbb9d301c 100644 --- a/boards/arm/stm32l4/nucleo-l452re/src/stm32_boot.c +++ b/boards/arm/stm32l4/nucleo-l452re/src/stm32_boot.c @@ -90,6 +90,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization here if so configured */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32l4/nucleo-l452re/src/stm32_bringup.c b/boards/arm/stm32l4/nucleo-l452re/src/stm32_bringup.c index f5ab73b333..3d4d6eee16 100644 --- a/boards/arm/stm32l4/nucleo-l452re/src/stm32_bringup.c +++ b/boards/arm/stm32l4/nucleo-l452re/src/stm32_bringup.c @@ -138,13 +138,13 @@ int stm32_bringup(void) #ifdef CONFIG_DAC ainfo("Initializing DAC\n"); - (void)stm32l4_dac_setup(); + stm32l4_dac_setup(); #endif #ifdef CONFIG_ADC ainfo("Initializing ADC\n"); - (void)stm32l4_adc_setup(); + stm32l4_adc_setup(); #endif UNUSED(ret); diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_ajoystick.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_ajoystick.c index 09dfa2f0c5..febcfbde4e 100644 --- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_ajoystick.c +++ b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_ajoystick.c @@ -376,8 +376,8 @@ static void ajoy_enable(FAR const struct ajoy_lowerhalf_s *lower, iinfo("GPIO %d: rising: %d falling: %d\n", i, rising, falling); - (void)stm32l4_gpiosetevent(g_joygpio[i], rising, falling, - true, ajoy_interrupt, NULL); + stm32l4_gpiosetevent(g_joygpio[i], rising, falling, + true, ajoy_interrupt, NULL); } } } @@ -403,7 +403,7 @@ static void ajoy_disable(void) flags = up_irq_save(); for (i = 0; i < AJOY_NGPIOS; i++) { - (void)stm32l4_gpiosetevent(g_joygpio[i], false, false, false, NULL, NULL); + stm32l4_gpiosetevent(g_joygpio[i], false, false, false, NULL, NULL); } up_irq_restore(flags); diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_appinit.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_appinit.c index 887f34a425..f6840b97a2 100644 --- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_appinit.c +++ b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_appinit.c @@ -174,9 +174,7 @@ int board_app_initialize(uintptr_t arg) int index; char buf[9]; #endif - int ret; - - (void)ret; + int ret = OK; #ifdef HAVE_PROC /* Mount the proc filesystem */ @@ -456,8 +454,7 @@ int board_app_initialize(uintptr_t arg) } #endif - UNUSED(ret); - return OK; + return ret; } #ifdef CONFIG_BOARDCTL_IOCTL diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_gpio.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_gpio.c index 81a963e1a7..66cdd64a6c 100644 --- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_gpio.c +++ b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_gpio.c @@ -223,8 +223,8 @@ static int gpint_attach(FAR struct gpio_dev_s *dev, /* Make sure the interrupt is disabled */ - (void)stm32l4_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], false, - false, false, NULL, NULL); + stm32l4_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], false, + false, false, NULL, NULL); gpioinfo("Attach %p\n", callback); stm32gpint->callback = callback; @@ -243,17 +243,17 @@ static int gpint_enable(FAR struct gpio_dev_s *dev, bool enable) /* Configure the interrupt for rising edge */ - (void)stm32l4_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], - true, false, false, stm32gpio_interrupt, - &g_gpint[stm32gpint->stm32gpio.id]); + stm32l4_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], + true, false, false, stm32gpio_interrupt, + &g_gpint[stm32gpint->stm32gpio.id]); } } else { gpioinfo("Disable the interrupt\n"); - (void)stm32l4_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], - false, false, false, NULL, NULL); + stm32l4_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], + false, false, false, NULL, NULL); } return OK; @@ -284,7 +284,7 @@ int stm32l4_gpio_initialize(void) g_gpin[i].gpio.gp_pintype = GPIO_INPUT_PIN; g_gpin[i].gpio.gp_ops = &gpin_ops; g_gpin[i].id = i; - (void)gpio_pin_register(&g_gpin[i].gpio, pincount); + gpio_pin_register(&g_gpin[i].gpio, pincount); /* Configure the pin that will be used as input */ @@ -302,7 +302,7 @@ int stm32l4_gpio_initialize(void) g_gpout[i].gpio.gp_pintype = GPIO_OUTPUT_PIN; g_gpout[i].gpio.gp_ops = &gpout_ops; g_gpout[i].id = i; - (void)gpio_pin_register(&g_gpout[i].gpio, pincount); + gpio_pin_register(&g_gpout[i].gpio, pincount); /* Configure the pin that will be used as output */ @@ -321,7 +321,7 @@ int stm32l4_gpio_initialize(void) g_gpint[i].stm32gpio.gpio.gp_pintype = GPIO_INTERRUPT_PIN; g_gpint[i].stm32gpio.gpio.gp_ops = &gpint_ops; g_gpint[i].stm32gpio.id = i; - (void)gpio_pin_register(&g_gpint[i].stm32gpio.gpio, pincount); + gpio_pin_register(&g_gpint[i].stm32gpio.gpio, pincount); /* Configure the pin that will be used as interrupt input */ diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_pcd8544.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_pcd8544.c index 2aaca06959..4cb7e82b3a 100644 --- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_pcd8544.c +++ b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_pcd8544.c @@ -121,11 +121,11 @@ FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) /* And turn the LCD on (CONFIG_LCD_MAXPOWER should be 1) */ - (void)g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); + g_lcddev->setpower(g_lcddev, CONFIG_LCD_MAXPOWER); /* Set contrast to right value, otherwise background too dark */ - (void)g_lcddev->setcontrast(g_lcddev, CONFIG_LCD_CONTRAST); + g_lcddev->setcontrast(g_lcddev, CONFIG_LCD_CONTRAST); return g_lcddev; } diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_spi.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_spi.c index 2525ab7729..ab06e0b8c9 100644 --- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_spi.c +++ b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_spi.c @@ -96,7 +96,7 @@ void weak_function stm32l4_spiinitialize(void) #endif #ifdef CONFIG_LCD_PCD8544 - (void)stm32l4_configgpio(STM32_LCD_CS); /* PCD8544 chip select */ + stm32l4_configgpio(STM32_LCD_CS); /* PCD8544 chip select */ #endif #endif @@ -241,7 +241,7 @@ int stm32l4_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) * data bits are data or a command. */ - (void)stm32l4_gpiowrite(STM32_LCD_CD, !cmd); + stm32l4_gpiowrite(STM32_LCD_CD, !cmd); return OK; } diff --git a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_boot.c b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_boot.c index 9edfee6a3a..2132364d46 100644 --- a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_boot.c +++ b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_boot.c @@ -103,7 +103,7 @@ void board_late_initialize(void) * but the initialization function must run in kernel space. */ - (void)board_app_initialize(0); + board_app_initialize(0); #endif } #endif diff --git a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_sdio.c b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_sdio.c index a19472ffc6..e31da4b073 100644 --- a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_sdio.c +++ b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_sdio.c @@ -132,8 +132,8 @@ int stm32l4_sdio_initialize(void) /* Register an interrupt handler for the card detect pin */ - (void)stm32l4_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, - stm32l4_ncd_interrupt, NULL); + stm32l4_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, + stm32l4_ncd_interrupt, NULL); #endif /* Mount the SDIO-based MMC/SD block driver */ diff --git a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c index d3dc07c57b..a9f67ddada 100644 --- a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c +++ b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c @@ -119,7 +119,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/arm/stm32l4/stm32l476-mdk/src/stm32_boot.c b/boards/arm/stm32l4/stm32l476-mdk/src/stm32_boot.c index a97acdfeac..8314d06aae 100644 --- a/boards/arm/stm32l4/stm32l476-mdk/src/stm32_boot.c +++ b/boards/arm/stm32l4/stm32l476-mdk/src/stm32_boot.c @@ -100,6 +100,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)stm32_bringup(); + stm32_bringup(); } #endif diff --git a/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_appinit.c b/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_appinit.c index 77cc4b9a84..abaa91d16d 100644 --- a/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_appinit.c +++ b/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_appinit.c @@ -135,9 +135,7 @@ FAR struct mtd_dev_s *mtd_temp; char blockdev[18]; char chardev[12]; #endif - int ret; - - (void)ret; + int ret = OK; #ifdef HAVE_PROC /* mount the proc filesystem */ @@ -315,7 +313,7 @@ FAR struct mtd_dev_s *mtd_temp; } #endif - return OK; + return ret; } #endif /* CONFIG_LIB_BOARDCTL */ diff --git a/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_buttons.c b/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_buttons.c index d433f1cbe9..24e80a526d 100644 --- a/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_buttons.c +++ b/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_buttons.c @@ -248,7 +248,7 @@ void board_button_initialize(void) #if 0 #ifdef CONFIG_ARCH_IRQBUTTONS - (void)board_button_irq(i, button_handler); + board_button_irq(i, button_handler); #endif #endif } diff --git a/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c b/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c index 7cb40f8ee6..a78e824d31 100644 --- a/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c +++ b/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c @@ -117,7 +117,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } @@ -313,7 +313,7 @@ void stm32l4_usbhost_vbusdrive(int iface, bool enable) #ifdef CONFIG_USBHOST xcpt_t stm32l4_setup_overcurrent(xcpt_t handler) { - (void)stm32l4_gpiosetevent(GPIO_OTGFS_OVER, true, true, true, handler, NULL); + stm32l4_gpiosetevent(GPIO_OTGFS_OVER, true, true, true, handler, NULL); return NULL; } #endif diff --git a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_appinit.c b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_appinit.c index ea0da72b4d..38d85214b3 100644 --- a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_appinit.c +++ b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_appinit.c @@ -122,9 +122,7 @@ int board_app_initialize(uintptr_t arg) #ifdef HAVE_RTC_DRIVER FAR struct rtc_lowerhalf_s *rtclower; #endif - int ret; - - (void)ret; + int ret = OK; #ifdef HAVE_PROC /* mount the proc filesystem */ @@ -209,7 +207,7 @@ int board_app_initialize(uintptr_t arg) #ifdef CONFIG_ADC ainfo("Initializing ADC\n"); - (void)stm32l4_adc_setup(); + stm32l4_adc_setup(); #ifdef CONFIG_STM32L4_DFSDM /* Initialize DFSDM and register its filters as additional ADC devices. */ @@ -224,10 +222,10 @@ int board_app_initialize(uintptr_t arg) #ifdef CONFIG_DAC ainfo("Initializing DAC\n"); - (void)stm32l4_dac_setup(); + stm32l4_dac_setup(); #endif - return OK; + return ret; } #endif /* CONFIG_LIB_BOARDCTL */ diff --git a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_buttons.c b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_buttons.c index 84b97b12f7..7574081cc0 100644 --- a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_buttons.c +++ b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_buttons.c @@ -247,7 +247,7 @@ void board_button_initialize(void) #if 0 #ifdef CONFIG_ARCH_IRQBUTTONS - (void)board_button_irq(i, button_handler); + board_button_irq(i, button_handler); #endif #endif } diff --git a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c index 1da9324e9f..07da1b0b06 100644 --- a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c +++ b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c @@ -117,7 +117,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } @@ -312,7 +312,7 @@ void stm32l4_usbhost_vbusdrive(int iface, bool enable) #ifdef CONFIG_USBHOST xcpt_t stm32l4_setup_overcurrent(xcpt_t handler) { - (void)stm32l4_gpiosetevent(GPIO_OTGFS_OVER, true, true, true, handler, NULL); + stm32l4_gpiosetevent(GPIO_OTGFS_OVER, true, true, true, handler, NULL); return NULL; } #endif diff --git a/boards/arm/str71x/olimex-strp711/src/str71_spi.c b/boards/arm/str71x/olimex-strp711/src/str71_spi.c index 7c79b80b10..b76a0896b0 100644 --- a/boards/arm/str71x/olimex-strp711/src/str71_spi.c +++ b/boards/arm/str71x/olimex-strp711/src/str71_spi.c @@ -550,7 +550,7 @@ static inline void spi_drain(FAR struct str71x_spidev_s *priv) do { - (void)spi_getreg(priv, STR71X_BSPI_RXR_OFFSET); + spi_getreg(priv, STR71X_BSPI_RXR_OFFSET); } while ((spi_getreg(priv, STR71X_BSPI_CSR2_OFFSET) & STR71X_BSPICSR2_RFNE) != 0); } @@ -583,24 +583,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; @@ -880,7 +867,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size { /* Yes.. Read and discard */ - (void)spi_getreg(priv, STR71X_BSPI_RXR_OFFSET); + spi_getreg(priv, STR71X_BSPI_RXR_OFFSET); } /* There is a race condition where TFNE may go false just before diff --git a/boards/arm/tiva/dk-tm4c129x/src/tm4c_boot.c b/boards/arm/tiva/dk-tm4c129x/src/tm4c_boot.c index 0dd7673011..343a74c71a 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/tm4c_boot.c +++ b/boards/arm/tiva/dk-tm4c129x/src/tm4c_boot.c @@ -112,6 +112,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)tm4c_bringup(); + tm4c_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/tiva/dk-tm4c129x/src/tm4c_tmp100.c b/boards/arm/tiva/dk-tm4c129x/src/tm4c_tmp100.c index a4a53373e1..351995f668 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/tm4c_tmp100.c +++ b/boards/arm/tiva/dk-tm4c129x/src/tm4c_tmp100.c @@ -94,7 +94,7 @@ int tiva_tmp100_initialize(FAR const char *devpath) ret = lm75_register(devpath, i2c, TMP100_I2CADDR); if (ret < 0) { - (void)tiva_i2cbus_uninitialize(i2c); + tiva_i2cbus_uninitialize(i2c); } return ret; diff --git a/boards/arm/tiva/launchxl-cc1310/src/cc1310_autoleds.c b/boards/arm/tiva/launchxl-cc1310/src/cc1310_autoleds.c index a0b1f2f3f5..8f34bab0bc 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/cc1310_autoleds.c +++ b/boards/arm/tiva/launchxl-cc1310/src/cc1310_autoleds.c @@ -62,8 +62,8 @@ void board_autoled_initialize(void) { - (void)tiva_configgpio(&g_gpio_gled); - (void)tiva_configgpio(&g_gpio_rled); + tiva_configgpio(&g_gpio_gled); + tiva_configgpio(&g_gpio_rled); } /**************************************************************************** diff --git a/boards/arm/tiva/launchxl-cc1310/src/cc1310_boot.c b/boards/arm/tiva/launchxl-cc1310/src/cc1310_boot.c index 55ca2f7421..612b2eeb8b 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/cc1310_boot.c +++ b/boards/arm/tiva/launchxl-cc1310/src/cc1310_boot.c @@ -105,6 +105,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)cc1310_bringup(); + cc1310_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/tiva/launchxl-cc1310/src/cc1310_buttons.c b/boards/arm/tiva/launchxl-cc1310/src/cc1310_buttons.c index 334ea2c6e6..4d2c0102d1 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/cc1310_buttons.c +++ b/boards/arm/tiva/launchxl-cc1310/src/cc1310_buttons.c @@ -72,8 +72,8 @@ void board_button_initialize(void) { - (void)tiva_configgpio(&g_gpio_sw1); - (void)tiva_configgpio(&g_gpio_sw2); + tiva_configgpio(&g_gpio_sw1); + tiva_configgpio(&g_gpio_sw2); } /**************************************************************************** diff --git a/boards/arm/tiva/launchxl-cc1310/src/cc1310_userleds.c b/boards/arm/tiva/launchxl-cc1310/src/cc1310_userleds.c index 92c62b6347..1806ca1a0a 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/cc1310_userleds.c +++ b/boards/arm/tiva/launchxl-cc1310/src/cc1310_userleds.c @@ -58,8 +58,8 @@ void board_userled_initialize(void) { - (void)tiva_configgpio(&g_gpio_gled); - (void)tiva_configgpio(&g_gpio_rled); + tiva_configgpio(&g_gpio_gled); + tiva_configgpio(&g_gpio_rled); } /**************************************************************************** diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_autoleds.c b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_autoleds.c index 680a1c6b80..a08c42ed6f 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_autoleds.c +++ b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_autoleds.c @@ -62,8 +62,8 @@ void board_autoled_initialize(void) { - (void)tiva_configgpio(&g_gpio_gled); - (void)tiva_configgpio(&g_gpio_rled); + tiva_configgpio(&g_gpio_gled); + tiva_configgpio(&g_gpio_rled); } /**************************************************************************** diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_boot.c b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_boot.c index 5627e6d422..fac301835c 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_boot.c +++ b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_boot.c @@ -105,6 +105,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)cc1312_bringup(); + cc1312_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_buttons.c b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_buttons.c index 56f34677bc..6ff5372c18 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_buttons.c +++ b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_buttons.c @@ -72,8 +72,8 @@ void board_button_initialize(void) { - (void)tiva_configgpio(&g_gpio_sw1); - (void)tiva_configgpio(&g_gpio_sw2); + tiva_configgpio(&g_gpio_sw1); + tiva_configgpio(&g_gpio_sw2); } /**************************************************************************** diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_userleds.c b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_userleds.c index 315b377d33..fccc834ed4 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_userleds.c +++ b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_userleds.c @@ -58,8 +58,8 @@ void board_userled_initialize(void) { - (void)tiva_configgpio(&g_gpio_gled); - (void)tiva_configgpio(&g_gpio_rled); + tiva_configgpio(&g_gpio_gled); + tiva_configgpio(&g_gpio_rled); } /**************************************************************************** diff --git a/boards/arm/tiva/lm3s6965-ek/src/lm_oled.c b/boards/arm/tiva/lm3s6965-ek/src/lm_oled.c index d8ddb3e3f1..f68f6ecbe7 100644 --- a/boards/arm/tiva/lm3s6965-ek/src/lm_oled.c +++ b/boards/arm/tiva/lm3s6965-ek/src/lm_oled.c @@ -126,7 +126,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* And turn the OLED on (CONFIG_LCD_MAXPOWER should be 1) */ - (void)dev->setpower(dev, CONFIG_LCD_MAXPOWER); + dev->setpower(dev, CONFIG_LCD_MAXPOWER); return dev; } } diff --git a/boards/arm/tiva/lm3s8962-ek/src/lm_oled.c b/boards/arm/tiva/lm3s8962-ek/src/lm_oled.c index a7ecb62cde..65f8e8aff7 100644 --- a/boards/arm/tiva/lm3s8962-ek/src/lm_oled.c +++ b/boards/arm/tiva/lm3s8962-ek/src/lm_oled.c @@ -130,7 +130,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* And turn the OLED on (CONFIG_LCD_MAXPOWER should be 1) */ - (void)dev->setpower(dev, CONFIG_LCD_MAXPOWER); + dev->setpower(dev, CONFIG_LCD_MAXPOWER); return dev; } } diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_boot.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_boot.c index 5962395501..690c075fb4 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_boot.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_boot.c @@ -106,6 +106,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)tm4c_bringup(); + tm4c_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_buttons.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_buttons.c index fdafcc63a2..55df894486 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_buttons.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_buttons.c @@ -103,7 +103,7 @@ void board_button_initialize(void) /* Configure GPIO interrupts */ #ifdef CONFIG_ARCH_IRQBUTTONS - (void)tiva_gpioirqinitialize(); + tiva_gpioirqinitialize(); #endif } diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_mcp2515.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_mcp2515.c index cf97ea7b81..b0eb934e7f 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_mcp2515.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_mcp2515.c @@ -162,7 +162,7 @@ static int mcp2515_attach(FAR struct mcp2515_config_s *state, /* Configure the interrupt for falling edge */ - (void)tiva_configgpio(GPIO_MCP2515_IRQ); + tiva_configgpio(GPIO_MCP2515_IRQ); leave_critical_section(flags); @@ -202,7 +202,7 @@ int tiva_mcp2515initialize(FAR const char *devpath) /* Configure the MCP2515 interrupt pin as an input */ - (void)tiva_configgpio(GPIO_MCP2515_IRQ); + tiva_configgpio(GPIO_MCP2515_IRQ); spi = tiva_ssibus_initialize(MCP2515_SPI_PORTNO); diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_ssi.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_ssi.c index 0ebaccb5b5..8041740cc5 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_ssi.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_ssi.c @@ -80,7 +80,7 @@ void weak_function tm4c_ssidev_initialize(void) { #ifdef CONFIG_CAN_MCP2515 - (void)tiva_configgpio(GPIO_MCP2515_CS); /* mcp2515 chip select */ + tiva_configgpio(GPIO_MCP2515_CS); /* mcp2515 chip select */ #endif } diff --git a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_boot.c b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_boot.c index e85f1552a1..2fc1bf6463 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_boot.c +++ b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_boot.c @@ -114,6 +114,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)tm4c_bringup(); + tm4c_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_buttons.c b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_buttons.c index 8ae859086d..9d0bda6fbb 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_buttons.c +++ b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_buttons.c @@ -100,7 +100,7 @@ void board_button_initialize(void) #ifdef CONFIG_ARCH_IRQBUTTONS /* Configure GPIO interrupts */ - (void)tiva_gpioirqinitialize(); + tiva_gpioirqinitialize(); #endif } diff --git a/boards/arm/tms570/launchxl-tms57004/src/tms570_buttons.c b/boards/arm/tms570/launchxl-tms57004/src/tms570_buttons.c index fe6f17900f..d0a9586dbc 100644 --- a/boards/arm/tms570/launchxl-tms57004/src/tms570_buttons.c +++ b/boards/arm/tms570/launchxl-tms57004/src/tms570_buttons.c @@ -107,14 +107,14 @@ static int board_button_irqx(gio_pinset_t pinset, int irq, /* Configure the interrupt */ tms570_gioirq(pinset); - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); tms570_gioirqenable(irq); } else { /* Detach and disable the interrupt */ - (void)irq_detach(irq); + irq_detach(irq); tms570_gioirqdisable(irq); } @@ -145,7 +145,7 @@ void board_button_initialize(void) { /* Configure button GIOs */ - (void)tms570_configgio(GIO_BUTTON); + tms570_configgio(GIO_BUTTON); } /**************************************************************************** diff --git a/boards/arm/tms570/tms570ls31x-usb-kit/src/tms570_buttons.c b/boards/arm/tms570/tms570ls31x-usb-kit/src/tms570_buttons.c index 4cae671851..8ac40484d3 100644 --- a/boards/arm/tms570/tms570ls31x-usb-kit/src/tms570_buttons.c +++ b/boards/arm/tms570/tms570ls31x-usb-kit/src/tms570_buttons.c @@ -107,14 +107,14 @@ static int board_button_irqx(gio_pinset_t pinset, int irq, /* Configure the interrupt */ tms570_gioirq(pinset); - (void)irq_attach(irq, irqhandler, arg); + irq_attach(irq, irqhandler, arg); tms570_gioirqenable(irq); } else { /* Detach and disable the interrupt */ - (void)irq_detach(irq); + irq_detach(irq); tms570_gioirqdisable(irq); } @@ -145,7 +145,7 @@ void board_button_initialize(void) { /* Configure button GIOs */ - (void)tms570_configgio(GIO_BUTTON); + tms570_configgio(GIO_BUTTON); } /**************************************************************************** diff --git a/boards/arm/xmc4/xmc4500-relax/src/xmc4_autoleds.c b/boards/arm/xmc4/xmc4500-relax/src/xmc4_autoleds.c index fcb93cf9f5..4d937ffe2a 100644 --- a/boards/arm/xmc4/xmc4500-relax/src/xmc4_autoleds.c +++ b/boards/arm/xmc4/xmc4500-relax/src/xmc4_autoleds.c @@ -165,8 +165,8 @@ void board_autoled_initialize(void) { /* Configure LED1-2 GPIOs for output */ - (void)xmc4_gpio_config(GPIO_LED1); - (void)xmc4_gpio_config(GPIO_LED2); + xmc4_gpio_config(GPIO_LED1); + xmc4_gpio_config(GPIO_LED2); } /**************************************************************************** diff --git a/boards/arm/xmc4/xmc4500-relax/src/xmc4_boot.c b/boards/arm/xmc4/xmc4500-relax/src/xmc4_boot.c index 217106172a..616709dc9b 100644 --- a/boards/arm/xmc4/xmc4500-relax/src/xmc4_boot.c +++ b/boards/arm/xmc4/xmc4500-relax/src/xmc4_boot.c @@ -90,7 +90,7 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)xmc4_bringup(); + xmc4_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/xmc4/xmc4500-relax/src/xmc4_spi.c b/boards/arm/xmc4/xmc4500-relax/src/xmc4_spi.c index 5a74be85b1..6cb91c002a 100644 --- a/boards/arm/xmc4/xmc4500-relax/src/xmc4_spi.c +++ b/boards/arm/xmc4/xmc4500-relax/src/xmc4_spi.c @@ -76,7 +76,7 @@ void weak_function xmc4_spidev_initialize(void) /* Configure SPI2 chip selects */ #if define(CONFIG_XMC4_SPI2) && defined(CONFIG_SENSORS_MAX6675) - (void)xmc4_gpio_config(GPIO_CS_MAX6675); + xmc4_gpio_config(GPIO_CS_MAX6675); #endif /* Configure SPI3 chip selects */ diff --git a/boards/arm/xmc4/xmc4500-relax/src/xmc4_userleds.c b/boards/arm/xmc4/xmc4500-relax/src/xmc4_userleds.c index fda2b2f7f0..050c060467 100644 --- a/boards/arm/xmc4/xmc4500-relax/src/xmc4_userleds.c +++ b/boards/arm/xmc4/xmc4500-relax/src/xmc4_userleds.c @@ -57,8 +57,8 @@ void board_userled_initialize(void) { /* Configure LED1-2 GPIOs for output */ - (void)xmc4_gpio_config(GPIO_LED1); - (void)xmc4_gpio_config(GPIO_LED2); + xmc4_gpio_config(GPIO_LED1); + xmc4_gpio_config(GPIO_LED2); } /**************************************************************************** diff --git a/boards/avr/at32uc3/avr32dev1/src/avr32_buttons.c b/boards/avr/at32uc3/avr32dev1/src/avr32_buttons.c index fc83d97a19..a257e2d345 100644 --- a/boards/avr/at32uc3/avr32dev1/src/avr32_buttons.c +++ b/boards/avr/at32uc3/avr32dev1/src/avr32_buttons.c @@ -110,8 +110,8 @@ static int board_button_irqx(int irq, xcpt_t irqhandler, void *arg) void board_button_initialize(void) { - (void)at32uc3_configgpio(PINMUX_GPIO_BUTTON1); - (void)at32uc3_configgpio(PINMUX_GPIO_BUTTON2); + at32uc3_configgpio(PINMUX_GPIO_BUTTON1); + at32uc3_configgpio(PINMUX_GPIO_BUTTON2); } /**************************************************************************** diff --git a/boards/mips/pic32mx/pic32mx-starterkit/src/pic32mx_appinit.c b/boards/mips/pic32mx/pic32mx-starterkit/src/pic32mx_appinit.c index d5bb61f9cc..53f5bdde77 100644 --- a/boards/mips/pic32mx/pic32mx-starterkit/src/pic32mx_appinit.c +++ b/boards/mips/pic32mx/pic32mx-starterkit/src/pic32mx_appinit.c @@ -200,7 +200,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_boot.c b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_boot.c index 2dd0a926aa..9ab223662f 100644 --- a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_boot.c +++ b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_boot.c @@ -120,7 +120,7 @@ void board_late_initialize(void) { /* Perform board-specific initialization here if so configured */ - (void)pic32mx_bringup(); + pic32mx_bringup(); } #endif diff --git a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c index 8157a3c886..404d25562b 100644 --- a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c +++ b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c @@ -200,7 +200,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_touchscreen.c b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_touchscreen.c index c7c1d50ce0..feea862858 100644 --- a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_touchscreen.c +++ b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_touchscreen.c @@ -605,11 +605,6 @@ static int tc_waitsample(FAR struct tc_dev_s *priv, if (ret < 0) { - /* If we are awakened by a signal, then we need to return - * the failure now. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } } @@ -1010,9 +1005,6 @@ static int tc_open(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1065,9 +1057,6 @@ static int tc_close(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1122,9 +1111,6 @@ static ssize_t tc_read(FAR struct file *filep, FAR char *buffer, size_t len) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1236,9 +1222,6 @@ static int tc_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1282,9 +1265,6 @@ static int tc_poll(FAR struct file *filep, FAR struct pollfd *fds, ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1412,7 +1392,7 @@ int pic32mx_tsc_setup(int minor) /* Register the device as an input device */ - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); iinfo("Registering %s\n", devname); ret = register_driver(devname, &tc_fops, 0666, priv); diff --git a/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_appinit.c b/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_appinit.c index 57a566622d..a26a730c42 100644 --- a/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_appinit.c +++ b/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_appinit.c @@ -197,7 +197,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)CONN_ENUMERATE(g_usbconn, hport); + CONN_ENUMERATE(g_usbconn, hport); } } diff --git a/boards/mips/pic32mz/flipnclick-pic32mz/src/pic32mz_boot.c b/boards/mips/pic32mz/flipnclick-pic32mz/src/pic32mz_boot.c index 349754f724..f2e4054c9e 100644 --- a/boards/mips/pic32mz/flipnclick-pic32mz/src/pic32mz_boot.c +++ b/boards/mips/pic32mz/flipnclick-pic32mz/src/pic32mz_boot.c @@ -100,6 +100,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)pic32mz_bringup(); + pic32mz_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/mips/pic32mz/flipnclick-pic32mz/src/pic32mz_spi.c b/boards/mips/pic32mz/flipnclick-pic32mz/src/pic32mz_spi.c index cd84d421de..711d93430d 100644 --- a/boards/mips/pic32mz/flipnclick-pic32mz/src/pic32mz_spi.c +++ b/boards/mips/pic32mz/flipnclick-pic32mz/src/pic32mz_spi.c @@ -71,8 +71,8 @@ void weak_function pic32mz_spidev_initialize(void) #ifdef HAVE_SSD1306 /* Configure the SSD1306 chip select and command/data GPIOs */ - (void)pic32mz_configgpio(GPIO_SSD1306_CS); - (void)pic32mz_configgpio(GPIO_SSD1306_DC); + pic32mz_configgpio(GPIO_SSD1306_CS); + pic32mz_configgpio(GPIO_SSD1306_DC); #endif } diff --git a/boards/mips/pic32mz/flipnclick-pic32mz/src/pic32mz_ssd1306.c b/boards/mips/pic32mz/flipnclick-pic32mz/src/pic32mz_ssd1306.c index fa7e2fd667..ff1ea39bf1 100644 --- a/boards/mips/pic32mz/flipnclick-pic32mz/src/pic32mz_ssd1306.c +++ b/boards/mips/pic32mz/flipnclick-pic32mz/src/pic32mz_ssd1306.c @@ -107,7 +107,7 @@ FAR struct lcd_dev_s *pic32mz_graphics_setup(unsigned int devno) * putting the OLED into reset state. */ - (void)pic32mz_configgpio(GPIO_SSD1306_RST); + pic32mz_configgpio(GPIO_SSD1306_RST); /* Wait a bit then release the OLED from the reset state */ @@ -136,7 +136,7 @@ FAR struct lcd_dev_s *pic32mz_graphics_setup(unsigned int devno) /* And turn the OLED on */ - (void)dev->setpower(dev, CONFIG_LCD_MAXPOWER); + dev->setpower(dev, CONFIG_LCD_MAXPOWER); #if defined(CONFIG_VIDEO_FB) && defined(CONFIG_LCD_FRAMEBUFFER) /* Initialize and register the simulated framebuffer driver */ diff --git a/boards/mips/pic32mz/pic32mz-starterkit/src/pic32mz_boot.c b/boards/mips/pic32mz/pic32mz-starterkit/src/pic32mz_boot.c index 7af4034583..4b47b11d5f 100644 --- a/boards/mips/pic32mz/pic32mz-starterkit/src/pic32mz_boot.c +++ b/boards/mips/pic32mz/pic32mz-starterkit/src/pic32mz_boot.c @@ -108,6 +108,6 @@ void board_late_initialize(void) { /* Perform board initialization */ - (void)pic32mz_bringup(); + pic32mz_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/or1k/mor1kx/or1k/src/or1k_boot.c b/boards/or1k/mor1kx/or1k/src/or1k_boot.c index 5821456dc9..0efe8c2661 100644 --- a/boards/or1k/mor1kx/or1k/src/or1k_boot.c +++ b/boards/or1k/mor1kx/or1k/src/or1k_boot.c @@ -87,6 +87,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)or1k_bringup(); + or1k_bringup(); } #endif diff --git a/boards/renesas/sh7032/us7032evb1/shterm/shterm.c b/boards/renesas/sh7032/us7032evb1/shterm/shterm.c index c35a674e8d..ed47edfcf9 100644 --- a/boards/renesas/sh7032/us7032evb1/shterm/shterm.c +++ b/boards/renesas/sh7032/us7032evb1/shterm/shterm.c @@ -108,10 +108,10 @@ static void putconsole(char ch) { if (g_logstream) { - (void)putc(ch, g_logstream); + putc(ch, g_logstream); } - (void)putchar(ch); + putchar(ch); } /**************************************************************************** @@ -122,10 +122,10 @@ static void flushconsole(void) { if (g_logstream) { - (void)fflush(g_logstream); + fflush(g_logstream); } - (void)fflush(stdout); + fflush(stdout); } /**************************************************************************** @@ -139,10 +139,10 @@ static void printconsole(const char *fmt, ...) va_start(ap, fmt); if (g_logstream) { - (void)vfprintf(g_logstream, fmt, ap); + vfprintf(g_logstream, fmt, ap); } - (void)vprintf(fmt, ap); + vprintf(fmt, ap); va_end(ap); } @@ -165,7 +165,7 @@ static void sendfile(int fdtarg, char *filename, int verify) if (fdin < 0) { fprintf(stderr, "ERROR: Failed to open '%s' for reading\n", filename); - (void)writebyte(fdin, '>'); + writebyte(fdin, '>'); return; } @@ -293,13 +293,13 @@ static void receivefile(int fdtarg, char *filename) if (fdout < 0) { fprintf(stderr, "ERROR: Failed to open '%s' for writing\n", filename); - (void)writebyte(fdtarg, '>'); + writebyte(fdtarg, '>'); return; } printconsole("Receiving file '%s':\n", filename); flushconsole(); - (void)writebyte(fdtarg, '+'); + writebyte(fdtarg, '+'); /* Synchronize */ @@ -437,7 +437,7 @@ static void close_tty(void) if (g_fdnb >= 0) { - (void)close(g_fdnb); + close(g_fdnb); } if (g_fd >= 0) @@ -449,12 +449,12 @@ static void close_tty(void) g_ttydev, strerror(errno)); } - (void)close(g_fd); + close(g_fd); } if (g_logstream) { - (void)fclose(g_logstream); + fclose(g_logstream); } } @@ -687,8 +687,8 @@ int main(int argc, char **argv, char **envp) tty.c_cflag &= ~(CSIZE | PARENB); tty.c_cflag |= CS8; - (void)cfsetispeed(&tty, speed); - (void)cfsetospeed(&tty, speed); + cfsetispeed(&tty, speed); + cfsetospeed(&tty, speed); ret = tcsetattr(g_fd, TCSANOW, &tty); if (ret < 0) diff --git a/boards/sim/sim/sim/src/sim_bringup.c b/boards/sim/sim/sim/src/sim_bringup.c index 1011853b9c..837f9c3f4c 100644 --- a/boards/sim/sim/sim/src/sim_bringup.c +++ b/boards/sim/sim/sim/src/sim_bringup.c @@ -116,13 +116,13 @@ int sim_bringup(void) #ifdef CONFIG_LIB_ZONEINFO_ROMFS /* Mount the TZ database */ - (void)sim_zoneinfo(3); + sim_zoneinfo(3); #endif #ifdef CONFIG_EXAMPLES_GPIO /* Initialize simulated GPIO drivers */ - (void)sim_gpio_initialize(); + sim_gpio_initialize(); #endif #ifdef CONFIG_RAMMTD diff --git a/boards/sim/sim/sim/src/sim_gpio.c b/boards/sim/sim/sim/src/sim_gpio.c index 1a3b2e26c2..b6ba6d8662 100644 --- a/boards/sim/sim/sim/src/sim_gpio.c +++ b/boards/sim/sim/sim/src/sim_gpio.c @@ -201,14 +201,14 @@ static int gpint_enable(FAR struct gpio_dev_s *dev, bool enable) if (simgpint->callback != NULL) { gpioinfo("Start 1 second timer\n"); - (void)wd_start(simgpint->wdog, SEC2TICK(1), - (wdentry_t)sim_interrupt, 1, (wdparm_t)dev); + wd_start(simgpint->wdog, SEC2TICK(1), + (wdentry_t)sim_interrupt, 1, (wdparm_t)dev); } } else { gpioinfo("Cancel 1 second timer\n"); - (void)wd_cancel(simgpint->wdog); + wd_cancel(simgpint->wdog); } return OK; @@ -231,9 +231,9 @@ int sim_gpio_initialize(void) g_gpint.wdog = wd_create(); DEBUGASSERT(g_gpint.wdog != NULL); - (void)gpio_pin_register(&g_gpin.gpio, g_gpin.id); - (void)gpio_pin_register(&g_gpout.gpio, g_gpout.id); - (void)gpio_pin_register(&g_gpint.simgpio.gpio, g_gpint.simgpio.id); + gpio_pin_register(&g_gpin.gpio, g_gpin.id); + gpio_pin_register(&g_gpout.gpio, g_gpout.id); + gpio_pin_register(&g_gpint.simgpio.gpio, g_gpint.simgpio.id); return 0; } #endif /* CONFIG_EXAMPLES_GPIO && !CONFIG_GPIO_LOWER_HALF */ diff --git a/boards/sim/sim/sim/src/sim_ioexpander.c b/boards/sim/sim/sim/src/sim_ioexpander.c index 4facdec07b..00f1a46b06 100644 --- a/boards/sim/sim/sim/src/sim_ioexpander.c +++ b/boards/sim/sim/sim/src/sim_ioexpander.c @@ -77,39 +77,39 @@ int sim_gpio_initialize(void) /* Pin 0: an non-inverted, input pin */ - (void)IOEXP_SETDIRECTION(ioe, 0, IOEXPANDER_DIRECTION_IN); - (void)IOEXP_SETOPTION(ioe, 0, IOEXPANDER_OPTION_INVERT, - (FAR void *)IOEXPANDER_VAL_NORMAL); - (void)IOEXP_SETOPTION(ioe, 0, IOEXPANDER_OPTION_INTCFG, - (FAR void *)IOEXPANDER_VAL_DISABLE); - (void)gpio_lower_half(ioe, 0, GPIO_INPUT_PIN, 0); + IOEXP_SETDIRECTION(ioe, 0, IOEXPANDER_DIRECTION_IN); + IOEXP_SETOPTION(ioe, 0, IOEXPANDER_OPTION_INVERT, + (FAR void *)IOEXPANDER_VAL_NORMAL); + IOEXP_SETOPTION(ioe, 0, IOEXPANDER_OPTION_INTCFG, + (FAR void *)IOEXPANDER_VAL_DISABLE); + gpio_lower_half(ioe, 0, GPIO_INPUT_PIN, 0); /* Pin 1: an non-inverted, output pin */ - (void)IOEXP_SETDIRECTION(ioe, 1, IOEXPANDER_DIRECTION_OUT); - (void)IOEXP_SETOPTION(ioe, 1, IOEXPANDER_OPTION_INVERT, - (FAR void *)IOEXPANDER_VAL_NORMAL); - (void)IOEXP_SETOPTION(ioe, 2, IOEXPANDER_OPTION_INTCFG, - (FAR void *)IOEXPANDER_VAL_DISABLE); - (void)gpio_lower_half(ioe, 1, GPIO_OUTPUT_PIN, 1); + IOEXP_SETDIRECTION(ioe, 1, IOEXPANDER_DIRECTION_OUT); + IOEXP_SETOPTION(ioe, 1, IOEXPANDER_OPTION_INVERT, + (FAR void *)IOEXPANDER_VAL_NORMAL); + IOEXP_SETOPTION(ioe, 2, IOEXPANDER_OPTION_INTCFG, + (FAR void *)IOEXPANDER_VAL_DISABLE); + gpio_lower_half(ioe, 1, GPIO_OUTPUT_PIN, 1); /* Pin 2: an non-inverted, edge interrupting pin */ - (void)IOEXP_SETDIRECTION(ioe, 2, IOEXPANDER_DIRECTION_IN); - (void)IOEXP_SETOPTION(ioe, 2, IOEXPANDER_OPTION_INVERT, - (FAR void *)IOEXPANDER_VAL_NORMAL); - (void)IOEXP_SETOPTION(ioe, 2, IOEXPANDER_OPTION_INTCFG, - (FAR void *)IOEXPANDER_VAL_BOTH); - (void)gpio_lower_half(ioe, 2, GPIO_INTERRUPT_PIN, 2); + IOEXP_SETDIRECTION(ioe, 2, IOEXPANDER_DIRECTION_IN); + IOEXP_SETOPTION(ioe, 2, IOEXPANDER_OPTION_INVERT, + (FAR void *)IOEXPANDER_VAL_NORMAL); + IOEXP_SETOPTION(ioe, 2, IOEXPANDER_OPTION_INTCFG, + (FAR void *)IOEXPANDER_VAL_BOTH); + gpio_lower_half(ioe, 2, GPIO_INTERRUPT_PIN, 2); /* Pin 3: a non-inverted, level interrupting pin */ - (void)IOEXP_SETDIRECTION(ioe, 3, IOEXPANDER_DIRECTION_IN); - (void)IOEXP_SETOPTION(ioe, 3, IOEXPANDER_OPTION_INVERT, - (FAR void *)IOEXPANDER_VAL_NORMAL); - (void)IOEXP_SETOPTION(ioe, 3, IOEXPANDER_OPTION_INTCFG, - (FAR void *)IOEXPANDER_VAL_HIGH); - (void)gpio_lower_half(ioe, 3, GPIO_INTERRUPT_PIN, 3); + IOEXP_SETDIRECTION(ioe, 3, IOEXPANDER_DIRECTION_IN); + IOEXP_SETOPTION(ioe, 3, IOEXPANDER_OPTION_INVERT, + (FAR void *)IOEXPANDER_VAL_NORMAL); + IOEXP_SETOPTION(ioe, 3, IOEXPANDER_OPTION_INTCFG, + (FAR void *)IOEXPANDER_VAL_HIGH); + gpio_lower_half(ioe, 3, GPIO_INTERRUPT_PIN, 3); return 0; } diff --git a/boards/sim/sim/sim/src/sim_touchscreen.c b/boards/sim/sim/sim/src/sim_touchscreen.c index d9a140b3c5..cc7cb0c022 100644 --- a/boards/sim/sim/sim/src/sim_touchscreen.c +++ b/boards/sim/sim/sim/src/sim_touchscreen.c @@ -135,7 +135,7 @@ static FAR void *sim_listener(FAR void *arg) if (!g_simtc.connected) { g_simtc.connected = true; - sem_post(&g_simtc.eventsem); + nxsem_post(&g_simtc.eventsem); ginfo("Connected\n"); } } @@ -213,10 +213,10 @@ int sim_tsc_setup(int minor) * but it makes this example flow more smoothly. */ - (void)pthread_attr_init(&attr); + pthread_attr_init(&attr); param.sched_priority = CONFIG_SIM_LISTENERPRIO; - (void)pthread_attr_setschedparam(&attr, ¶m); - (void)pthread_attr_setstacksize(&attr, CONFIG_SIM_LISTENER_STACKSIZE); + pthread_attr_setschedparam(&attr, ¶m); + pthread_attr_setstacksize(&attr, CONFIG_SIM_LISTENER_STACKSIZE); ret = pthread_create(&thread, &attr, sim_listener, NULL); if (ret != 0) @@ -233,7 +233,7 @@ int sim_tsc_setup(int minor) * are connected. */ - (void)sem_wait(&g_simtc.eventsem); + nxsem_wait(&g_simtc.eventsem); } } else diff --git a/boards/xtensa/esp32/esp32-core/src/esp32_boot.c b/boards/xtensa/esp32/esp32-core/src/esp32_boot.c index 357b1253ab..866c7976fd 100644 --- a/boards/xtensa/esp32/esp32-core/src/esp32_boot.c +++ b/boards/xtensa/esp32/esp32-core/src/esp32_boot.c @@ -91,6 +91,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)esp32_bringup(); + esp32_bringup(); } #endif diff --git a/boards/z80/ez80/makerlisp/src/ez80_boot.c b/boards/z80/ez80/makerlisp/src/ez80_boot.c index e4d40433a7..101e0a6dcd 100644 --- a/boards/z80/ez80/makerlisp/src/ez80_boot.c +++ b/boards/z80/ez80/makerlisp/src/ez80_boot.c @@ -212,6 +212,6 @@ void board_late_initialize(void) { /* Perform board-specific initialization */ - (void)ez80_bringup(); + ez80_bringup(); } #endif diff --git a/boards/z80/ez80/makerlisp/src/sd_main.c b/boards/z80/ez80/makerlisp/src/sd_main.c index 2c9f837bfa..1d28c8af0b 100644 --- a/boards/z80/ez80/makerlisp/src/sd_main.c +++ b/boards/z80/ez80/makerlisp/src/sd_main.c @@ -151,7 +151,7 @@ int sd_main(int argc, char *argv) /* Interrupts must be disabled through the following. */ - (void)up_irq_save(); + up_irq_save(); /* Then jump into SRAM via the reset vector at 0x040000 */ diff --git a/boards/z80/z80/z80sim/src/z80_serial.c b/boards/z80/z80/z80sim/src/z80_serial.c index beec65de75..46408843bc 100644 --- a/boards/z80/z80/z80sim/src/z80_serial.c +++ b/boards/z80/z80/z80sim/src/z80_serial.c @@ -319,8 +319,8 @@ static bool up_txempty(FAR struct uart_dev_s *dev) void z80_serial_initialize(void) { - (void)uart_register("/dev/console", &g_uartport); - (void)uart_register("/dev/ttyS0", &g_uartport); + uart_register("/dev/console", &g_uartport); + uart_register("/dev/ttyS0", &g_uartport); } #endif /* USE_SERIALDRIVER */ diff --git a/crypto/blake2s.c b/crypto/blake2s.c index c2c761d614..54e751e173 100644 --- a/crypto/blake2s.c +++ b/crypto/blake2s.c @@ -251,7 +251,7 @@ static void blake2s_compress(FAR blake2s_state *S, #else /* Larger, slightly faster. */ - (void)(round = 0); + UNUSED(round); ROUND(0); ROUND(1); ROUND(2); diff --git a/crypto/cryptodev.c b/crypto/cryptodev.c index f70be00a48..26536adc32 100644 --- a/crypto/cryptodev.c +++ b/crypto/cryptodev.c @@ -173,5 +173,5 @@ static int cryptodev_ioctl(FAR struct file *filep, int cmd, unsigned long arg) void devcrypto_register(void) { - (void)register_driver("/dev/crypto", &g_cryptodevops, 0666, NULL); + register_driver("/dev/crypto", &g_cryptodevops, 0666, NULL); } diff --git a/crypto/random_pool.c b/crypto/random_pool.c index ace8ca7442..a4b3cf9006 100644 --- a/crypto/random_pool.c +++ b/crypto/random_pool.c @@ -453,7 +453,7 @@ void up_rngaddentropy(enum rnd_source_t kindof, FAR const uint32_t *buf, * reseeding too fast. */ - (void)clock_gettime(CLOCK_REALTIME, &ts); + clock_gettime(CLOCK_REALTIME, &ts); tbuf[0] = ROTL_32(ts.tv_nsec, 17) ^ ROTL_32(ts.tv_sec, 3); tbuf[0] += ROTL_32(kindof, 27); tbuf[0] += ROTL_32((uintptr_t)&tbuf[0], 11); @@ -500,21 +500,7 @@ void up_rngaddentropy(enum rnd_source_t kindof, FAR const uint32_t *buf, void up_rngreseed(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_rng.rd_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_rng.rd_sem); if (g_rng.rd_newentr >= MIN_SEED_NEW_ENTROPY_WORDS) { @@ -563,22 +549,7 @@ void up_randompool_initialize(void) void getrandom(FAR void *bytes, size_t nbytes) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_rng.rd_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); - + nxsem_wait_uninterruptible(&g_rng.rd_sem); rng_buf_internal(bytes, nbytes); nxsem_post(&g_rng.rd_sem); } diff --git a/drivers/1wire/1wire.c b/drivers/1wire/1wire.c index f3d0dd75f1..f793dbf420 100644 --- a/drivers/1wire/1wire.c +++ b/drivers/1wire/1wire.c @@ -248,19 +248,7 @@ void onewire_sem_wait(FAR struct onewire_master_s *master) else { - int ret; - - do - { - ret = nxsem_wait(&master->devsem.sem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&master->devsem.sem); /* Now we hold the semaphore */ @@ -736,7 +724,7 @@ FAR struct onewire_master_s * /* Register to receive power management callbacks */ - (void)pm_register(&master->pm_cb); + pm_register(&master->pm_cb); #endif return master; diff --git a/drivers/analog/ad5410.c b/drivers/analog/ad5410.c index ab8609480e..efffa0fa83 100644 --- a/drivers/analog/ad5410.c +++ b/drivers/analog/ad5410.c @@ -135,10 +135,10 @@ static struct dac_dev_s g_dacdev = static void dac_lock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); SPI_SETMODE(spi, SPIDEV_MODE0); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); + SPI_HWFEATURES(spi, 0); SPI_SETFREQUENCY(spi, 400000); } @@ -152,7 +152,7 @@ static void dac_lock(FAR struct spi_dev_s *spi) static void dac_unlock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } /**************************************************************************** diff --git a/drivers/analog/ads1242.c b/drivers/analog/ads1242.c index 836de53d26..65f4071b9e 100644 --- a/drivers/analog/ads1242.c +++ b/drivers/analog/ads1242.c @@ -140,10 +140,10 @@ static const struct file_operations g_ads1242_fops = static void ads1242_lock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); SPI_SETMODE(spi, ADS1242_SPI_MODE); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); + SPI_HWFEATURES(spi, 0); SPI_SETFREQUENCY(spi, ADS1242_SPI_FREQUENCY); } @@ -157,7 +157,7 @@ static void ads1242_lock(FAR struct spi_dev_s *spi) static void ads1242_unlock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } /**************************************************************************** diff --git a/drivers/analog/ads1255.c b/drivers/analog/ads1255.c index 3f8c29ae90..b815706eec 100644 --- a/drivers/analog/ads1255.c +++ b/drivers/analog/ads1255.c @@ -227,10 +227,10 @@ static uint8_t getspsreg(uint16_t sps) static void adc_lock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); SPI_SETMODE(spi, SPIDEV_MODE1); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); + SPI_HWFEATURES(spi, 0); SPI_SETFREQUENCY(spi, CONFIG_ADS1255_FREQUENCY); } @@ -244,7 +244,7 @@ static void adc_lock(FAR struct spi_dev_s *spi) static void adc_unlock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } /**************************************************************************** diff --git a/drivers/analog/comp.c b/drivers/analog/comp.c index 6eaecb451c..a85fbd850d 100644 --- a/drivers/analog/comp.c +++ b/drivers/analog/comp.c @@ -143,21 +143,7 @@ static void comp_pollnotify(FAR struct comp_dev_s *dev, static void comp_semtake(FAR sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -420,10 +406,10 @@ int comp_register(FAR const char *path, FAR struct comp_dev_s *dev) /* Initialize semaphores */ nxsem_init(&dev->ad_sem, 0, 1); - (void)nxsem_setprotocol(&dev->ad_sem, SEM_PRIO_NONE); + nxsem_setprotocol(&dev->ad_sem, SEM_PRIO_NONE); nxsem_init(&dev->ad_readsem, 0, 0); - (void)nxsem_setprotocol(&dev->ad_readsem, SEM_PRIO_NONE); + nxsem_setprotocol(&dev->ad_readsem, SEM_PRIO_NONE); /* Bind the upper-half callbacks to the lower half COMP driver */ diff --git a/drivers/analog/dac.c b/drivers/analog/dac.c index 08bb73b776..0dfbbcec3a 100644 --- a/drivers/analog/dac.c +++ b/drivers/analog/dac.c @@ -361,15 +361,11 @@ static ssize_t dac_write(FAR struct file *filep, FAR const char *buffer, /* Wait for a message to be sent */ - do + ret = nxsem_wait_uninterruptible(&fifo->af_sem); + if (ret < 0) { - ret = nxsem_wait(&fifo->af_sem); - if (ret < 0 && ret != -EINTR) - { - goto return_with_irqdisabled; - } + goto return_with_irqdisabled; } - while (ret < 0); /* Re-check the FIFO state */ diff --git a/drivers/analog/ltc1867l.c b/drivers/analog/ltc1867l.c index db463428ea..209c3e0d8f 100644 --- a/drivers/analog/ltc1867l.c +++ b/drivers/analog/ltc1867l.c @@ -128,10 +128,10 @@ static const struct adc_ops_s g_adcops = static void adc_lock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); SPI_SETMODE(spi, LTC1867L_SPI_MODE); SPI_SETBITS(spi, 16); - (void)SPI_HWFEATURES(spi, 0); + SPI_HWFEATURES(spi, 0); SPI_SETFREQUENCY(spi, CONFIG_LTC1867L_FREQUENCY); } @@ -145,7 +145,7 @@ static void adc_lock(FAR struct spi_dev_s *spi) static void adc_unlock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } /**************************************************************************** diff --git a/drivers/analog/pga11x.c b/drivers/analog/pga11x.c index 99d2e50dae..b09a99e1a1 100644 --- a/drivers/analog/pga11x.c +++ b/drivers/analog/pga11x.c @@ -128,8 +128,8 @@ static void pga11x_configure(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, CONFIG_PGA11X_SPIMODE); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_PGA11X_SPIFREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_PGA11X_SPIFREQUENCY); } /**************************************************************************** diff --git a/drivers/audio/audio_null.c b/drivers/audio/audio_null.c index f8df9af60f..62c6862d8e 100644 --- a/drivers/audio/audio_null.c +++ b/drivers/audio/audio_null.c @@ -544,8 +544,8 @@ static int null_start(FAR struct audio_lowerhalf_s *dev) pthread_attr_init(&tattr); sparam.sched_priority = sched_get_priority_max(SCHED_FIFO) - 3; - (void)pthread_attr_setschedparam(&tattr, &sparam); - (void)pthread_attr_setstacksize(&tattr, CONFIG_AUDIO_NULL_WORKER_STACKSIZE); + pthread_attr_setschedparam(&tattr, &sparam); + pthread_attr_setstacksize(&tattr, CONFIG_AUDIO_NULL_WORKER_STACKSIZE); audinfo("Starting worker thread\n"); ret = pthread_create(&priv->threadid, &tattr, null_workerthread, @@ -590,8 +590,8 @@ static int null_stop(FAR struct audio_lowerhalf_s *dev) term_msg.msgId = AUDIO_MSG_STOP; term_msg.u.data = 0; - (void)nxmq_send(priv->mq, (FAR const char *)&term_msg, sizeof(term_msg), - CONFIG_AUDIO_NULL_MSG_PRIO); + nxmq_send(priv->mq, (FAR const char *)&term_msg, sizeof(term_msg), + CONFIG_AUDIO_NULL_MSG_PRIO); /* Join the worker thread */ diff --git a/drivers/audio/cs43l22.c b/drivers/audio/cs43l22.c index 2f1336bd27..75fa0f31c9 100644 --- a/drivers/audio/cs43l22.c +++ b/drivers/audio/cs43l22.c @@ -366,14 +366,7 @@ cs43l22_writereg(FAR struct cs43l22_dev_s *priv, uint8_t regaddr, static void cs43l22_takesem(sem_t * sem) { - int ret; - - do - { - ret = nxsem_wait(sem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /************************************************************************************ @@ -1182,8 +1175,8 @@ static int cs43l22_start(FAR struct audio_lowerhalf_s *dev) pthread_attr_init(&tattr); sparam.sched_priority = sched_get_priority_max(SCHED_FIFO) - 3; - (void)pthread_attr_setschedparam(&tattr, &sparam); - (void)pthread_attr_setstacksize(&tattr, CONFIG_CS43L22_WORKER_STACKSIZE); + pthread_attr_setschedparam(&tattr, &sparam); + pthread_attr_setstacksize(&tattr, CONFIG_CS43L22_WORKER_STACKSIZE); audinfo("Starting worker thread\n"); ret = pthread_create(&priv->threadid, &tattr, cs43l22_workerthread, @@ -1224,8 +1217,8 @@ static int cs43l22_stop(FAR struct audio_lowerhalf_s *dev) term_msg.msgId = AUDIO_MSG_STOP; term_msg.u.data = 0; - (void)nxmq_send(priv->mq, (FAR const char *)&term_msg, sizeof(term_msg), - CONFIG_CS43L22_MSG_PRIO); + nxmq_send(priv->mq, (FAR const char *)&term_msg, sizeof(term_msg), + CONFIG_CS43L22_MSG_PRIO); /* Join the worker thread */ diff --git a/drivers/audio/vs1053.c b/drivers/audio/vs1053.c index e71b57a7d1..cf4652bcdd 100644 --- a/drivers/audio/vs1053.c +++ b/drivers/audio/vs1053.c @@ -259,7 +259,7 @@ static void vs1053_spi_lock(FAR struct spi_dev_s *dev, unsigned long freq_mhz) * the SPI buss. We will retain that exclusive access until the bus is unlocked. */ - (void)SPI_LOCK(dev, true); + SPI_LOCK(dev, true); /* After locking the SPI bus, the we also need call the setfrequency, setbits, and * setmode methods to make sure that the SPI is properly configured for the device. @@ -269,8 +269,8 @@ static void vs1053_spi_lock(FAR struct spi_dev_s *dev, unsigned long freq_mhz) SPI_SETMODE(dev, CONFIG_VS1053_SPIMODE); SPI_SETBITS(dev, 8); - (void)SPI_HWFEATURES(dev, 0); - (void)SPI_SETFREQUENCY(dev, freq_mhz); + SPI_HWFEATURES(dev, 0); + SPI_SETFREQUENCY(dev, freq_mhz); } /************************************************************************************ @@ -279,7 +279,7 @@ static void vs1053_spi_lock(FAR struct spi_dev_s *dev, unsigned long freq_mhz) static inline void vs1053_spi_unlock(FAR struct spi_dev_s *dev) { - (void)SPI_LOCK(dev, false); + SPI_LOCK(dev, false); } /************************************************************************************ @@ -1009,7 +1009,7 @@ static void vs1053_feeddata(FAR struct vs1053_struct_s *dev) /* After at least 2052 bytes, we send an SM_CANCEL */ dev->hw_lower->disable(dev->hw_lower); /* Disable the DREQ interrupt */ - (void)SPI_SETFREQUENCY(dev->spi, dev->spi_freq); + SPI_SETFREQUENCY(dev->spi, dev->spi_freq); reg = vs1053_readreg(dev, VS1053_SCI_MODE); vs1053_writereg(dev, VS1053_SCI_MODE, reg | VS1053_SM_CANCEL); dev->hw_lower->enable(dev->hw_lower); /* Enable the DREQ interrupt */ @@ -1032,7 +1032,7 @@ static void vs1053_feeddata(FAR struct vs1053_struct_s *dev) if (!(vs1053_readreg(dev, VS1053_SCI_STATUS) & VS1053_SM_CANCEL)) { - (void)SPI_SETFREQUENCY(dev->spi, dev->spi_freq); + SPI_SETFREQUENCY(dev->spi, dev->spi_freq); dev->hw_lower->disable(dev->hw_lower); /* Disable the DREQ interrupt */ audinfo("HDAT1: 0x%0X HDAT0: 0x%0X\n", @@ -1092,9 +1092,9 @@ static void vs1053_feeddata(FAR struct vs1053_struct_s *dev) /* Read the VS1053 MODE register */ dev->hw_lower->disable(dev->hw_lower); /* Disable the DREQ interrupt */ - (void)SPI_SETFREQUENCY(dev->spi, dev->spi_freq); + SPI_SETFREQUENCY(dev->spi, dev->spi_freq); reg = vs1053_readreg(dev, VS1053_SCI_MODE); - (void)SPI_SETFREQUENCY(dev->spi, VS1053_DATA_FREQ); + SPI_SETFREQUENCY(dev->spi, VS1053_DATA_FREQ); dev->hw_lower->enable(dev->hw_lower); /* Enable the DREQ interrupt */ /* Check the SM_CANCEL bit */ @@ -1120,10 +1120,10 @@ static void vs1053_feeddata(FAR struct vs1053_struct_s *dev) /* This is the final buffer. Get the VS1053 endfillchar */ dev->hw_lower->disable(dev->hw_lower); /* Disable the DREQ interrupt */ - (void)SPI_SETFREQUENCY(dev->spi, dev->spi_freq); + SPI_SETFREQUENCY(dev->spi, dev->spi_freq); vs1053_writereg(dev, VS1053_SCI_WRAMADDR, VS1053_END_FILL_BYTE); dev->endfillchar = vs1053_readreg(dev, VS1053_SCI_WRAM) >> 8; - (void)SPI_SETFREQUENCY(dev->spi, VS1053_DATA_FREQ); + SPI_SETFREQUENCY(dev->spi, VS1053_DATA_FREQ); dev->hw_lower->enable(dev->hw_lower); /* Enable the DREQ interrupt */ /* Mark the device as endmode */ @@ -1223,8 +1223,8 @@ static int vs1053_dreq_isr(int irq, FAR void *context, FAR void *arg) if (dev->running) { msg.msgId = AUDIO_MSG_DATA_REQUEST; - (void)nxmq_send(dev->mq, (FAR const char *)&msg, sizeof(msg), - CONFIG_VS1053_MSG_PRIO); + nxmq_send(dev->mq, (FAR const char *)&msg, sizeof(msg), + CONFIG_VS1053_MSG_PRIO); } else { @@ -1472,8 +1472,8 @@ static int vs1053_start(FAR struct audio_lowerhalf_s *lower) pthread_attr_init(&tattr); sparam.sched_priority = sched_get_priority_max(SCHED_FIFO) - 3; - (void)pthread_attr_setschedparam(&tattr, &sparam); - (void)pthread_attr_setstacksize(&tattr, CONFIG_VS1053_WORKER_STACKSIZE); + pthread_attr_setschedparam(&tattr, &sparam); + pthread_attr_setstacksize(&tattr, CONFIG_VS1053_WORKER_STACKSIZE); audinfo("Starting workerthread\n"); ret = pthread_create(&dev->threadid, &tattr, vs1053_workerthread, @@ -1514,8 +1514,8 @@ static int vs1053_stop(FAR struct audio_lowerhalf_s *lower) term_msg.msgId = AUDIO_MSG_STOP; term_msg.u.data = 0; - (void)nxmq_send(dev->mq, (FAR const char *)&term_msg, sizeof(term_msg), - CONFIG_VS1053_MSG_PRIO); + nxmq_send(dev->mq, (FAR const char *)&term_msg, sizeof(term_msg), + CONFIG_VS1053_MSG_PRIO); /* Join the worker thread */ @@ -1628,8 +1628,8 @@ static int vs1053_enqueuebuffer(FAR struct audio_lowerhalf_s *lower, { term_msg.msgId = AUDIO_MSG_ENQUEUE; term_msg.u.data = 0; - (void)nxmq_send(dev->mq, (FAR const char *)&term_msg, - sizeof(term_msg), CONFIG_VS1053_MSG_PRIO); + nxmq_send(dev->mq, (FAR const char *)&term_msg, + sizeof(term_msg), CONFIG_VS1053_MSG_PRIO); } } diff --git a/drivers/audio/wm8776.c b/drivers/audio/wm8776.c index 72953632b4..0c0050b7c4 100644 --- a/drivers/audio/wm8776.c +++ b/drivers/audio/wm8776.c @@ -219,21 +219,7 @@ static void wm8776_writereg(FAR struct wm8776_dev_s *priv, static void wm8776_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /************************************************************************************ @@ -759,8 +745,8 @@ static int wm8776_start(FAR struct audio_lowerhalf_s *dev) pthread_attr_init(&tattr); sparam.sched_priority = sched_get_priority_max(SCHED_FIFO) - 3; - (void)pthread_attr_setschedparam(&tattr, &sparam); - (void)pthread_attr_setstacksize(&tattr, CONFIG_WM8776_WORKER_STACKSIZE); + pthread_attr_setschedparam(&tattr, &sparam); + pthread_attr_setstacksize(&tattr, CONFIG_WM8776_WORKER_STACKSIZE); audinfo("Starting worker thread\n"); ret = pthread_create(&priv->threadid, &tattr, wm8776_workerthread, @@ -1244,7 +1230,7 @@ repeat: break; } - (void)mq_getattr(priv->mq, &attr); + mq_getattr(priv->mq, &attr); /* If there is a message in the queue, process it */ diff --git a/drivers/audio/wm8904.c b/drivers/audio/wm8904.c index a087ee039b..2dabc13e5f 100644 --- a/drivers/audio/wm8904.c +++ b/drivers/audio/wm8904.c @@ -416,14 +416,7 @@ static void wm8904_writereg(FAR struct wm8904_dev_s *priv, uint8_t regaddr, static void wm8904_takesem(sem_t *sem) { - int ret; - - do - { - ret = nxsem_wait(sem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /************************************************************************************ @@ -1579,8 +1572,8 @@ static int wm8904_start(FAR struct audio_lowerhalf_s *dev) pthread_attr_init(&tattr); sparam.sched_priority = sched_get_priority_max(SCHED_FIFO) - 3; - (void)pthread_attr_setschedparam(&tattr, &sparam); - (void)pthread_attr_setstacksize(&tattr, CONFIG_WM8904_WORKER_STACKSIZE); + pthread_attr_setschedparam(&tattr, &sparam); + pthread_attr_setstacksize(&tattr, CONFIG_WM8904_WORKER_STACKSIZE); audinfo("Starting worker thread\n"); ret = pthread_create(&priv->threadid, &tattr, wm8904_workerthread, @@ -1621,8 +1614,8 @@ static int wm8904_stop(FAR struct audio_lowerhalf_s *dev) term_msg.msgId = AUDIO_MSG_STOP; term_msg.u.data = 0; - (void)nxmq_send(priv->mq, (FAR const char *)&term_msg, sizeof(term_msg), - CONFIG_WM8904_MSG_PRIO); + nxmq_send(priv->mq, (FAR const char *)&term_msg, sizeof(term_msg), + CONFIG_WM8904_MSG_PRIO); /* Join the worker thread */ diff --git a/drivers/bch/bchdev_driver.c b/drivers/bch/bchdev_driver.c index cb60d3cef9..a337a1524c 100644 --- a/drivers/bch/bchdev_driver.c +++ b/drivers/bch/bchdev_driver.c @@ -173,7 +173,7 @@ static int bch_close(FAR struct file *filep) /* Flush any dirty pages remaining in the cache */ bchlib_semtake(bch); - (void)bchlib_flushsector(bch); + bchlib_flushsector(bch); /* Decrement the reference count (I don't use bchlib_decref() because I * want the entire close operation to be atomic wrt other driver diff --git a/drivers/bch/bchdev_unregister.c b/drivers/bch/bchdev_unregister.c index 05e2123134..8a507d20ef 100644 --- a/drivers/bch/bchdev_unregister.c +++ b/drivers/bch/bchdev_unregister.c @@ -99,7 +99,7 @@ int bchdev_unregister(FAR const char *chardev) ret = file_ioctl(&filestruct, DIOC_GETPRIV, (unsigned long)((uintptr_t)&bch)); - (void)file_close(&filestruct); + file_close(&filestruct); if (ret < 0) { diff --git a/drivers/bch/bchlib_cache.c b/drivers/bch/bchlib_cache.c index 7999605836..a0b6b01ed7 100644 --- a/drivers/bch/bchlib_cache.c +++ b/drivers/bch/bchlib_cache.c @@ -181,7 +181,7 @@ int bchlib_readsector(FAR struct bchlib_s *bch, size_t sector) { inode = bch->inode; - (void)bchlib_flushsector(bch); + bchlib_flushsector(bch); bch->sector = (size_t)-1; ret = inode->u.i_bops->read(inode, bch->buffer, sector, 1); diff --git a/drivers/bch/bchlib_sem.c b/drivers/bch/bchlib_sem.c index b2b78bfcb5..3cdc308c7f 100644 --- a/drivers/bch/bchlib_sem.c +++ b/drivers/bch/bchlib_sem.c @@ -57,19 +57,5 @@ void bchlib_semtake(FAR struct bchlib_s *bch) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&bch->sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&bch->sem); } diff --git a/drivers/bch/bchlib_teardown.c b/drivers/bch/bchlib_teardown.c index 36229a9d5d..d46fb4c550 100644 --- a/drivers/bch/bchlib_teardown.c +++ b/drivers/bch/bchlib_teardown.c @@ -81,7 +81,7 @@ int bchlib_teardown(FAR void *handle) /* Close the block driver */ - (void)close_blockdriver(bch->inode); + close_blockdriver(bch->inode); /* Free the BCH state structure */ diff --git a/drivers/can/can.c b/drivers/can/can.c index 8cfb5d0d40..4556d5690c 100644 --- a/drivers/can/can.c +++ b/drivers/can/can.c @@ -177,18 +177,7 @@ static const struct file_operations g_canops = static int can_takesem(FAR sem_t *sem) { - int ret; - - /* Take a count from the semaphore, possibly waiting */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - return ret; + return nxsem_wait(sem); } /**************************************************************************** @@ -879,7 +868,7 @@ static ssize_t can_write(FAR struct file *filep, FAR const char *buffer, if (inactive) { - (void)can_xmit(dev); + can_xmit(dev); } /* Wait for a message to be sent */ @@ -922,7 +911,7 @@ static ssize_t can_write(FAR struct file *filep, FAR const char *buffer, if (inactive) { - (void)can_xmit(dev); + can_xmit(dev); } /* Return the number of bytes that were sent */ @@ -1494,7 +1483,7 @@ int can_txdone(FAR struct can_dev_s *dev) /* Send the next message in the FIFO */ - (void)can_xmit(dev); + can_xmit(dev); /* Are there any threads waiting for space in the TX FIFO? */ diff --git a/drivers/can/mcp2515.c b/drivers/can/mcp2515.c index 2f8879f7ed..487ab4bb8e 100644 --- a/drivers/can/mcp2515.c +++ b/drivers/can/mcp2515.c @@ -358,7 +358,7 @@ static void mcp2515_readregs(FAR struct mcp2515_can_s *priv, uint8_t regaddr, int i; #endif - (void)SPI_LOCK(config->spi, true); + SPI_LOCK(config->spi, true); /* Select the MCP2515 */ @@ -366,11 +366,11 @@ static void mcp2515_readregs(FAR struct mcp2515_can_s *priv, uint8_t regaddr, /* Send the READ command */ - (void)SPI_SEND(config->spi, MCP2515_READ); + SPI_SEND(config->spi, MCP2515_READ); /* Send register to read and get the next bytes read back */ - (void)SPI_SEND(config->spi, regaddr); + SPI_SEND(config->spi, regaddr); SPI_RECVBLOCK(config->spi, buffer, len); /* Deselect the MCP2515 */ @@ -379,7 +379,7 @@ static void mcp2515_readregs(FAR struct mcp2515_can_s *priv, uint8_t regaddr, /* Unlock bus */ - (void)SPI_LOCK(config->spi, false); + SPI_LOCK(config->spi, false); #ifdef CONFIG_CANBUS_REGDEBUG for (i = 0; i < len; i++) @@ -393,7 +393,7 @@ static void mcp2515_transfer(FAR struct mcp2515_can_s *priv, uint8_t len) { FAR struct mcp2515_config_s *config = priv->config; - (void)SPI_LOCK(config->spi, true); + SPI_LOCK(config->spi, true); /* Select the MCP2515 */ @@ -409,7 +409,7 @@ static void mcp2515_transfer(FAR struct mcp2515_can_s *priv, uint8_t len) /* Unlock bus */ - (void)SPI_LOCK(config->spi, false); + SPI_LOCK(config->spi, false); } /**************************************************************************** @@ -441,7 +441,7 @@ static void mcp2515_writeregs(FAR struct mcp2515_can_s *priv, uint8_t regaddr, } #endif - (void)SPI_LOCK(config->spi, true); + SPI_LOCK(config->spi, true); /* Select the MCP2515 */ @@ -449,11 +449,11 @@ static void mcp2515_writeregs(FAR struct mcp2515_can_s *priv, uint8_t regaddr, /* Send the READ command */ - (void)SPI_SEND(config->spi, MCP2515_WRITE); + SPI_SEND(config->spi, MCP2515_WRITE); /* Send initial register to be written */ - (void)SPI_SEND(config->spi, regaddr); + SPI_SEND(config->spi, regaddr); SPI_SNDBLOCK(config->spi, buffer, len); /* Deselect the MCP2515 */ @@ -462,7 +462,7 @@ static void mcp2515_writeregs(FAR struct mcp2515_can_s *priv, uint8_t regaddr, /* Unlock bus */ - (void)SPI_LOCK(config->spi, false); + SPI_LOCK(config->spi, false); } /**************************************************************************** @@ -490,7 +490,7 @@ static void mcp2515_modifyreg(FAR struct mcp2515_can_s *priv, uint8_t regaddr, MCP2515_BITMOD, regaddr, mask, value }; - (void)SPI_LOCK(config->spi, true); + SPI_LOCK(config->spi, true); /* Select the MCP2515 */ @@ -504,7 +504,7 @@ static void mcp2515_modifyreg(FAR struct mcp2515_can_s *priv, uint8_t regaddr, /* Unlock bus */ - (void)SPI_LOCK(config->spi, false); + SPI_LOCK(config->spi, false); } /**************************************************************************** @@ -546,19 +546,7 @@ static void mcp2515_dumpregs(FAR struct mcp2515_can_s *priv, static void mcp2515_dev_lock(FAR struct mcp2515_can_s *priv) { - int ret; - - /* Wait until we successfully get the semaphore. EINTR is the only - * expected 'failure' (meaning that the wait for the semaphore was - * interrupted by a signal. - */ - - do - { - ret = nxsem_wait(&priv->locksem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->locksem); } /**************************************************************************** @@ -1841,7 +1829,7 @@ static int mcp2515_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) * called from the tasking level. */ - (void)can_txdone(dev); + can_txdone(dev); return OK; } @@ -2280,7 +2268,7 @@ static int mcp2515_interrupt(FAR struct mcp2515_config_s *config, * data in mcp2515_send(). */ - (void)can_txready(dev); + can_txready(dev); #endif } else if ((pending & priv->txints) != 0) @@ -2510,7 +2498,7 @@ FAR struct mcp2515_can_s * SPI_SETFREQUENCY(config->spi, CONFIG_MCP2515_SPI_SCK_FREQUENCY); SPI_SETMODE(config->spi, MCP2515_SPI_MODE); SPI_SETBITS(config->spi, 8); - (void)SPI_HWFEATURES(config->spi, 0); + SPI_HWFEATURES(config->spi, 0); /* Perform one time data initialization */ diff --git a/drivers/contactless/mfrc522.c b/drivers/contactless/mfrc522.c index 835aeae13a..134459c5ce 100644 --- a/drivers/contactless/mfrc522.c +++ b/drivers/contactless/mfrc522.c @@ -139,17 +139,17 @@ static const struct file_operations g_mfrc522fops = static void mfrc522_lock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); SPI_SETMODE(spi, SPIDEV_MODE0); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_MFRC522_SPI_FREQ); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_MFRC522_SPI_FREQ); } static void mfrc522_unlock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } static inline void mfrc522_configspi(FAR struct spi_dev_s *spi) @@ -158,8 +158,8 @@ static inline void mfrc522_configspi(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, SPIDEV_MODE0); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_MFRC522_SPI_FREQ); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_MFRC522_SPI_FREQ); } static inline void mfrc522_select(struct mfrc522_dev_s *dev) @@ -1395,7 +1395,7 @@ int mfrc522_selftest(FAR struct mfrc522_dev_s *dev) { for (j = 0, k = 0; j < 8; j++, k += 3) { - (void)sprintf(&outbuf[k], " %02x", result[i + j]); + sprintf(&outbuf[k], " %02x", result[i + j]); } ctlsinfo(" %02x:%s\n", i, outbuf); @@ -1526,7 +1526,7 @@ static ssize_t mfrc522_write(FAR struct file *filep, FAR const char *buffer, DEBUGASSERT(inode && inode->i_private); dev = inode->i_private; - (void)dev; + UNUSED(dev); return -ENOSYS; } diff --git a/drivers/contactless/pn532.c b/drivers/contactless/pn532.c index 49ba4e5fe1..a81df33579 100644 --- a/drivers/contactless/pn532.c +++ b/drivers/contactless/pn532.c @@ -145,7 +145,7 @@ static void pn532_lock(FAR struct spi_dev_s *spi) { int ret; - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); SPI_SETMODE(spi, SPIDEV_MODE0); SPI_SETBITS(spi, 8); @@ -156,12 +156,12 @@ static void pn532_lock(FAR struct spi_dev_s *spi) ctlserr("ERROR: SPI_HWFEATURES failed to set bit order: %d\n", ret); } - (void)SPI_SETFREQUENCY(spi, CONFIG_PN532_SPI_FREQ); + SPI_SETFREQUENCY(spi, CONFIG_PN532_SPI_FREQ); } static void pn532_unlock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } static inline void pn532_configspi(FAR struct spi_dev_s *spi) @@ -179,7 +179,7 @@ static inline void pn532_configspi(FAR struct spi_dev_s *spi) ctlserr("ERROR: SPI_HWFEATURES failed to set bit order: %d\n", ret); } - (void)SPI_SETFREQUENCY(spi, CONFIG_PN532_SPI_FREQ); + SPI_SETFREQUENCY(spi, CONFIG_PN532_SPI_FREQ); } static inline void pn532_select(FAR struct pn532_dev_s *dev) @@ -316,7 +316,7 @@ static int pn532_wait_rx_ready(FAR struct pn532_dev_s *dev, int timeout) struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); ts.tv_sec += 1; - (void)nxsem_timedwait(dev->sem_rx, &ts); + nxsem_timedwait(dev->sem_rx, &ts); #endif /* TODO: Handle Exception bits 2, 3 */ @@ -848,9 +848,6 @@ static inline int (FAR struct pn532_dev_s *dev, xcpt_t isr) static int irq_handler(int irq, FAR void *context) { - (void)irq; - (void)context; - ctlsinfo("*IRQ*\n"); work_queue(HPWORK, &g_dev->irq_work, pn532_worker, dev, 0); @@ -973,7 +970,7 @@ static ssize_t _write(FAR struct file *filep, FAR const char *buffer, DEBUGASSERT(inode && inode->i_private); dev = inode->i_private; - (void) dev; + UNUSED(dev); return -ENOSYS; } diff --git a/drivers/crypto/dev_urandom.c b/drivers/crypto/dev_urandom.c index 67bc9b6529..fde163155c 100644 --- a/drivers/crypto/dev_urandom.c +++ b/drivers/crypto/dev_urandom.c @@ -344,7 +344,7 @@ void devurandom_register(void) g_prng.state.z = g_prng.state.x << 25; #endif - (void)register_driver("/dev/urandom", &g_urand_fops, 0666, NULL); + register_driver("/dev/urandom", &g_urand_fops, 0666, NULL); } #endif /* CONFIG_DEV_URANDOM && CONFIG_DEV_URANDOM_ARCH */ diff --git a/drivers/dev_null.c b/drivers/dev_null.c index 11e872f3b9..925fb11168 100644 --- a/drivers/dev_null.c +++ b/drivers/dev_null.c @@ -135,5 +135,5 @@ static int devnull_poll(FAR struct file *filep, FAR struct pollfd *fds, void devnull_register(void) { - (void)register_driver("/dev/null", &devnull_fops, 0666, NULL); + register_driver("/dev/null", &devnull_fops, 0666, NULL); } diff --git a/drivers/dev_zero.c b/drivers/dev_zero.c index d376371953..d8f1db39bb 100644 --- a/drivers/dev_zero.c +++ b/drivers/dev_zero.c @@ -136,5 +136,5 @@ static int devzero_poll(FAR struct file *filep, FAR struct pollfd *fds, void devzero_register(void) { - (void)register_driver("/dev/zero", &devzero_fops, 0666, NULL); + register_driver("/dev/zero", &devzero_fops, 0666, NULL); } diff --git a/drivers/eeprom/i2c_xx24xx.c b/drivers/eeprom/i2c_xx24xx.c index b6043847e1..d4f49ada2a 100644 --- a/drivers/eeprom/i2c_xx24xx.c +++ b/drivers/eeprom/i2c_xx24xx.c @@ -323,16 +323,7 @@ static int ee24xx_writepage(FAR struct ee24xx_dev_s *eedev, uint32_t memaddr, static void ee24xx_semtake(FAR struct ee24xx_dev_s *eedev) { - /* Take the semaphore (perhaps waiting) */ - - while (sem_wait(&eedev->sem) != 0) - { - /* The only case that an error should occur here is if - * the wait was awakened by a signal. - */ - - DEBUGASSERT(errno == EINTR || errno == ECANCELED); - } + nxsem_wait_uninterruptible(&eedev->sem); } /**************************************************************************** @@ -344,7 +335,7 @@ static void ee24xx_semtake(FAR struct ee24xx_dev_s *eedev) static inline void ee24xx_semgive(FAR struct ee24xx_dev_s *eedev) { - sem_post(&eedev->sem); + nxsem_post(&eedev->sem); } /**************************************************************************** @@ -770,11 +761,11 @@ static int ee24xx_ioctl(FAR struct file *filep, int cmd, unsigned long arg) DEBUGASSERT(inode && inode->i_private); eedev = (FAR struct ee24xx_dev_s *)inode->i_private; + UNUSED(eedev); switch (cmd) { default: - (void)eedev; ret = -EINVAL; } @@ -818,7 +809,7 @@ int ee24xx_initialize(FAR struct i2c_master_s *bus, uint8_t devaddr, return -ENOMEM; } - sem_init(&eedev->sem, 0, 1); + nxsem_init(&eedev->sem, 0, 1); eedev->freq = CONFIG_EE24XX_FREQUENCY; eedev->i2c = bus; diff --git a/drivers/eeprom/spi_xx25xx.c b/drivers/eeprom/spi_xx25xx.c index 3bbc74c825..ba5dd7c76e 100644 --- a/drivers/eeprom/spi_xx25xx.c +++ b/drivers/eeprom/spi_xx25xx.c @@ -277,7 +277,7 @@ static void ee25xx_lock(FAR struct spi_dev_s *dev) * bus is unlocked. */ - (void)SPI_LOCK(dev, true); + SPI_LOCK(dev, true); /* After locking the SPI bus, the we also need call the setfrequency, * setbits, and setmode methods to make sure that the SPI is properly @@ -287,8 +287,8 @@ static void ee25xx_lock(FAR struct spi_dev_s *dev) SPI_SETMODE(dev, CONFIG_EE25XX_SPIMODE); SPI_SETBITS(dev, 8); - (void)SPI_HWFEATURES(dev, 0); - (void)SPI_SETFREQUENCY(dev, CONFIG_EE25XX_FREQUENCY); + SPI_HWFEATURES(dev, 0); + SPI_SETFREQUENCY(dev, CONFIG_EE25XX_FREQUENCY); } /**************************************************************************** @@ -297,7 +297,7 @@ static void ee25xx_lock(FAR struct spi_dev_s *dev) static inline void ee25xx_unlock(FAR struct spi_dev_s *dev) { - (void)SPI_LOCK(dev, false); + SPI_LOCK(dev, false); } /**************************************************************************** @@ -361,7 +361,7 @@ static void ee25xx_waitwritecomplete(struct ee25xx_dev_s *priv) /* Send "Read Status Register (RDSR)" command */ - (void)SPI_SEND(priv->spi, EE25XX_CMD_RDSR); + SPI_SEND(priv->spi, EE25XX_CMD_RDSR); /* Send a dummy byte to generate the clock needed to shift out the * status @@ -439,21 +439,7 @@ static void ee25xx_writepage(FAR struct ee25xx_dev_s *eedev, uint32_t devaddr, static void ee25xx_semtake(FAR struct ee25xx_dev_s *eedev) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&eedev->sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&eedev->sem); } /**************************************************************************** @@ -760,11 +746,11 @@ static int ee25xx_ioctl(FAR struct file *filep, int cmd, unsigned long arg) DEBUGASSERT(inode && inode->i_private); eedev = (FAR struct ee25xx_dev_s *)inode->i_private; + UNUSED(eedev); switch (cmd) { default: - (void)eedev; ret = -EINVAL; } diff --git a/drivers/input/ads7843e.c b/drivers/input/ads7843e.c index 9ff3f9b10a..10cb5073b1 100644 --- a/drivers/input/ads7843e.c +++ b/drivers/input/ads7843e.c @@ -179,7 +179,7 @@ static void ads7843e_lock(FAR struct spi_dev_s *spi) * SPI bus */ - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); /* We have the lock. Now make sure that the SPI bus is configured for the * ADS7843 (it might have gotten configured for a different device while @@ -189,8 +189,8 @@ static void ads7843e_lock(FAR struct spi_dev_s *spi) SPI_SELECT(spi, SPIDEV_TOUCHSCREEN(0), true); SPI_SETMODE(spi, CONFIG_ADS7843E_SPIMODE); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_ADS7843E_FREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_ADS7843E_FREQUENCY); SPI_SELECT(spi, SPIDEV_TOUCHSCREEN(0), false); } @@ -215,7 +215,7 @@ static void ads7843e_unlock(FAR struct spi_dev_s *spi) { /* Relinquish the SPI bus. */ - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } /**************************************************************************** @@ -264,7 +264,7 @@ static uint16_t ads7843e_sendcmd(FAR struct ads7843e_dev_s *priv, uint8_t cmd) /* Send the command */ - (void)SPI_SEND(priv->spi, cmd); + SPI_SEND(priv->spi, cmd); /* Wait a tiny amount to make sure that the acquisition time is complete */ @@ -504,7 +504,7 @@ static int ads7843e_schedule(FAR struct ads7843e_dev_s *priv) static void ads7843e_wdog(int argc, uint32_t arg1, ...) { FAR struct ads7843e_dev_s *priv = (FAR struct ads7843e_dev_s *)((uintptr_t)arg1); - (void)ads7843e_schedule(priv); + ads7843e_schedule(priv); } /**************************************************************************** @@ -520,7 +520,6 @@ static void ads7843e_worker(FAR void *arg) uint16_t xdiff; uint16_t ydiff; bool pendown; - int ret; DEBUGASSERT(priv != NULL); @@ -543,17 +542,7 @@ static void ads7843e_worker(FAR void *arg) /* Get exclusive access to the driver data structure */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* This should only fail if the wait was canceled by an signal - * (and the worker thread will receive a lot of signals). - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Check for pen up or down by reading the PENIRQ GPIO. */ @@ -599,8 +588,8 @@ static void ads7843e_worker(FAR void *arg) * later. */ - (void)wd_start(priv->wdog, ADS7843E_WDOG_DELAY, ads7843e_wdog, 1, - (uint32_t)priv); + wd_start(priv->wdog, ADS7843E_WDOG_DELAY, ads7843e_wdog, 1, + (uint32_t)priv); goto ignored; } else @@ -682,7 +671,7 @@ ignored: /* Re-enable the PENIRQ interrupt at the ADS7843E */ - (void)ads7843e_sendcmd(priv, ADS7843_CMD_ENABPENIRQ); + ads7843e_sendcmd(priv, ADS7843_CMD_ENABPENIRQ); /* Re-enable the PENIRQ interrupt at the MCU's interrupt controller */ @@ -758,9 +747,6 @@ static int ads7843e_open(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -815,9 +801,6 @@ static int ads7843e_close(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -875,10 +858,7 @@ static ssize_t ads7843e_read(FAR struct file *filep, FAR char *buffer, size_t le ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - ierr("ERROR: nxsem_wait: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -988,9 +968,6 @@ static int ads7843e_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1047,9 +1024,6 @@ static int ads7843e_poll(FAR struct file *filep, FAR struct pollfd *fds, ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1216,7 +1190,7 @@ int ads7843e_register(FAR struct spi_dev_s *spi, /* Register the device as an input device */ - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); iinfo("Registering %s\n", devname); ret = register_driver(devname, &ads7843e_fops, 0666, priv); diff --git a/drivers/input/ajoystick.c b/drivers/input/ajoystick.c index 8a237adf72..cc68c58649 100644 --- a/drivers/input/ajoystick.c +++ b/drivers/input/ajoystick.c @@ -172,18 +172,7 @@ static const struct file_operations ajoy_fops = static inline int ajoy_takesem(sem_t *sem) { - int ret; - - /* Take a count from the semaphore, possibly waiting */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - return ret; + return nxsem_wait(sem); } /**************************************************************************** diff --git a/drivers/input/button_lower.c b/drivers/input/button_lower.c index b2b830f8f5..67dd99159d 100644 --- a/drivers/input/button_lower.c +++ b/drivers/input/button_lower.c @@ -159,7 +159,7 @@ static void btn_enable(FAR const struct btn_lowerhalf_s *lower, mask = (1 << id); if ((either & mask) != 0) { - (void)board_button_irq(id, btn_interrupt, NULL); + board_button_irq(id, btn_interrupt, NULL); } } } @@ -185,7 +185,7 @@ static void btn_disable(void) flags = enter_critical_section(); for (id = 0; id < NUM_BUTTONS; id++) { - (void)board_button_irq(id, NULL, NULL); + board_button_irq(id, NULL, NULL); } /* Nullify the handler and argument */ diff --git a/drivers/input/button_upper.c b/drivers/input/button_upper.c index 2c62ece45e..b756e3595d 100644 --- a/drivers/input/button_upper.c +++ b/drivers/input/button_upper.c @@ -168,18 +168,7 @@ static const struct file_operations btn_fops = static inline int btn_takesem(sem_t *sem) { - int ret; - - /* Take a count from the semaphore, possibly waiting */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - return ret; + return nxsem_wait(sem); } /**************************************************************************** diff --git a/drivers/input/cypress_mbr3108.c b/drivers/input/cypress_mbr3108.c index bebd408be3..6e888c1355 100644 --- a/drivers/input/cypress_mbr3108.c +++ b/drivers/input/cypress_mbr3108.c @@ -874,19 +874,7 @@ static int mbr3108_open(FAR struct file *filep) DEBUGASSERT(inode && inode->i_private); priv = inode->i_private; - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); use_count = priv->cref + 1; if (use_count == 1) @@ -910,7 +898,7 @@ static int mbr3108_open(FAR struct file *filep) { /* No such device. Power off the switch. */ - (void)priv->board->set_power(priv->board, false); + priv->board->set_power(priv->board, false); goto out_sem; } @@ -923,7 +911,7 @@ static int mbr3108_open(FAR struct file *filep) { /* Configuration failed. Power off the switch. */ - (void)priv->board->set_power(priv->board, false); + priv->board->set_power(priv->board, false); goto out_sem; } } @@ -948,7 +936,6 @@ static int mbr3108_close(FAR struct file *filep) FAR struct inode *inode; FAR struct mbr3108_dev_s *priv; int use_count; - int ret; DEBUGASSERT(filep); inode = filep->f_inode; @@ -956,19 +943,7 @@ static int mbr3108_close(FAR struct file *filep) DEBUGASSERT(inode && inode->i_private); priv = inode->i_private; - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); use_count = priv->cref - 1; if (use_count == 0) @@ -979,11 +954,11 @@ static int mbr3108_close(FAR struct file *filep) /* Set chip in low-power mode. */ - (void)mbr3108_enter_low_power_mode(priv); + mbr3108_enter_low_power_mode(priv); /* Last user, do power off. */ - (void)priv->board->set_power(priv->board, false); + priv->board->set_power(priv->board, false); priv->debug_conf.debug_mode = false; priv->cref = use_count; diff --git a/drivers/input/djoystick.c b/drivers/input/djoystick.c index 2d4d968768..0e28acc583 100644 --- a/drivers/input/djoystick.c +++ b/drivers/input/djoystick.c @@ -172,18 +172,7 @@ static const struct file_operations djoy_fops = static inline int djoy_takesem(sem_t *sem) { - int ret; - - /* Take a count from the semaphore, possibly waiting */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - return ret; + return nxsem_wait(sem); } /**************************************************************************** diff --git a/drivers/input/ft5x06.c b/drivers/input/ft5x06.c index 7dfb6b4513..fc39cacff5 100644 --- a/drivers/input/ft5x06.c +++ b/drivers/input/ft5x06.c @@ -276,12 +276,7 @@ static void ft5x06_data_worker(FAR void *arg) * corrupt any read operation that is in place. */ - do - { - ret = nxsem_wait(&priv->devsem); - DEBUGASSERT(ret >= 0 || ret == -EINTR); - } - while (ret < 0); + nxsem_wait_uninterruptible(&priv->devsem); /* Read touch data */ /* Set up the address write operation */ @@ -356,7 +351,7 @@ static void ft5x06_data_worker(FAR void *arg) #ifdef CONFIG_FT5X06_POLLMODE /* Exit, re-starting the poll. */ - (void)wd_start(priv->polltimer, priv->delay, ft5x06_poll_timeout, 1, priv); + wd_start(priv->polltimer, priv->delay, ft5x06_poll_timeout, 1, priv); #else /* Exit, re-enabling FT5x06 interrupts */ @@ -670,12 +665,7 @@ static ssize_t ft5x06_waitsample(FAR struct ft5x06_dev_s *priv, if (ret < 0) { - /* If we are awakened by a signal, then we need to return - * the failure now. - */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } } @@ -761,7 +751,7 @@ static void ft5x06_shutdown(FAR struct ft5x06_dev_s *priv) #ifdef CONFIG_FT5X06_POLLMODE /* Stop the poll timer */ - (void)wd_cancel(priv->polltimer); + wd_cancel(priv->polltimer); #else FAR const struct ft5x06_config_s *config = priv->config; @@ -795,10 +785,7 @@ static int ft5x06_open(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -857,10 +844,7 @@ static int ft5x06_close(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -921,10 +905,7 @@ static ssize_t ft5x06_read(FAR struct file *filep, FAR char *buffer, ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -984,10 +965,7 @@ static int ft5x06_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1044,10 +1022,7 @@ static int ft5x06_poll(FAR struct file *filep, FAR struct pollfd *fds, ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1214,7 +1189,7 @@ int ft5x06_register(FAR struct i2c_master_s *i2c, /* Register the device as an input device */ - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); iinfo("Registering %s\n", devname); ret = register_driver(devname, &ft5x06_fops, 0666, priv); @@ -1241,7 +1216,7 @@ int ft5x06_register(FAR struct i2c_master_s *i2c, errout_with_timer: #ifdef CONFIG_FT5X06_POLLMODE - (void)wd_delete(priv->polltimer); + wd_delete(priv->polltimer); errout_with_priv: #endif diff --git a/drivers/input/max11802.c b/drivers/input/max11802.c index bfc32cc6e7..68a65a2f0c 100644 --- a/drivers/input/max11802.c +++ b/drivers/input/max11802.c @@ -178,7 +178,7 @@ static void max11802_lock(FAR struct spi_dev_s *spi) * SPI bus */ - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); /* We have the lock. Now make sure that the SPI bus is configured for the * MAX11802 (it might have gotten configured for a different device while @@ -187,8 +187,8 @@ static void max11802_lock(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, CONFIG_MAX11802_SPIMODE); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_MAX11802_FREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_MAX11802_FREQUENCY); } /**************************************************************************** @@ -212,7 +212,7 @@ static void max11802_unlock(FAR struct spi_dev_s *spi) { /* Relinquish the SPI bus. */ - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } /**************************************************************************** @@ -231,7 +231,7 @@ static uint16_t max11802_sendcmd(FAR struct max11802_dev_s *priv, /* Send the command */ - (void)SPI_SEND(priv->spi, cmd); + SPI_SEND(priv->spi, cmd); /* Read the data */ @@ -382,12 +382,7 @@ static int max11802_waitsample(FAR struct max11802_dev_s *priv, if (ret < 0) { - /* If we are awakened by a signal, then we need to return - * the failure now. - */ - ierr("ERROR: nxsem_wait: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } } @@ -469,7 +464,7 @@ static int max11802_schedule(FAR struct max11802_dev_s *priv) static void max11802_wdog(int argc, uint32_t arg1, ...) { FAR struct max11802_dev_s *priv = (FAR struct max11802_dev_s *)((uintptr_t)arg1); - (void)max11802_schedule(priv); + max11802_schedule(priv); } /**************************************************************************** @@ -485,7 +480,6 @@ static void max11802_worker(FAR void *arg) uint16_t xdiff; uint16_t ydiff; bool pendown; - int ret; int tags, tags2; DEBUGASSERT(priv != NULL); @@ -509,21 +503,11 @@ static void max11802_worker(FAR void *arg) /* Start coordinate measurement */ - (void)max11802_sendcmd(priv, MAX11802_CMD_MEASUREXY, &tags); + max11802_sendcmd(priv, MAX11802_CMD_MEASUREXY, &tags); /* Get exclusive access to the driver data structure */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* This should only fail if the wait was cancelled by an signal - * (and the worker thread will receive a lot of signals). - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Check for pen up or down by reading the PENIRQ GPIO. */ @@ -584,8 +568,8 @@ static void max11802_worker(FAR void *arg) iinfo("Previous pen up event still in buffer\n"); max11802_notify(priv); - (void)wd_start(priv->wdog, MAX11802_WDOG_DELAY, max11802_wdog, 1, - (uint32_t)priv); + wd_start(priv->wdog, MAX11802_WDOG_DELAY, max11802_wdog, 1, + (uint32_t)priv); goto ignored; } else @@ -624,8 +608,8 @@ static void max11802_worker(FAR void *arg) /* Continue to sample the position while the pen is down */ - (void)wd_start(priv->wdog, MAX11802_WDOG_DELAY, max11802_wdog, 1, - (uint32_t)priv); + wd_start(priv->wdog, MAX11802_WDOG_DELAY, max11802_wdog, 1, + (uint32_t)priv); /* Check if data is valid */ @@ -763,9 +747,6 @@ static int max11802_open(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -820,9 +801,6 @@ static int max11802_close(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -881,10 +859,7 @@ static ssize_t max11802_read(FAR struct file *filep, FAR char *buffer, ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - ierr("ERROR: nxsem_wait: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -994,9 +969,6 @@ static int max11802_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1053,9 +1025,6 @@ static int max11802_poll(FAR struct file *filep, FAR struct pollfd *fds, ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1215,39 +1184,39 @@ int max11802_register(FAR struct spi_dev_s *spi, /* Configure MAX11802 registers */ SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), true); - (void)SPI_SEND(priv->spi, MAX11802_CMD_MODE_WR); - (void)SPI_SEND(priv->spi, MAX11802_MODE); + SPI_SEND(priv->spi, MAX11802_CMD_MODE_WR); + SPI_SEND(priv->spi, MAX11802_MODE); SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), false); SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), true); - (void)SPI_SEND(priv->spi, MAX11802_CMD_AVG_WR); - (void)SPI_SEND(priv->spi, MAX11802_AVG); + SPI_SEND(priv->spi, MAX11802_CMD_AVG_WR); + SPI_SEND(priv->spi, MAX11802_AVG); SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), false); SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), true); - (void)SPI_SEND(priv->spi, MAX11802_CMD_SAMPLE_WR); - (void)SPI_SEND(priv->spi, MAX11802_SAMPLE); + SPI_SEND(priv->spi, MAX11802_CMD_SAMPLE_WR); + SPI_SEND(priv->spi, MAX11802_SAMPLE); SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), false); SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), true); - (void)SPI_SEND(priv->spi, MAX11802_CMD_TIMING_WR); - (void)SPI_SEND(priv->spi, MAX11802_TIMING); + SPI_SEND(priv->spi, MAX11802_CMD_TIMING_WR); + SPI_SEND(priv->spi, MAX11802_TIMING); SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), false); SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), true); - (void)SPI_SEND(priv->spi, MAX11802_CMD_DELAY_WR); - (void)SPI_SEND(priv->spi, MAX11802_DELAY); + SPI_SEND(priv->spi, MAX11802_CMD_DELAY_WR); + SPI_SEND(priv->spi, MAX11802_DELAY); SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), false); SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), true); - (void)SPI_SEND(priv->spi, MAX11802_CMD_PULL_WR); - (void)SPI_SEND(priv->spi, MAX11802_PULL); + SPI_SEND(priv->spi, MAX11802_CMD_PULL_WR); + SPI_SEND(priv->spi, MAX11802_PULL); SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), false); /* Test that the device access was successful. */ SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), true); - (void)SPI_SEND(priv->spi, MAX11802_CMD_MODE_RD); + SPI_SEND(priv->spi, MAX11802_CMD_MODE_RD); ret = SPI_SEND(priv->spi, 0); SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN(0), false); @@ -1263,7 +1232,7 @@ int max11802_register(FAR struct spi_dev_s *spi, /* Register the device as an input device */ - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); iinfo("Registering %s\n", devname); ret = register_driver(devname, &max11802_fops, 0666, priv); diff --git a/drivers/input/mxt.c b/drivers/input/mxt.c index b2a656518f..1d8151403b 100644 --- a/drivers/input/mxt.c +++ b/drivers/input/mxt.c @@ -704,11 +704,6 @@ static inline int mxt_waitsample(FAR struct mxt_dev_s *priv) if (ret < 0) { - /* If we are awakened by a signal, then we need to return - * the failure now. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } } @@ -989,12 +984,7 @@ static void mxt_worker(FAR void *arg) /* Get exclusive access to the MXT driver data structure */ - do - { - ret = nxsem_wait(&priv->devsem); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Loop, processing each message from the maXTouch */ @@ -1136,9 +1126,6 @@ static int mxt_open(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1217,9 +1204,6 @@ static int mxt_close(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1288,9 +1272,6 @@ static ssize_t mxt_read(FAR struct file *filep, FAR char *buffer, size_t len) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1510,9 +1491,6 @@ static int mxt_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1570,9 +1548,6 @@ static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds, ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1927,7 +1902,7 @@ int mxt_register(FAR struct i2c_master_s *i2c, /* Register the device as an input device */ - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); iinfo("Registering %s\n", devname); ret = register_driver(devname, &mxt_fops, 0666, priv); diff --git a/drivers/input/nunchuck.c b/drivers/input/nunchuck.c index 92a9447029..9b135609b1 100644 --- a/drivers/input/nunchuck.c +++ b/drivers/input/nunchuck.c @@ -289,18 +289,7 @@ static int nunchuck_sample(FAR struct nunchuck_dev_s *priv, static inline int nunchuck_takesem(sem_t *sem) { - int ret; - - /* Take a count from the semaphore, possibly waiting */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - return ret; + return nxsem_wait(sem); } /**************************************************************************** diff --git a/drivers/input/stmpe811_tsc.c b/drivers/input/stmpe811_tsc.c index b9ededff8b..1bdc453445 100644 --- a/drivers/input/stmpe811_tsc.c +++ b/drivers/input/stmpe811_tsc.c @@ -299,12 +299,7 @@ static inline int stmpe811_waitsample(FAR struct stmpe811_dev_s *priv, if (ret < 0) { - /* If we are awakened by a signal, then we need to return - * the failure now. - */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } } @@ -354,10 +349,7 @@ static int stmpe811_open(FAR struct file *filep) ret = nxsem_wait(&priv->exclsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -414,10 +406,7 @@ static int stmpe811_close(FAR struct file *filep) ret = nxsem_wait(&priv->exclsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -477,10 +466,7 @@ static ssize_t stmpe811_read(FAR struct file *filep, FAR char *buffer, size_t le ret = nxsem_wait(&priv->exclsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -592,10 +578,7 @@ static int stmpe811_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = nxsem_wait(&priv->exclsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -659,7 +642,6 @@ static int stmpe811_poll(FAR struct file *filep, FAR struct pollfd *fds, /* This should only happen if the wait was canceled by an signal */ ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -898,7 +880,6 @@ int stmpe811_register(STMPE811_HANDLE handle, int minor) if (ret < 0) { ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -973,7 +954,7 @@ void stmpe811_tscworker(FAR struct stmpe811_dev_s *priv, uint8_t intsta) /* Cancel the missing pen up timer */ - (void)wd_cancel(priv->wdog); + wd_cancel(priv->wdog); /* Check for pen up or down from the TSC_STA ibit n the STMPE811_TSC_CTRL register. */ @@ -1113,8 +1094,8 @@ ignored: if (priv->sample.contact == CONTACT_DOWN || priv->sample.contact == CONTACT_MOVE) { - (void)wd_start(priv->wdog, STMPE811_PENUP_TICKS, stmpe811_timeout, - 1, (uint32_t)((uintptr_t)priv)); + wd_start(priv->wdog, STMPE811_PENUP_TICKS, stmpe811_timeout, + 1, (uint32_t)((uintptr_t)priv)); } /* Reset and clear all data in the FIFO */ diff --git a/drivers/input/tsc2007.c b/drivers/input/tsc2007.c index b65dfefeaa..3b99fe4fc6 100644 --- a/drivers/input/tsc2007.c +++ b/drivers/input/tsc2007.c @@ -373,12 +373,7 @@ static int tsc2007_waitsample(FAR struct tsc2007_dev_s *priv, if (ret < 0) { - /* If we are awakened by a signal, then we need to return - * the failure now. - */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } } @@ -433,7 +428,7 @@ static int tsc2007_activate(FAR struct tsc2007_dev_s *priv, uint8_t cmd) /* Ignore errors from the setup command (because it is not ACKed) */ - (void)I2C_TRANSFER(priv->i2c, &msg, 1); + I2C_TRANSFER(priv->i2c, &msg, 1); /* Now activate the A/D converter */ @@ -620,7 +615,7 @@ static void tsc2007_worker(FAR void *arg) * in the cases previously listed." */ - (void)tsc2007_activate(priv, TSC2007_ACTIVATE_X); + tsc2007_activate(priv, TSC2007_ACTIVATE_X); y = tsc2007_transfer(priv, TSC2007_MEASURE_Y); @@ -629,7 +624,7 @@ static void tsc2007_worker(FAR void *arg) * process provides the X and Y coordinates to the associated processor." */ - (void)tsc2007_activate(priv, TSC2007_ACTIVATE_Y); + tsc2007_activate(priv, TSC2007_ACTIVATE_Y); x = tsc2007_transfer(priv, TSC2007_MEASURE_X); /* "... To determine pen or finger touch, the pressure of the touch must be @@ -648,14 +643,14 @@ static void tsc2007_worker(FAR void *arg) * Read Z1 and Z2 values. */ - (void)tsc2007_activate(priv, TSC2007_ACTIVATE_Z); + tsc2007_activate(priv, TSC2007_ACTIVATE_Z); z1 = tsc2007_transfer(priv, TSC2007_MEASURE_Z1); - (void)tsc2007_activate(priv, TSC2007_ACTIVATE_Z); + tsc2007_activate(priv, TSC2007_ACTIVATE_Z); z2 = tsc2007_transfer(priv, TSC2007_MEASURE_Z2); /* Power down ADC and enable PENIRQ */ - (void)tsc2007_transfer(priv, TSC2007_ENABLE_PENIRQ); + tsc2007_transfer(priv, TSC2007_ENABLE_PENIRQ); /* Now calculate the pressure using the first method, reduced to: * @@ -809,10 +804,7 @@ static int tsc2007_open(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -865,10 +857,7 @@ static int tsc2007_close(FAR struct file *filep) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -923,10 +912,7 @@ static ssize_t tsc2007_read(FAR struct file *filep, FAR char *buffer, size_t len ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1040,10 +1026,7 @@ static int tsc2007_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1116,10 +1099,7 @@ static int tsc2007_poll(FAR struct file *filep, FAR struct pollfd *fds, ret = nxsem_wait(&priv->devsem); if (ret < 0) { - /* This should only happen if the wait was cancelled by an signal */ - ierr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1282,7 +1262,7 @@ int tsc2007_register(FAR struct i2c_master_s *dev, /* Register the device as an input device */ - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor); iinfo("Registering %s\n", devname); ret = register_driver(devname, &tsc2007_fops, 0666, priv); diff --git a/drivers/ioexpander/gpio.c b/drivers/ioexpander/gpio.c index 8523be6696..864e4d75e5 100644 --- a/drivers/ioexpander/gpio.c +++ b/drivers/ioexpander/gpio.c @@ -627,7 +627,7 @@ void gpio_pin_unregister(FAR struct gpio_dev_s *dev, int minor) snprintf(devname, 16, fmt, (unsigned int)minor); gpioinfo("Unregistering %s\n", devname); - (void)unregister_driver(devname); + unregister_driver(devname); } #endif /* CONFIG_DEV_GPIO */ diff --git a/drivers/ioexpander/gpio_lower_half.c b/drivers/ioexpander/gpio_lower_half.c index ebacfeed51..7b3ead8249 100644 --- a/drivers/ioexpander/gpio_lower_half.c +++ b/drivers/ioexpander/gpio_lower_half.c @@ -222,7 +222,7 @@ static int gplh_attach(FAR struct gpio_dev_s *gpio, pin_interrupt_t callback) if (priv->handle != NULL) { gpioinfo("pin%u: Detaching handle %p\n", priv->pin, priv->handle); - (void)IOEP_DETACH(priv->ioe, priv->handle); + IOEP_DETACH(priv->ioe, priv->handle); priv->handle = NULL; } diff --git a/drivers/ioexpander/pca9555.c b/drivers/ioexpander/pca9555.c index f7a1bd9d6f..0c3174a2f8 100644 --- a/drivers/ioexpander/pca9555.c +++ b/drivers/ioexpander/pca9555.c @@ -150,21 +150,7 @@ static const struct ioexpander_ops_s g_pca9555_ops = static void pca9555_lock(FAR struct pca9555_dev_s *pca) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&pca->exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&pca->exclsem); } #define pca9555_unlock(p) nxsem_post(&(p)->exclsem) @@ -847,8 +833,8 @@ static void pca9555_irqworker(void *arg) { /* Yes.. perform the callback */ - (void)pca->cb[i].cbfunc(&pca->dev, match, - pca->cb[i].cbarg); + pca->cb[i].cbfunc(&pca->dev, match, + pca->cb[i].cbarg); } } } diff --git a/drivers/ioexpander/pcf8574.c b/drivers/ioexpander/pcf8574.c index ba8bca8c1f..54653e6cf7 100644 --- a/drivers/ioexpander/pcf8574.c +++ b/drivers/ioexpander/pcf8574.c @@ -154,21 +154,7 @@ static const struct ioexpander_ops_s g_pcf8574_ops = static void pcf8574_lock(FAR struct pcf8574_dev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); } #define pcf8574_unlock(p) nxsem_post(&(p)->exclsem) @@ -944,8 +930,8 @@ static void pcf8574_irqworker(void *arg) { /* Yes.. perform the callback */ - (void)priv->cb[i].cbfunc(&priv->dev, match, - priv->cb[i].cbarg); + priv->cb[i].cbfunc(&priv->dev, match, + priv->cb[i].cbarg); } } } @@ -1007,7 +993,7 @@ static void pcf8574_interrupt(FAR void *arg) #ifdef CONFIG_PCF8574_INT_POLL /* Cancel the poll timer */ - (void)wd_cancel(priv->wdog); + wd_cancel(priv->wdog); #endif /* Disable interrupts */ diff --git a/drivers/ioexpander/skeleton.c b/drivers/ioexpander/skeleton.c index 2dda5a219a..8469dd91e8 100644 --- a/drivers/ioexpander/skeleton.c +++ b/drivers/ioexpander/skeleton.c @@ -168,21 +168,7 @@ static const struct ioexpander_ops_s g_skel_ops = static void skel_lock(FAR struct skel_dev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); } #define skel_unlock(p) nxsem_post(&(p)->exclsem) @@ -654,7 +640,7 @@ static void skel_irqworker(void *arg) { /* Yes.. perform the callback */ - (void)priv->cb[i].cbfunc(&priv->dev, match); + priv->cb[i].cbfunc(&priv->dev, match); } } } diff --git a/drivers/ioexpander/tca64xx.c b/drivers/ioexpander/tca64xx.c index a339dfec03..8aea715563 100644 --- a/drivers/ioexpander/tca64xx.c +++ b/drivers/ioexpander/tca64xx.c @@ -197,21 +197,7 @@ static const struct tca64_part_s g_tca64_parts[TCA64_NPARTS] = static void tca64_lock(FAR struct tca64_dev_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); } #define tca64_unlock(p) nxsem_post(&(p)->exclsem) @@ -1215,8 +1201,8 @@ static void tca64_irqworker(void *arg) { /* Yes.. perform the callback */ - (void)priv->cb[i].cbfunc(&priv->dev, match, - priv->cb[i].cbarg); + priv->cb[i].cbfunc(&priv->dev, match, + priv->cb[i].cbarg); } } } @@ -1280,7 +1266,7 @@ static void tca64_interrupt(FAR void *arg) #ifdef CONFIG_TCA64XX_INT_POLL /* Cancel the poll timer */ - (void)wd_cancel(priv->wdog); + wd_cancel(priv->wdog); #endif /* Disable interrupts */ diff --git a/drivers/lcd/ft80x.c b/drivers/lcd/ft80x.c index 6850e200f1..78ffd71d48 100644 --- a/drivers/lcd/ft80x.c +++ b/drivers/lcd/ft80x.c @@ -209,7 +209,7 @@ static int ft80x_fade(FAR struct ft80x_dev_s *priv, { /* Wait for FADE_STEP_MSEC msec (or whatever we get) */ - (void)nxsig_usleep(FADE_STEP_MSEC * 1000); + nxsig_usleep(FADE_STEP_MSEC * 1000); /* Get the elapsed time */ @@ -290,18 +290,12 @@ static void ft80x_interrupt_work(FAR void *arg) FAR struct ft80x_dev_s *priv = (FAR struct ft80x_dev_s *)arg; uint32_t intflags; uint32_t regval; - int ret; DEBUGASSERT(priv != NULL); /* Get exclusive access to the device structures */ - do - { - ret = nxsem_wait(&priv->exclsem); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret < 0); + nxsem_wait_uninterruptible(&priv->exclsem); /* Get the set of pending interrupts. Note that simply reading this * register is sufficient to clear all pending interrupts. @@ -444,7 +438,7 @@ static void ft80x_destroy(FAR struct ft80x_dev_s *priv) /* Then free our container */ - sem_destroy(&priv->exclsem); + nxsem_destroy(&priv->exclsem); kmm_free(priv); } #endif @@ -1539,7 +1533,7 @@ int ft80x_register(FAR struct i2c_master_s *i2c, /* Initialize the mutual exclusion semaphore */ - sem_init(&priv->exclsem, 0, 1); + nxsem_init(&priv->exclsem, 0, 1); /* Initialize the FT80x */ @@ -1582,7 +1576,7 @@ errout_with_interrupts: lower->attach(lower, NULL, NULL); errout_with_sem: - sem_destroy(&priv->exclsem); + nxsem_destroy(&priv->exclsem); return ret; } diff --git a/drivers/lcd/ft80x_spi.c b/drivers/lcd/ft80x_spi.c index d1521ca734..04f6956c2c 100644 --- a/drivers/lcd/ft80x_spi.c +++ b/drivers/lcd/ft80x_spi.c @@ -70,14 +70,14 @@ static void ft80x_select(FAR struct ft80x_dev_s *priv) /* Lock the SPI bus */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); /* Configure SPI for the FT80X */ SPI_SETMODE(priv->spi, SPIDEV_MODE0); SPI_SETBITS(priv->spi, 8); - (void)SPI_HWFEATURES(priv->spi, 0); - (void)SPI_SETFREQUENCY(priv->spi, priv->frequency); + SPI_HWFEATURES(priv->spi, 0); + SPI_SETFREQUENCY(priv->spi, priv->frequency); /* Select SPI device */ @@ -100,7 +100,7 @@ static void ft80x_deselect(FAR struct ft80x_dev_s *priv) /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); } /**************************************************************************** diff --git a/drivers/lcd/lcd_framebuffer.c b/drivers/lcd/lcd_framebuffer.c index b3ee46bdb6..184a09734f 100644 --- a/drivers/lcd/lcd_framebuffer.c +++ b/drivers/lcd/lcd_framebuffer.c @@ -589,7 +589,7 @@ int up_fbinitialize(int display) /* Turn the LCD on at 75% power */ - (void)priv->lcd->setpower(priv->lcd, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); + priv->lcd->setpower(priv->lcd, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); return OK; errout_with_lcd: diff --git a/drivers/lcd/max7219.c b/drivers/lcd/max7219.c index f80d1e7731..68a674a7ec 100644 --- a/drivers/lcd/max7219.c +++ b/drivers/lcd/max7219.c @@ -367,8 +367,8 @@ static void max7219_select(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, SPIDEV_MODE0); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_MAX7219_FREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_MAX7219_FREQUENCY); } /**************************************************************************** @@ -516,7 +516,7 @@ static int max7219_putrun(fb_coord_t row, fb_coord_t col, /* Then transfer all 8 columns of data */ - (void)SPI_SNDBLOCK(priv->spi, &data, 2); + SPI_SNDBLOCK(priv->spi, &data, 2); } /* Unlock */ @@ -706,7 +706,7 @@ static int max7219_setpower(struct lcd_dev_s *dev, int power) /* Turn the display off (power-down) */ - (void)SPI_SNDBLOCK(priv->spi, &data, 2); + SPI_SNDBLOCK(priv->spi, &data, 2); priv->powered = MAX7219_POWER_OFF; } @@ -716,7 +716,7 @@ static int max7219_setpower(struct lcd_dev_s *dev, int power) /* Leave the power-down */ - (void)SPI_SNDBLOCK(priv->spi, &data, 2); + SPI_SNDBLOCK(priv->spi, &data, 2); priv->powered = MAX7219_POWER_ON; } @@ -778,7 +778,7 @@ static int max7219_setcontrast(struct lcd_dev_s *dev, unsigned int contrast) /* Set the contrast */ - (void)SPI_SNDBLOCK(priv->spi, &data, 2); + SPI_SNDBLOCK(priv->spi, &data, 2); /* Let go of the SPI lock and de-select the device */ @@ -819,7 +819,7 @@ static inline void up_clear(FAR struct max7219_dev_s *priv) /* Then transfer all 8 columns of data */ - (void)SPI_SNDBLOCK(priv->spi, &data, 2); + SPI_SNDBLOCK(priv->spi, &data, 2); /* Unlock and de-select the device */ @@ -870,7 +870,7 @@ FAR struct lcd_dev_s *max7219_initialize(FAR struct spi_dev_s *spi, data = (MAX7219_SHUTDOWN) | (MAX7219_POWER_ON << 8); - (void)SPI_SNDBLOCK(priv->spi, &data, 2); + SPI_SNDBLOCK(priv->spi, &data, 2); max7219_deselect(spi); @@ -880,7 +880,7 @@ FAR struct lcd_dev_s *max7219_initialize(FAR struct spi_dev_s *spi, data = (MAX7219_DECODE_MODE) | (DISABLE_DECODE << 8); - (void)SPI_SNDBLOCK(priv->spi, &data, 2); + SPI_SNDBLOCK(priv->spi, &data, 2); max7219_deselect(spi); @@ -890,7 +890,7 @@ FAR struct lcd_dev_s *max7219_initialize(FAR struct spi_dev_s *spi, data = (MAX7219_SCAN_LIMIT) | (DEFAULT_SCAN_LIMIT << 8); - (void)SPI_SNDBLOCK(priv->spi, &data, 2); + SPI_SNDBLOCK(priv->spi, &data, 2); max7219_deselect(spi); @@ -900,7 +900,7 @@ FAR struct lcd_dev_s *max7219_initialize(FAR struct spi_dev_s *spi, data = (MAX7219_INTENSITY) | (DISPLAY_INTENSITY(CONFIG_LCD_MAXCONTRAST) << 8); - (void)SPI_SNDBLOCK(priv->spi, &data, 2); + SPI_SNDBLOCK(priv->spi, &data, 2); /* Let go of the SPI lock and de-select the device */ diff --git a/drivers/lcd/memlcd.c b/drivers/lcd/memlcd.c index c70b7f24a8..e09d299f66 100644 --- a/drivers/lcd/memlcd.c +++ b/drivers/lcd/memlcd.c @@ -301,9 +301,9 @@ static void memlcd_select(FAR struct spi_dev_s *spi) } #ifdef CONFIG_MEMLCD_SPI_FREQUENCY - (void)SPI_SETFREQUENCY(spi, CONFIG_MEMLCD_SPI_FREQUENCY); + SPI_SETFREQUENCY(spi, CONFIG_MEMLCD_SPI_FREQUENCY); #else - (void)SPI_SETFREQUENCY(spi, MEMLCD_SPI_FREQUENCY); + SPI_SETFREQUENCY(spi, MEMLCD_SPI_FREQUENCY); #endif } diff --git a/drivers/lcd/p14201.c b/drivers/lcd/p14201.c index 87f48d94b7..a5f0a3b7ad 100644 --- a/drivers/lcd/p14201.c +++ b/drivers/lcd/p14201.c @@ -451,9 +451,9 @@ static void rit_select(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, CONFIG_P14201_SPIMODE); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); + SPI_HWFEATURES(spi, 0); #ifdef CONFIG_P14201_FREQUENCY - (void)SPI_SETFREQUENCY(spi, CONFIG_P14201_FREQUENCY); + SPI_SETFREQUENCY(spi, CONFIG_P14201_FREQUENCY); #endif } @@ -512,7 +512,7 @@ static void rit_sndbytes(FAR struct rit_dev_s *priv, FAR const uint8_t *buffer, /* Clear/set the D/Cn bit to enable command or data mode */ - (void)SPI_CMDDATA(spi, SPIDEV_DISPLAY(0), cmd); + SPI_CMDDATA(spi, SPIDEV_DISPLAY(0), cmd); /* Loop until the entire command/data block is transferred */ @@ -521,7 +521,7 @@ static void rit_sndbytes(FAR struct rit_dev_s *priv, FAR const uint8_t *buffer, /* Write the next byte to the controller */ tmp = *buffer++; - (void)SPI_SEND(spi, tmp); + SPI_SEND(spi, tmp); } } diff --git a/drivers/lcd/pcd8544.c b/drivers/lcd/pcd8544.c index a437a86b0b..b68a6c99a7 100644 --- a/drivers/lcd/pcd8544.c +++ b/drivers/lcd/pcd8544.c @@ -392,8 +392,8 @@ static void pcd8544_select(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, CONFIG_PCD8544_SPIMODE); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_PCD8544_FREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_PCD8544_FREQUENCY); } /************************************************************************************** @@ -551,8 +551,8 @@ static int pcd8544_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buf /* Set the starting position for the run */ - (void)SPI_SEND(priv->spi, PCD8544_SET_Y_ADDR+page); /* Set the page start */ - (void)SPI_SEND(priv->spi, PCD8544_SET_X_ADDR + (col & 0x7f)); /* Set the low column */ + SPI_SEND(priv->spi, PCD8544_SET_Y_ADDR+page); /* Set the page start */ + SPI_SEND(priv->spi, PCD8544_SET_X_ADDR + (col & 0x7f)); /* Set the low column */ /* Select data transfer */ @@ -560,7 +560,7 @@ static int pcd8544_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buf /* Then transfer all of the data */ - (void)SPI_SNDBLOCK(priv->spi, fbptr, pixlen); + SPI_SNDBLOCK(priv->spi, fbptr, pixlen); /* Unlock and de-select the device */ @@ -775,7 +775,7 @@ static int pcd8544_setpower(struct lcd_dev_s *dev, int power) { /* Turn the display off (power-down) */ - (void)SPI_SEND(priv->spi, (PCD8544_FUNC_SET | PCD8544_POWER_DOWN)); + SPI_SEND(priv->spi, (PCD8544_FUNC_SET | PCD8544_POWER_DOWN)); priv->powered = PCD8544_POWER_OFF; } @@ -783,7 +783,7 @@ static int pcd8544_setpower(struct lcd_dev_s *dev, int power) { /* Leave the power-down */ - (void)SPI_SEND(priv->spi, PCD8544_FUNC_SET); + SPI_SEND(priv->spi, PCD8544_FUNC_SET); priv->powered = PCD8544_POWER_ON; } @@ -848,15 +848,15 @@ static int pcd8544_setcontrast(struct lcd_dev_s *dev, unsigned int contrast) /* Select the extended instruction set ( H = 1 ) */ - (void)SPI_SEND(priv->spi, (PCD8544_FUNC_SET | PCD8544_MODEH)); + SPI_SEND(priv->spi, (PCD8544_FUNC_SET | PCD8544_MODEH)); /* Set the contrast */ - (void)SPI_SEND(priv->spi, (PCD8544_WRITE_VOP | contrast) ); + SPI_SEND(priv->spi, (PCD8544_WRITE_VOP | contrast) ); /* Return to normal mode */ - (void)SPI_SEND(priv->spi, PCD8544_FUNC_SET); + SPI_SEND(priv->spi, PCD8544_FUNC_SET); /* Select data transfer */ @@ -901,8 +901,8 @@ static inline void up_clear(FAR struct pcd8544_dev_s *priv) /* Set the starting position for the run */ - (void)SPI_SEND(priv->spi, PCD8544_SET_Y_ADDR+i); /* Set the page start */ - (void)SPI_SEND(priv->spi, PCD8544_SET_X_ADDR + page); /* Set the column */ + SPI_SEND(priv->spi, PCD8544_SET_Y_ADDR+i); /* Set the page start */ + SPI_SEND(priv->spi, PCD8544_SET_X_ADDR + page); /* Set the column */ /* Select data transfer */ @@ -911,7 +911,7 @@ static inline void up_clear(FAR struct pcd8544_dev_s *priv) /* Then transfer all 84 columns of data */ - (void)SPI_SNDBLOCK(priv->spi, &priv->fb[page * PCD8544_XRES], PCD8544_XRES); + SPI_SNDBLOCK(priv->spi, &priv->fb[page * PCD8544_XRES], PCD8544_XRES); } /* Unlock and de-select the device */ @@ -967,23 +967,23 @@ FAR struct lcd_dev_s *pcd8544_initialize(FAR struct spi_dev_s *spi, unsigned int /* Leave the power-down and select extended instruction set mode H = 1 */ - (void)SPI_SEND(spi, (PCD8544_FUNC_SET | PCD8544_MODEH)); + SPI_SEND(spi, (PCD8544_FUNC_SET | PCD8544_MODEH)); /* Set LCD Bias to n = 3 */ - (void)SPI_SEND(spi, (PCD8544_BIAS_SYSTEM | PCD8544_BIAS_BS2)); + SPI_SEND(spi, (PCD8544_BIAS_SYSTEM | PCD8544_BIAS_BS2)); /* Select the normal instruction set mode H = 0 */ - (void)SPI_SEND(spi, PCD8544_FUNC_SET); + SPI_SEND(spi, PCD8544_FUNC_SET); /* Clear the screen */ - (void)SPI_SEND(spi, (PCD8544_DISP_CTRL | PCD8544_DISP_BLANK)); + SPI_SEND(spi, (PCD8544_DISP_CTRL | PCD8544_DISP_BLANK)); /* Set the Display Control to Normal Mode D = 1 and E = 0 */ - (void)SPI_SEND(spi, (PCD8544_DISP_CTRL | PCD8544_DISP_NORMAL)); + SPI_SEND(spi, (PCD8544_DISP_CTRL | PCD8544_DISP_NORMAL)); /* Select data transfer */ diff --git a/drivers/lcd/pcf8574_lcd_backpack.c b/drivers/lcd/pcf8574_lcd_backpack.c index 8c93c54342..043a914b24 100644 --- a/drivers/lcd/pcf8574_lcd_backpack.c +++ b/drivers/lcd/pcf8574_lcd_backpack.c @@ -629,7 +629,7 @@ static void lcd_create_char(FAR struct pcf8574_lcd_dev_s *priv, int nidx; uint8_t addr; - (void)lcd_read_busy_addr(priv, &addr); + lcd_read_busy_addr(priv, &addr); lcd_putcmd(priv, CMD_SET_CGADDR | (idxchar << 3)); /* set CGRAM address */ for (nidx = 0; nidx < 8; ++nidx) @@ -680,7 +680,7 @@ static void lcd_get_curpos(FAR struct pcf8574_lcd_dev_s *priv, { uint8_t addr; - (void)lcd_read_busy_addr(priv, &addr); + lcd_read_busy_addr(priv, &addr); addr2rc(priv, addr, row, col); } @@ -1156,7 +1156,7 @@ static ssize_t pcf8574_lcd_read(FAR struct file *filep, FAR char *buffer, /* Get current cursor position so we can restore it */ - (void)lcd_read_busy_addr(priv, &addr); + lcd_read_busy_addr(priv, &addr); /* Convert file position to row/col address and position DDADDR there */ diff --git a/drivers/lcd/ssd1306_base.c b/drivers/lcd/ssd1306_base.c index 56206f9198..d36dc69dd1 100644 --- a/drivers/lcd/ssd1306_base.c +++ b/drivers/lcd/ssd1306_base.c @@ -771,7 +771,7 @@ static int ssd1306_setpower(FAR struct lcd_dev_s *dev, int power) { /* Do power on. */ - (void)priv->board_priv->set_vcc(true); + priv->board_priv->set_vcc(true); } if (!priv->is_conf) diff --git a/drivers/lcd/ssd1306_spi.c b/drivers/lcd/ssd1306_spi.c index 66c958ca38..853a833b52 100644 --- a/drivers/lcd/ssd1306_spi.c +++ b/drivers/lcd/ssd1306_spi.c @@ -70,8 +70,8 @@ void ssd1306_configspi(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, CONFIG_SSD1306_SPIMODE); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_SSD1306_FREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_SSD1306_FREQUENCY); } /**************************************************************************** @@ -90,7 +90,7 @@ int ssd1306_sendbyte(FAR struct ssd1306_dev_s *priv, uint8_t regval) /* Send byte value to display */ - (void)SPI_SEND(priv->spi, regval); + SPI_SEND(priv->spi, regval); return OK; } @@ -106,7 +106,7 @@ int ssd1306_sendblk(FAR struct ssd1306_dev_s *priv, uint8_t *data, uint8_t len) { /* Send byte value to display */ - (void)SPI_SNDBLOCK(priv->spi, data, len); + SPI_SNDBLOCK(priv->spi, data, len); return OK; } @@ -126,7 +126,7 @@ void ssd1306_select(FAR struct ssd1306_dev_s *priv, bool cs) { /* If SPI bus is shared then lock and configure it */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); ssd1306_configspi(priv->spi); } @@ -140,7 +140,7 @@ void ssd1306_select(FAR struct ssd1306_dev_s *priv, bool cs) { /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); } } diff --git a/drivers/lcd/ssd1351.c b/drivers/lcd/ssd1351.c index 6c375e012e..2c983e694c 100644 --- a/drivers/lcd/ssd1351.c +++ b/drivers/lcd/ssd1351.c @@ -499,8 +499,8 @@ static void ssd1351_select(FAR struct ssd1351_dev_s *priv) SPI_SETMODE(spi, CONFIG_SSD1351_SPIMODE); SPI_SETBITS(spi, SSD1351_SPIBITS); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_SSD1351_SPIFREQ); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_SSD1351_SPIFREQ); } #endif @@ -554,7 +554,7 @@ static void ssd1351_read(FAR struct ssd1351_dev_s *priv, uint8_t cmd, if (cmd == SSD1351_CMD_RAMREAD) { - (void)lcd->read(lcd); + lcd->read(lcd); } /* Read all of the data */ @@ -622,7 +622,7 @@ static void ssd1351_write(FAR struct ssd1351_dev_s *priv, uint8_t cmd, /* Send the line buffer */ - (void)SPI_SNDBLOCK(priv->spi, priv->rowbuffer, datlen+1); + SPI_SNDBLOCK(priv->spi, priv->rowbuffer, datlen+1); } #elif defined(CONFIG_SSD1351_SPI4WIRE) static void ssd1351_write(FAR struct ssd1351_dev_s *priv, uint8_t cmd, @@ -637,11 +637,11 @@ static void ssd1351_write(FAR struct ssd1351_dev_s *priv, uint8_t cmd, /* Select command transfer */ - (void)SPI_CMDDATA(spi, SPIDEV_DISPLAY(0), true); + SPI_CMDDATA(spi, SPIDEV_DISPLAY(0), true); /* Send the command */ - (void)SPI_SEND(spi, cmd); + SPI_SEND(spi, cmd); /* Do we have any data to send? */ @@ -649,11 +649,11 @@ static void ssd1351_write(FAR struct ssd1351_dev_s *priv, uint8_t cmd, { /* Yes, select data transfer */ - (void)SPI_CMDDATA(spi, SPIDEV_DISPLAY(0), false); + SPI_CMDDATA(spi, SPIDEV_DISPLAY(0), false); /* Transfer all of the data */ - (void)SPI_SNDBLOCK(spi, data, datlen); + SPI_SNDBLOCK(spi, data, datlen); } } #endif diff --git a/drivers/lcd/st7565.c b/drivers/lcd/st7565.c index 3ae17f199c..6e0f0023a2 100644 --- a/drivers/lcd/st7565.c +++ b/drivers/lcd/st7565.c @@ -561,9 +561,9 @@ static int st7565_putrun(fb_coord_t row, fb_coord_t col, /* Set the starting position for the run */ - (void)st7565_send_one_data(priv, ST7565_SETPAGESTART + page); - (void)st7565_send_one_data(priv, ST7565_SETCOLL + (col & 0x0f)); - (void)st7565_send_one_data(priv, ST7565_SETCOLH + (col >> 4)); + st7565_send_one_data(priv, ST7565_SETPAGESTART + page); + st7565_send_one_data(priv, ST7565_SETCOLL + (col & 0x0f)); + st7565_send_one_data(priv, ST7565_SETCOLH + (col >> 4)); /* Select data transfer */ @@ -571,7 +571,7 @@ static int st7565_putrun(fb_coord_t row, fb_coord_t col, /* Then transfer all of the data */ - (void)st7565_send_data_buf(priv, fbptr, pixlen); + st7565_send_data_buf(priv, fbptr, pixlen); /* Unlock and de-select the device */ @@ -787,24 +787,24 @@ static int st7565_setpower(struct lcd_dev_s *dev, int power) { /* Turn the display off */ - (void)st7565_send_one_data(priv, ST7565_DISPOFF); - (void)st7565_backlight(priv, 0); + st7565_send_one_data(priv, ST7565_DISPOFF); + st7565_backlight(priv, 0); priv->power_level = 0; } else { - (void)st7565_send_one_data(priv, ST7565_DISPON); - (void)st7565_send_one_data(priv, ST7565_DISPRAM); + st7565_send_one_data(priv, ST7565_DISPON); + st7565_send_one_data(priv, ST7565_DISPRAM); /* Don't use value 1 of backlight to allow low power mode */ if (power == 1) { - (void)st7565_backlight(priv, 0); + st7565_backlight(priv, 0); } else { - (void)st7565_backlight(priv, power); + st7565_backlight(priv, power); } priv->power_level = 1; @@ -861,8 +861,8 @@ static int st7565_setcontrast(struct lcd_dev_s *dev, unsigned int contrast) /* Set the contrast */ - (void)st7565_send_one_data(priv, ST7565_SETEVMODE); - (void)st7565_send_one_data(priv, ST7565_SETEVREG(contrast)); + st7565_send_one_data(priv, ST7565_SETEVMODE); + st7565_send_one_data(priv, ST7565_SETEVREG(contrast)); priv->contrast = contrast; /* Deselect command transfer */ @@ -906,9 +906,9 @@ static inline void up_clear(FAR struct st7565_dev_s *priv) /* Set the starting position for the run */ - (void)st7565_send_one_data(priv, ST7565_SETPAGESTART + i); - (void)st7565_send_one_data(priv, ST7565_SETCOLL); - (void)st7565_send_one_data(priv, ST7565_SETCOLH); + st7565_send_one_data(priv, ST7565_SETPAGESTART + i); + st7565_send_one_data(priv, ST7565_SETCOLL); + st7565_send_one_data(priv, ST7565_SETCOLH); /* Select data transfer */ @@ -916,8 +916,8 @@ static inline void up_clear(FAR struct st7565_dev_s *priv) /* Then transfer all 96 columns of data */ - (void)st7565_send_data_buf(priv, &priv->fb[page * ST7565_XRES], - ST7565_XRES); + st7565_send_data_buf(priv, &priv->fb[page * ST7565_XRES], + ST7565_XRES); } /* Unlock and de-select the device */ @@ -997,87 +997,87 @@ FAR struct lcd_dev_s *st7565_initialize(FAR struct st7565_lcd_s *lcd, /* Reset by command in case of st7565_reset not implemeted */ - (void)st7565_send_one_data(priv, ST7565_EXIT_SOFTRST); + st7565_send_one_data(priv, ST7565_EXIT_SOFTRST); /* Follow NHD-C12864KGZ DISPLAY INITIALIZATION... */ #if defined(CONFIG_NHD_C12864KGZ) - (void)st7565_send_one_data(priv, ST7565_BIAS_1_9); + st7565_send_one_data(priv, ST7565_BIAS_1_9); - (void)st7565_send_one_data(priv, ST7565_REG_RES_5_5); - (void)st7565_send_one_data(priv, ST7565_SETEVMODE); - (void)st7565_send_one_data(priv, ST7565_SETEVREG(15)); - (void)st7565_send_one_data(priv, ST7565_POWERCTRL_INT); - (void)st7565_send_one_data(priv, ST7565_SETSTARTLINE); + st7565_send_one_data(priv, ST7565_REG_RES_5_5); + st7565_send_one_data(priv, ST7565_SETEVMODE); + st7565_send_one_data(priv, ST7565_SETEVREG(15)); + st7565_send_one_data(priv, ST7565_POWERCTRL_INT); + st7565_send_one_data(priv, ST7565_SETSTARTLINE); #elif defined(CONFIG_ERC_12864_3) - (void)st7565_send_one_data(priv, ST7565_ADCNORMAL); - (void)st7565_send_one_data(priv, ST7565_SETCOMREVERSE); - (void)st7565_send_one_data(priv, ST7565_BIAS_1_9); - (void)st7565_send_one_data(priv, ST7565_POWERCTRL_INT); - (void)st7565_send_one_data(priv, ST7565_REG_RES_5_5); - (void)st7565_send_one_data(priv, ST7565_SETEVMODE); - (void)st7565_send_one_data(priv, ST7565_SETEVREG(0x24)); - (void)st7565_send_one_data(priv, ST7565_SETSTARTLINE); + st7565_send_one_data(priv, ST7565_ADCNORMAL); + st7565_send_one_data(priv, ST7565_SETCOMREVERSE); + st7565_send_one_data(priv, ST7565_BIAS_1_9); + st7565_send_one_data(priv, ST7565_POWERCTRL_INT); + st7565_send_one_data(priv, ST7565_REG_RES_5_5); + st7565_send_one_data(priv, ST7565_SETEVMODE); + st7565_send_one_data(priv, ST7565_SETEVREG(0x24)); + st7565_send_one_data(priv, ST7565_SETSTARTLINE); #elif defined(CONFIG_AQM_1248A) - (void)st7565_send_one_data(priv, ST7565_DISPOFF); - (void)st7565_send_one_data(priv, ST7565_ADCNORMAL); - (void)st7565_send_one_data(priv, ST7565_SETCOMREVERSE); - (void)st7565_send_one_data(priv, ST7565_BIAS_1_7); + st7565_send_one_data(priv, ST7565_DISPOFF); + st7565_send_one_data(priv, ST7565_ADCNORMAL); + st7565_send_one_data(priv, ST7565_SETCOMREVERSE); + st7565_send_one_data(priv, ST7565_BIAS_1_7); - (void)st7565_send_one_data(priv, ST7565_POWERCTRL_B); + st7565_send_one_data(priv, ST7565_POWERCTRL_B); up_mdelay(2); - (void)st7565_send_one_data(priv, ST7565_POWERCTRL_BR); + st7565_send_one_data(priv, ST7565_POWERCTRL_BR); up_mdelay(2); - (void)st7565_send_one_data(priv, ST7565_POWERCTRL_INT); + st7565_send_one_data(priv, ST7565_POWERCTRL_INT); - (void)st7565_send_one_data(priv, ST7565_REG_RES_4_5); - (void)st7565_send_one_data(priv, ST7565_SETEVMODE); - (void)st7565_send_one_data(priv, ST7565_SETEVREG(0x1c)); - (void)st7565_send_one_data(priv, ST7565_DISPRAM); - (void)st7565_send_one_data(priv, ST7565_SETSTARTLINE); - (void)st7565_send_one_data(priv, ST7565_DISPNORMAL); - (void)st7565_send_one_data(priv, ST7565_DISPON); + st7565_send_one_data(priv, ST7565_REG_RES_4_5); + st7565_send_one_data(priv, ST7565_SETEVMODE); + st7565_send_one_data(priv, ST7565_SETEVREG(0x1c)); + st7565_send_one_data(priv, ST7565_DISPRAM); + st7565_send_one_data(priv, ST7565_SETSTARTLINE); + st7565_send_one_data(priv, ST7565_DISPNORMAL); + st7565_send_one_data(priv, ST7565_DISPON); #else # error "No initialization sequence selected" #endif #if 0 - (void)st7565_send_one_data(priv, ST7565_DISPON); - (void)st7565_send_one_data(priv, ST7565_SETCOMREVERSE); - (void)st7565_send_one_data(priv, ST7565_REG_RES_RR1); - (void)st7565_send_one_data(priv, ST7565_SETEV); - (void)st7565_send_one_data(priv, 0x32); - (void)st7565_send_one_data(priv, ST7565_POWERCTRL); - (void)st7565_send_one_data(priv, ST7565_SETSTARTLINE); - (void)st7565_send_one_data(priv, ST7565_SETPAGESTART); - (void)st7565_send_one_data(priv, ST7565_SETCOLH); - (void)st7565_send_one_data(priv, ST7565_SETCOLL); - (void)st7565_send_one_data(priv, ST7565_DISPON); - (void)st7565_send_one_data(priv, ST7565_DISPRAM); + st7565_send_one_data(priv, ST7565_DISPON); + st7565_send_one_data(priv, ST7565_SETCOMREVERSE); + st7565_send_one_data(priv, ST7565_REG_RES_RR1); + st7565_send_one_data(priv, ST7565_SETEV); + st7565_send_one_data(priv, 0x32); + st7565_send_one_data(priv, ST7565_POWERCTRL); + st7565_send_one_data(priv, ST7565_SETSTARTLINE); + st7565_send_one_data(priv, ST7565_SETPAGESTART); + st7565_send_one_data(priv, ST7565_SETCOLH); + st7565_send_one_data(priv, ST7565_SETCOLL); + st7565_send_one_data(priv, ST7565_DISPON); + st7565_send_one_data(priv, ST7565_DISPRAM); #endif #ifdef CONFIG_ST7565_MIRROR_X - (void)st7565_send_one_data(priv, ST7565_ADCINVERSE); + st7565_send_one_data(priv, ST7565_ADCINVERSE); #else - (void)st7565_send_one_data(priv, ST7565_ADCNORMAL); + st7565_send_one_data(priv, ST7565_ADCNORMAL); #endif #ifdef CONFIG_ST7565_MIRROR_Y - (void)st7565_send_one_data(priv, ST7565_SETCOMREVERSE); + st7565_send_one_data(priv, ST7565_SETCOMREVERSE); #else - (void)st7565_send_one_data(priv, ST7565_SETCOMNORMAL); + st7565_send_one_data(priv, ST7565_SETCOMNORMAL); #endif #ifdef CONFIG_ST7565_INVERSE_VIDEO - (void)st7565_send_one_data(priv, ST7565_DISPINVERSE); + st7565_send_one_data(priv, ST7565_DISPINVERSE); #else - (void)st7565_send_one_data(priv, ST7565_DISPNORMAL); + st7565_send_one_data(priv, ST7565_DISPNORMAL); #endif /* Let go of the SPI lock and de-select the device */ diff --git a/drivers/lcd/st7567.c b/drivers/lcd/st7567.c index 535cfde11d..8bd9ec001a 100644 --- a/drivers/lcd/st7567.c +++ b/drivers/lcd/st7567.c @@ -367,9 +367,9 @@ static void st7567_select(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, CONFIG_ST7567_SPIMODE); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); + SPI_HWFEATURES(spi, 0); #ifdef CONFIG_ST7567_FREQUENCY - (void)SPI_SETFREQUENCY(spi, CONFIG_ST7567_FREQUENCY); + SPI_SETFREQUENCY(spi, CONFIG_ST7567_FREQUENCY); #endif } @@ -528,9 +528,9 @@ static int st7567_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buff /* Set the starting position for the run */ - (void)SPI_SEND(priv->spi, ST7567_SETPAGESTART+page); /* Set the page start */ - (void)SPI_SEND(priv->spi, ST7567_SETCOLL + (col & 0x0f)); /* Set the low column */ - (void)SPI_SEND(priv->spi, ST7567_SETCOLH + (col >> 4)); /* Set the high column */ + SPI_SEND(priv->spi, ST7567_SETPAGESTART+page); /* Set the page start */ + SPI_SEND(priv->spi, ST7567_SETCOLL + (col & 0x0f)); /* Set the low column */ + SPI_SEND(priv->spi, ST7567_SETCOLH + (col >> 4)); /* Set the high column */ /* Select data transfer */ @@ -538,7 +538,7 @@ static int st7567_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buff /* Then transfer all of the data */ - (void)SPI_SNDBLOCK(priv->spi, fbptr, pixlen); + SPI_SNDBLOCK(priv->spi, fbptr, pixlen); /* Unlock and de-select the device */ @@ -748,15 +748,15 @@ static int st7567_setpower(struct lcd_dev_s *dev, int power) { /* Turn the display off */ - (void)SPI_SEND(priv->spi, ST7567_DISPOFF); /* Display off */ + SPI_SEND(priv->spi, ST7567_DISPOFF); /* Display off */ priv->powered = ST7567_POWER_OFF; } else { - (void)SPI_SEND(priv->spi, ST7567_DISPON); /* Display on, normal mode */ + SPI_SEND(priv->spi, ST7567_DISPON); /* Display on, normal mode */ power = ST7567_POWER_ON; - (void)SPI_SEND(priv->spi, ST7567_DISPRAM); /* Resume to RAM content display */ + SPI_SEND(priv->spi, ST7567_DISPRAM); /* Resume to RAM content display */ priv->powered = power; } @@ -810,8 +810,8 @@ static int st7567_setcontrast(struct lcd_dev_s *dev, unsigned int contrast) /* Set the contrast */ - (void)SPI_SEND(priv->spi, ST7567_SETEV); /* Set contrast control register */ - (void)SPI_SEND(priv->spi, contrast); /* Data 1: Set 1 of 256 contrast steps */ + SPI_SEND(priv->spi, ST7567_SETEV); /* Set contrast control register */ + SPI_SEND(priv->spi, contrast); /* Data 1: Set 1 of 256 contrast steps */ priv->contrast = contrast; /* Unlock and de-select the device */ @@ -852,9 +852,9 @@ static inline void up_clear(FAR struct st7567_dev_s *priv) /* Set the starting position for the run */ - (void)SPI_SEND(priv->spi, ST7567_SETPAGESTART+i); - (void)SPI_SEND(priv->spi, ST7567_SETCOLL); - (void)SPI_SEND(priv->spi, ST7567_SETCOLH); + SPI_SEND(priv->spi, ST7567_SETPAGESTART+i); + SPI_SEND(priv->spi, ST7567_SETCOLL); + SPI_SEND(priv->spi, ST7567_SETCOLH); /* Select data transfer */ @@ -862,7 +862,7 @@ static inline void up_clear(FAR struct st7567_dev_s *priv) /* Then transfer all 96 columns of data */ - (void)SPI_SNDBLOCK(priv->spi, &priv->fb[page * ST7567_XRES], ST7567_XRES); + SPI_SNDBLOCK(priv->spi, &priv->fb[page * ST7567_XRES], ST7567_XRES); } /* Unlock and de-select the device */ @@ -922,21 +922,21 @@ FAR struct lcd_dev_s *st7567_initialize(FAR struct spi_dev_s *spi, unsigned int /* Set the starting position for the run */ - (void)SPI_SEND(spi, ST7567_EXIT_SOFTRST); - (void)SPI_SEND(spi, ST7567_BIAS_1_7); - (void)SPI_SEND(spi, ST7567_DISPON); - (void)SPI_SEND(spi, SSD1305_MAPCOL0); - (void)SPI_SEND(spi, ST7567_SETCOMREVERSE); - (void)SPI_SEND(spi, ST7567_REG_RES_RR1); - (void)SPI_SEND(spi, ST7567_SETEV); - (void)SPI_SEND(spi, 0x32); - (void)SPI_SEND(spi, ST7567_POWERCTRL); - (void)SPI_SEND(spi, ST7567_SETSTARTLINE); - (void)SPI_SEND(spi, ST7567_SETPAGESTART); - (void)SPI_SEND(spi, ST7567_SETCOLH); - (void)SPI_SEND(spi, ST7567_SETCOLL); - (void)SPI_SEND(spi, ST7567_DISPON); - (void)SPI_SEND(spi, ST7567_DISPRAM); + SPI_SEND(spi, ST7567_EXIT_SOFTRST); + SPI_SEND(spi, ST7567_BIAS_1_7); + SPI_SEND(spi, ST7567_DISPON); + SPI_SEND(spi, SSD1305_MAPCOL0); + SPI_SEND(spi, ST7567_SETCOMREVERSE); + SPI_SEND(spi, ST7567_REG_RES_RR1); + SPI_SEND(spi, ST7567_SETEV); + SPI_SEND(spi, 0x32); + SPI_SEND(spi, ST7567_POWERCTRL); + SPI_SEND(spi, ST7567_SETSTARTLINE); + SPI_SEND(spi, ST7567_SETPAGESTART); + SPI_SEND(spi, ST7567_SETCOLH); + SPI_SEND(spi, ST7567_SETCOLL); + SPI_SEND(spi, ST7567_DISPON); + SPI_SEND(spi, ST7567_DISPRAM); /* Let go of the SPI lock and de-select the device */ diff --git a/drivers/lcd/tda19988.c b/drivers/lcd/tda19988.c index 19b905853a..defed9dd23 100644 --- a/drivers/lcd/tda19988.c +++ b/drivers/lcd/tda19988.c @@ -769,8 +769,8 @@ static int tda19988_fetch_edid(struct tda1988_dev_s *priv) done: if (priv->version == HDMI_CTRL_REV_TDA19988) { - (void)tda19988_hdmi_modifyreg(priv, HDMI_HDCPOTP_TX4_REG, - 0, HDMI_HDCPOTP_TX4_PDRAM); + tda19988_hdmi_modifyreg(priv, HDMI_HDCPOTP_TX4_REG, + 0, HDMI_HDCPOTP_TX4_PDRAM); } return ret; @@ -1610,8 +1610,8 @@ static void tda19988_shutdown(FAR struct tda1988_dev_s *priv) DEBUGASSERT(priv->lower->attach != NULL && priv->lower->enable != NULL); - (void)priv->lower->attach(priv->lower, NULL, NULL); - (void)priv->lower->enable(priv->lower, false); + priv->lower->attach(priv->lower, NULL, NULL); + priv->lower->enable(priv->lower, false); } /* Release resources */ @@ -1684,7 +1684,7 @@ TDA19988_HANDLE tda19988_register(FAR const char *devpath, priv->lower = lower; priv->page = HDMI_NO_PAGE; - sem_init(&priv->exclsem, 0, 1); + nxsem_init(&priv->exclsem, 0, 1); /* Initialize the TDA19988 */ diff --git a/drivers/lcd/ug-2864ambag01.c b/drivers/lcd/ug-2864ambag01.c index b1633d1e2b..01b4f3d2fb 100644 --- a/drivers/lcd/ug-2864ambag01.c +++ b/drivers/lcd/ug-2864ambag01.c @@ -419,8 +419,8 @@ static inline void ug2864ambag01_lock(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, CONFIG_UG2864AMBAG01_SPIMODE); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_UG2864AMBAG01_FREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_UG2864AMBAG01_FREQUENCY); } /************************************************************************************** @@ -644,7 +644,7 @@ static int ug2864ambag01_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_ /* Then transfer all of the data */ - (void)SPI_SNDBLOCK(priv->spi, fbptr, pixlen); + SPI_SNDBLOCK(priv->spi, fbptr, pixlen); /* De-select and unlock the device */ @@ -898,14 +898,14 @@ static int ug2864ambag01_setpower(struct lcd_dev_s *dev, int power) { /* Turn the display off */ - (void)SPI_SEND(priv->spi, SH1101A_DISPOFF); + SPI_SEND(priv->spi, SH1101A_DISPOFF); priv->on = false; } else { /* Turn the display on */ - (void)SPI_SEND(priv->spi, SH1101A_DISPON); + SPI_SEND(priv->spi, SH1101A_DISPON); priv->on = true; } @@ -979,8 +979,8 @@ static int ug2864ambag01_setcontrast(struct lcd_dev_s *dev, unsigned int contras /* Set the contrast */ - (void)SPI_SEND(priv->spi, SH1101A_CONTRAST_MODE); /* Set contrast control register */ - (void)SPI_SEND(priv->spi, SH1101A_CONTRAST(scaled)); /* Data 1: Set 1 of 256 contrast steps */ + SPI_SEND(priv->spi, SH1101A_CONTRAST_MODE); /* Set contrast control register */ + SPI_SEND(priv->spi, SH1101A_CONTRAST(scaled)); /* Data 1: Set 1 of 256 contrast steps */ priv->contrast = contrast; /* De-select and unlock the device */ @@ -1137,8 +1137,8 @@ void ug2864ambag01_fill(FAR struct lcd_dev_s *dev, uint8_t color) /* Transfer one page of the selected color */ - (void)SPI_SNDBLOCK(priv->spi, &priv->fb[page * UG2864AMBAG01_XRES], - UG2864AMBAG01_XRES); + SPI_SNDBLOCK(priv->spi, &priv->fb[page * UG2864AMBAG01_XRES], + UG2864AMBAG01_XRES); } /* De-select and unlock the device */ diff --git a/drivers/lcd/ug-9664hswag01.c b/drivers/lcd/ug-9664hswag01.c index 8fbc6121bd..2dce4124c9 100644 --- a/drivers/lcd/ug-9664hswag01.c +++ b/drivers/lcd/ug-9664hswag01.c @@ -401,9 +401,9 @@ static void ug_select(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, CONFIG_UG9664HSWAG01_SPIMODE); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); + SPI_HWFEATURES(spi, 0); #ifdef CONFIG_UG9664HSWAG01_FREQUENCY - (void)SPI_SETFREQUENCY(spi, CONFIG_UG9664HSWAG01_FREQUENCY); + SPI_SETFREQUENCY(spi, CONFIG_UG9664HSWAG01_FREQUENCY); #endif } @@ -612,9 +612,9 @@ static int ug_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, /* Set the starting position for the run */ - (void)SPI_SEND(priv->spi, SSD1305_SETPAGESTART+page); /* Set the page start */ - (void)SPI_SEND(priv->spi, SSD1305_SETCOLL + (devcol & 0x0f)); /* Set the low column */ - (void)SPI_SEND(priv->spi, SSD1305_SETCOLH + (devcol >> 4)); /* Set the high column */ + SPI_SEND(priv->spi, SSD1305_SETPAGESTART+page); /* Set the page start */ + SPI_SEND(priv->spi, SSD1305_SETCOLL + (devcol & 0x0f)); /* Set the low column */ + SPI_SEND(priv->spi, SSD1305_SETCOLH + (devcol >> 4)); /* Set the high column */ /* Select data transfer */ @@ -622,7 +622,7 @@ static int ug_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, /* Then transfer all of the data */ - (void)SPI_SNDBLOCK(priv->spi, fbptr, pixlen); + SPI_SNDBLOCK(priv->spi, fbptr, pixlen); /* Unlock and de-select the device */ @@ -864,7 +864,7 @@ static int ug_setpower(struct lcd_dev_s *dev, int power) { /* Turn the display off */ - (void)SPI_SEND(priv->spi, SSD1305_DISPOFF); /* Display off */ + SPI_SEND(priv->spi, SSD1305_DISPOFF); /* Display off */ /* Remove power to the device */ @@ -877,14 +877,14 @@ static int ug_setpower(struct lcd_dev_s *dev, int power) if (power == UG_POWER_DIM) { - (void)SPI_SEND(priv->spi, SSD1305_DISPONDIM); /* Display on, dim mode */ + SPI_SEND(priv->spi, SSD1305_DISPONDIM); /* Display on, dim mode */ } else /* if (power > UG_POWER_DIM) */ { - (void)SPI_SEND(priv->spi, SSD1305_DISPON); /* Display on, normal mode */ + SPI_SEND(priv->spi, SSD1305_DISPON); /* Display on, normal mode */ power = UG_POWER_ON; } - (void)SPI_SEND(priv->spi, SSD1305_DISPRAM); /* Resume to RAM content display */ + SPI_SEND(priv->spi, SSD1305_DISPRAM); /* Resume to RAM content display */ /* Restore power to the device */ @@ -941,8 +941,8 @@ static int ug_setcontrast(struct lcd_dev_s *dev, unsigned int contrast) /* Set the contrast */ - (void)SPI_SEND(priv->spi, SSD1305_SETCONTRAST); /* Set contrast control register */ - (void)SPI_SEND(priv->spi, contrast); /* Data 1: Set 1 of 256 contrast steps */ + SPI_SEND(priv->spi, SSD1305_SETCONTRAST); /* Set contrast control register */ + SPI_SEND(priv->spi, contrast); /* Data 1: Set 1 of 256 contrast steps */ priv->contrast = contrast; /* Unlock and de-select the device */ @@ -983,9 +983,9 @@ static inline void up_clear(FAR struct ug_dev_s *priv) /* Set the starting position for the run */ - (void)SPI_SEND(priv->spi, SSD1305_SETPAGESTART+i); - (void)SPI_SEND(priv->spi, SSD1305_SETCOLL + (UG_XOFFSET & 0x0f)); - (void)SPI_SEND(priv->spi, SSD1305_SETCOLH + (UG_XOFFSET >> 4)); + SPI_SEND(priv->spi, SSD1305_SETPAGESTART+i); + SPI_SEND(priv->spi, SSD1305_SETCOLL + (UG_XOFFSET & 0x0f)); + SPI_SEND(priv->spi, SSD1305_SETCOLH + (UG_XOFFSET >> 4)); /* Select data transfer */ @@ -993,7 +993,7 @@ static inline void up_clear(FAR struct ug_dev_s *priv) /* Then transfer all 96 columns of data */ - (void)SPI_SNDBLOCK(priv->spi, &priv->fb[page * UG_XRES], UG_XRES); + SPI_SNDBLOCK(priv->spi, &priv->fb[page * UG_XRES], UG_XRES); } /* Unlock and de-select the device */ @@ -1053,43 +1053,43 @@ FAR struct lcd_dev_s *ug_initialize(FAR struct spi_dev_s *spi, unsigned int devn /* Configure the device */ - (void)SPI_SEND(spi, SSD1305_SETCOLL + 2); /* Set low column address */ - (void)SPI_SEND(spi, SSD1305_SETCOLH + 2); /* Set high column address */ - (void)SPI_SEND(spi, SSD1305_SETSTARTLINE+0); /* Display start set */ - (void)SPI_SEND(spi, SSD1305_SCROLL_STOP); /* Stop horizontal scroll */ - (void)SPI_SEND(spi, SSD1305_SETCONTRAST); /* Set contrast control register */ - (void)SPI_SEND(spi, 0x32); /* Data 1: Set 1 of 256 contrast steps */ - (void)SPI_SEND(spi, SSD1305_SETBRIGHTNESS); /* Brightness for color bank */ - (void)SPI_SEND(spi, 0x80); /* Data 1: Set 1 of 256 contrast steps */ - (void)SPI_SEND(spi, SSD1305_MAPCOL131); /* Set segment re-map */ - (void)SPI_SEND(spi, SSD1305_DISPNORMAL); /* Set normal display */ + SPI_SEND(spi, SSD1305_SETCOLL + 2); /* Set low column address */ + SPI_SEND(spi, SSD1305_SETCOLH + 2); /* Set high column address */ + SPI_SEND(spi, SSD1305_SETSTARTLINE+0); /* Display start set */ + SPI_SEND(spi, SSD1305_SCROLL_STOP); /* Stop horizontal scroll */ + SPI_SEND(spi, SSD1305_SETCONTRAST); /* Set contrast control register */ + SPI_SEND(spi, 0x32); /* Data 1: Set 1 of 256 contrast steps */ + SPI_SEND(spi, SSD1305_SETBRIGHTNESS); /* Brightness for color bank */ + SPI_SEND(spi, 0x80); /* Data 1: Set 1 of 256 contrast steps */ + SPI_SEND(spi, SSD1305_MAPCOL131); /* Set segment re-map */ + SPI_SEND(spi, SSD1305_DISPNORMAL); /* Set normal display */ //(void)SPI_SEND(spi, SSD1305_DISPINVERTED); /* Set inverse display */ - (void)SPI_SEND(spi, SSD1305_SETMUX); /* Set multiplex ratio */ - (void)SPI_SEND(spi, 0x3f); /* Data 1: MUX ratio -1: 15-63 */ - (void)SPI_SEND(spi, SSD1305_SETOFFSET); /* Set display offset */ - (void)SPI_SEND(spi, 0x40); /* Data 1: Vertical shift by COM: 0-63 */ - (void)SPI_SEND(spi, SSD1305_MSTRCONFIG); /* Set dc-dc on/off */ - (void)SPI_SEND(spi, SSD1305_MSTRCONFIG_EXTVCC); /* Data 1: Select external Vcc */ - (void)SPI_SEND(spi, SSD1305_SETCOMREMAPPED); /* Set com output scan direction */ - (void)SPI_SEND(spi, SSD1305_SETDCLK); /* Set display clock divide + SPI_SEND(spi, SSD1305_SETMUX); /* Set multiplex ratio */ + SPI_SEND(spi, 0x3f); /* Data 1: MUX ratio -1: 15-63 */ + SPI_SEND(spi, SSD1305_SETOFFSET); /* Set display offset */ + SPI_SEND(spi, 0x40); /* Data 1: Vertical shift by COM: 0-63 */ + SPI_SEND(spi, SSD1305_MSTRCONFIG); /* Set dc-dc on/off */ + SPI_SEND(spi, SSD1305_MSTRCONFIG_EXTVCC); /* Data 1: Select external Vcc */ + SPI_SEND(spi, SSD1305_SETCOMREMAPPED); /* Set com output scan direction */ + SPI_SEND(spi, SSD1305_SETDCLK); /* Set display clock divide * ratio/oscillator/frequency */ - (void)SPI_SEND(spi, 15 << SSD1305_DCLKFREQ_SHIFT | 0 << SSD1305_DCLKDIV_SHIFT); - (void)SPI_SEND(spi, SSD1305_SETCOLORMODE); /* Set area color mode on/off & low power + SPI_SEND(spi, 15 << SSD1305_DCLKFREQ_SHIFT | 0 << SSD1305_DCLKDIV_SHIFT); + SPI_SEND(spi, SSD1305_SETCOLORMODE); /* Set area color mode on/off & low power * display mode */ - (void)SPI_SEND(spi, SSD1305_COLORMODE_MONO | SSD1305_POWERMODE_LOW); - (void)SPI_SEND(spi, SSD1305_SETPRECHARGE); /* Set pre-charge period */ - (void)SPI_SEND(spi, 15 << SSD1305_PHASE2_SHIFT | 1 << SSD1305_PHASE1_SHIFT); - (void)SPI_SEND(spi, SSD1305_SETCOMCONFIG); /* Set COM configuration */ - (void)SPI_SEND(spi, SSD1305_COMCONFIG_ALT); /* Data 1, Bit 4: 1=Alternative COM pin configuration */ - (void)SPI_SEND(spi, SSD1305_SETVCOMHDESEL); /* Set VCOMH deselect level */ - (void)SPI_SEND(spi, SSD1305_VCOMH_x7p7); /* Data 1: ~0.77 x Vcc */ - (void)SPI_SEND(spi, SSD1305_SETLUT); /* Set look up table for area color */ - (void)SPI_SEND(spi, 0x3f); /* Data 1: Pulse width: 31-63 */ - (void)SPI_SEND(spi, 0x3f); /* Data 2: Color A: 31-63 */ - (void)SPI_SEND(spi, 0x3f); /* Data 3: Color B: 31-63 */ - (void)SPI_SEND(spi, 0x3f); /* Data 4: Color C: 31-63 */ - (void)SPI_SEND(spi, SSD1305_DISPON); /* Display on, normal mode */ - (void)SPI_SEND(spi, SSD1305_DISPRAM); /* Resume to RAM content display */ + SPI_SEND(spi, SSD1305_COLORMODE_MONO | SSD1305_POWERMODE_LOW); + SPI_SEND(spi, SSD1305_SETPRECHARGE); /* Set pre-charge period */ + SPI_SEND(spi, 15 << SSD1305_PHASE2_SHIFT | 1 << SSD1305_PHASE1_SHIFT); + SPI_SEND(spi, SSD1305_SETCOMCONFIG); /* Set COM configuration */ + SPI_SEND(spi, SSD1305_COMCONFIG_ALT); /* Data 1, Bit 4: 1=Alternative COM pin configuration */ + SPI_SEND(spi, SSD1305_SETVCOMHDESEL); /* Set VCOMH deselect level */ + SPI_SEND(spi, SSD1305_VCOMH_x7p7); /* Data 1: ~0.77 x Vcc */ + SPI_SEND(spi, SSD1305_SETLUT); /* Set look up table for area color */ + SPI_SEND(spi, 0x3f); /* Data 1: Pulse width: 31-63 */ + SPI_SEND(spi, 0x3f); /* Data 2: Color A: 31-63 */ + SPI_SEND(spi, 0x3f); /* Data 3: Color B: 31-63 */ + SPI_SEND(spi, 0x3f); /* Data 4: Color C: 31-63 */ + SPI_SEND(spi, SSD1305_DISPON); /* Display on, normal mode */ + SPI_SEND(spi, SSD1305_DISPRAM); /* Resume to RAM content display */ /* Let go of the SPI lock and de-select the device */ diff --git a/drivers/leds/apa102.c b/drivers/leds/apa102.c index dd539c1aa9..a2a41512a5 100644 --- a/drivers/leds/apa102.c +++ b/drivers/leds/apa102.c @@ -117,8 +117,8 @@ static inline void apa102_configspi(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, SPIDEV_MODE0); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, APA102_SPI_MAXFREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, APA102_SPI_MAXFREQUENCY); } /**************************************************************************** @@ -134,21 +134,21 @@ static inline void apa102_write32(FAR struct apa102_dev_s *priv, { /* If SPI bus is shared then lock and configure it */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); apa102_configspi(priv->spi); /* Note: APA102 doesn't use chip select */ /* Send 32 bits (4 bytes) */ - (void)SPI_SEND(priv->spi, (value & 0xff)); - (void)SPI_SEND(priv->spi, ((value & 0xff00) >> 8)); - (void)SPI_SEND(priv->spi, ((value & 0xff0000) >> 16)); - (void)SPI_SEND(priv->spi, ((value & 0xff000000) >> 24)); + SPI_SEND(priv->spi, (value & 0xff)); + SPI_SEND(priv->spi, ((value & 0xff00) >> 8)); + SPI_SEND(priv->spi, ((value & 0xff0000) >> 16)); + SPI_SEND(priv->spi, ((value & 0xff000000) >> 24)); /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); } /**************************************************************************** diff --git a/drivers/leds/max7219.c b/drivers/leds/max7219.c index 1f0367cc30..2e1ab5e6fd 100644 --- a/drivers/leds/max7219.c +++ b/drivers/leds/max7219.c @@ -128,8 +128,8 @@ static inline void max7219_configspi(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, SPIDEV_MODE0); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_MAX7219_FREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_MAX7219_FREQUENCY); } /**************************************************************************** @@ -145,7 +145,7 @@ static inline void max7219_write16(FAR struct max7219_dev_s *priv, { /* If SPI bus is shared then lock and configure it */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); /* Configure the SPI */ @@ -157,7 +157,7 @@ static inline void max7219_write16(FAR struct max7219_dev_s *priv, /* Send 16 bits (2 bytes) */ - (void)SPI_SNDBLOCK(priv->spi, &value, 2); + SPI_SNDBLOCK(priv->spi, &value, 2); /* De-select */ @@ -165,7 +165,7 @@ static inline void max7219_write16(FAR struct max7219_dev_s *priv, /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); } /**************************************************************************** diff --git a/drivers/leds/rgbled.c b/drivers/leds/rgbled.c index ef8b1e5eea..404c29760d 100644 --- a/drivers/leds/rgbled.c +++ b/drivers/leds/rgbled.c @@ -139,7 +139,6 @@ static int rgbled_open(FAR struct file *filep) if (ret < 0) { lcderr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } @@ -191,7 +190,6 @@ static int rgbled_close(FAR struct file *filep) if (ret < 0) { lcderr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } diff --git a/drivers/leds/userled_upper.c b/drivers/leds/userled_upper.c index 5826e36868..1f531f9eb8 100644 --- a/drivers/leds/userled_upper.c +++ b/drivers/leds/userled_upper.c @@ -139,18 +139,7 @@ static const struct file_operations userled_fops = static inline int userled_takesem(sem_t *sem) { - int ret; - - /* Take a count from the semaphore, possibly waiting */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - return ret; + return nxsem_wait(sem); } /**************************************************************************** diff --git a/drivers/loop/loop.c b/drivers/loop/loop.c index f4ed22d977..344e3b41dc 100644 --- a/drivers/loop/loop.c +++ b/drivers/loop/loop.c @@ -173,7 +173,7 @@ static int loop_ioctl(FAR struct file *filep, int cmd, unsigned long arg) void loop_register(void) { - (void)register_driver("/dev/loop", &g_loop_fops, 0666, NULL); + register_driver("/dev/loop", &g_loop_fops, 0666, NULL); } #endif /* CONFIG_DEV_LOOP */ diff --git a/drivers/loop/losetup.c b/drivers/loop/losetup.c index c927ab98b5..5a4d67876b 100644 --- a/drivers/loop/losetup.c +++ b/drivers/loop/losetup.c @@ -133,18 +133,7 @@ static const struct block_operations g_bops = static int loop_semtake(FAR struct loop_struct_s *dev) { - int ret; - - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&dev->sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - return ret; + return nxsem_wait(&dev->sem); } /**************************************************************************** @@ -521,7 +510,7 @@ int loteardown(FAR const char *devname) if (dev->devfile.f_inode != NULL) { - (void)file_close(&dev->devfile); + file_close(&dev->devfile); } kmm_free(dev); diff --git a/drivers/mmcsd/mmcsd_sdio.c b/drivers/mmcsd/mmcsd_sdio.c index eb5d2048d1..d2bb1a24fa 100644 --- a/drivers/mmcsd/mmcsd_sdio.c +++ b/drivers/mmcsd/mmcsd_sdio.c @@ -283,23 +283,11 @@ static const struct block_operations g_bops = static void mmcsd_takesem(FAR struct mmcsd_state_s *priv) { - int ret; - /* Take the semaphore, giving exclusive access to the driver (perhaps * waiting) */ - do - { - ret = nxsem_wait(&priv->sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sem); /* Lock the bus if mutually exclusive access to the SDIO bus is required * on this platform. @@ -510,9 +498,9 @@ static int mmcsd_getSCR(FAR struct mmcsd_state_s *priv, uint32_t scr[2]) SDIO_BLOCKSETUP(priv->dev, 8, 1); SDIO_RECVSETUP(priv->dev, (FAR uint8_t *)scr, 8); - (void)SDIO_WAITENABLE(priv->dev, - SDIOWAIT_TRANSFERDONE | SDIOWAIT_TIMEOUT | - SDIOWAIT_ERROR); + SDIO_WAITENABLE(priv->dev, + SDIOWAIT_TRANSFERDONE | SDIOWAIT_TIMEOUT | + SDIOWAIT_ERROR); /* Send CMD55 APP_CMD with argument as card's RCA */ @@ -2505,7 +2493,7 @@ static void mmcsd_mediachange(FAR void *arg) * NOTE that mmcsd_probe() will always re-enable callbacks appropriately. */ - (void)mmcsd_probe(priv); + mmcsd_probe(priv); } else { @@ -2514,7 +2502,7 @@ static void mmcsd_mediachange(FAR void *arg) * re-enable callbacks so we will need to do that here. */ - (void)mmcsd_removed(priv); + mmcsd_removed(priv); /* Enable logic to detect if a card is re-inserted */ @@ -2702,7 +2690,7 @@ static int mmcsd_mmcinitialize(FAR struct mmcsd_state_s *priv) * the card default value (0x0404) will be used. */ - (void)mmcsd_sendcmd4(priv); + mmcsd_sendcmd4(priv); /* Send CMD7 with the argument == RCA in order to select the card * and send it in data-trasfer mode. Since we are supporting @@ -2976,7 +2964,7 @@ static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv) * the card default value (0x0404) will be used. */ - (void)mmcsd_sendcmd4(priv); + mmcsd_sendcmd4(priv); /* Select high speed SD clocking (which may depend on the DSR setting) */ @@ -3514,7 +3502,7 @@ static int mmcsd_removed(FAR struct mmcsd_state_s *priv) /* Disable clocking to the card */ - (void)SDIO_CLOCK(priv->dev, CLOCK_SDIO_DISABLED); + SDIO_CLOCK(priv->dev, CLOCK_SDIO_DISABLED); return OK; } diff --git a/drivers/mmcsd/mmcsd_spi.c b/drivers/mmcsd/mmcsd_spi.c index 444ba024b8..947d437c4a 100644 --- a/drivers/mmcsd/mmcsd_spi.c +++ b/drivers/mmcsd/mmcsd_spi.c @@ -356,11 +356,9 @@ static const struct mmcsd_cmdinfo_s g_acmd41 = {ACMD41, MMCSD_CMDRESP_R1, 0xff}; static void mmcsd_semtake(FAR struct mmcsd_slot_s *slot) { - int ret; - /* Get exclusive access to the SPI bus (if necessary) */ - (void)SPI_LOCK(slot->spi, true); + SPI_LOCK(slot->spi, true); /* Set the frequency, bit width and mode, as some other driver could have * changed those since the last time that we had the SPI bus. @@ -368,26 +366,14 @@ static void mmcsd_semtake(FAR struct mmcsd_slot_s *slot) SPI_SETMODE(slot->spi, CONFIG_MMCSD_SPIMODE); SPI_SETBITS(slot->spi, 8); - (void)SPI_HWFEATURES(slot->spi, 0); - (void)SPI_SETFREQUENCY(slot->spi, slot->spispeed); + SPI_HWFEATURES(slot->spi, 0); + SPI_SETFREQUENCY(slot->spi, slot->spispeed); /* Get exclusive access to the MMC/SD device (possibly unnecessary if * SPI_LOCK is also implemented as a semaphore). */ - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&slot->sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&slot->sem); } /**************************************************************************** @@ -406,11 +392,11 @@ static void mmcsd_semgive(FAR struct mmcsd_slot_s *slot) * and release the MISO line. */ - (void)SPI_SEND(slot->spi, 0xff); + SPI_SEND(slot->spi, 0xff); /* Relinquish exclusive access to the SPI bus */ - (void)SPI_LOCK(slot->spi, false); + SPI_LOCK(slot->spi, false); } /**************************************************************************** @@ -1012,7 +998,7 @@ static int mmcsd_xmitblock(FAR struct mmcsd_slot_s *slot, /* Transmit the block to the MMC/SD card */ - (void)SPI_SNDBLOCK(spi, buffer, nbytes); + SPI_SNDBLOCK(spi, buffer, nbytes); /* Add the bogus CRC. By default, the SPI interface is initialized in * non-protected mode. However, we still have to send bogus CRC values @@ -1443,7 +1429,7 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer, /* Wait until the card is no longer busy */ - (void)mmcsd_waitready(slot); + mmcsd_waitready(slot); SPI_SELECT(spi, SPIDEV_MMCSD(0), false); SPI_SEND(spi, 0xff); mmcsd_semgive(slot); @@ -1596,7 +1582,7 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot) /* Clock Freq. Identification Mode < 400kHz */ slot->spispeed = MMCSD_IDMODE_CLOCK; - (void)SPI_SETFREQUENCY(spi, MMCSD_IDMODE_CLOCK); + SPI_SETFREQUENCY(spi, MMCSD_IDMODE_CLOCK); /* Set the maximum access time out */ @@ -2000,7 +1986,7 @@ int mmcsd_spislotinitialize(int minor, int slotno, FAR struct spi_dev_s *spi) * removal of cards. */ - (void)SPI_REGISTERCALLBACK(spi, mmcsd_mediachanged, (FAR void *)slot); + SPI_REGISTERCALLBACK(spi, mmcsd_mediachanged, (FAR void *)slot); return OK; } diff --git a/drivers/modem/altair/altmdm.c b/drivers/modem/altair/altmdm.c index c9483f8c8a..39d2081f44 100644 --- a/drivers/modem/altair/altmdm.c +++ b/drivers/modem/altair/altmdm.c @@ -453,7 +453,7 @@ void altmdm_unregister(FAR void *handle) altmdm_uninitialize(priv); - (void)unregister_driver(priv->path); + unregister_driver(priv->path); kmm_free(priv->path); kmm_free(priv); diff --git a/drivers/modem/altair/altmdm_spi.c b/drivers/modem/altair/altmdm_spi.c index c3c39807d9..a85fe1b5a7 100644 --- a/drivers/modem/altair/altmdm_spi.c +++ b/drivers/modem/altair/altmdm_spi.c @@ -1908,11 +1908,11 @@ int altmdm_spi_init(FAR struct altmdm_dev_s *priv) /* SPI settings */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); SPI_SETMODE(priv->spi, SPIDEV_MODE0); SPI_SETBITS(priv->spi, 8); - (void)SPI_SETFREQUENCY(priv->spi, SPI_MAXFREQUENCY); - (void)SPI_LOCK(priv->spi, false); + SPI_SETFREQUENCY(priv->spi, SPI_MAXFREQUENCY); + SPI_LOCK(priv->spi, false); priv->spidev.task_id = task_create(XFER_TASK_NAME, XFER_TASK_PRI, XFER_TASK_STKSIZE, xfer_task, NULL); diff --git a/drivers/modem/altair/altmdm_sys.c b/drivers/modem/altair/altmdm_sys.c index 2c4451f648..f4cb8e4e94 100644 --- a/drivers/modem/altair/altmdm_sys.c +++ b/drivers/modem/altair/altmdm_sys.c @@ -68,9 +68,6 @@ int altmdm_sys_initlock(FAR struct altmdm_sys_lock_s *handle) { int ret; -#ifdef CONFIG_MODEM_ALTMDM_DEBUG - int l_errno; -#endif /* Check argument. */ @@ -79,13 +76,12 @@ int altmdm_sys_initlock(FAR struct altmdm_sys_lock_s *handle) return ERROR; } - ret = sem_init(&handle->sem, 0, 1); + ret = nxsem_init(&handle->sem, 0, 1); #ifdef CONFIG_MODEM_ALTMDM_DEBUG - if (ret == ERROR) + if (ret < 0) { - l_errno = errno; - m_err("sem_init() failed:%d\n", l_errno); + m_err("nxsem_init() failed:%d\n", ret); } #endif @@ -103,9 +99,6 @@ int altmdm_sys_initlock(FAR struct altmdm_sys_lock_s *handle) int altmdm_sys_deletelock(FAR struct altmdm_sys_lock_s *handle) { int ret; -#ifdef CONFIG_MODEM_ALTMDM_DEBUG - int l_errno; -#endif /* Check argument. */ @@ -114,13 +107,12 @@ int altmdm_sys_deletelock(FAR struct altmdm_sys_lock_s *handle) return ERROR; } - ret = sem_destroy(&handle->sem); + ret = nxsem_destroy(&handle->sem); #ifdef CONFIG_MODEM_ALTMDM_DEBUG - if (ret == ERROR) + if (ret < 0) { - l_errno = errno; - m_err("sem_destroy() failed:%d\n", l_errno); + m_err("nxsem_destroy() failed:%d\n", ret); } #endif @@ -138,7 +130,6 @@ int altmdm_sys_deletelock(FAR struct altmdm_sys_lock_s *handle) int altmdm_sys_lock(FAR struct altmdm_sys_lock_s *handle) { int ret; - int l_errno; /* Check argument. */ @@ -147,20 +138,10 @@ int altmdm_sys_lock(FAR struct altmdm_sys_lock_s *handle) return ERROR; } - while (1) + ret = nxsem_wait_uninterruptible(&handle->sem); + if (ret < 0) { - ret = sem_wait(&handle->sem); - if (ret == ERROR) - { - l_errno = errno; - if (l_errno == EINTR) - { - continue; - } - m_err("sem_wait() failed:%d\n", l_errno); - } - - break; + m_err("nxsem_wait_uninterruptible() failed:%d\n", ret); } return ret; @@ -177,9 +158,6 @@ int altmdm_sys_lock(FAR struct altmdm_sys_lock_s *handle) int altmdm_sys_unlock(FAR struct altmdm_sys_lock_s *handle) { int ret; -#ifdef CONFIG_MODEM_ALTMDM_DEBUG - int l_errno; -#endif /* Check argument. */ @@ -188,13 +166,12 @@ int altmdm_sys_unlock(FAR struct altmdm_sys_lock_s *handle) return ERROR; } - ret = sem_post(&handle->sem); + ret = nxsem_post(&handle->sem); #ifdef CONFIG_MODEM_ALTMDM_DEBUG - if (ret == ERROR) + if (ret < 0) { - l_errno = errno; - m_err("sem_post() failed:%d\n", l_errno); + m_err("nxsem_post() failed:%d\n", ret); } #endif @@ -212,9 +189,6 @@ int altmdm_sys_unlock(FAR struct altmdm_sys_lock_s *handle) int altmdm_sys_initcsem(FAR struct altmdm_sys_csem_s *handle) { int ret; -#ifdef CONFIG_MODEM_ALTMDM_DEBUG - int l_errno; -#endif /* Check argument. */ @@ -223,13 +197,12 @@ int altmdm_sys_initcsem(FAR struct altmdm_sys_csem_s *handle) return ERROR; } - ret = sem_init(&handle->sem, 0, 0); + ret = nxsem_init(&handle->sem, 0, 0); #ifdef CONFIG_MODEM_ALTMDM_DEBUG - if (ret == ERROR) + if (ret < 0) { - l_errno = errno; - m_err("sem_init() failed:%d\n", l_errno); + m_err("nxsem_init() failed:%d\n", ret); } #endif @@ -247,9 +220,6 @@ int altmdm_sys_initcsem(FAR struct altmdm_sys_csem_s *handle) int altmdm_sys_deletecsem(FAR struct altmdm_sys_csem_s *handle) { int ret; -#ifdef CONFIG_MODEM_ALTMDM_DEBUG - int l_errno; -#endif /* Check argument. */ @@ -258,13 +228,12 @@ int altmdm_sys_deletecsem(FAR struct altmdm_sys_csem_s *handle) return ERROR; } - ret = sem_destroy(&handle->sem); + ret = nxsem_destroy(&handle->sem); #ifdef CONFIG_MODEM_ALTMDM_DEBUG - if (ret == ERROR) + if (ret < 0) { - l_errno = errno; - m_err("sem_destroy() failed:%d\n", l_errno); + m_err("nxsem_destroy() failed:%d\n", ret); } #endif @@ -282,7 +251,6 @@ int altmdm_sys_deletecsem(FAR struct altmdm_sys_csem_s *handle) int altmdm_sys_waitcsem(FAR struct altmdm_sys_csem_s *handle) { int ret; - int l_errno; /* Check argument. */ @@ -291,21 +259,10 @@ int altmdm_sys_waitcsem(FAR struct altmdm_sys_csem_s *handle) return ERROR; } - while (1) + ret = nxsem_wait_uninterruptible(&handle->sem); + if (ret < 0) { - ret = sem_wait(&handle->sem); - if (ret == ERROR) - { - l_errno = errno; - if (l_errno == EINTR) - { - continue; - } - - m_err("sem_wait() failed:%d\n", l_errno); - } - - break; + m_err("nxsem_wait_uninterruptible() failed:%d\n", ret); } return ret; @@ -322,9 +279,6 @@ int altmdm_sys_waitcsem(FAR struct altmdm_sys_csem_s *handle) int altmdm_sys_postcsem(FAR struct altmdm_sys_csem_s *handle) { int ret; -#ifdef CONFIG_MODEM_ALTMDM_DEBUG - int l_errno; -#endif /* Check argument. */ @@ -333,13 +287,12 @@ int altmdm_sys_postcsem(FAR struct altmdm_sys_csem_s *handle) return ERROR; } - ret = sem_post(&handle->sem); + ret = nxsem_post(&handle->sem); #ifdef CONFIG_MODEM_ALTMDM_DEBUG - if (ret == ERROR) + if (ret < 0) { - l_errno = errno; - m_err("sem_post() failed:%d\n", l_errno); + m_err("nxsem_post() failed:%d\n", ret); } #endif @@ -358,9 +311,6 @@ int altmdm_sys_getcsemvalue(FAR struct altmdm_sys_csem_s *handle, FAR int *value) { int ret; -#ifdef CONFIG_MODEM_ALTMDM_DEBUG - int l_errno; -#endif /* Check argument. */ @@ -369,13 +319,12 @@ int altmdm_sys_getcsemvalue(FAR struct altmdm_sys_csem_s *handle, return ERROR; } - ret = sem_getvalue(&handle->sem, value); + ret = nxsem_getvalue(&handle->sem, value); #ifdef CONFIG_MODEM_ALTMDM_DEBUG - if (ret == ERROR) + if (ret < 0) { - l_errno = errno; - m_err("sem_getvalue() failed:%d\n", l_errno); + m_err("nxsem_getvalue() failed:%d\n", ret); } #endif @@ -393,9 +342,6 @@ int altmdm_sys_getcsemvalue(FAR struct altmdm_sys_csem_s *handle, int altmdm_sys_initflag(FAR struct altmdm_sys_flag_s *handle) { int ret; -#ifdef CONFIG_MODEM_ALTMDM_DEBUG - int l_errno; -#endif /* Check argument. */ @@ -405,13 +351,12 @@ int altmdm_sys_initflag(FAR struct altmdm_sys_flag_s *handle) } handle->flag = 0; - ret = sem_init(&handle->sem, 0, 0); + ret = nxsem_init(&handle->sem, 0, 0); #ifdef CONFIG_MODEM_ALTMDM_DEBUG - if (ret == ERROR) + if (ret < 0) { - l_errno = errno; - m_err("sem_init() failed:%d\n", l_errno); + m_err("nxsem_init() failed:%d\n", ret); } #endif @@ -429,9 +374,6 @@ int altmdm_sys_initflag(FAR struct altmdm_sys_flag_s *handle) int altmdm_sys_deleteflag(FAR struct altmdm_sys_flag_s *handle) { int ret; -#ifdef CONFIG_MODEM_ALTMDM_DEBUG - int l_errno; -#endif /* Check argument. */ @@ -440,13 +382,12 @@ int altmdm_sys_deleteflag(FAR struct altmdm_sys_flag_s *handle) return ERROR; } - ret = sem_destroy(&handle->sem); + ret = nxsem_destroy(&handle->sem); #ifdef CONFIG_MODEM_ALTMDM_DEBUG - if (ret == ERROR) + if (ret < 0) { - l_errno = errno; - m_err("sem_destroy() failed:%d\n", l_errno); + m_err("nxsem_destroy() failed:%d\n", ret); } #endif @@ -466,8 +407,6 @@ int altmdm_sys_waitflag(FAR struct altmdm_sys_flag_s *handle, FAR uint32_t * pattern, uint32_t timeout_ms) { int ret = OK; - int ret2; - int l_errno; struct timespec abs_time; struct timespec curr_time; irqstate_t flags; @@ -538,8 +477,7 @@ int altmdm_sys_waitflag(FAR struct altmdm_sys_flag_s *handle, while (1) { - ret2 = sem_trywait(&handle->sem); - if (ret2 == ERROR) + if (nxsem_trywait(&handle->sem) < 0) { break; } @@ -569,8 +507,7 @@ int altmdm_sys_waitflag(FAR struct altmdm_sys_flag_s *handle, while (1) { - ret2 = sem_trywait(&handle->sem); - if (ret2 == ERROR) + if (nxsem_trywait(&handle->sem) < 0) { break; } @@ -589,16 +526,10 @@ int altmdm_sys_waitflag(FAR struct altmdm_sys_flag_s *handle, { /* Wait for the semaphore to be posted until timeout occurs. */ - ret = sem_timedwait(&handle->sem, &abs_time); - if (ret == ERROR) + ret = nxsem_timedwait_uninterruptible(&handle->sem, &abs_time); + if (ret < 0) { - l_errno = errno; - if (l_errno == EINTR) - { - continue; - } - - m_err("sem_timedwait() failed:%d\n", l_errno); + m_err("nxsem_timedwait_uninterruptible() failed:%d\n", ret); break; } } @@ -606,16 +537,10 @@ int altmdm_sys_waitflag(FAR struct altmdm_sys_flag_s *handle, { /* Wait for the semaphore to be posted forever. */ - ret = sem_wait(&handle->sem); - if (ret == ERROR) + ret = nxsem_wait_uninterruptible(&handle->sem); + if (ret < 0) { - l_errno = errno; - if (l_errno == EINTR) - { - continue; - } - - m_err("sem_wait() failed:%d\n", l_errno); + m_err("nxsem_wait_uninterruptible() failed:%d\n", ret); break; } } @@ -650,7 +575,7 @@ int altmdm_sys_setflag(FAR struct altmdm_sys_flag_s *handle, uint32_t pattern) leave_critical_section(flags); - ret = sem_post(&handle->sem); + ret = nxsem_post(&handle->sem); return ret; } diff --git a/drivers/modem/u-blox.c b/drivers/modem/u-blox.c index 11c5db7066..0d4ca50bd2 100644 --- a/drivers/modem/u-blox.c +++ b/drivers/modem/u-blox.c @@ -324,9 +324,9 @@ void ubxmdm_unregister(FAR void *handle) m_info("Unregistering: %s\n", upper->path); DEBUGASSERT(lower->ops->poweroff); - (void) lower->ops->poweroff(lower); + lower->ops->poweroff(lower); - (void) unregister_driver(upper->path); + unregister_driver(upper->path); kmm_free(upper->path); kmm_free(upper); diff --git a/drivers/mtd/at25.c b/drivers/mtd/at25.c index 58ffde25e1..a35c3a8d01 100644 --- a/drivers/mtd/at25.c +++ b/drivers/mtd/at25.c @@ -191,7 +191,7 @@ static void at25_lock(FAR struct spi_dev_s *dev) * the SPI buss. We will retain that exclusive access until the bus is unlocked. */ - (void)SPI_LOCK(dev, true); + SPI_LOCK(dev, true); /* After locking the SPI bus, the we also need call the setfrequency, setbits, and * setmode methods to make sure that the SPI is properly configured for the device. @@ -201,8 +201,8 @@ static void at25_lock(FAR struct spi_dev_s *dev) SPI_SETMODE(dev, CONFIG_AT25_SPIMODE); SPI_SETBITS(dev, 8); - (void)SPI_HWFEATURES(dev, 0); - (void)SPI_SETFREQUENCY(dev, CONFIG_AT25_SPIFREQUENCY); + SPI_HWFEATURES(dev, 0); + SPI_SETFREQUENCY(dev, CONFIG_AT25_SPIFREQUENCY); } /************************************************************************************ @@ -211,7 +211,7 @@ static void at25_lock(FAR struct spi_dev_s *dev) static inline void at25_unlock(FAR struct spi_dev_s *dev) { - (void)SPI_LOCK(dev, false); + SPI_LOCK(dev, false); } /************************************************************************************ @@ -232,7 +232,7 @@ static inline int at25_readid(struct at25_dev_s *priv) /* Send the "Read ID (RDID)" command and read the first three ID bytes */ - (void)SPI_SEND(priv->dev, AT25_RDID); + SPI_SEND(priv->dev, AT25_RDID); manufacturer = SPI_SEND(priv->dev, AT25_DUMMY); memory = SPI_SEND(priv->dev, AT25_DUMMY); @@ -284,7 +284,7 @@ static void at25_waitwritecomplete(struct at25_dev_s *priv) /* Send "Read Status Register (RDSR)" command */ - (void)SPI_SEND(priv->dev, AT25_RDSR); + SPI_SEND(priv->dev, AT25_RDSR); /* Send a dummy byte to generate the clock needed to shift out the status */ @@ -323,7 +323,7 @@ static void at25_waitwritecomplete(struct at25_dev_s *priv) static void at25_writeenable(struct at25_dev_s *priv) { SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); - (void)SPI_SEND(priv->dev, AT25_WREN); + SPI_SEND(priv->dev, AT25_WREN); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), false); finfo("Enabled\n"); } @@ -356,16 +356,16 @@ static inline void at25_sectorerase(struct at25_dev_s *priv, off_t sector) /* Send the "Sector Erase (SE)" instruction */ - (void)SPI_SEND(priv->dev, AT25_SE); + SPI_SEND(priv->dev, AT25_SE); /* Send the sector offset high byte first. For all of the supported * parts, the sector number is completely contained in the first byte * and the values used in the following two bytes don't really matter. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Deselect the FLASH */ @@ -399,7 +399,7 @@ static inline int at25_bulkerase(struct at25_dev_s *priv) /* Send the "Bulk Erase (BE)" instruction */ - (void)SPI_SEND(priv->dev, AT25_BE); + SPI_SEND(priv->dev, AT25_BE); /* Deselect the FLASH */ @@ -437,13 +437,13 @@ static inline void at25_pagewrite(struct at25_dev_s *priv, FAR const uint8_t *bu /* Send "Page Program (PP)" command */ - (void)SPI_SEND(priv->dev, AT25_PP); + SPI_SEND(priv->dev, AT25_PP); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Then write the specified number of bytes */ @@ -563,13 +563,13 @@ static ssize_t at25_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, /* Send "Read from Memory " instruction */ - (void)SPI_SEND(priv->dev, AT25_READ); + SPI_SEND(priv->dev, AT25_READ); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Then read all of the requested bytes */ @@ -708,8 +708,8 @@ FAR struct mtd_dev_s *at25_initialize(FAR struct spi_dev_s *dev) at25_writeenable(priv); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); - (void)SPI_SEND(priv->dev, AT25_WRSR); - (void)SPI_SEND(priv->dev, AT25_SR_UNPROT); + SPI_SEND(priv->dev, AT25_WRSR); + SPI_SEND(priv->dev, AT25_SR_UNPROT); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), false); } } diff --git a/drivers/mtd/at45db.c b/drivers/mtd/at45db.c index 92b6287144..12a68c36b8 100644 --- a/drivers/mtd/at45db.c +++ b/drivers/mtd/at45db.c @@ -282,7 +282,7 @@ static void at45db_lock(FAR struct at45db_dev_s *priv) * the SPI bus. We will retain that exclusive access until the bus is unlocked. */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); /* After locking the SPI bus, the we also need call the setfrequency, setbits, and * setmode methods to make sure that the SPI is properly configured for the device. @@ -292,8 +292,8 @@ static void at45db_lock(FAR struct at45db_dev_s *priv) SPI_SETMODE(priv->spi, SPIDEV_MODE0); SPI_SETBITS(priv->spi, 8); - (void)SPI_HWFEATURES(priv->spi, 0); - (void)SPI_SETFREQUENCY(priv->spi, CONFIG_AT45DB_FREQUENCY); + SPI_HWFEATURES(priv->spi, 0); + SPI_SETFREQUENCY(priv->spi, CONFIG_AT45DB_FREQUENCY); } /************************************************************************************ @@ -302,7 +302,7 @@ static void at45db_lock(FAR struct at45db_dev_s *priv) static inline void at45db_unlock(FAR struct at45db_dev_s *priv) { - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); } /************************************************************************************ @@ -353,7 +353,7 @@ static inline int at45db_rdid(FAR struct at45db_dev_s *priv) * ID bytes from the FLASH. */ - (void)SPI_SEND(priv->spi, AT45DB_RDDEVID); + SPI_SEND(priv->spi, AT45DB_RDDEVID); SPI_RECVBLOCK(priv->spi, devid, 3); /* Deselect the FLASH */ diff --git a/drivers/mtd/filemtd.c b/drivers/mtd/filemtd.c index 60949f38d2..e86095c157 100644 --- a/drivers/mtd/filemtd.c +++ b/drivers/mtd/filemtd.c @@ -205,7 +205,7 @@ static ssize_t filemtd_write(FAR struct file_dev_s *priv, size_t offset, if (buflen == 0) { file_seek(&priv->mtdfile, seekpos, SEEK_SET); - (void)file_write(&priv->mtdfile, buf, sizeof(buf)); + file_write(&priv->mtdfile, buf, sizeof(buf)); seekpos += sizeof(buf); } } @@ -215,7 +215,7 @@ static ssize_t filemtd_write(FAR struct file_dev_s *priv, size_t offset, if (buflen != 0) { file_seek(&priv->mtdfile, seekpos, SEEK_SET); - (void)file_write(&priv->mtdfile, buf, sizeof(buf)); + file_write(&priv->mtdfile, buf, sizeof(buf)); } return len; @@ -231,7 +231,7 @@ static ssize_t filemtd_read(FAR struct file_dev_s *priv, { /* Set the starting location in the file */ - (void)file_seek(&priv->mtdfile, priv->offset + offsetbytes, SEEK_SET); + file_seek(&priv->mtdfile, priv->offset + offsetbytes, SEEK_SET); return file_read(&priv->mtdfile, buffer, nbytes); } @@ -282,7 +282,7 @@ static int filemtd_erase(FAR struct mtd_dev_s *dev, off_t startblock, memset(buffer, CONFIG_FILEMTD_ERASESTATE, sizeof(buffer)); while (nbytes) { - (void)file_write(&priv->mtdfile, buffer, sizeof(buffer)); + file_write(&priv->mtdfile, buffer, sizeof(buffer)); nbytes -= sizeof(buffer); } @@ -325,7 +325,7 @@ static ssize_t filemtd_bread(FAR struct mtd_dev_s *dev, off_t startblock, /* Then read the data from the file */ - (void)filemtd_read(priv, buf, offset, nbytes); + filemtd_read(priv, buf, offset, nbytes); return nblocks; } @@ -387,7 +387,7 @@ static ssize_t filemtd_byteread(FAR struct mtd_dev_s *dev, off_t offset, return 0; } - (void)filemtd_read(priv, buf, offset, nbytes); + filemtd_read(priv, buf, offset, nbytes); return nbytes; } diff --git a/drivers/mtd/gd25.c b/drivers/mtd/gd25.c index 930e57c71c..6f0cd10758 100644 --- a/drivers/mtd/gd25.c +++ b/drivers/mtd/gd25.c @@ -217,7 +217,7 @@ static ssize_t gd25_write(FAR struct mtd_dev_s *dev, off_t offset, static inline void gd25_purdid(FAR struct gd25_dev_s *priv) { SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), true); - (void)SPI_SEND(priv->spi, GD25_PURDID); + SPI_SEND(priv->spi, GD25_PURDID); SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), false); up_udelay(20); } @@ -229,7 +229,7 @@ static inline void gd25_purdid(FAR struct gd25_dev_s *priv) static inline void gd25_pd(FAR struct gd25_dev_s *priv) { SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), true); - (void)SPI_SEND(priv->spi, GD25_PD); + SPI_SEND(priv->spi, GD25_PD); SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), false); } @@ -239,12 +239,12 @@ static inline void gd25_pd(FAR struct gd25_dev_s *priv) static void gd25_lock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); SPI_SETMODE(spi, CONFIG_GD25_SPIMODE); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_GD25_SPIFREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_GD25_SPIFREQUENCY); } /************************************************************************** @@ -253,7 +253,7 @@ static void gd25_lock(FAR struct spi_dev_s *spi) static inline void gd25_unlock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } /************************************************************************** @@ -278,7 +278,7 @@ static inline int gd25_readid(FAR struct gd25_dev_s *priv) /* Send the "Read ID (RDID)" command and read the first three ID bytes */ - (void)SPI_SEND(priv->spi, GD25_JEDEC_ID); + SPI_SEND(priv->spi, GD25_JEDEC_ID); manufacturer = SPI_SEND(priv->spi, GD25_DUMMY); memory = SPI_SEND(priv->spi, GD25_DUMMY); capacity = SPI_SEND(priv->spi, GD25_DUMMY); @@ -371,7 +371,7 @@ static void gd25_unprotect(FAR struct gd25_dev_s *priv) /* Wait for any preceding write or erase operation to complete. */ - (void)gd25_waitwritecomplete(priv); + gd25_waitwritecomplete(priv); /* Send "Write enable (WREN)" */ @@ -433,7 +433,7 @@ static inline uint8_t gd25_rdsr(FAR struct gd25_dev_s *priv, uint32_t id) }; SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), true); - (void)SPI_SEND(priv->spi, rdsr[id]); + SPI_SEND(priv->spi, rdsr[id]); status = SPI_SEND(priv->spi, GD25_DUMMY); SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), false); @@ -447,7 +447,7 @@ static inline uint8_t gd25_rdsr(FAR struct gd25_dev_s *priv, uint32_t id) static inline void gd25_4ben(FAR struct gd25_dev_s *priv) { SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), true); - (void)SPI_SEND(priv->spi, GD25_4BEN); + SPI_SEND(priv->spi, GD25_4BEN); SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), false); } @@ -458,7 +458,7 @@ static inline void gd25_4ben(FAR struct gd25_dev_s *priv) static inline void gd25_wren(FAR struct gd25_dev_s *priv) { SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), true); - (void)SPI_SEND(priv->spi, GD25_WREN); + SPI_SEND(priv->spi, GD25_WREN); SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), false); } @@ -469,7 +469,7 @@ static inline void gd25_wren(FAR struct gd25_dev_s *priv) static inline void gd25_wrdi(FAR struct gd25_dev_s *priv) { SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), true); - (void)SPI_SEND(priv->spi, GD25_WRDI); + SPI_SEND(priv->spi, GD25_WRDI); SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), false); } @@ -536,7 +536,7 @@ static void gd25_sectorerase(FAR struct gd25_dev_s *priv, off_t sector) /* Wait for any preceding write or erase operation to complete. */ - (void)gd25_waitwritecomplete(priv); + gd25_waitwritecomplete(priv); /* Send write enable instruction */ @@ -546,7 +546,7 @@ static void gd25_sectorerase(FAR struct gd25_dev_s *priv, off_t sector) /* Send the "Sector Erase (SE)" instruction */ - (void)SPI_SEND(priv->spi, GD25_SE); + SPI_SEND(priv->spi, GD25_SE); priv->prev_instr = GD25_SE; /* Send the sector address high byte first. Only the most significant @@ -555,12 +555,12 @@ static void gd25_sectorerase(FAR struct gd25_dev_s *priv, off_t sector) if (priv->addr_4byte) { - (void)SPI_SEND(priv->spi, (address >> 24) & 0xff); + SPI_SEND(priv->spi, (address >> 24) & 0xff); } - (void)SPI_SEND(priv->spi, (address >> 16) & 0xff); - (void)SPI_SEND(priv->spi, (address >> 8) & 0xff); - (void)SPI_SEND(priv->spi, address & 0xff); + SPI_SEND(priv->spi, (address >> 16) & 0xff); + SPI_SEND(priv->spi, (address >> 8) & 0xff); + SPI_SEND(priv->spi, address & 0xff); SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), false); } @@ -573,7 +573,7 @@ static inline int gd25_chiperase(FAR struct gd25_dev_s *priv) { /* Wait for any preceding write or erase operation to complete. */ - (void)gd25_waitwritecomplete(priv); + gd25_waitwritecomplete(priv); /* Send write enable instruction */ @@ -583,7 +583,7 @@ static inline int gd25_chiperase(FAR struct gd25_dev_s *priv) /* Send the "Chip Erase (CE)" instruction */ - (void)SPI_SEND(priv->spi, GD25_CE); + SPI_SEND(priv->spi, GD25_CE); priv->prev_instr = GD25_CE; SPI_SELECT(priv->spi, SPIDEV_FLASH(priv->spi_devid), false); @@ -612,10 +612,10 @@ static void gd25_byteread(FAR struct gd25_dev_s *priv, FAR uint8_t *buffer, /* Send "Read from Memory " instruction */ #ifdef CONFIG_GD25_SLOWREAD - (void)SPI_SEND(priv->spi, GD25_RDDATA); + SPI_SEND(priv->spi, GD25_RDDATA); priv->prev_instr = GD25_RDDATA; #else - (void)SPI_SEND(priv->spi, GD25_FRD); + SPI_SEND(priv->spi, GD25_FRD); priv->prev_instr = GD25_FRD; #endif @@ -623,17 +623,17 @@ static void gd25_byteread(FAR struct gd25_dev_s *priv, FAR uint8_t *buffer, if (priv->addr_4byte) { - (void)SPI_SEND(priv->spi, (address >> 24) & 0xff); + SPI_SEND(priv->spi, (address >> 24) & 0xff); } - (void)SPI_SEND(priv->spi, (address >> 16) & 0xff); - (void)SPI_SEND(priv->spi, (address >> 8) & 0xff); - (void)SPI_SEND(priv->spi, address & 0xff); + SPI_SEND(priv->spi, (address >> 16) & 0xff); + SPI_SEND(priv->spi, (address >> 8) & 0xff); + SPI_SEND(priv->spi, address & 0xff); /* Send a dummy byte */ #ifndef CONFIG_GD25_SLOWREAD - (void)SPI_SEND(priv->spi, GD25_DUMMY); + SPI_SEND(priv->spi, GD25_DUMMY); #endif /* Then read all of the requested bytes */ @@ -677,12 +677,12 @@ static void gd25_pagewrite(FAR struct gd25_dev_s *priv, if (priv->addr_4byte) { - (void)SPI_SEND(priv->spi, (address >> 24) & 0xff); + SPI_SEND(priv->spi, (address >> 24) & 0xff); } - (void)SPI_SEND(priv->spi, (address >> 16) & 0xff); - (void)SPI_SEND(priv->spi, (address >> 8) & 0xff); - (void)SPI_SEND(priv->spi, address & 0xff); + SPI_SEND(priv->spi, (address >> 16) & 0xff); + SPI_SEND(priv->spi, (address >> 8) & 0xff); + SPI_SEND(priv->spi, address & 0xff); /* Then send the page of data */ @@ -725,19 +725,19 @@ static inline void gd25_bytewrite(FAR struct gd25_dev_s *priv, /* Send "Page Program (PP)" command */ - (void)SPI_SEND(priv->spi, GD25_PP); + SPI_SEND(priv->spi, GD25_PP); priv->prev_instr = GD25_PP; /* Send the page offset high byte first. */ if (priv->addr_4byte) { - (void)SPI_SEND(priv->spi, (offset >> 24) & 0xff); + SPI_SEND(priv->spi, (offset >> 24) & 0xff); } - (void)SPI_SEND(priv->spi, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->spi, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->spi, offset & 0xff); + SPI_SEND(priv->spi, (offset >> 16) & 0xff); + SPI_SEND(priv->spi, (offset >> 8) & 0xff); + SPI_SEND(priv->spi, offset & 0xff); /* Then write the specified number of bytes */ diff --git a/drivers/mtd/gd5f.c b/drivers/mtd/gd5f.c index f9ee51c8ea..1fc3f15de3 100644 --- a/drivers/mtd/gd5f.c +++ b/drivers/mtd/gd5f.c @@ -223,12 +223,12 @@ static int gd5f_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblock static inline void gd5f_lock(FAR struct spi_dev_s *dev) { - (void)SPI_LOCK(dev, true); + SPI_LOCK(dev, true); SPI_SETMODE(dev, CONFIG_GD5F_SPIMODE); SPI_SETBITS(dev, 8); - (void)SPI_HWFEATURES(dev, 0); - (void)SPI_SETFREQUENCY(dev, CONFIG_GD5F_SPIFREQUENCY); + SPI_HWFEATURES(dev, 0); + SPI_SETFREQUENCY(dev, CONFIG_GD5F_SPIFREQUENCY); } /************************************************************************************ @@ -237,7 +237,7 @@ static inline void gd5f_lock(FAR struct spi_dev_s *dev) static inline void gd5f_unlock(FAR struct spi_dev_s *dev) { - (void)SPI_LOCK(dev, false); + SPI_LOCK(dev, false); } /************************************************************************************ @@ -259,8 +259,8 @@ static int gd5f_readid(FAR struct gd5f_dev_s *priv) /* Send the "Read ID" command and read two ID bytes */ - (void)SPI_SEND(priv->dev, GD5F_READ_ID); - (void)SPI_SEND(priv->dev, GD5F_DUMMY); + SPI_SEND(priv->dev, GD5F_READ_ID); + SPI_SEND(priv->dev, GD5F_DUMMY); manufacturer = SPI_SEND(priv->dev, GD5F_DUMMY); deviceid = SPI_SEND(priv->dev, GD5F_DUMMY); @@ -321,8 +321,8 @@ static bool gd5f_waitstatus(FAR struct gd5f_dev_s *priv, uint8_t mask, bool succ /* Get feature command */ - (void)SPI_SEND(priv->dev, GD5F_GET_FEATURE); - (void)SPI_SEND(priv->dev, GD5F_STATUS); + SPI_SEND(priv->dev, GD5F_GET_FEATURE); + SPI_SEND(priv->dev, GD5F_STATUS); status = SPI_SEND(priv->dev, GD5F_DUMMY); /* Deselect the FLASH */ @@ -349,7 +349,7 @@ static inline void gd5f_writeenable(FAR struct gd5f_dev_s *priv) /* Send Write Enable command */ - (void)SPI_SEND(priv->dev, GD5F_WRITE_ENABLE); + SPI_SEND(priv->dev, GD5F_WRITE_ENABLE); /* Deselect the FLASH */ @@ -368,7 +368,7 @@ static inline void gd5f_writedisable(FAR struct gd5f_dev_s *priv) /* Send Write Enable command */ - (void)SPI_SEND(priv->dev, GD5F_WRITE_DISABLE); + SPI_SEND(priv->dev, GD5F_WRITE_DISABLE); /* Deselect the FLASH */ @@ -395,10 +395,10 @@ static bool gd5f_sectorerase(FAR struct gd5f_dev_s *priv, off_t startsector) /* Send the Block Erase instruction */ - (void)SPI_SEND(priv->dev, GD5F_BLOCK_ERASE); - (void)SPI_SEND(priv->dev, (block >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (block >> 8) & 0xff); - (void)SPI_SEND(priv->dev, block & 0xff); + SPI_SEND(priv->dev, GD5F_BLOCK_ERASE); + SPI_SEND(priv->dev, (block >> 16) & 0xff); + SPI_SEND(priv->dev, (block >> 8) & 0xff); + SPI_SEND(priv->dev, block & 0xff); /* De-select the FLASH */ @@ -455,16 +455,16 @@ static void gd5f_readbuffer(FAR struct gd5f_dev_s *priv, uint32_t address, SPI_SELECT(priv->dev, SPIDEV_FLASH(priv->spi_devid), true); - (void)SPI_SEND(priv->dev, GD5F_READ_FROM_CACHE); + SPI_SEND(priv->dev, GD5F_READ_FROM_CACHE); /* Send the address high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, (offset) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, (offset) & 0xff); /* Send a dummy byte */ - (void)SPI_SEND(priv->dev, GD5F_DUMMY); + SPI_SEND(priv->dev, GD5F_DUMMY); /* Then read all of the requested bytes */ @@ -489,10 +489,10 @@ static bool gd5f_read_page(FAR struct gd5f_dev_s *priv, uint32_t pageaddress) /* Send the Read Page instruction */ - (void)SPI_SEND(priv->dev, GD5F_PAGE_READ); - (void)SPI_SEND(priv->dev, (row >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (row >> 8) & 0xff); - (void)SPI_SEND(priv->dev, row & 0xff); + SPI_SEND(priv->dev, GD5F_PAGE_READ); + SPI_SEND(priv->dev, (row >> 16) & 0xff); + SPI_SEND(priv->dev, (row >> 8) & 0xff); + SPI_SEND(priv->dev, row & 0xff); /* Deselect the FLASH */ @@ -598,12 +598,12 @@ static void gd5f_write_to_cache(FAR struct gd5f_dev_s *priv, uint32_t address, /* Send the Program Load command */ - (void)SPI_SEND(priv->dev, GD5F_PROGRAM_LOAD); + SPI_SEND(priv->dev, GD5F_PROGRAM_LOAD); /* Send the address high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, (offset) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, (offset) & 0xff); /* Send block of bytes */ @@ -628,10 +628,10 @@ static bool gd5f_execute_write(FAR struct gd5f_dev_s *priv, uint32_t pageaddress /* Send the Program Execute instruction */ - (void)SPI_SEND(priv->dev, GD5F_PROGRAM_EXECUTE); - (void)SPI_SEND(priv->dev, (row >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (row >> 8) & 0xff); - (void)SPI_SEND(priv->dev, row & 0xff); + SPI_SEND(priv->dev, GD5F_PROGRAM_EXECUTE); + SPI_SEND(priv->dev, (row >> 16) & 0xff); + SPI_SEND(priv->dev, (row >> 8) & 0xff); + SPI_SEND(priv->dev, row & 0xff); /* De-select the FLASH */ @@ -772,8 +772,8 @@ static int gd5f_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) static inline void gd5f_eccstatusread(FAR struct gd5f_dev_s *priv) { SPI_SELECT(priv->dev, SPIDEV_FLASH(priv->spi_devid), true); - (void)SPI_SEND(priv->dev, GD5F_GET_FEATURE); - (void)SPI_SEND(priv->dev, GD5F_STATUS); + SPI_SEND(priv->dev, GD5F_GET_FEATURE); + SPI_SEND(priv->dev, GD5F_STATUS); priv->eccstatus = SPI_SEND(priv->dev, GD5F_DUMMY); SPI_SELECT(priv->dev, SPIDEV_FLASH(priv->spi_devid), false); } @@ -790,9 +790,9 @@ static inline void gd5f_enable_ecc(FAR struct gd5f_dev_s *priv) gd5f_writeenable(priv); SPI_SELECT(priv->dev, SPIDEV_FLASH(priv->spi_devid), true); - (void)SPI_SEND(priv->dev, GD5F_SET_FEATURE); - (void)SPI_SEND(priv->dev, GD5F_SECURE_OTP); - (void)SPI_SEND(priv->dev, secure_otp); + SPI_SEND(priv->dev, GD5F_SET_FEATURE); + SPI_SEND(priv->dev, GD5F_SECURE_OTP); + SPI_SEND(priv->dev, secure_otp); SPI_SELECT(priv->dev, SPIDEV_FLASH(priv->spi_devid), false); gd5f_writedisable(priv); @@ -811,9 +811,9 @@ static inline void gd5f_unlockblocks(FAR struct gd5f_dev_s *priv) gd5f_writeenable(priv); SPI_SELECT(priv->dev, SPIDEV_FLASH(priv->spi_devid), true); - (void)SPI_SEND(priv->dev, GD5F_SET_FEATURE); - (void)SPI_SEND(priv->dev, GD5F_BLOCK_PROTECTION); - (void)SPI_SEND(priv->dev, blockprotection); + SPI_SEND(priv->dev, GD5F_SET_FEATURE); + SPI_SEND(priv->dev, GD5F_BLOCK_PROTECTION); + SPI_SEND(priv->dev, blockprotection); SPI_SELECT(priv->dev, SPIDEV_FLASH(priv->spi_devid), false); gd5f_writedisable(priv); @@ -864,7 +864,7 @@ FAR struct mtd_dev_s *gd5f_initialize(FAR struct spi_dev_s *dev, /* Reset the flash */ SPI_SELECT(priv->dev, SPIDEV_FLASH(priv->spi_devid), true); - (void)SPI_SEND(priv->dev, GD5F_RESET); + SPI_SEND(priv->dev, GD5F_RESET); SPI_SELECT(priv->dev, SPIDEV_FLASH(priv->spi_devid), false); /* Wait reset complete */ diff --git a/drivers/mtd/is25xp.c b/drivers/mtd/is25xp.c index 5632ddb495..fd151aa3cd 100644 --- a/drivers/mtd/is25xp.c +++ b/drivers/mtd/is25xp.c @@ -216,7 +216,7 @@ static void is25xp_lock(FAR struct spi_dev_s *dev) * the SPI buss. We will retain that exclusive access until the bus is unlocked. */ - (void)SPI_LOCK(dev, true); + SPI_LOCK(dev, true); /* After locking the SPI bus, the we also need call the setfrequency, setbits, and * setmode methods to make sure that the SPI is properly configured for the device. @@ -226,8 +226,8 @@ static void is25xp_lock(FAR struct spi_dev_s *dev) SPI_SETMODE(dev, CONFIG_IS25XP_SPIMODE); SPI_SETBITS(dev, 8); - (void)SPI_HWFEATURES(dev, 0); - (void)SPI_SETFREQUENCY(dev, CONFIG_IS25XP_SPIFREQUENCY); + SPI_HWFEATURES(dev, 0); + SPI_SETFREQUENCY(dev, CONFIG_IS25XP_SPIFREQUENCY); } /************************************************************************************ @@ -236,7 +236,7 @@ static void is25xp_lock(FAR struct spi_dev_s *dev) static inline void is25xp_unlock(FAR struct spi_dev_s *dev) { - (void)SPI_LOCK(dev, false); + SPI_LOCK(dev, false); } /************************************************************************************ @@ -258,7 +258,7 @@ static inline int is25xp_readid(struct is25xp_dev_s *priv) /* Send the "Read ID (RDID)" command and read the first three ID bytes */ - (void)SPI_SEND(priv->dev, IS25_RDID); + SPI_SEND(priv->dev, IS25_RDID); manufacturer = SPI_SEND(priv->dev, IS25_DUMMY); memory = SPI_SEND(priv->dev, IS25_DUMMY); capacity = SPI_SEND(priv->dev, IS25_DUMMY); @@ -329,7 +329,7 @@ static void is25xp_waitwritecomplete(struct is25xp_dev_s *priv) /* Send "Read Status Register (RDSR)" command */ - (void)SPI_SEND(priv->dev, IS25_RDSR); + SPI_SEND(priv->dev, IS25_RDSR); /* Loop as long as the memory is busy with a write cycle */ @@ -357,7 +357,7 @@ static void is25xp_waitwritecomplete(struct is25xp_dev_s *priv) /* Send "Read Status Register (RDSR)" command */ - (void)SPI_SEND(priv->dev, IS25_RDSR); + SPI_SEND(priv->dev, IS25_RDSR); /* Send a dummy byte to generate the clock needed to shift out the status */ @@ -399,7 +399,7 @@ static void is25xp_writeenable(struct is25xp_dev_s *priv) /* Send "Write Enable (WREN)" command */ - (void)SPI_SEND(priv->dev, IS25_WREN); + SPI_SEND(priv->dev, IS25_WREN); /* Deselect the FLASH */ @@ -461,16 +461,16 @@ static void is25xp_sectorerase(struct is25xp_dev_s *priv, off_t sector, uint8_t * that was passed in as the erase type. */ - (void)SPI_SEND(priv->dev, type); + SPI_SEND(priv->dev, type); /* Send the sector offset high byte first. For all of the supported * parts, the sector number is completely contained in the first byte * and the values used in the following two bytes don't really matter. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); priv->lastwaswrite = true; /* Deselect the FLASH */ @@ -505,7 +505,7 @@ static inline int is25xp_bulkerase(struct is25xp_dev_s *priv) /* Send the "Chip Erase (CER)" instruction */ - (void)SPI_SEND(priv->dev, IS25_CER); + SPI_SEND(priv->dev, IS25_CER); /* Deselect the FLASH */ @@ -545,13 +545,13 @@ static inline void is25xp_pagewrite(struct is25xp_dev_s *priv, FAR const uint8_t /* Send "Page Program (PP)" command */ - (void)SPI_SEND(priv->dev, IS25_PP); + SPI_SEND(priv->dev, IS25_PP); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Then write the specified number of bytes */ @@ -593,13 +593,13 @@ static inline void is25xp_bytewrite(struct is25xp_dev_s *priv, /* Send "Page Program (PP)" command */ - (void)SPI_SEND(priv->dev, IS25_PP); + SPI_SEND(priv->dev, IS25_PP); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Then write the specified number of bytes */ @@ -773,13 +773,13 @@ static ssize_t is25xp_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyte /* Send "Read from Memory " instruction */ - (void)SPI_SEND(priv->dev, IS25_READ); + SPI_SEND(priv->dev, IS25_READ); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Then read all of the requested bytes */ diff --git a/drivers/mtd/m25px.c b/drivers/mtd/m25px.c index 8b015930c4..299ddc85df 100644 --- a/drivers/mtd/m25px.c +++ b/drivers/mtd/m25px.c @@ -297,7 +297,7 @@ static void m25p_lock(FAR struct spi_dev_s *dev) * the SPI buss. We will retain that exclusive access until the bus is unlocked. */ - (void)SPI_LOCK(dev, true); + SPI_LOCK(dev, true); /* After locking the SPI bus, the we also need call the setfrequency, setbits, and * setmode methods to make sure that the SPI is properly configured for the device. @@ -307,8 +307,8 @@ static void m25p_lock(FAR struct spi_dev_s *dev) SPI_SETMODE(dev, CONFIG_M25P_SPIMODE); SPI_SETBITS(dev, 8); - (void)SPI_HWFEATURES(dev, 0); - (void)SPI_SETFREQUENCY(dev, CONFIG_M25P_SPIFREQUENCY); + SPI_HWFEATURES(dev, 0); + SPI_SETFREQUENCY(dev, CONFIG_M25P_SPIFREQUENCY); } /************************************************************************************ @@ -317,7 +317,7 @@ static void m25p_lock(FAR struct spi_dev_s *dev) static inline void m25p_unlock(FAR struct spi_dev_s *dev) { - (void)SPI_LOCK(dev, false); + SPI_LOCK(dev, false); } /************************************************************************************ @@ -339,7 +339,7 @@ static inline int m25p_readid(struct m25p_dev_s *priv) /* Send the "Read ID (RDID)" command and read the first three ID bytes */ - (void)SPI_SEND(priv->dev, M25P_RDID); + SPI_SEND(priv->dev, M25P_RDID); manufacturer = SPI_SEND(priv->dev, M25P_DUMMY); memory = SPI_SEND(priv->dev, M25P_DUMMY); capacity = SPI_SEND(priv->dev, M25P_DUMMY); @@ -475,7 +475,7 @@ static void m25p_waitwritecomplete(struct m25p_dev_s *priv) /* Send "Read Status Register (RDSR)" command */ - (void)SPI_SEND(priv->dev, M25P_RDSR); + SPI_SEND(priv->dev, M25P_RDSR); /* Send a dummy byte to generate the clock needed to shift out the status */ @@ -514,7 +514,7 @@ static void m25p_writeenable(struct m25p_dev_s *priv) /* Send "Write Enable (WREN)" command */ - (void)SPI_SEND(priv->dev, M25P_WREN); + SPI_SEND(priv->dev, M25P_WREN); /* Deselect the FLASH */ @@ -563,16 +563,16 @@ static void m25p_sectorerase(struct m25p_dev_s *priv, off_t sector, uint8_t type * that was passed in as the erase type. */ - (void)SPI_SEND(priv->dev, type); + SPI_SEND(priv->dev, type); /* Send the sector offset high byte first. For all of the supported * parts, the sector number is completely contained in the first byte * and the values used in the following two bytes don't really matter. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Deselect the FLASH */ @@ -606,7 +606,7 @@ static inline int m25p_bulkerase(struct m25p_dev_s *priv) /* Send the "Bulk Erase (BE)" instruction */ - (void)SPI_SEND(priv->dev, M25P_BE); + SPI_SEND(priv->dev, M25P_BE); /* Deselect the FLASH */ @@ -644,13 +644,13 @@ static inline void m25p_pagewrite(struct m25p_dev_s *priv, FAR const uint8_t *bu /* Send "Page Program (PP)" command */ - (void)SPI_SEND(priv->dev, M25P_PP); + SPI_SEND(priv->dev, M25P_PP); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Then write the specified number of bytes */ @@ -690,13 +690,13 @@ static inline void m25p_bytewrite(struct m25p_dev_s *priv, FAR const uint8_t *bu /* Send "Page Program (PP)" command */ - (void)SPI_SEND(priv->dev, M25P_PP); + SPI_SEND(priv->dev, M25P_PP); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Then write the specified number of bytes */ @@ -857,13 +857,13 @@ static ssize_t m25p_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, /* Send "Read from Memory" instruction */ - (void)SPI_SEND(priv->dev, M25P_READ); + SPI_SEND(priv->dev, M25P_READ); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Then read all of the requested bytes */ diff --git a/drivers/mtd/mtd_config.c b/drivers/mtd/mtd_config.c index 3d70dbe1ac..931a67e8c1 100644 --- a/drivers/mtd/mtd_config.c +++ b/drivers/mtd/mtd_config.c @@ -1022,7 +1022,6 @@ static int mtdconfig_open(FAR struct file *filep) if (ret < 0) { ferr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } @@ -1717,7 +1716,7 @@ int mtdconfig_register(FAR struct mtd_dev_s *mtd) dev->erasesize = geo.erasesize; dev->nblocks = geo.neraseblocks * geo.erasesize / geo.blocksize; - (void)register_driver("/dev/config", &mtdconfig_fops, 0666, dev); + register_driver("/dev/config", &mtdconfig_fops, 0666, dev); } errout: diff --git a/drivers/mtd/mtd_nand.c b/drivers/mtd/mtd_nand.c index 7313eac6b8..7f5a2781b2 100644 --- a/drivers/mtd/mtd_nand.c +++ b/drivers/mtd/mtd_nand.c @@ -144,12 +144,7 @@ static int nand_ioctl(struct mtd_dev_s *dev, int cmd, static int nand_lock(FAR struct nand_dev_s *nand) { - int errcode; - int ret; - - ret = nxsem_wait(&nand->exclsem); - DEBUGASSERT(ret == OK || ret == -EINTR); - return ret; + return nxsem_wait(&nand->exclsem); } /**************************************************************************** @@ -939,7 +934,7 @@ FAR struct mtd_dev_s *nand_initialize(FAR struct nand_raw_s *raw) /* Disable any internal, embedded ECC function */ - (void)onfi_embeddedecc(&onfi, cmdaddr, addraddr, dataaddr, false); + onfi_embeddedecc(&onfi, cmdaddr, addraddr, dataaddr, false); } /* Allocate an NAND MTD device structure */ @@ -963,7 +958,7 @@ FAR struct mtd_dev_s *nand_initialize(FAR struct nand_raw_s *raw) /* Scan the device for bad blocks */ - (void)nand_devscan(nand); + nand_devscan(nand); /* Return the implementation-specific state structure as the MTD device */ diff --git a/drivers/mtd/mx25lx.c b/drivers/mtd/mx25lx.c index 25b6249076..128cb28ef7 100644 --- a/drivers/mtd/mx25lx.c +++ b/drivers/mtd/mx25lx.c @@ -306,7 +306,7 @@ static void mx25l_lock(FAR struct spi_dev_s *dev) * the SPI buss. We will retain that exclusive access until the bus is unlocked. */ - (void)SPI_LOCK(dev, true); + SPI_LOCK(dev, true); /* After locking the SPI bus, the we also need call the setfrequency, setbits, and * setmode methods to make sure that the SPI is properly configured for the device. @@ -316,8 +316,8 @@ static void mx25l_lock(FAR struct spi_dev_s *dev) SPI_SETMODE(dev, CONFIG_MX25L_SPIMODE); SPI_SETBITS(dev, 8); - (void)SPI_HWFEATURES(dev, 0); - (void)SPI_SETFREQUENCY(dev, CONFIG_MX25L_SPIFREQUENCY); + SPI_HWFEATURES(dev, 0); + SPI_SETFREQUENCY(dev, CONFIG_MX25L_SPIFREQUENCY); } /************************************************************************************ @@ -326,7 +326,7 @@ static void mx25l_lock(FAR struct spi_dev_s *dev) static inline void mx25l_unlock(FAR struct spi_dev_s *dev) { - (void)SPI_LOCK(dev, false); + SPI_LOCK(dev, false); } /************************************************************************************ @@ -348,7 +348,7 @@ static inline int mx25l_readid(FAR struct mx25l_dev_s *priv) /* Send the "Read ID (RDID)" command and read the first three ID bytes */ - (void)SPI_SEND(priv->dev, MX25L_RDID); + SPI_SEND(priv->dev, MX25L_RDID); manufacturer = SPI_SEND(priv->dev, MX25L_DUMMY); memory = SPI_SEND(priv->dev, MX25L_DUMMY); capacity = SPI_SEND(priv->dev, MX25L_DUMMY); @@ -420,7 +420,7 @@ static void mx25l_waitwritecomplete(FAR struct mx25l_dev_s *priv) /* Send "Read Status Register (RDSR)" command */ - (void)SPI_SEND(priv->dev, MX25L_RDSR); + SPI_SEND(priv->dev, MX25L_RDSR); /* Send a dummy byte to generate the clock needed to shift out the status */ @@ -459,7 +459,7 @@ static void mx25l_writeenable(FAR struct mx25l_dev_s *priv) /* Send "Write Enable (WREN)" command */ - (void)SPI_SEND(priv->dev, MX25L_WREN); + SPI_SEND(priv->dev, MX25L_WREN); /* Deselect the FLASH */ @@ -480,7 +480,7 @@ static void mx25l_writedisable(FAR struct mx25l_dev_s *priv) /* Send "Write Disable (WRDI)" command */ - (void)SPI_SEND(priv->dev, MX25L_WRDI); + SPI_SEND(priv->dev, MX25L_WRDI); /* Deselect the FLASH */ @@ -517,27 +517,27 @@ static void mx25l_sectorerase(FAR struct mx25l_dev_s *priv, off_t sector) if (priv->addressbytes == MX25L_ADDRESSBYTES_4) { - (void)SPI_SEND(priv->dev, MX25L_SE4B); + SPI_SEND(priv->dev, MX25L_SE4B); /* Send the sector offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 24) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 24) & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); } else { - (void)SPI_SEND(priv->dev, MX25L_SE); + SPI_SEND(priv->dev, MX25L_SE); /* Send the sector offset high byte first. For all of the supported * parts, the sector number is completely contained in the first byte * and the values used in the following two bytes don't really matter. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); } /* Deselect the FLASH */ @@ -567,7 +567,7 @@ static inline int mx25l_chiperase(FAR struct mx25l_dev_s *priv) /* Send the "Chip Erase (CE)" instruction */ - (void)SPI_SEND(priv->dev, MX25L_CE); + SPI_SEND(priv->dev, MX25L_CE); /* Deselect the FLASH */ @@ -606,31 +606,31 @@ static void mx25l_byteread(FAR struct mx25l_dev_s *priv, FAR uint8_t *buffer, { /* Send "Read from Memory - 4 byte mode" instruction */ - (void)SPI_SEND(priv->dev, MX25L_FAST_READ4B); + SPI_SEND(priv->dev, MX25L_FAST_READ4B); /* Send the address high byte first. */ - (void)SPI_SEND(priv->dev, (address >> 24) & 0xff); - (void)SPI_SEND(priv->dev, (address >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (address >> 8) & 0xff); - (void)SPI_SEND(priv->dev, address & 0xff); + SPI_SEND(priv->dev, (address >> 24) & 0xff); + SPI_SEND(priv->dev, (address >> 16) & 0xff); + SPI_SEND(priv->dev, (address >> 8) & 0xff); + SPI_SEND(priv->dev, address & 0xff); } else { /* Send "Read from Memory " instruction */ - (void)SPI_SEND(priv->dev, MX25L_FAST_READ); + SPI_SEND(priv->dev, MX25L_FAST_READ); /* Send the address high byte first. */ - (void)SPI_SEND(priv->dev, (address >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (address >> 8) & 0xff); - (void)SPI_SEND(priv->dev, address & 0xff); + SPI_SEND(priv->dev, (address >> 16) & 0xff); + SPI_SEND(priv->dev, (address >> 8) & 0xff); + SPI_SEND(priv->dev, address & 0xff); } /* Send a dummy byte */ - (void)SPI_SEND(priv->dev, MX25L_DUMMY); + SPI_SEND(priv->dev, MX25L_DUMMY); /* Then read all of the requested bytes */ @@ -669,10 +669,10 @@ static inline void mx25l_pagewrite(FAR struct mx25l_dev_s *priv, /* Send the address high byte first. */ - (void)SPI_SEND(priv->dev, (address >> 24) & 0xff); - (void)SPI_SEND(priv->dev, (address >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (address >> 8) & 0xff); - (void)SPI_SEND(priv->dev, address & 0xff); + SPI_SEND(priv->dev, (address >> 24) & 0xff); + SPI_SEND(priv->dev, (address >> 16) & 0xff); + SPI_SEND(priv->dev, (address >> 8) & 0xff); + SPI_SEND(priv->dev, address & 0xff); } else { @@ -682,9 +682,9 @@ static inline void mx25l_pagewrite(FAR struct mx25l_dev_s *priv, /* Send the address high byte first. */ - (void)SPI_SEND(priv->dev, (address >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (address >> 8) & 0xff); - (void)SPI_SEND(priv->dev, address & 0xff); + SPI_SEND(priv->dev, (address >> 16) & 0xff); + SPI_SEND(priv->dev, (address >> 8) & 0xff); + SPI_SEND(priv->dev, address & 0xff); } /* Then send the page of data */ diff --git a/drivers/mtd/mx25rxx.c b/drivers/mtd/mx25rxx.c index 984df6b7aa..9a84b12c23 100644 --- a/drivers/mtd/mx25rxx.c +++ b/drivers/mtd/mx25rxx.c @@ -261,7 +261,7 @@ void mx25rxx_lock(FAR struct qspi_dev_s *qspi, bool read) * unlocked. */ - (void)QSPI_LOCK(qspi, true); + QSPI_LOCK(qspi, true); /* After locking the SPI bus, the we also need call the setfrequency, setbits * and setmode methods to make sure that the SPI is properly configured for @@ -271,13 +271,13 @@ void mx25rxx_lock(FAR struct qspi_dev_s *qspi, bool read) QSPI_SETMODE(qspi, CONFIG_MX25RXX_QSPIMODE); QSPI_SETBITS(qspi, 8); - (void)QSPI_SETFREQUENCY(qspi, + QSPI_SETFREQUENCY(qspi, read ? CONFIG_MX25RXX_QSPI_READ_FREQUENCY : CONFIG_MX25RXX_QSPI_FREQUENCY); } void mx25rxx_unlock(FAR struct qspi_dev_s *qspi) { - (void)QSPI_LOCK(qspi, false); + QSPI_LOCK(qspi, false); } int mx25rxx_command_read(FAR struct qspi_dev_s *qspi, uint8_t cmd, diff --git a/drivers/mtd/mx35.c b/drivers/mtd/mx35.c index 2f7a4a7ed3..b118ab02ae 100644 --- a/drivers/mtd/mx35.c +++ b/drivers/mtd/mx35.c @@ -264,7 +264,7 @@ static inline void mx35_lock(FAR struct spi_dev_s *dev) * the SPI buss. We will retain that exclusive access until the bus is unlocked. */ - (void)SPI_LOCK(dev, true); + SPI_LOCK(dev, true); /* After locking the SPI bus, the we also need call the setfrequency, setbits, and * setmode methods to make sure that the SPI is properly configured for the device. @@ -274,8 +274,8 @@ static inline void mx35_lock(FAR struct spi_dev_s *dev) SPI_SETMODE(dev, CONFIG_MX35_SPIMODE); SPI_SETBITS(dev, 8); - (void)SPI_HWFEATURES(dev, 0); - (void)SPI_SETFREQUENCY(dev, CONFIG_MX35_SPIFREQUENCY); + SPI_HWFEATURES(dev, 0); + SPI_SETFREQUENCY(dev, CONFIG_MX35_SPIFREQUENCY); } /************************************************************************************ @@ -284,7 +284,7 @@ static inline void mx35_lock(FAR struct spi_dev_s *dev) static inline void mx35_unlock(FAR struct spi_dev_s *dev) { - (void)SPI_LOCK(dev, false); + SPI_LOCK(dev, false); } /************************************************************************************ @@ -305,8 +305,8 @@ static int mx35_readid(struct mx35_dev_s *priv) /* Send the "Read ID" command and read two ID bytes */ - (void)SPI_SEND(priv->dev, MX35_READ_ID); - (void)SPI_SEND(priv->dev, MX35_DUMMY); + SPI_SEND(priv->dev, MX35_READ_ID); + SPI_SEND(priv->dev, MX35_DUMMY); manufacturer = SPI_SEND(priv->dev, MX35_DUMMY); capacity = SPI_SEND(priv->dev, MX35_DUMMY); @@ -367,8 +367,8 @@ static bool mx35_waitstatus(FAR struct mx35_dev_s *priv, uint8_t mask, bool succ /* Get feature command */ - (void)SPI_SEND(priv->dev, MX35_GET_FEATURE); - (void)SPI_SEND(priv->dev, MX35_STATUS); + SPI_SEND(priv->dev, MX35_GET_FEATURE); + SPI_SEND(priv->dev, MX35_STATUS); status = SPI_SEND(priv->dev, MX35_DUMMY); /* Deselect the FLASH */ @@ -398,7 +398,7 @@ static inline void mx35_writeenable(struct mx35_dev_s *priv) /* Send Write Enable command */ - (void)SPI_SEND(priv->dev, MX35_WRITE_ENABLE); + SPI_SEND(priv->dev, MX35_WRITE_ENABLE); /* Deselect the FLASH */ @@ -417,7 +417,7 @@ static inline void mx35_writedisable(struct mx35_dev_s *priv) /* Send Write Enable command */ - (void)SPI_SEND(priv->dev, MX35_WRITE_DISABLE); + SPI_SEND(priv->dev, MX35_WRITE_DISABLE); /* Deselect the FLASH */ @@ -501,10 +501,10 @@ static bool mx35_sectorerase(FAR struct mx35_dev_s *priv, off_t startsector) /* Send the Block Erase instruction */ - (void)SPI_SEND(priv->dev, MX35_BLOCK_ERASE); - (void)SPI_SEND(priv->dev, (block >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (block >> 8) & 0xff); - (void)SPI_SEND(priv->dev, block & 0xff); + SPI_SEND(priv->dev, MX35_BLOCK_ERASE); + SPI_SEND(priv->dev, (block >> 16) & 0xff); + SPI_SEND(priv->dev, (block >> 8) & 0xff); + SPI_SEND(priv->dev, block & 0xff); /* Deselect the FLASH */ @@ -556,16 +556,16 @@ static void mx35_readbuffer(FAR struct mx35_dev_s *priv, uint32_t address, SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); - (void)SPI_SEND(priv->dev, MX35_READ_FROM_CACHE); + SPI_SEND(priv->dev, MX35_READ_FROM_CACHE); /* Send the address high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, (offset) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, (offset) & 0xff); /* Send a dummy byte */ - (void)SPI_SEND(priv->dev, MX35_DUMMY); + SPI_SEND(priv->dev, MX35_DUMMY); /* Then read all of the requested bytes */ @@ -590,10 +590,10 @@ static bool mx35_read_page(FAR struct mx35_dev_s *priv, uint32_t pageaddress) /* Send the Read Page instruction */ - (void)SPI_SEND(priv->dev, MX35_PAGE_READ); - (void)SPI_SEND(priv->dev, (row >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (row >> 8) & 0xff); - (void)SPI_SEND(priv->dev, row & 0xff); + SPI_SEND(priv->dev, MX35_PAGE_READ); + SPI_SEND(priv->dev, (row >> 16) & 0xff); + SPI_SEND(priv->dev, (row >> 8) & 0xff); + SPI_SEND(priv->dev, row & 0xff); /* Deselect the FLASH */ @@ -670,12 +670,12 @@ static void mx35_write_to_cache(FAR struct mx35_dev_s *priv, uint32_t address, /* Send the Program Load command */ - (void)SPI_SEND(priv->dev, MX35_PROGRAM_LOAD); + SPI_SEND(priv->dev, MX35_PROGRAM_LOAD); /* Send the address high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, (offset) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, (offset) & 0xff); /* Send block of bytes */ @@ -700,10 +700,10 @@ static bool mx35_execute_write(FAR struct mx35_dev_s *priv, uint32_t pageaddress /* Send the Pragram Execute instruction */ - (void)SPI_SEND(priv->dev, MX35_PROGRAM_EXECUTE); - (void)SPI_SEND(priv->dev, (row >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (row >> 8) & 0xff); - (void)SPI_SEND(priv->dev, row & 0xff); + SPI_SEND(priv->dev, MX35_PROGRAM_EXECUTE); + SPI_SEND(priv->dev, (row >> 16) & 0xff); + SPI_SEND(priv->dev, (row >> 8) & 0xff); + SPI_SEND(priv->dev, row & 0xff); /* Deselect the FLASH */ @@ -826,8 +826,8 @@ static int mx35_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) static inline void mx35_eccstatusread(struct mx35_dev_s *priv) { SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); - (void)SPI_SEND(priv->dev, MX35_GET_FEATURE); - (void)SPI_SEND(priv->dev, MX35_STATUS); + SPI_SEND(priv->dev, MX35_GET_FEATURE); + SPI_SEND(priv->dev, MX35_STATUS); priv->eccstatus = SPI_SEND(priv->dev, MX35_DUMMY); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), false); } @@ -844,9 +844,9 @@ static inline void mx35_enableECC(struct mx35_dev_s *priv) mx35_writeenable(priv); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); - (void)SPI_SEND(priv->dev, MX35_SET_FEATURE); - (void)SPI_SEND(priv->dev, MX35_SECURE_OTP); - (void)SPI_SEND(priv->dev, secureOTP); + SPI_SEND(priv->dev, MX35_SET_FEATURE); + SPI_SEND(priv->dev, MX35_SECURE_OTP); + SPI_SEND(priv->dev, secureOTP); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), false); mx35_writedisable(priv); @@ -865,9 +865,9 @@ static inline void mx35_unlockblocks(struct mx35_dev_s *priv) mx35_writeenable(priv); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); - (void)SPI_SEND(priv->dev, MX35_SET_FEATURE); - (void)SPI_SEND(priv->dev, MX35_BLOCK_PROTECTION); - (void)SPI_SEND(priv->dev, blockprotection); + SPI_SEND(priv->dev, MX35_SET_FEATURE); + SPI_SEND(priv->dev, MX35_BLOCK_PROTECTION); + SPI_SEND(priv->dev, blockprotection); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), false); mx35_writedisable(priv); @@ -923,7 +923,7 @@ FAR struct mtd_dev_s *mx35_initialize(FAR struct spi_dev_s *dev) /* Reset the flash */ SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); - (void)SPI_SEND(priv->dev, MX35_RESET); + SPI_SEND(priv->dev, MX35_RESET); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), false); /* Wait reset complete */ diff --git a/drivers/mtd/n25qxxx.c b/drivers/mtd/n25qxxx.c index 3ab92626dc..166c1c3e2a 100644 --- a/drivers/mtd/n25qxxx.c +++ b/drivers/mtd/n25qxxx.c @@ -361,7 +361,7 @@ static void n25qxxx_lock(FAR struct qspi_dev_s *qspi) * unlocked. */ - (void)QSPI_LOCK(qspi, true); + QSPI_LOCK(qspi, true); /* After locking the QuadSPI bus, the we also need call the setfrequency, setbits, * and setmode methods to make sure that the QuadSPI is properly configured for @@ -371,7 +371,7 @@ static void n25qxxx_lock(FAR struct qspi_dev_s *qspi) QSPI_SETMODE(qspi, CONFIG_N25QXXX_QSPIMODE); QSPI_SETBITS(qspi, 8); - (void)QSPI_SETFREQUENCY(qspi, CONFIG_N25QXXX_QSPI_FREQUENCY); + QSPI_SETFREQUENCY(qspi, CONFIG_N25QXXX_QSPI_FREQUENCY); } /************************************************************************************ @@ -380,7 +380,7 @@ static void n25qxxx_lock(FAR struct qspi_dev_s *qspi) static inline void n25qxxx_unlock(FAR struct qspi_dev_s *qspi) { - (void)QSPI_LOCK(qspi, false); + QSPI_LOCK(qspi, false); } /************************************************************************************ diff --git a/drivers/mtd/ramtron.c b/drivers/mtd/ramtron.c index 165a1ab083..ba66f833f2 100644 --- a/drivers/mtd/ramtron.c +++ b/drivers/mtd/ramtron.c @@ -421,7 +421,7 @@ static void ramtron_lock(FAR struct ramtron_dev_s *priv) * the SPI buss. We will retain that exclusive access until the bus is unlocked. */ - (void)SPI_LOCK(dev, true); + SPI_LOCK(dev, true); /* After locking the SPI bus, the we also need call the setfrequency, setbits, and * setmode methods to make sure that the SPI is properly configured for the device. @@ -431,8 +431,8 @@ static void ramtron_lock(FAR struct ramtron_dev_s *priv) SPI_SETMODE(dev, SPIDEV_MODE3); SPI_SETBITS(dev, 8); - (void)SPI_HWFEATURES(dev, 0); - (void)SPI_SETFREQUENCY(dev, priv->speed); + SPI_HWFEATURES(dev, 0); + SPI_SETFREQUENCY(dev, priv->speed); } /************************************************************************************ @@ -441,7 +441,7 @@ static void ramtron_lock(FAR struct ramtron_dev_s *priv) static inline void ramtron_unlock(FAR struct spi_dev_s *dev) { - (void)SPI_LOCK(dev, false); + SPI_LOCK(dev, false); } /************************************************************************************ @@ -465,7 +465,7 @@ static inline int ramtron_readid(struct ramtron_dev_s *priv) /* Send the "Read ID (RDID)" command */ - (void)SPI_SEND(priv->dev, RAMTRON_RDID); + SPI_SEND(priv->dev, RAMTRON_RDID); /* Read the first six manufacturer ID bytes. */ @@ -536,7 +536,7 @@ static int ramtron_waitwritecomplete(struct ramtron_dev_s *priv) /* Send "Read Status Register (RDSR)" command */ - (void)SPI_SEND(priv->dev, RAMTRON_RDSR); + SPI_SEND(priv->dev, RAMTRON_RDSR); /* Loop as long as the memory is busy with a write cycle, but limit the * cycles. @@ -583,7 +583,7 @@ static void ramtron_writeenable(struct ramtron_dev_s *priv) /* Send "Write Enable (WREN)" command */ - (void)SPI_SEND(priv->dev, RAMTRON_WREN); + SPI_SEND(priv->dev, RAMTRON_WREN); /* Deselect the FLASH */ @@ -601,11 +601,11 @@ static inline void ramtron_sendaddr(const struct ramtron_dev_s *priv, uint32_t a if (priv->part->addr_len == 3) { - (void)SPI_SEND(priv->dev, (addr >> 16) & 0xff); + SPI_SEND(priv->dev, (addr >> 16) & 0xff); } - (void)SPI_SEND(priv->dev, (addr >> 8) & 0xff); - (void)SPI_SEND(priv->dev, addr & 0xff); + SPI_SEND(priv->dev, (addr >> 8) & 0xff); + SPI_SEND(priv->dev, addr & 0xff); } /************************************************************************************ @@ -627,7 +627,7 @@ static inline int ramtron_pagewrite(struct ramtron_dev_s *priv, * improve performance. */ - (void)ramtron_waitwritecomplete(priv); + ramtron_waitwritecomplete(priv); #endif /* Enable the write access to the FLASH */ @@ -640,7 +640,7 @@ static inline int ramtron_pagewrite(struct ramtron_dev_s *priv, /* Send "Page Program (PP)" command */ - (void)SPI_SEND(priv->dev, RAMTRON_WRITE); + SPI_SEND(priv->dev, RAMTRON_WRITE); /* Send the page offset high byte first. */ @@ -839,7 +839,7 @@ static ssize_t ramtron_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt * improve performance. */ - (void)ramtron_waitwritecomplete(priv); + ramtron_waitwritecomplete(priv); #endif /* Select this FLASH part */ @@ -848,7 +848,7 @@ static ssize_t ramtron_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt /* Send "Read from Memory " instruction */ - (void)SPI_SEND(priv->dev, RAMTRON_READ); + SPI_SEND(priv->dev, RAMTRON_READ); /* Send the page offset high byte first. */ @@ -866,7 +866,7 @@ static ssize_t ramtron_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt * enable state */ - (void)SPI_SEND(priv->dev, RAMTRON_RDSR); + SPI_SEND(priv->dev, RAMTRON_RDSR); status = SPI_SEND(priv->dev, RAMTRON_DUMMY); if ((status & ~RAMTRON_SR_SRWD) == 0) { diff --git a/drivers/mtd/s25fl1.c b/drivers/mtd/s25fl1.c index ceb011656b..60321ea903 100644 --- a/drivers/mtd/s25fl1.c +++ b/drivers/mtd/s25fl1.c @@ -414,7 +414,7 @@ static void s25fl1_lock(FAR struct qspi_dev_s *qspi) * the QuadSPI buss. We will retain that exclusive access until the bus is unlocked. */ - (void)QSPI_LOCK(qspi, true); + QSPI_LOCK(qspi, true); /* After locking the QuadSPI bus, the we also need call the setfrequency, setbits, and * setmode methods to make sure that the QuadSPI is properly configured for the device. @@ -424,7 +424,7 @@ static void s25fl1_lock(FAR struct qspi_dev_s *qspi) QSPI_SETMODE(qspi, CONFIG_S25FL1_QSPIMODE); QSPI_SETBITS(qspi, 8); - (void)QSPI_SETFREQUENCY(qspi, CONFIG_S25FL1_QSPI_FREQUENCY); + QSPI_SETFREQUENCY(qspi, CONFIG_S25FL1_QSPI_FREQUENCY); } /************************************************************************************ @@ -433,7 +433,7 @@ static void s25fl1_lock(FAR struct qspi_dev_s *qspi) static inline void s25fl1_unlock(FAR struct qspi_dev_s *qspi) { - (void)QSPI_LOCK(qspi, false); + QSPI_LOCK(qspi, false); } /************************************************************************************ diff --git a/drivers/mtd/smart.c b/drivers/mtd/smart.c index 1a34c72771..68debd681e 100644 --- a/drivers/mtd/smart.c +++ b/drivers/mtd/smart.c @@ -5520,7 +5520,7 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd, FAR const char *partn } #ifdef CONFIG_SMART_DEV_LOOP - (void)register_driver("/dev/smart", &g_fops, 0666, NULL); + register_driver("/dev/smart", &g_fops, 0666, NULL); #endif return OK; diff --git a/drivers/mtd/sst25.c b/drivers/mtd/sst25.c index 6ca0c36905..c499a5001c 100644 --- a/drivers/mtd/sst25.c +++ b/drivers/mtd/sst25.c @@ -277,7 +277,7 @@ static void sst25_lock(FAR struct spi_dev_s *dev) * the SPI buss. We will retain that exclusive access until the bus is unlocked. */ - (void)SPI_LOCK(dev, true); + SPI_LOCK(dev, true); /* After locking the SPI bus, the we also need call the setfrequency, setbits, and * setmode methods to make sure that the SPI is properly configured for the device. @@ -287,8 +287,8 @@ static void sst25_lock(FAR struct spi_dev_s *dev) SPI_SETMODE(dev, CONFIG_SST25_SPIMODE); SPI_SETBITS(dev, 8); - (void)SPI_HWFEATURES(dev, 0); - (void)SPI_SETFREQUENCY(dev, CONFIG_SST25_SPIFREQUENCY); + SPI_HWFEATURES(dev, 0); + SPI_SETFREQUENCY(dev, CONFIG_SST25_SPIFREQUENCY); } /************************************************************************************ @@ -297,7 +297,7 @@ static void sst25_lock(FAR struct spi_dev_s *dev) static inline void sst25_unlock(FAR struct spi_dev_s *dev) { - (void)SPI_LOCK(dev, false); + SPI_LOCK(dev, false); } /************************************************************************************ @@ -319,7 +319,7 @@ static inline int sst25_readid(struct sst25_dev_s *priv) /* Send the "Read ID (RDID)" command and read the first three ID bytes */ - (void)SPI_SEND(priv->dev, SST25_JEDEC_ID); + SPI_SEND(priv->dev, SST25_JEDEC_ID); manufacturer = SPI_SEND(priv->dev, SST25_DUMMY); memory = SPI_SEND(priv->dev, SST25_DUMMY); capacity = SPI_SEND(priv->dev, SST25_DUMMY); @@ -407,7 +407,7 @@ static uint8_t sst25_waitwritecomplete(struct sst25_dev_s *priv) /* Send "Read Status Register (RDSR)" command */ - (void)SPI_SEND(priv->dev, SST25_RDSR); + SPI_SEND(priv->dev, SST25_RDSR); /* Send a dummy byte to generate the clock needed to shift out the status */ @@ -448,7 +448,7 @@ static inline void sst25_cmd(struct sst25_dev_s *priv, uint8_t cmd) /* Send command */ - (void)SPI_SEND(priv->dev, cmd); + SPI_SEND(priv->dev, cmd); /* Deselect the FLASH */ @@ -491,7 +491,7 @@ static void sst25_sectorerase(struct sst25_dev_s *priv, off_t sector) /* Wait for any preceding write or erase operation to complete. */ - (void)sst25_waitwritecomplete(priv); + sst25_waitwritecomplete(priv); /* Send write enable instruction */ @@ -503,15 +503,15 @@ static void sst25_sectorerase(struct sst25_dev_s *priv, off_t sector) /* Send the "Sector Erase (SE)" instruction */ - (void)SPI_SEND(priv->dev, SST25_SE); + SPI_SEND(priv->dev, SST25_SE); /* Send the sector address high byte first. Only the most significant bits (those * corresponding to the sector) have any meaning. */ - (void)SPI_SEND(priv->dev, (address >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (address >> 8) & 0xff); - (void)SPI_SEND(priv->dev, address & 0xff); + SPI_SEND(priv->dev, (address >> 16) & 0xff); + SPI_SEND(priv->dev, (address >> 8) & 0xff); + SPI_SEND(priv->dev, address & 0xff); /* Deselect the FLASH */ @@ -528,7 +528,7 @@ static inline int sst25_chiperase(struct sst25_dev_s *priv) /* Wait for any preceding write or erase operation to complete. */ - (void)sst25_waitwritecomplete(priv); + sst25_waitwritecomplete(priv); /* Send write enable instruction */ @@ -566,21 +566,21 @@ static void sst25_byteread(FAR struct sst25_dev_s *priv, FAR uint8_t *buffer, /* Send "Read from Memory " instruction */ #ifdef CONFIG_SST25_SLOWREAD - (void)SPI_SEND(priv->dev, SST25_READ); + SPI_SEND(priv->dev, SST25_READ); #else - (void)SPI_SEND(priv->dev, SST25_FAST_READ); + SPI_SEND(priv->dev, SST25_FAST_READ); #endif /* Send the address high byte first. */ - (void)SPI_SEND(priv->dev, (address >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (address >> 8) & 0xff); - (void)SPI_SEND(priv->dev, address & 0xff); + SPI_SEND(priv->dev, (address >> 16) & 0xff); + SPI_SEND(priv->dev, (address >> 8) & 0xff); + SPI_SEND(priv->dev, address & 0xff); /* Send a dummy byte */ #ifndef CONFIG_SST25_SLOWREAD - (void)SPI_SEND(priv->dev, SST25_DUMMY); + SPI_SEND(priv->dev, SST25_DUMMY); #endif /* Then read all of the requested bytes */ @@ -628,17 +628,17 @@ static void sst25_bytewrite(struct sst25_dev_s *priv, FAR const uint8_t *buffer, /* Send "Byte Program (BP)" command */ - (void)SPI_SEND(priv->dev, SST25_BP); + SPI_SEND(priv->dev, SST25_BP); /* Send the byte address high byte first. */ - (void)SPI_SEND(priv->dev, (address >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (address >> 8) & 0xff); - (void)SPI_SEND(priv->dev, address & 0xff); + SPI_SEND(priv->dev, (address >> 16) & 0xff); + SPI_SEND(priv->dev, (address >> 8) & 0xff); + SPI_SEND(priv->dev, address & 0xff); /* Then write the single byte */ - (void)SPI_SEND(priv->dev, *buffer); + SPI_SEND(priv->dev, *buffer); /* Deselect the FLASH and setup for the next pass through the loop */ @@ -709,13 +709,13 @@ static void sst25_wordwrite(struct sst25_dev_s *priv, FAR const uint8_t *buffer, /* Send "Auto Address Increment (AAI)" command */ - (void)SPI_SEND(priv->dev, SST25_AAI); + SPI_SEND(priv->dev, SST25_AAI); /* Send the word address high byte first. */ - (void)SPI_SEND(priv->dev, (address >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (address >> 8) & 0xff); - (void)SPI_SEND(priv->dev, address & 0xff); + SPI_SEND(priv->dev, (address >> 16) & 0xff); + SPI_SEND(priv->dev, (address >> 8) & 0xff); + SPI_SEND(priv->dev, address & 0xff); /* Then write one 16-bit word */ @@ -754,7 +754,7 @@ static void sst25_wordwrite(struct sst25_dev_s *priv, FAR const uint8_t *buffer, /* Send "Auto Address Increment (AAI)" command with no address */ - (void)SPI_SEND(priv->dev, SST25_AAI); + SPI_SEND(priv->dev, SST25_AAI); /* Then write one 16-bit word */ diff --git a/drivers/mtd/sst25xx.c b/drivers/mtd/sst25xx.c index 667d12cad3..e299497843 100644 --- a/drivers/mtd/sst25xx.c +++ b/drivers/mtd/sst25xx.c @@ -227,7 +227,7 @@ static void sst25xx_lock(FAR struct spi_dev_s *dev) * the SPI buss. We will retain that exclusive access until the bus is unlocked. */ - (void)SPI_LOCK(dev, true); + SPI_LOCK(dev, true); /* After locking the SPI bus, the we also need call the setfrequency, setbits, and * setmode methods to make sure that the SPI is properly configured for the device. @@ -237,8 +237,8 @@ static void sst25xx_lock(FAR struct spi_dev_s *dev) SPI_SETMODE(dev, CONFIG_SST25XX_SPIMODE); SPI_SETBITS(dev, 8); - (void)SPI_HWFEATURES(dev, 0); - (void)SPI_SETFREQUENCY(dev, CONFIG_SST25XX_SPIFREQUENCY); + SPI_HWFEATURES(dev, 0); + SPI_SETFREQUENCY(dev, CONFIG_SST25XX_SPIFREQUENCY); } /************************************************************************************ @@ -247,7 +247,7 @@ static void sst25xx_lock(FAR struct spi_dev_s *dev) static inline void sst25xx_unlock(FAR struct spi_dev_s *dev) { - (void)SPI_LOCK(dev, false); + SPI_LOCK(dev, false); } /************************************************************************************ @@ -269,7 +269,7 @@ static inline int sst25xx_readid(struct sst25xx_dev_s *priv) /* Send the "Read ID (RDID)" command and read the first three ID bytes */ - (void)SPI_SEND(priv->dev, SST25_RDID); + SPI_SEND(priv->dev, SST25_RDID); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); manufacturer = SPI_SEND(priv->dev, SST25_DUMMY); memory = SPI_SEND(priv->dev, SST25_DUMMY); @@ -331,7 +331,7 @@ static void sst25xx_waitwritecomplete(struct sst25xx_dev_s *priv) /* Send "Read Status Register (RDSR)" command */ - (void)SPI_SEND(priv->dev, SST25_RDSR); + SPI_SEND(priv->dev, SST25_RDSR); /* Send a dummy byte to generate the clock needed to shift out the status */ @@ -372,7 +372,7 @@ static void sst25xx_writeenable(struct sst25xx_dev_s *priv) /* Send "Write Enable (WREN)" command */ - (void)SPI_SEND(priv->dev, SST25_WREN); + SPI_SEND(priv->dev, SST25_WREN); /* Deselect the FLASH */ @@ -389,7 +389,7 @@ static void sst25xx_unprotect(struct sst25xx_dev_s *priv) /* Send "Write enable status (EWSR)" */ SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); - (void)SPI_SEND(priv->dev, SST25_EWSR); + SPI_SEND(priv->dev, SST25_EWSR); /* Deselect the FLASH */ @@ -439,16 +439,16 @@ static void sst25xx_sectorerase(struct sst25xx_dev_s *priv, off_t sector, uint8_ * that was passed in as the erase type. */ - (void)SPI_SEND(priv->dev, type); + SPI_SEND(priv->dev, type); /* Send the sector offset high byte first. For all of the supported * parts, the sector number is completely contained in the first byte * and the values used in the following two bytes don't really matter. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); priv->lastwaswrite = true; /* Deselect the FLASH */ @@ -483,7 +483,7 @@ static inline int sst25xx_bulkerase(struct sst25xx_dev_s *priv) /* Send the "Bulk Erase (BE)" instruction */ - (void)SPI_SEND(priv->dev, SST25_BE); + SPI_SEND(priv->dev, SST25_BE); /* Deselect the FLASH */ @@ -523,13 +523,13 @@ static inline void sst25xx_pagewrite(struct sst25xx_dev_s *priv, FAR const uint8 /* Send "Page Program (PP)" command */ - (void)SPI_SEND(priv->dev, SST25_PP); + SPI_SEND(priv->dev, SST25_PP); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Then write the specified number of bytes */ @@ -571,13 +571,13 @@ static inline void sst25xx_bytewrite(struct sst25xx_dev_s *priv, /* Send "Page Program (PP)" command */ - (void)SPI_SEND(priv->dev, SST25_PP); + SPI_SEND(priv->dev, SST25_PP); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Then write the specified number of bytes */ @@ -752,13 +752,13 @@ static ssize_t sst25xx_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt /* Send "Read from Memory " instruction */ - (void)SPI_SEND(priv->dev, SST25_READ); + SPI_SEND(priv->dev, SST25_READ); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Then read all of the requested bytes */ diff --git a/drivers/mtd/sst26.c b/drivers/mtd/sst26.c index 6a55152118..5ff4461977 100644 --- a/drivers/mtd/sst26.c +++ b/drivers/mtd/sst26.c @@ -291,7 +291,7 @@ static void sst26_lock(FAR struct spi_dev_s *dev) * the SPI buss. We will retain that exclusive access until the bus is unlocked. */ - (void)SPI_LOCK(dev, true); + SPI_LOCK(dev, true); /* After locking the SPI bus, then we also need to call the setfrequency, setbits, * and setmode methods to make sure that the SPI is properly configured for the @@ -301,8 +301,8 @@ static void sst26_lock(FAR struct spi_dev_s *dev) SPI_SETMODE(dev, CONFIG_SST26_SPIMODE); SPI_SETBITS(dev, 8); - (void)SPI_HWFEATURES(dev, 0); - (void)SPI_SETFREQUENCY(dev, CONFIG_SST26_SPIFREQUENCY); + SPI_HWFEATURES(dev, 0); + SPI_SETFREQUENCY(dev, CONFIG_SST26_SPIFREQUENCY); } /************************************************************************************ @@ -311,7 +311,7 @@ static void sst26_lock(FAR struct spi_dev_s *dev) static inline void sst26_unlock(FAR struct spi_dev_s *dev) { - (void)SPI_LOCK(dev, false); + SPI_LOCK(dev, false); } /************************************************************************************ @@ -333,7 +333,7 @@ static inline int sst26_readid(struct sst26_dev_s *priv) /* Send the "Read ID (RDID)" command and read the first three ID bytes */ - (void)SPI_SEND(priv->dev, SST26_RDID); + SPI_SEND(priv->dev, SST26_RDID); manufacturer = SPI_SEND(priv->dev, SST26_DUMMY); memory = SPI_SEND(priv->dev, SST26_DUMMY); capacity = SPI_SEND(priv->dev, SST26_DUMMY); @@ -405,7 +405,7 @@ static void sst26_waitwritecomplete(struct sst26_dev_s *priv) /* Send "Read Status Register (RDSR)" command */ - (void)SPI_SEND(priv->dev, SST26_RDSR); + SPI_SEND(priv->dev, SST26_RDSR); /* Send a dummy byte to generate the clock needed to shift out the status */ @@ -446,7 +446,7 @@ static void sst26_globalunlock(struct sst26_dev_s *priv) /* Send "Global Unlock (ULBPR)" command */ - (void)SPI_SEND(priv->dev, SST26_ULBPR); + SPI_SEND(priv->dev, SST26_ULBPR); /* Deselect the FLASH */ @@ -467,7 +467,7 @@ static void sst26_writeenable(struct sst26_dev_s *priv) /* Send "Write Enable (WREN)" command */ - (void)SPI_SEND(priv->dev, SST26_WREN); + SPI_SEND(priv->dev, SST26_WREN); /* Deselect the FLASH */ @@ -488,7 +488,7 @@ static void sst26_writedisable(struct sst26_dev_s *priv) /* Send "Write Disable (WRDI)" command */ - (void)SPI_SEND(priv->dev, SST26_WRDI); + SPI_SEND(priv->dev, SST26_WRDI); /* Deselect the FLASH */ @@ -521,16 +521,16 @@ static void sst26_sectorerase(struct sst26_dev_s *priv, off_t sector, uint8_t ty * that was passed in as the erase type. */ - (void)SPI_SEND(priv->dev, type); + SPI_SEND(priv->dev, type); /* Send the sector offset high byte first. For all of the supported * parts, the sector number is completely contained in the first byte * and the values used in the following two bytes don't really matter. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Deselect the FLASH */ @@ -559,7 +559,7 @@ static inline int sst26_chiperase(struct sst26_dev_s *priv) /* Send the "Chip Erase (CE)" instruction */ - (void)SPI_SEND(priv->dev, SST26_CE); + SPI_SEND(priv->dev, SST26_CE); /* Deselect the FLASH */ @@ -592,13 +592,13 @@ static inline void sst26_pagewrite(struct sst26_dev_s *priv, /* Send "Page Program (PP)" command */ - (void)SPI_SEND(priv->dev, SST26_PP); + SPI_SEND(priv->dev, SST26_PP); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Then write the specified number of bytes */ @@ -634,13 +634,13 @@ static inline void sst26_bytewrite(struct sst26_dev_s *priv, /* Send "Page Program (PP)" command */ - (void)SPI_SEND(priv->dev, SST26_PP); + SPI_SEND(priv->dev, SST26_PP); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Then write the specified number of bytes */ @@ -757,17 +757,17 @@ static ssize_t sst26_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes /* Send "Read from Memory " instruction */ - (void)SPI_SEND(priv->dev, SST26_FAST_READ); + SPI_SEND(priv->dev, SST26_FAST_READ); /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->dev, offset & 0xff); + SPI_SEND(priv->dev, (offset >> 16) & 0xff); + SPI_SEND(priv->dev, (offset >> 8) & 0xff); + SPI_SEND(priv->dev, offset & 0xff); /* Dummy read */ - (void)SPI_SEND(priv->dev, SST26_DUMMY); + SPI_SEND(priv->dev, SST26_DUMMY); /* Then read all of the requested bytes */ diff --git a/drivers/mtd/w25.c b/drivers/mtd/w25.c index 7fc22f4176..67dc122f99 100644 --- a/drivers/mtd/w25.c +++ b/drivers/mtd/w25.c @@ -307,7 +307,7 @@ static void w25_lock(FAR struct spi_dev_s *spi) * the SPI buss. We will retain that exclusive access until the bus is unlocked. */ - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); /* After locking the SPI bus, the we also need call the setfrequency, setbits, and * setmode methods to make sure that the SPI is properly configured for the device. @@ -317,8 +317,8 @@ static void w25_lock(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, CONFIG_W25_SPIMODE); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_W25_SPIFREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_W25_SPIFREQUENCY); } /************************************************************************************ @@ -327,7 +327,7 @@ static void w25_lock(FAR struct spi_dev_s *spi) static inline void w25_unlock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } /************************************************************************************ @@ -348,7 +348,7 @@ static inline int w25_readid(struct w25_dev_s *priv) /* Wait for any preceding write or erase operation to complete. */ - (void)w25_waitwritecomplete(priv); + w25_waitwritecomplete(priv); /* Select this FLASH part. */ @@ -356,7 +356,7 @@ static inline int w25_readid(struct w25_dev_s *priv) /* Send the "Read ID (RDID)" command and read the first three ID bytes */ - (void)SPI_SEND(priv->spi, W25_JEDEC_ID); + SPI_SEND(priv->spi, W25_JEDEC_ID); manufacturer = SPI_SEND(priv->spi, W25_DUMMY); memory = SPI_SEND(priv->spi, W25_DUMMY); capacity = SPI_SEND(priv->spi, W25_DUMMY); @@ -458,7 +458,7 @@ static void w25_unprotect(FAR struct w25_dev_s *priv) /* Wait for any preceding write or erase operation to complete. */ - (void)w25_waitwritecomplete(priv); + w25_waitwritecomplete(priv); /* Send "Write enable (WREN)" */ @@ -506,7 +506,7 @@ static uint8_t w25_waitwritecomplete(struct w25_dev_s *priv) /* Send "Read Status Register (RDSR)" command */ - (void)SPI_SEND(priv->spi, W25_RDSR); + SPI_SEND(priv->spi, W25_RDSR); /* Send a dummy byte to generate the clock needed to shift out the status */ @@ -547,7 +547,7 @@ static inline void w25_wren(struct w25_dev_s *priv) /* Send "Write Enable (WREN)" command */ - (void)SPI_SEND(priv->spi, W25_WREN); + SPI_SEND(priv->spi, W25_WREN); /* Deselect the FLASH */ @@ -566,7 +566,7 @@ static inline void w25_wrdi(struct w25_dev_s *priv) /* Send "Write Disable (WRDI)" command */ - (void)SPI_SEND(priv->spi, W25_WRDI); + SPI_SEND(priv->spi, W25_WRDI); /* Deselect the FLASH */ @@ -643,7 +643,7 @@ static void w25_sectorerase(struct w25_dev_s *priv, off_t sector) /* Wait for any preceding write or erase operation to complete. */ - (void)w25_waitwritecomplete(priv); + w25_waitwritecomplete(priv); /* Send write enable instruction */ @@ -655,16 +655,16 @@ static void w25_sectorerase(struct w25_dev_s *priv, off_t sector) /* Send the "Sector Erase (SE)" instruction */ - (void)SPI_SEND(priv->spi, W25_SE); + SPI_SEND(priv->spi, W25_SE); priv->prev_instr = W25_SE; /* Send the sector address high byte first. Only the most significant bits (those * corresponding to the sector) have any meaning. */ - (void)SPI_SEND(priv->spi, (address >> 16) & 0xff); - (void)SPI_SEND(priv->spi, (address >> 8) & 0xff); - (void)SPI_SEND(priv->spi, address & 0xff); + SPI_SEND(priv->spi, (address >> 16) & 0xff); + SPI_SEND(priv->spi, (address >> 8) & 0xff); + SPI_SEND(priv->spi, address & 0xff); /* Deselect the FLASH */ @@ -681,7 +681,7 @@ static inline int w25_chiperase(struct w25_dev_s *priv) /* Wait for any preceding write or erase operation to complete. */ - (void)w25_waitwritecomplete(priv); + w25_waitwritecomplete(priv); /* Send write enable instruction */ @@ -693,7 +693,7 @@ static inline int w25_chiperase(struct w25_dev_s *priv) /* Send the "Chip Erase (CE)" instruction */ - (void)SPI_SEND(priv->spi, W25_CE); + SPI_SEND(priv->spi, W25_CE); priv->prev_instr = W25_CE; /* Deselect the FLASH */ @@ -730,23 +730,23 @@ static void w25_byteread(FAR struct w25_dev_s *priv, FAR uint8_t *buffer, /* Send "Read from Memory " instruction */ #ifdef CONFIG_W25_SLOWREAD - (void)SPI_SEND(priv->spi, W25_RDDATA); + SPI_SEND(priv->spi, W25_RDDATA); priv->prev_instr = W25_RDDATA; #else - (void)SPI_SEND(priv->spi, W25_FRD); + SPI_SEND(priv->spi, W25_FRD); priv->prev_instr = W25_FRD; #endif /* Send the address high byte first. */ - (void)SPI_SEND(priv->spi, (address >> 16) & 0xff); - (void)SPI_SEND(priv->spi, (address >> 8) & 0xff); - (void)SPI_SEND(priv->spi, address & 0xff); + SPI_SEND(priv->spi, (address >> 16) & 0xff); + SPI_SEND(priv->spi, (address >> 8) & 0xff); + SPI_SEND(priv->spi, address & 0xff); /* Send a dummy byte */ #ifndef CONFIG_W25_SLOWREAD - (void)SPI_SEND(priv->spi, W25_DUMMY); + SPI_SEND(priv->spi, W25_DUMMY); #endif /* Then read all of the requested bytes */ @@ -794,9 +794,9 @@ static void w25_pagewrite(struct w25_dev_s *priv, FAR const uint8_t *buffer, /* Send the address high byte first. */ - (void)SPI_SEND(priv->spi, (address >> 16) & 0xff); - (void)SPI_SEND(priv->spi, (address >> 8) & 0xff); - (void)SPI_SEND(priv->spi, address & 0xff); + SPI_SEND(priv->spi, (address >> 16) & 0xff); + SPI_SEND(priv->spi, (address >> 8) & 0xff); + SPI_SEND(priv->spi, address & 0xff); /* Then send the page of data */ @@ -846,14 +846,14 @@ static inline void w25_bytewrite(struct w25_dev_s *priv, FAR const uint8_t *buff /* Send "Page Program (PP)" command */ - (void)SPI_SEND(priv->spi, W25_PP); + SPI_SEND(priv->spi, W25_PP); priv->prev_instr = W25_PP; /* Send the page offset high byte first. */ - (void)SPI_SEND(priv->spi, (offset >> 16) & 0xff); - (void)SPI_SEND(priv->spi, (offset >> 8) & 0xff); - (void)SPI_SEND(priv->spi, offset & 0xff); + SPI_SEND(priv->spi, (offset >> 16) & 0xff); + SPI_SEND(priv->spi, (offset >> 8) & 0xff); + SPI_SEND(priv->spi, offset & 0xff); /* Then write the specified number of bytes */ diff --git a/drivers/net/dm90x0.c b/drivers/net/dm90x0.c index fed10442e9..c3c60b1ce9 100644 --- a/drivers/net/dm90x0.c +++ b/drivers/net/dm90x0.c @@ -766,8 +766,8 @@ static int dm9x_transmit(FAR struct dm9x_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->dm_txtimeout, DM6X_TXTIMEOUT, - dm9x_txtimeout_expiry, 1, (wdparm_t)priv); + wd_start(priv->dm_txtimeout, DM6X_TXTIMEOUT, + dm9x_txtimeout_expiry, 1, (wdparm_t)priv); return OK; } @@ -883,8 +883,8 @@ static void dm9x_receive(FAR struct dm9x_driver_s *priv) { /* Store the value of memory data read address register */ - (void)getreg(DM9X_MDRAH); - (void)getreg(DM9X_MDRAL); + getreg(DM9X_MDRAH); + getreg(DM9X_MDRAL); getreg(DM9X_MRCMDX); /* Dummy read */ rxbyte = (uint8_t)DM9X_DATA; /* Get the most up-to-date data */ @@ -1118,7 +1118,7 @@ static void dm9x_txdone(FAR struct dm9x_driver_s *priv) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->dm_dev, dm9x_txpoll); + devif_poll(&priv->dm_dev, dm9x_txpoll); } /**************************************************************************** @@ -1334,7 +1334,7 @@ static void dm9x_txtimeout_work(FAR void *arg) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->dm_dev, dm9x_txpoll); + devif_poll(&priv->dm_dev, dm9x_txpoll); net_unlock(); } @@ -1416,13 +1416,13 @@ static void dm9x_poll_work(FAR void *arg) { /* If so, update TCP timing states and poll the network for new XMIT data */ - (void)devif_timer(&priv->dm_dev, DM9X_WDDELAY, dm9x_txpoll); + devif_timer(&priv->dm_dev, DM9X_WDDELAY, dm9x_txpoll); } /* Setup the watchdog poll timer again */ - (void)wd_start(priv->dm_txpoll, DM9X_WDDELAY, dm9x_poll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->dm_txpoll, DM9X_WDDELAY, dm9x_poll_expiry, 1, + (wdparm_t)priv); net_unlock(); } @@ -1556,8 +1556,8 @@ static int dm9x_ifup(FAR struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->dm_txpoll, DM9X_WDDELAY, dm9x_poll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->dm_txpoll, DM9X_WDDELAY, dm9x_poll_expiry, 1, + (wdparm_t)priv); /* Enable the DM9X interrupt */ @@ -1649,7 +1649,7 @@ static void dm9x_txavail_work(FAR void *arg) { /* If so, then poll the network for new XMIT data */ - (void)devif_poll(&priv->dm_dev, dm9x_txpoll); + devif_poll(&priv->dm_dev, dm9x_txpoll); } } @@ -1992,7 +1992,7 @@ int dm9x_initialize(void) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&g_dm9x[0].dm_dev, NET_LL_ETHERNET); + netdev_register(&g_dm9x[0].dm_dev, NET_LL_ETHERNET); return OK; } diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index 857e893f74..cfb05dbf5e 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c @@ -382,8 +382,8 @@ static inline void enc_configspi(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, CONFIG_ENC28J60_SPIMODE); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_ENC28J60_FREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_ENC28J60_FREQUENCY); } /**************************************************************************** @@ -416,8 +416,8 @@ static void enc_lock(FAR struct enc_driver_s *priv) SPI_SETMODE(priv->spi, CONFIG_ENC28J60_SPIMODE); SPI_SETBITS(priv->spi, 8); - (void)SPI_HWFEATURES(priv->spi, 0); - (void)SPI_SETFREQUENCY(priv->spi, CONFIG_ENC28J60_FREQUENCY); + SPI_HWFEATURES(priv->spi, 0); + SPI_SETFREQUENCY(priv->spi, CONFIG_ENC28J60_FREQUENCY); } /**************************************************************************** @@ -475,7 +475,7 @@ static uint8_t enc_rdgreg2(FAR struct enc_driver_s *priv, uint8_t cmd) * 16-clocks: 8 to clock out the cmd + 8 to clock in the data. */ - (void)SPI_SEND(priv->spi, cmd); /* Clock out the command */ + SPI_SEND(priv->spi, cmd); /* Clock out the command */ rddata = SPI_SEND(priv->spi, 0); /* Clock in the data */ /* De-select ENC28J60 chip */ @@ -518,8 +518,8 @@ static void enc_wrgreg2(FAR struct enc_driver_s *priv, uint8_t cmd, * 8 to clock out the cmd + 8 to clock out the data. */ - (void)SPI_SEND(priv->spi, cmd); /* Clock out the command */ - (void)SPI_SEND(priv->spi, wrdata); /* Clock out the data */ + SPI_SEND(priv->spi, cmd); /* Clock out the command */ + SPI_SEND(priv->spi, wrdata); /* Clock out the data */ /* De-select ENC28J60 chip. */ @@ -560,7 +560,7 @@ static inline void enc_src(FAR struct enc_driver_s *priv) /* Send the system reset command. */ - (void)SPI_SEND(priv->spi, ENC_SRC); + SPI_SEND(priv->spi, ENC_SRC); /* Check CLKRDY bit to see when the reset is complete. There is an errata * that says the CLKRDY may be invalid. We'll wait a couple of msec to @@ -662,14 +662,14 @@ static uint8_t enc_rdbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg) * 16-clocks: 8 to clock out the cmd and 8 to clock in the data. */ - (void)SPI_SEND(priv->spi, ENC_RCR | GETADDR(ctrlreg)); /* Clock out the command */ + SPI_SEND(priv->spi, ENC_RCR | GETADDR(ctrlreg)); /* Clock out the command */ if (ISPHYMAC(ctrlreg)) { /* The PHY/MAC sequence requires 24-clocks: 8 to clock out the cmd, * 8 dummy bits, and 8 to clock in the PHY/MAC data. */ - (void)SPI_SEND(priv->spi, 0); /* Clock in the dummy byte */ + SPI_SEND(priv->spi, 0); /* Clock in the dummy byte */ } rddata = SPI_SEND(priv->spi, 0); /* Clock in the data */ @@ -718,8 +718,8 @@ static void enc_wrbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg, * 8 to clock out the cmd + 8 to clock out the data. */ - (void)SPI_SEND(priv->spi, ENC_WCR | GETADDR(ctrlreg)); /* Clock out the command */ - (void)SPI_SEND(priv->spi, wrdata); /* Clock out the data */ + SPI_SEND(priv->spi, ENC_WCR | GETADDR(ctrlreg)); /* Clock out the command */ + SPI_SEND(priv->spi, wrdata); /* Clock out the data */ /* De-select ENC28J60 chip. */ @@ -870,7 +870,7 @@ static void enc_rdbuffer(FAR struct enc_driver_s *priv, FAR uint8_t *buffer, /* Send the read buffer memory command (ignoring the response) */ - (void)SPI_SEND(priv->spi, ENC_RBM); + SPI_SEND(priv->spi, ENC_RBM); /* Then read the buffer data */ @@ -919,7 +919,7 @@ static inline void enc_wrbuffer(FAR struct enc_driver_s *priv, * followed by the 5-bit constant, 1Ah." */ - (void)SPI_SEND(priv->spi, ENC_WBM); + SPI_SEND(priv->spi, ENC_WBM); /* "...the ENC28J60 requires a single per packet control byte to * precede the packet for transmission." @@ -937,8 +937,8 @@ static inline void enc_wrbuffer(FAR struct enc_driver_s *priv, * because POVERRIDE is zero). */ - (void)SPI_SEND(priv->spi, - (PKTCTRL_PCRCEN | PKTCTRL_PPADEN | PKTCTRL_PHUGEEN)); + SPI_SEND(priv->spi, + (PKTCTRL_PCRCEN | PKTCTRL_PPADEN | PKTCTRL_PHUGEEN)); /* Then send the buffer * @@ -1158,8 +1158,8 @@ static int enc_transmit(FAR struct enc_driver_s *priv) * the timer is started? */ - (void)wd_start(priv->txtimeout, ENC_TXTIMEOUT, enc_txtimeout, 1, - (wdparm_t)priv); + wd_start(priv->txtimeout, ENC_TXTIMEOUT, enc_txtimeout, 1, + (wdparm_t)priv); return OK; } @@ -1299,7 +1299,7 @@ static void enc_txif(FAR struct enc_driver_s *priv) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->dev, enc_txpoll); + devif_poll(&priv->dev, enc_txpoll); } /**************************************************************************** @@ -1916,7 +1916,7 @@ static void enc_toworker(FAR void *arg) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->dev, enc_txpoll); + devif_poll(&priv->dev, enc_txpoll); /* Release lock on the network */ @@ -2005,7 +2005,7 @@ static void enc_pollworker(FAR void *arg) * is a transmit in progress, we will missing TCP time state updates? */ - (void)devif_timer(&priv->dev, ENC_WDDELAY, enc_txpoll); + devif_timer(&priv->dev, ENC_WDDELAY, enc_txpoll); } /* Release lock on the SPI bus and the network */ @@ -2015,8 +2015,8 @@ static void enc_pollworker(FAR void *arg) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, ENC_WDDELAY, enc_polltimer, 1, - (wdparm_t)arg); + wd_start(priv->txpoll, ENC_WDDELAY, enc_polltimer, 1, + (wdparm_t)arg); } /**************************************************************************** @@ -2115,8 +2115,8 @@ static int enc_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, ENC_WDDELAY, enc_polltimer, 1, - (wdparm_t)priv); + wd_start(priv->txpoll, ENC_WDDELAY, enc_polltimer, 1, + (wdparm_t)priv); /* Mark the interface up and enable the Ethernet interrupt at the * controller @@ -2229,7 +2229,7 @@ static int enc_txavail(struct net_driver_s *dev) { /* The interface is up and TX is idle; poll the network for new XMIT data */ - (void)devif_poll(&priv->dev, enc_txpoll); + devif_poll(&priv->dev, enc_txpoll); } } diff --git a/drivers/net/encx24j600.c b/drivers/net/encx24j600.c index 6f69f72c3c..aba503efee 100644 --- a/drivers/net/encx24j600.c +++ b/drivers/net/encx24j600.c @@ -407,8 +407,8 @@ static void enc_lock(FAR struct enc_driver_s *priv) SPI_SETMODE(priv->spi, CONFIG_ENCX24J600_SPIMODE); SPI_SETBITS(priv->spi, 8); - (void)SPI_HWFEATURES(priv->spi, 0); - (void)SPI_SETFREQUENCY(priv->spi, CONFIG_ENCX24J600_FREQUENCY); + SPI_HWFEATURES(priv->spi, 0); + SPI_SETFREQUENCY(priv->spi, CONFIG_ENCX24J600_FREQUENCY); } /**************************************************************************** @@ -460,9 +460,9 @@ static void enc_cmd(FAR struct enc_driver_s *priv, uint8_t cmd, uint16_t arg) SPI_SELECT(priv->spi, SPIDEV_ETHERNET(0), true); - (void)SPI_SEND(priv->spi, cmd); /* Clock out the command */ - (void)SPI_SEND(priv->spi, arg & 0xff); /* Clock out the low byte */ - (void)SPI_SEND(priv->spi, arg >> 8); /* Clock out the high byte */ + SPI_SEND(priv->spi, cmd); /* Clock out the command */ + SPI_SEND(priv->spi, arg & 0xff); /* Clock out the low byte */ + SPI_SEND(priv->spi, arg >> 8); /* Clock out the high byte */ /* De-select ENCX24J600 chip. */ @@ -496,7 +496,7 @@ static inline void enc_setethrst(FAR struct enc_driver_s *priv) /* Send the system reset command. */ - (void)SPI_SEND(priv->spi, ENC_SETETHRST); + SPI_SEND(priv->spi, ENC_SETETHRST); up_udelay(25); @@ -697,9 +697,9 @@ static void enc_bfs(FAR struct enc_driver_s *priv, uint16_t ctrlreg, * 8 to clock out the cmd + 16 to clock out the data. */ - (void)SPI_SEND(priv->spi, ENC_BFS | GETADDR(ctrlreg)); /* Clock out the command */ - (void)SPI_SEND(priv->spi, bits & 0xff); /* Clock out the low byte */ - (void)SPI_SEND(priv->spi, bits >> 8); /* Clock out the high byte */ + SPI_SEND(priv->spi, ENC_BFS | GETADDR(ctrlreg)); /* Clock out the command */ + SPI_SEND(priv->spi, bits & 0xff); /* Clock out the low byte */ + SPI_SEND(priv->spi, bits >> 8); /* Clock out the high byte */ /* De-select ENCX24J600 chip. */ @@ -742,9 +742,9 @@ static void enc_bfc(FAR struct enc_driver_s *priv, uint16_t ctrlreg, * 8 to clock out the cmd + 16 to clock out the data. */ - (void)SPI_SEND(priv->spi, ENC_BFC | GETADDR(ctrlreg)); /* Clock out the command */ - (void)SPI_SEND(priv->spi, bits & 0xff); /* Clock out the low byte */ - (void)SPI_SEND(priv->spi, bits >> 8); /* Clock out the high byte */ + SPI_SEND(priv->spi, ENC_BFC | GETADDR(ctrlreg)); /* Clock out the command */ + SPI_SEND(priv->spi, bits & 0xff); /* Clock out the low byte */ + SPI_SEND(priv->spi, bits >> 8); /* Clock out the high byte */ /* De-select ENCX24J600 chip. */ @@ -854,7 +854,7 @@ static void enc_rdbuffer(FAR struct enc_driver_s *priv, FAR uint8_t *buffer, /* Send the read buffer memory command (ignoring the response) */ - (void)SPI_SEND(priv->spi, ENC_RRXDATA); + SPI_SEND(priv->spi, ENC_RRXDATA); /* Then read the buffer data */ @@ -1063,8 +1063,8 @@ static int enc_transmit(FAR struct enc_driver_s *priv) * the timer is started? */ - (void)wd_start(priv->txtimeout, ENC_TXTIMEOUT, enc_txtimeout, 1, - (wdparm_t)priv); + wd_start(priv->txtimeout, ENC_TXTIMEOUT, enc_txtimeout, 1, + (wdparm_t)priv); /* free the descriptor */ @@ -1484,7 +1484,7 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv) #ifdef CONFIG_NET_PKT /* When packet sockets are enabled, feed the frame into the packet tap */ - (void)pkt_input(&priv->dev); + pkt_input(&priv->dev); #endif /* We only accept IP packets of the configured type and ARP packets */ @@ -1500,7 +1500,7 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv) */ arp_ipin(&priv->dev); - (void)ipv4_input(&priv->dev); + ipv4_input(&priv->dev); /* Free the packet */ @@ -1543,7 +1543,7 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv) /* Give the IPv6 packet to the network layer */ - (void)ipv6_input(&priv->dev); + ipv6_input(&priv->dev); /* Free the packet */ @@ -2064,11 +2064,11 @@ static void enc_toworker(FAR void *arg) DEBUGASSERT(ret == OK); ret = enc_ifup(&priv->dev); DEBUGASSERT(ret == OK); - (void)ret; + UNUSED(ret); /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->dev, enc_txpoll); + devif_poll(&priv->dev, enc_txpoll); /* Release the network */ @@ -2112,7 +2112,7 @@ static void enc_txtimeout(int argc, uint32_t arg, ...) */ ret = work_queue(ENCWORK, &priv->towork, enc_toworker, (FAR void *)priv, 0); - (void)ret; + UNUSED(ret); DEBUGASSERT(ret == OK); } @@ -2157,7 +2157,7 @@ static void enc_pollworker(FAR void *arg) * is a transmit in progress, we will missing TCP time state updates? */ - (void)devif_timer(&priv->dev, ENC_WDDELAY, enc_txpoll); + devif_timer(&priv->dev, ENC_WDDELAY, enc_txpoll); } /* Release lock on the SPI bus and the network */ @@ -2167,7 +2167,7 @@ static void enc_pollworker(FAR void *arg) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, ENC_WDDELAY, enc_polltimer, 1, (wdparm_t)arg); + wd_start(priv->txpoll, ENC_WDDELAY, enc_polltimer, 1, (wdparm_t)arg); } /**************************************************************************** @@ -2269,8 +2269,8 @@ static int enc_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, ENC_WDDELAY, enc_polltimer, 1, - (wdparm_t)priv); + wd_start(priv->txpoll, ENC_WDDELAY, enc_polltimer, 1, + (wdparm_t)priv); /* Mark the interface up and enable the Ethernet interrupt at the * controller @@ -2385,7 +2385,7 @@ static int enc_txavail(struct net_driver_s *dev) { /* The interface is up and TX is idle; poll the network for new XMIT data */ - (void)devif_poll(&priv->dev, enc_txpoll); + devif_poll(&priv->dev, enc_txpoll); } } diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c index 978b3ac633..c3fcc34a1d 100644 --- a/drivers/net/ftmac100.c +++ b/drivers/net/ftmac100.c @@ -324,8 +324,8 @@ static int ftmac100_transmit(FAR struct ftmac100_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->ft_txtimeout, FTMAC100_TXTIMEOUT, - ftmac100_txtimeout_expiry, 1, (wdparm_t)priv); + wd_start(priv->ft_txtimeout, FTMAC100_TXTIMEOUT, + ftmac100_txtimeout_expiry, 1, (wdparm_t)priv); return OK; } @@ -862,7 +862,7 @@ static void ftmac100_txdone(FAR struct ftmac100_driver_s *priv) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->ft_dev, ftmac100_txpoll); + devif_poll(&priv->ft_dev, ftmac100_txpoll); } /**************************************************************************** @@ -1057,7 +1057,7 @@ static void ftmac100_txtimeout_work(FAR void *arg) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->ft_dev, ftmac100_txpoll); + devif_poll(&priv->ft_dev, ftmac100_txpoll); net_unlock(); } @@ -1130,12 +1130,12 @@ static void ftmac100_poll_work(FAR void *arg) * progress, we will missing TCP time state updates? */ - (void)devif_timer(&priv->ft_dev, FTMAC100_WDDELAY, ftmac100_txpoll); + devif_timer(&priv->ft_dev, FTMAC100_WDDELAY, ftmac100_txpoll); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->ft_txpoll, FTMAC100_WDDELAY, ftmac100_poll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->ft_txpoll, FTMAC100_WDDELAY, ftmac100_poll_expiry, 1, + (wdparm_t)priv); net_unlock(); } @@ -1218,8 +1218,8 @@ static int ftmac100_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->ft_txpoll, FTMAC100_WDDELAY, ftmac100_poll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->ft_txpoll, FTMAC100_WDDELAY, ftmac100_poll_expiry, 1, + (wdparm_t)priv); /* Enable the Ethernet interrupt */ @@ -1309,7 +1309,7 @@ static void ftmac100_txavail_work(FAR void *arg) /* If so, then poll the network for new XMIT data */ - (void)devif_poll(&priv->ft_dev, ftmac100_txpoll); + devif_poll(&priv->ft_dev, ftmac100_txpoll); } net_unlock(); @@ -1512,7 +1512,7 @@ static void ftmac100_ipv6multicast(FAR struct ftmac100_driver_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)ftmac100_addmac(dev, mac); + ftmac100_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -1520,7 +1520,7 @@ static void ftmac100_ipv6multicast(FAR struct ftmac100_driver_s *priv) * packets. */ - (void)ftmac100_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + ftmac100_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -1529,7 +1529,7 @@ static void ftmac100_ipv6multicast(FAR struct ftmac100_driver_s *priv) * packets. */ - (void)ftmac100_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + ftmac100_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -1607,7 +1607,7 @@ int ftmac100_initialize(int intf) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->ft_dev, NET_LL_ETHERNET); + netdev_register(&priv->ft_dev, NET_LL_ETHERNET); return OK; } diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index c90f70c7c8..d990d6856b 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c @@ -234,7 +234,7 @@ static void lo_poll_work(FAR void *arg) net_lock(); priv->lo_txdone = false; - (void)devif_timer(&priv->lo_dev, LO_WDDELAY, lo_txpoll); + devif_timer(&priv->lo_dev, LO_WDDELAY, lo_txpoll); /* Was something received and looped back? */ @@ -243,12 +243,12 @@ static void lo_poll_work(FAR void *arg) /* Yes, poll again for more TX data */ priv->lo_txdone = false; - (void)devif_poll(&priv->lo_dev, lo_txpoll); + devif_poll(&priv->lo_dev, lo_txpoll); } /* Setup the watchdog poll timer again */ - (void)wd_start(priv->lo_polldog, LO_WDDELAY, lo_poll_expiry, 1, priv); + wd_start(priv->lo_polldog, LO_WDDELAY, lo_poll_expiry, 1, priv); net_unlock(); } @@ -315,8 +315,8 @@ static int lo_ifup(FAR struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->lo_polldog, LO_WDDELAY, lo_poll_expiry, - 1, (wdparm_t)priv); + wd_start(priv->lo_polldog, LO_WDDELAY, lo_poll_expiry, + 1, (wdparm_t)priv); priv->lo_bifup = true; return OK; @@ -383,7 +383,7 @@ static void lo_txavail_work(FAR void *arg) /* If so, then poll the network for new XMIT data */ priv->lo_txdone = false; - (void)devif_poll(&priv->lo_dev, lo_txpoll); + devif_poll(&priv->lo_dev, lo_txpoll); } while (priv->lo_txdone); } @@ -530,7 +530,7 @@ int localhost_initialize(void) * performed. */ - (void)netdev_register(&priv->lo_dev, NET_LL_LOOPBACK); + netdev_register(&priv->lo_dev, NET_LL_LOOPBACK); /* Set the local loopback IP address */ diff --git a/drivers/net/phy_notify.c b/drivers/net/phy_notify.c index 71664a3af2..4f5cc93834 100644 --- a/drivers/net/phy_notify.c +++ b/drivers/net/phy_notify.c @@ -143,21 +143,7 @@ static struct phy_notify_s g_notify_clients[CONFIG_PHY_NOTIFICATION_NCLIENTS]; static void phy_semtake(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_notify_clients_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_notify_clients_sem); } #define phy_semgive() nxsem_post(&g_notify_clients_sem); @@ -384,7 +370,7 @@ int phy_notify_unsubscribe(FAR const char *intf, pid_t pid) /* Detach and disable the PHY interrupt */ phy_semtake(); - (void)arch_phy_irq(intf, NULL, NULL, NULL); + arch_phy_irq(intf, NULL, NULL, NULL); /* Cancel any pending notification */ diff --git a/drivers/net/rpmsgdrv.c b/drivers/net/rpmsgdrv.c index 8bb3f38572..ba451d1dc1 100644 --- a/drivers/net/rpmsgdrv.c +++ b/drivers/net/rpmsgdrv.c @@ -255,21 +255,7 @@ static const rpmsg_ept_cb g_net_rpmsg_drv_handler[] = static void net_rpmsg_drv_wait(FAR sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = net_lockedwait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + net_lockedwait_uninterruptible(sem); } /**************************************************************************** diff --git a/drivers/net/skeleton.c b/drivers/net/skeleton.c index 4933a5a745..abec3609e3 100644 --- a/drivers/net/skeleton.c +++ b/drivers/net/skeleton.c @@ -239,8 +239,8 @@ static int skel_transmit(FAR struct skel_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->sk_txtimeout, skeleton_TXTIMEOUT, - skel_txtimeout_expiry, 1, (wdparm_t)priv); + wd_start(priv->sk_txtimeout, skeleton_TXTIMEOUT, + skel_txtimeout_expiry, 1, (wdparm_t)priv); return OK; } @@ -522,7 +522,7 @@ static void skel_txdone(FAR struct skel_driver_s *priv) /* In any event, poll the network for new TX data */ - (void)devif_poll(&priv->sk_dev, skel_txpoll); + devif_poll(&priv->sk_dev, skel_txpoll); } /**************************************************************************** @@ -660,7 +660,7 @@ static void skel_txtimeout_work(FAR void *arg) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->sk_dev, skel_txpoll); + devif_poll(&priv->sk_dev, skel_txpoll); net_unlock(); } @@ -740,12 +740,12 @@ static void skel_poll_work(FAR void *arg) * progress, we will missing TCP time state updates? */ - (void)devif_timer(&priv->sk_dev, skeleton_WDDELAY, skel_txpoll); + devif_timer(&priv->sk_dev, skeleton_WDDELAY, skel_txpoll); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->sk_txpoll, skeleton_WDDELAY, skel_poll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->sk_txpoll, skeleton_WDDELAY, skel_poll_expiry, 1, + (wdparm_t)priv); net_unlock(); } @@ -823,8 +823,8 @@ static int skel_ifup(FAR struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->sk_txpoll, skeleton_WDDELAY, skel_poll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->sk_txpoll, skeleton_WDDELAY, skel_poll_expiry, 1, + (wdparm_t)priv); /* Enable the Ethernet interrupt */ @@ -914,7 +914,7 @@ static void skel_txavail_work(FAR void *arg) /* If so, then poll the network for new XMIT data */ - (void)devif_poll(&priv->sk_dev, skel_txpoll); + devif_poll(&priv->sk_dev, skel_txpoll); } net_unlock(); @@ -1060,7 +1060,7 @@ static void skel_ipv6multicast(FAR struct skel_driver_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)skel_addmac(dev, mac); + skel_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -1068,7 +1068,7 @@ static void skel_ipv6multicast(FAR struct skel_driver_s *priv) * packets. */ - (void)skel_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + skel_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ @@ -1078,7 +1078,7 @@ static void skel_ipv6multicast(FAR struct skel_driver_s *priv) * packets. */ - (void)skel_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + skel_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } @@ -1201,7 +1201,7 @@ int skel_initialize(int intf) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->sk_dev, NET_LL_ETHERNET); + netdev_register(&priv->sk_dev, NET_LL_ETHERNET); return OK; } diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 39fc1ca1bc..0972a9c9c2 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c @@ -203,21 +203,7 @@ static int slip_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac); static void slip_semtake(FAR struct slip_driver_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->waitsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } #define slip_semgive(p) nxsem_post(&(p)->waitsem); @@ -494,14 +480,14 @@ static void slip_txtask(int argc, FAR char *argv[]) { /* Yes, perform the timer poll */ - (void)devif_timer(&priv->dev, hsec * TICK_PER_HSEC, slip_txpoll); + devif_timer(&priv->dev, hsec * TICK_PER_HSEC, slip_txpoll); start_ticks += hsec * TICK_PER_HSEC; } else { /* No, perform the normal TX poll */ - (void)devif_poll(&priv->dev, slip_txpoll); + devif_poll(&priv->dev, slip_txpoll); } net_unlock(); @@ -873,7 +859,7 @@ static int slip_txavail(FAR struct net_driver_s *dev) /* Wake up the TX polling thread */ priv->txnodelay = true; - (void)nxsig_kill(priv->txpid, SIGALRM); + nxsig_kill(priv->txpid, SIGALRM); } return OK; @@ -1038,7 +1024,7 @@ int slip_initialize(int intf, FAR const char *devname) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->dev, NET_LL_SLIP); + netdev_register(&priv->dev, NET_LL_SLIP); /* When the RX and TX tasks were created, the TTY file descriptor was * dup'ed for each task. This task no longer needs the file descriptor diff --git a/drivers/net/telnet.c b/drivers/net/telnet.c index 6c49adce4f..e1bf037ba8 100644 --- a/drivers/net/telnet.c +++ b/drivers/net/telnet.c @@ -712,7 +712,6 @@ static int telnet_open(FAR struct file *filep) if (ret < 0) { nerr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } @@ -762,7 +761,6 @@ static int telnet_close(FAR struct file *filep) if (ret < 0) { nerr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } @@ -901,13 +899,9 @@ static ssize_t telnet_read(FAR struct file *filep, FAR char *buffer, return 0; } - do - { - /* Wait for new data (or error) */ + /* Wait for new data (or error) */ - ret = nxsem_wait(&priv->td_iosem); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->td_iosem); /* poll fds.revents contains last poll status in case of error */ @@ -919,7 +913,7 @@ static ssize_t telnet_read(FAR struct file *filep, FAR char *buffer, /* Take exclusive access to data buffer */ - (void)nxsem_wait(&priv->td_exclsem); + nxsem_wait(&priv->td_exclsem); /* Process the buffered telnet data */ @@ -1060,7 +1054,7 @@ static int telnet_session(FAR struct telnet_session_s *session) * priority inheritance. */ - sem_setprotocol(&priv->td_iosem, SEM_PRIO_NONE); + nxsem_setprotocol(&priv->td_iosem, SEM_PRIO_NONE); priv->td_state = STATE_NORMAL; priv->td_crefs = 0; @@ -1103,16 +1097,12 @@ static int telnet_session(FAR struct telnet_session_s *session) * Get exclusive access to the minor counter. */ - do + ret = nxsem_wait_uninterruptible(&g_telnet_common.tc_exclsem); + if (ret < 0) { - ret = nxsem_wait(&g_telnet_common.tc_exclsem); - if (ret < 0 && ret != -EINTR) - { - nerr("ERROR: nxsem_wait failed: %d\n", ret); - goto errout_with_clone; - } + nerr("ERROR: nxsem_wait failed: %d\n", ret); + goto errout_with_clone; } - while (ret == -EINTR); /* Loop until the device name is verified to be unique. */ @@ -1165,7 +1155,7 @@ static int telnet_session(FAR struct telnet_session_s *session) * priority inheritance. */ - sem_setprotocol(&g_iosem, SEM_PRIO_NONE); + nxsem_setprotocol(&g_iosem, SEM_PRIO_NONE); /* Start the I/O thread */ @@ -1307,7 +1297,7 @@ static int telnet_io_main(int argc, FAR char** argv) priv->fds.events = POLLIN | POLLHUP | POLLERR; priv->fds.revents = 0; - (void)psock_poll(&priv->td_psock, &priv->fds, TRUE); + psock_poll(&priv->td_psock, &priv->fds, TRUE); } } @@ -1317,7 +1307,7 @@ static int telnet_io_main(int argc, FAR char** argv) * to include/remove client sockets from polling */ - (void)nxsem_wait(&g_iosem); + nxsem_wait(&g_iosem); /* Revisit each client in the g_telnet_clients[] array */ diff --git a/drivers/net/tun.c b/drivers/net/tun.c index d3205a707c..44f67bee01 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -252,21 +252,7 @@ static const struct file_operations g_tun_file_ops = static void tundev_lock(FAR struct tun_driver_s *tun) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&tun->waitsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&tun->waitsem); } /**************************************************************************** @@ -284,21 +270,7 @@ static void tundev_unlock(FAR struct tun_driver_s *tun) static void tun_lock(FAR struct tun_device_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->waitsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } /**************************************************************************** @@ -808,7 +780,7 @@ static void tun_txdone(FAR struct tun_device_s *priv) /* Then poll the network for new XMIT data */ priv->dev.d_buf = priv->read_buf; - (void)devif_poll(&priv->dev, tun_txpoll); + devif_poll(&priv->dev, tun_txpoll); } /**************************************************************************** @@ -846,12 +818,12 @@ static void tun_poll_work(FAR void *arg) /* If so, poll the network for new XMIT data. */ priv->dev.d_buf = priv->read_buf; - (void)devif_timer(&priv->dev, TUN_WDDELAY, tun_txpoll); + devif_timer(&priv->dev, TUN_WDDELAY, tun_txpoll); } /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, TUN_WDDELAY, tun_poll_expiry, 1, priv); + wd_start(priv->txpoll, TUN_WDDELAY, tun_poll_expiry, 1, priv); net_unlock(); tun_unlock(priv); @@ -929,8 +901,8 @@ static int tun_ifup(FAR struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, TUN_WDDELAY, tun_poll_expiry, - 1, (wdparm_t)priv); + wd_start(priv->txpoll, TUN_WDDELAY, tun_poll_expiry, + 1, (wdparm_t)priv); priv->bifup = true; return OK; @@ -1010,7 +982,7 @@ static void tun_txavail_work(FAR void *arg) /* Poll the network for new XMIT data */ priv->dev.d_buf = priv->read_buf; - (void)devif_poll(&priv->dev, tun_txpoll); + devif_poll(&priv->dev, tun_txpoll); } net_unlock(); @@ -1208,7 +1180,7 @@ static int tun_dev_uninit(FAR struct tun_device_s *priv) /* Remove the device from the OS */ - (void)netdev_unregister(&priv->dev); + netdev_unregister(&priv->dev); nxsem_destroy(&priv->waitsem); nxsem_destroy(&priv->read_wait_sem); @@ -1247,7 +1219,7 @@ static int tun_close(FAR struct file *filep) tundev_lock(tun); tun->free_tuns |= (1 << intf); - (void)tun_dev_uninit(priv); + tun_dev_uninit(priv); tundev_unlock(tun); @@ -1351,7 +1323,7 @@ static ssize_t tun_read(FAR struct file *filep, FAR char *buffer, priv->read_wait = true; tun_unlock(priv); - (void)nxsem_wait(&priv->read_wait_sem); + nxsem_wait(&priv->read_wait_sem); tun_lock(priv); } @@ -1526,7 +1498,7 @@ int tun_initialize(void) g_tun.free_tuns = (1 << CONFIG_TUN_NINTERFACES) - 1; - (void)register_driver("/dev/tun", &g_tun_file_ops, 0644, &g_tun); + register_driver("/dev/tun", &g_tun_file_ops, 0644, &g_tun); return OK; } diff --git a/drivers/pipes/pipe.c b/drivers/pipes/pipe.c index d824a0457c..4a0668838d 100644 --- a/drivers/pipes/pipe.c +++ b/drivers/pipes/pipe.c @@ -130,7 +130,7 @@ static inline void pipe_free(int pipeno) if (ret == OK) { g_pipeset &= ~(1 << pipeno); - (void)nxsem_post(&g_pipesem); + nxsem_post(&g_pipesem); } } @@ -208,7 +208,7 @@ int pipe2(int fd[2], size_t bufsize) pipeno = pipe_allocate(); if (pipeno < 0) { - (void)nxsem_post(&g_pipesem); + nxsem_post(&g_pipesem); errcode = -pipeno; goto errout; } @@ -226,7 +226,7 @@ int pipe2(int fd[2], size_t bufsize) dev = pipecommon_allocdev(bufsize); if (!dev) { - (void)nxsem_post(&g_pipesem); + nxsem_post(&g_pipesem); errcode = ENOMEM; goto errout_with_pipe; } @@ -238,7 +238,7 @@ int pipe2(int fd[2], size_t bufsize) ret = register_driver(devname, &pipe_fops, 0666, (FAR void *)dev); if (ret != 0) { - (void)nxsem_post(&g_pipesem); + nxsem_post(&g_pipesem); errcode = -ret; goto errout_with_dev; } @@ -248,7 +248,7 @@ int pipe2(int fd[2], size_t bufsize) g_pipecreated |= (1 << pipeno); } - (void)nxsem_post(&g_pipesem); + nxsem_post(&g_pipesem); /* Get a write file descriptor */ diff --git a/drivers/pipes/pipe_common.c b/drivers/pipes/pipe_common.c index d5250be11a..0ecb54c0eb 100644 --- a/drivers/pipes/pipe_common.c +++ b/drivers/pipes/pipe_common.c @@ -96,21 +96,7 @@ static void pipecommon_semtake(sem_t *sem); static void pipecommon_semtake(FAR sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -236,7 +222,7 @@ int pipecommon_open(FAR struct file *filep) dev->d_buffer = (FAR uint8_t *)kmm_malloc(dev->d_bufsize); if (!dev->d_buffer) { - (void)nxsem_post(&dev->d_bfsem); + nxsem_post(&dev->d_bfsem); return -ENOMEM; } } @@ -273,7 +259,7 @@ int pipecommon_open(FAR struct file *filep) */ sched_lock(); - (void)nxsem_post(&dev->d_bfsem); + nxsem_post(&dev->d_bfsem); if ((filep->f_oflags & O_RDWR) == O_RDONLY && /* Read-only */ dev->d_nwriters < 1 && /* No writers on the pipe */ @@ -299,7 +285,7 @@ int pipecommon_open(FAR struct file *filep) /* Immediately close the pipe that we just opened */ - (void)pipecommon_close(filep); + pipecommon_close(filep); } } diff --git a/drivers/power/activity_governor.c b/drivers/power/activity_governor.c index 3173a2f4e1..f456b2b953 100644 --- a/drivers/power/activity_governor.c +++ b/drivers/power/activity_governor.c @@ -290,7 +290,7 @@ static void governor_activity(int domain, int count) pdomstate->stime = now; pdomstate->accum = 0; - (void)governor_update(domain, tmp); + governor_update(domain, tmp); } leave_critical_section(flags); @@ -519,7 +519,7 @@ static enum pm_state_e governor_checkstate(int domain) pdomstate->stime = now; pdomstate->accum = 0; - (void)governor_update(domain, accum); + governor_update(domain, accum); } /* Consider the possible power state lock here */ diff --git a/drivers/power/pm_changestate.c b/drivers/power/pm_changestate.c index 92da5a21f0..8fb37977b3 100644 --- a/drivers/power/pm_changestate.c +++ b/drivers/power/pm_changestate.c @@ -243,7 +243,7 @@ int pm_changestate(int domain, enum pm_state_e newstate) */ newstate = g_pmglobals.domain[domain].state; - (void)pm_prepall(domain, newstate); + pm_prepall(domain, newstate); } /* All drivers have agreed to the state change (or, one or more have diff --git a/drivers/rwbuffer.c b/drivers/rwbuffer.c index 5c02a3048e..4878ab2b77 100644 --- a/drivers/rwbuffer.c +++ b/drivers/rwbuffer.c @@ -93,21 +93,7 @@ static void rwb_semtake(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -226,7 +212,7 @@ static void rwb_wrstarttimeout(FAR struct rwbuffer_s *rwb) */ int ticks = MSEC2TICK(CONFIG_DRVR_WRDELAY); - (void)work_queue(LPWORK, &rwb->work, rwb_wrtimeout, (FAR void *)rwb, ticks); + work_queue(LPWORK, &rwb->work, rwb_wrtimeout, (FAR void *)rwb, ticks); #endif } #endif @@ -239,7 +225,7 @@ static void rwb_wrstarttimeout(FAR struct rwbuffer_s *rwb) static inline void rwb_wrcanceltimeout(struct rwbuffer_s *rwb) { #if CONFIG_DRVR_WRDELAY != 0 - (void)work_cancel(LPWORK, &rwb->work); + work_cancel(LPWORK, &rwb->work); #endif } #endif diff --git a/drivers/sensors/adxl345_base.c b/drivers/sensors/adxl345_base.c index 7b85af8ea0..c55e445ecc 100644 --- a/drivers/sensors/adxl345_base.c +++ b/drivers/sensors/adxl345_base.c @@ -152,9 +152,6 @@ static ssize_t adxl345_read(FAR struct file *filep, FAR char *buffer, size_t len ret = nxsem_wait(&priv->exclsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -210,7 +207,6 @@ int adxl345_register(ADXL345_HANDLE handle, int minor) if (ret < 0) { snerr("ERROR: nxsem_wait failed: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } diff --git a/drivers/sensors/adxl345_spi.c b/drivers/sensors/adxl345_spi.c index f235a1b750..d352304108 100644 --- a/drivers/sensors/adxl345_spi.c +++ b/drivers/sensors/adxl345_spi.c @@ -70,8 +70,8 @@ static inline void adxl345_configspi(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, SPIDEV_MODE3); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, ADXL345_SPI_MAXFREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, ADXL345_SPI_MAXFREQUENCY); } /**************************************************************************** @@ -92,7 +92,7 @@ uint8_t adxl345_getreg8(FAR struct adxl345_dev_s *priv, uint8_t regaddr) /* If SPI bus is shared then lock and configure it */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); adxl345_configspi(priv->spi); /* Select the ADXL345 */ @@ -101,7 +101,7 @@ uint8_t adxl345_getreg8(FAR struct adxl345_dev_s *priv, uint8_t regaddr) /* Send register to read and get the next byte */ - (void)SPI_SEND(priv->spi, regaddr); + SPI_SEND(priv->spi, regaddr); SPI_RECVBLOCK(priv->spi, ®val, 1); /* Deselect the ADXL345 */ @@ -110,7 +110,7 @@ uint8_t adxl345_getreg8(FAR struct adxl345_dev_s *priv, uint8_t regaddr) /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); #ifdef CONFIG_ADXL345_REGDEBUG _err("%02x->%02x\n", regaddr, regval); @@ -135,7 +135,7 @@ void adxl345_putreg8(FAR struct adxl345_dev_s *priv, uint8_t regaddr, /* If SPI bus is shared then lock and configure it */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); adxl345_configspi(priv->spi); /* Select the ADXL345 */ @@ -144,8 +144,8 @@ void adxl345_putreg8(FAR struct adxl345_dev_s *priv, uint8_t regaddr, /* Send register address and set the value */ - (void)SPI_SEND(priv->spi, regaddr); - (void)SPI_SEND(priv->spi, regval); + SPI_SEND(priv->spi, regaddr); + SPI_SEND(priv->spi, regval); /* Deselect the ADXL345 */ @@ -153,7 +153,7 @@ void adxl345_putreg8(FAR struct adxl345_dev_s *priv, uint8_t regaddr, /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); } /**************************************************************************** @@ -170,7 +170,7 @@ uint16_t adxl345_getreg16(FAR struct adxl345_dev_s *priv, uint8_t regaddr) /* If SPI bus is shared then lock and configure it */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); adxl345_configspi(priv->spi); /* Select the ADXL345 */ @@ -179,7 +179,7 @@ uint16_t adxl345_getreg16(FAR struct adxl345_dev_s *priv, uint8_t regaddr) /* Send register to read and get the next 2 bytes */ - (void)SPI_SEND(priv->spi, regaddr); + SPI_SEND(priv->spi, regaddr); SPI_RECVBLOCK(priv->spi, ®val, 2); /* Deselect the ADXL345 */ @@ -188,7 +188,7 @@ uint16_t adxl345_getreg16(FAR struct adxl345_dev_s *priv, uint8_t regaddr) /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); #ifdef CONFIG_ADXL345_REGDEBUG _err("%02x->%04x\n", regaddr, regval); diff --git a/drivers/sensors/ak09912.c b/drivers/sensors/ak09912.c index 2cb843c8e2..01457c1e92 100644 --- a/drivers/sensors/ak09912.c +++ b/drivers/sensors/ak09912.c @@ -402,7 +402,7 @@ static void ak09912_wd_timeout(int argc, uint32_t arg, ...) { struct ak09912_dev_s *priv = (struct ak09912_dev_s *) arg; irqstate_t flags = enter_critical_section(); - sem_post(&priv->wait); + nxsem_post(&priv->wait); leave_critical_section(flags); } @@ -426,7 +426,7 @@ static int ak09912_read_mag_uncomp_data(FAR struct ak09912_dev_s *priv, state = ak09912_getreg8(priv, AK09912_ST1); while (! (state & 0x1)) { - sem_wait(&priv->wait); + nxsem_wait(&priv->wait); } wd_cancel(priv->wd); @@ -688,7 +688,7 @@ int ak09912_register(FAR const char *devpath, FAR struct i2c_master_s *i2c) priv->freq = AK09912_FREQ; priv->compensated = ENABLE_COMPENSATED; priv->wd = wd_create(); - sem_init(&priv->wait, 0, 0); + nxsem_init(&priv->wait, 0, 0); /* set default noice suppression filter. */ @@ -718,7 +718,7 @@ int ak09912_register(FAR const char *devpath, FAR struct i2c_master_s *i2c) /* Register the character driver */ - (void) snprintf(path, sizeof(path), "%s%d", devpath, 0); + snprintf(path, sizeof(path), "%s%d", devpath, 0); ret = register_driver(path, &g_ak09912fops, 0666, priv); if (ret < 0) { diff --git a/drivers/sensors/apds9960.c b/drivers/sensors/apds9960.c index e9c0f37709..309e4a73f3 100644 --- a/drivers/sensors/apds9960.c +++ b/drivers/sensors/apds9960.c @@ -1171,7 +1171,6 @@ static ssize_t apds9960_read(FAR struct file *filep, FAR char *buffer, { FAR struct inode *inode; FAR struct apds9960_dev_s *priv; - int ret; DEBUGASSERT(filep); inode = filep->f_inode; @@ -1189,17 +1188,7 @@ static ssize_t apds9960_read(FAR struct file *filep, FAR char *buffer, /* Wait for data available */ - do - { - ret = nxsem_wait(&priv->sample_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->sample_sem); buffer[0] = (char) priv->gesture_motion; buflen = 1; diff --git a/drivers/sensors/as726x.c b/drivers/sensors/as726x.c index 5e8161e3a2..dd36d9c1b6 100644 --- a/drivers/sensors/as726x.c +++ b/drivers/sensors/as726x.c @@ -213,7 +213,7 @@ static uint8_t as726x_read8(FAR struct as726x_dev_s *priv, uint8_t regaddr) * Read the byte but do nothing with it. */ - (void)read_register(priv, AS72XX_SLAVE_READ_REG); + read_register(priv, AS72XX_SLAVE_READ_REG); } /* Wait for WRITE flag to clear */ diff --git a/drivers/sensors/bmg160.c b/drivers/sensors/bmg160.c index 7cc934478a..9258189d7a 100644 --- a/drivers/sensors/bmg160.c +++ b/drivers/sensors/bmg160.c @@ -232,7 +232,6 @@ static void bmg160_read_measurement_data(FAR struct bmg160_dev_s *dev) if (ret < 0) { snerr("ERROR: Could not aquire dev->datasem: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return; } @@ -462,7 +461,6 @@ static ssize_t bmg160_read(FAR struct file *filep, FAR char *buffer, if (ret < 0) { snerr("ERROR: Could not aquire priv->datasem: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } diff --git a/drivers/sensors/bmi160.c b/drivers/sensors/bmi160.c index b09dfed562..cfcad528b3 100644 --- a/drivers/sensors/bmi160.c +++ b/drivers/sensors/bmi160.c @@ -294,8 +294,8 @@ static inline void bmi160_configspi(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, SPIDEV_MODE3); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, BMI160_SPI_MAXFREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, BMI160_SPI_MAXFREQUENCY); } #endif @@ -336,7 +336,7 @@ static uint8_t bmi160_getreg8(FAR struct bmi160_dev_s *priv, uint8_t regaddr) #else /* CONFIG_SENSORS_BMI160_SPI */ /* If SPI bus is shared then lock and configure it */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); bmi160_configspi(priv->spi); /* Select the BMI160 */ @@ -345,7 +345,7 @@ static uint8_t bmi160_getreg8(FAR struct bmi160_dev_s *priv, uint8_t regaddr) /* Send register to read and get the next byte */ - (void)SPI_SEND(priv->spi, regaddr | 0x80); + SPI_SEND(priv->spi, regaddr | 0x80); SPI_RECVBLOCK(priv->spi, ®val, 1); /* Deselect the BMI160 */ @@ -354,7 +354,7 @@ static uint8_t bmi160_getreg8(FAR struct bmi160_dev_s *priv, uint8_t regaddr) /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); #endif return regval; @@ -394,7 +394,7 @@ static void bmi160_putreg8(FAR struct bmi160_dev_s *priv, uint8_t regaddr, #else /* CONFIG_SENSORS_BMI160_SPI */ /* If SPI bus is shared then lock and configure it */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); bmi160_configspi(priv->spi); /* Select the BMI160 */ @@ -403,8 +403,8 @@ static void bmi160_putreg8(FAR struct bmi160_dev_s *priv, uint8_t regaddr, /* Send register address and set the value */ - (void)SPI_SEND(priv->spi, regaddr); - (void)SPI_SEND(priv->spi, regval); + SPI_SEND(priv->spi, regaddr); + SPI_SEND(priv->spi, regval); /* Deselect the BMI160 */ @@ -412,7 +412,7 @@ static void bmi160_putreg8(FAR struct bmi160_dev_s *priv, uint8_t regaddr, /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); #endif } @@ -455,7 +455,7 @@ static uint16_t bmi160_getreg16(FAR struct bmi160_dev_s *priv, #else /* CONFIG_SENSORS_BMI160_SPI */ /* If SPI bus is shared then lock and configure it */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); bmi160_configspi(priv->spi); /* Select the BMI160 */ @@ -464,7 +464,7 @@ static uint16_t bmi160_getreg16(FAR struct bmi160_dev_s *priv, /* Send register to read and get the next 2 bytes */ - (void)SPI_SEND(priv->spi, regaddr | 0x80); + SPI_SEND(priv->spi, regaddr | 0x80); SPI_RECVBLOCK(priv->spi, ®val, 2); /* Deselect the BMI160 */ @@ -473,7 +473,7 @@ static uint16_t bmi160_getreg16(FAR struct bmi160_dev_s *priv, /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); #endif return regval; @@ -515,7 +515,7 @@ static void bmi160_getregs(FAR struct bmi160_dev_s *priv, uint8_t regaddr, #else /* CONFIG_SENSORS_BMI160_SPI */ /* If SPI bus is shared then lock and configure it */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); bmi160_configspi(priv->spi); /* Select the BMI160 */ @@ -524,7 +524,7 @@ static void bmi160_getregs(FAR struct bmi160_dev_s *priv, uint8_t regaddr, /* Send register to read and get the next 2 bytes */ - (void)SPI_SEND(priv->spi, regaddr | 0x80); + SPI_SEND(priv->spi, regaddr | 0x80); SPI_RECVBLOCK(priv->spi, regval, len); /* Deselect the BMI160 */ @@ -533,7 +533,7 @@ static void bmi160_getregs(FAR struct bmi160_dev_s *priv, uint8_t regaddr, /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); #endif } diff --git a/drivers/sensors/bmp280.c b/drivers/sensors/bmp280.c index 4ff4713bde..ff557ccc69 100644 --- a/drivers/sensors/bmp280.c +++ b/drivers/sensors/bmp280.c @@ -483,7 +483,7 @@ static uint32_t bmp280_compensate_press(FAR struct bmp280_dev_s *priv, /* Update temperature fine value first. */ - (void) bmp280_compensate_temp(priv, temp); + bmp280_compensate_temp(priv, temp); var1 = (priv->tempfine >> 1) - 64000; var2 = (((var1 >> 2) * (var1 >> 2)) >> 11) * ((int32_t)c->p6); diff --git a/drivers/sensors/dhtxx.c b/drivers/sensors/dhtxx.c index d1ff744225..c79eb8e8f6 100644 --- a/drivers/sensors/dhtxx.c +++ b/drivers/sensors/dhtxx.c @@ -427,7 +427,6 @@ static int dht_parse_data(FAR struct dhtxx_dev_s *priv, static int dhtxx_open(FAR struct file *filep) { - int ret; FAR struct inode *inode = filep->f_inode; FAR struct dhtxx_dev_s *priv = inode->i_private; @@ -435,11 +434,7 @@ static int dhtxx_open(FAR struct file *filep) * pass unstable state. */ - do - { - ret = nxsem_wait(&priv->devsem); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); dht_standby_mode(priv); @@ -471,7 +466,7 @@ static int dhtxx_close(FAR struct file *filep) static ssize_t dhtxx_read(FAR struct file *filep, FAR char *buffer, size_t buflen) { - int ret; + int ret = OK; FAR struct inode *inode = filep->f_inode; FAR struct dhtxx_dev_s *priv = inode->i_private; FAR struct dhtxx_sensor_data_s *data = @@ -491,11 +486,7 @@ static ssize_t dhtxx_read(FAR struct file *filep, FAR char *buffer, memset(priv->raw_data, 0u, sizeof(priv->raw_data)); - do - { - ret = nxsem_wait(&priv->devsem); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); dht_send_start_signal(priv); diff --git a/drivers/sensors/hc_sr04.c b/drivers/sensors/hc_sr04.c index 4b2e961516..e07fea6bdb 100644 --- a/drivers/sensors/hc_sr04.c +++ b/drivers/sensors/hc_sr04.c @@ -149,22 +149,8 @@ static int hcsr04_open(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct hcsr04_dev_s *priv = inode->i_private; - int ret; - - /* Get exclusive access */ - - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); nxsem_post(&priv->devsem); hcsr04_dbg("OPENED\n"); return OK; @@ -174,25 +160,11 @@ static int hcsr04_close(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct hcsr04_dev_s *priv = inode->i_private; - int ret; - - /* Get exclusive access */ - - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); nxsem_post(&priv->devsem); hcsr04_dbg("CLOSED\n"); - return ret; + return OK; } static ssize_t hcsr04_read(FAR struct file *filep, FAR char *buffer, @@ -202,41 +174,20 @@ static ssize_t hcsr04_read(FAR struct file *filep, FAR char *buffer, FAR struct hcsr04_dev_s *priv = inode->i_private; int distance = 0; ssize_t length = 0; - int ret; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Setup and send a pulse to start measuring */ - (void)hcsr04_start_measuring(priv); + hcsr04_start_measuring(priv); /* Wait the convertion to finish */ /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->conv_donesem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->conv_donesem); distance = hcsr04_read_distance(priv); if (distance < 0) @@ -273,17 +224,7 @@ static int hcsr04_ioctl(FAR struct file *filep, int cmd, unsigned long arg) /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); switch (cmd) { @@ -348,7 +289,7 @@ static int hcsr04_poll(FAR struct file *filep, FAR struct pollfd *fds, FAR struct inode *inode; FAR struct hcsr04_dev_s *priv; uint32_t flags; - int ret; + int ret = OK; int i; DEBUGASSERT(filep && fds); @@ -359,17 +300,7 @@ static int hcsr04_poll(FAR struct file *filep, FAR struct pollfd *fds, /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); if (setup) { diff --git a/drivers/sensors/hts221.c b/drivers/sensors/hts221.c index 6913e68c79..0b2c081ee2 100644 --- a/drivers/sensors/hts221.c +++ b/drivers/sensors/hts221.c @@ -904,21 +904,10 @@ static int hts221_open(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct hts221_dev_s *priv = inode->i_private; - int ret; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); priv->config->set_power(priv->config, true); priv->config->irq_enable(priv->config, true); @@ -936,17 +925,7 @@ static int hts221_close(FAR struct file *filep) /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); priv->config->irq_enable(priv->config, false); ret = hts221_power_on_off(priv, false); @@ -968,17 +947,7 @@ static ssize_t hts221_read(FAR struct file *filep, FAR char *buffer, /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); ret = hts221_read_convert_data(priv, &data); if (ret < 0) @@ -1016,17 +985,7 @@ static int hts221_ioctl(FAR struct file *filep, int cmd, unsigned long arg) /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); switch (cmd) { @@ -1117,7 +1076,7 @@ static int hts221_poll(FAR struct file *filep, FAR struct pollfd *fds, FAR struct inode *inode; FAR struct hts221_dev_s *priv; irqstate_t flags; - int ret; + int ret = OK; int i; DEBUGASSERT(filep && fds); @@ -1128,17 +1087,7 @@ static int hts221_poll(FAR struct file *filep, FAR struct pollfd *fds, /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); if (setup) { diff --git a/drivers/sensors/kxtj9.c b/drivers/sensors/kxtj9.c index 21751bdec3..c34e34848b 100644 --- a/drivers/sensors/kxtj9.c +++ b/drivers/sensors/kxtj9.c @@ -341,13 +341,8 @@ static void kxtj9_set_mode_standby(FAR struct kxtj9_dev_s *priv) static int kxtj9_configure(FAR struct kxtj9_dev_s *priv, uint8_t odr) { uint8_t wbuf[0]; - int ret; - do - { - ret = nxsem_wait(&priv->exclsem); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); kxtj9_soft_reset(priv); kxtj9_set_mode_standby(priv); @@ -394,13 +389,8 @@ static int kxtj9_configure(FAR struct kxtj9_dev_s *priv, uint8_t odr) static int kxtj9_enable(FAR struct kxtj9_dev_s *priv, bool on) { uint8_t wbuf[1]; - int ret; - do - { - ret = nxsem_wait(&priv->exclsem); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); if (!on && priv->power_enabled) { @@ -441,13 +431,8 @@ static int kxtj9_read_sensor_data(FAR struct kxtj9_dev_s *priv, { int16_t acc_data[3]; uint8_t data; - int ret; - do - { - ret = nxsem_wait(&priv->exclsem); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); kxtj9_reg_read(priv, XOUT_L, (uint8_t *)acc_data, 6); diff --git a/drivers/sensors/l3gd20.c b/drivers/sensors/l3gd20.c index 441fb6cea5..e5c0b5fb8c 100644 --- a/drivers/sensors/l3gd20.c +++ b/drivers/sensors/l3gd20.c @@ -509,7 +509,6 @@ static ssize_t l3gd20_read(FAR struct file *filep, FAR char *buffer, if (ret < 0) { snerr("ERROR: Could not aquire priv->datasem: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } diff --git a/drivers/sensors/lis2dh.c b/drivers/sensors/lis2dh.c index e9c3d36b0c..9a885c003d 100644 --- a/drivers/sensors/lis2dh.c +++ b/drivers/sensors/lis2dh.c @@ -1164,7 +1164,7 @@ static int lis2dh_handle_selftest(FAR struct lis2dh_dev_s *priv) } out: - (void)lis2dh_clear_registers(priv); + lis2dh_clear_registers(priv); lis2dh_powerdown(priv); return ret; @@ -1672,9 +1672,9 @@ static int lis2dh_reboot(FAR struct lis2dh_dev_s *dev) /* Prefer monotonic for timeout calculation when enabled. */ #ifdef CONFIG_CLOCK_MONOTONIC - (void)clock_gettime(CLOCK_MONOTONIC, &start); + clock_gettime(CLOCK_MONOTONIC, &start); #else - (void)clock_gettime(CLOCK_REALTIME, &start); + clock_gettime(CLOCK_REALTIME, &start); #endif /* Reboot to reset chip. */ @@ -1701,9 +1701,9 @@ static int lis2dh_reboot(FAR struct lis2dh_dev_s *dev) } #ifdef CONFIG_CLOCK_MONOTONIC - (void)clock_gettime(CLOCK_MONOTONIC, &curr); + clock_gettime(CLOCK_MONOTONIC, &curr); #else - (void)clock_gettime(CLOCK_REALTIME, &curr); + clock_gettime(CLOCK_REALTIME, &curr); #endif diff_msec = (curr.tv_sec - start.tv_sec) * 1000; @@ -1775,7 +1775,7 @@ static int lis2dh_setup(FAR struct lis2dh_dev_s * dev, * new configuration and functions correctly. */ - (void)lis2dh_reboot(dev); + lis2dh_reboot(dev); /* TEMP_CFG_REG */ diff --git a/drivers/sensors/lps25h.c b/drivers/sensors/lps25h.c index dde08cf869..109443e360 100644 --- a/drivers/sensors/lps25h.c +++ b/drivers/sensors/lps25h.c @@ -343,17 +343,7 @@ static int lps25h_open(FAR struct file *filep) /* Get exclusive access */ - do - { - ret = nxsem_wait(&dev->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&dev->devsem); dev->config->set_power(dev->config, true); ret = lps25h_read_reg8(dev, &addr, &value); @@ -382,17 +372,7 @@ static int lps25h_close(FAR struct file *filep) /* Get exclusive access */ - do - { - ret = nxsem_wait(&dev->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&dev->devsem); dev->config->irq_enable(dev->config, false); dev->irqenabled = false; @@ -415,17 +395,7 @@ static ssize_t lps25h_read(FAR struct file *filep, FAR char *buffer, /* Get exclusive access */ - do - { - ret = nxsem_wait(&dev->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&dev->devsem); ret = lps25h_configure_dev(dev); if (ret < 0) @@ -561,7 +531,7 @@ static int lps25h_one_shot(FAR struct lps25h_dev_s *dev) return ret; } - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); abstime.tv_sec += (LPS25H_RETRY_TIMEOUT_MSECS / 1000); abstime.tv_nsec += (LPS25H_RETRY_TIMEOUT_MSECS % 1000) * 1000 * 1000; while (abstime.tv_nsec >= (1000 * 1000 * 1000)) @@ -570,52 +540,39 @@ static int lps25h_one_shot(FAR struct lps25h_dev_s *dev) abstime.tv_nsec -= 1000 * 1000 * 1000; } - while ((ret = nxsem_timedwait(&dev->waitsem, &abstime)) < 0) - { - if (ret == -EINTR) - { - continue; - } - else if (ret == -ETIMEDOUT) - { - uint8_t reg = LPS25H_CTRL_REG2; - uint8_t value; - - /* In 'AN4450 - Hardware and software guidelines for use of - * LPS25H pressure sensors' - '4.3 One-shot mode measurement - * sequence', one-shot mode example is given where interrupt line - * is not used, but CTRL_REG2 is polled until ONE_SHOT bit is - * unset (as it is self-clearing). Check ONE_SHOT bit status here - * to see if we just missed interrupt. - */ - - ret = lps25h_read_reg8(dev, ®, &value); - if (ret < 0) - { - break; - } - - if ((value & LPS25H_ONE_SHOT) == 0) - { - /* One-shot completed. */ - - ret = OK; - break; - } - } - else - { - /* Some unknown mystery error */ - - DEBUGASSERT(false); - return ret; - } - } - + ret = nxsem_timedwait_uninterruptible(&dev->waitsem, &abstime); if (ret == OK) { break; } + else if (ret == -ETIMEDOUT) + { + uint8_t reg = LPS25H_CTRL_REG2; + uint8_t value; + + /* In 'AN4450 - Hardware and software guidelines for use of + * LPS25H pressure sensors' - '4.3 One-shot mode measurement + * sequence', one-shot mode example is given where interrupt line + * is not used, but CTRL_REG2 is polled until ONE_SHOT bit is + * unset (as it is self-clearing). Check ONE_SHOT bit status here + * to see if we just missed interrupt. + */ + + ret = lps25h_read_reg8(dev, ®, &value); + if (ret == OK && (value & LPS25H_ONE_SHOT) == 0) + { + /* One-shot completed. */ + + break; + } + } + else + { + /* Some unknown mystery error */ + + DEBUGASSERT(false); + return ret; + } lps25h_dbg("Retrying one-shot measurement: retries=%d\n", retries); } @@ -746,17 +703,7 @@ static int lps25h_ioctl(FAR struct file *filep, int cmd, unsigned long arg) /* Get exclusive access */ - do - { - ret = nxsem_wait(&dev->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&dev->devsem); switch (cmd) { diff --git a/drivers/sensors/max31855.c b/drivers/sensors/max31855.c index 730d01f35a..3762a18910 100644 --- a/drivers/sensors/max31855.c +++ b/drivers/sensors/max31855.c @@ -125,10 +125,10 @@ static const struct file_operations g_max31855fops = static void max31855_lock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); SPI_SETMODE(spi, SPIDEV_MODE0); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); + SPI_HWFEATURES(spi, 0); SPI_SETFREQUENCY(spi, 400000); } @@ -142,7 +142,7 @@ static void max31855_lock(FAR struct spi_dev_s *spi) static void max31855_unlock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } /**************************************************************************** diff --git a/drivers/sensors/max44009.c b/drivers/sensors/max44009.c index ef990afc5b..1f002aa74e 100644 --- a/drivers/sensors/max44009.c +++ b/drivers/sensors/max44009.c @@ -235,17 +235,7 @@ static int max44009_open(FAR struct file *filep) DEBUGASSERT(inode && inode->i_private); priv = (FAR struct max44009_dev_s *)inode->i_private; - do - { - ret = nxsem_wait(&priv->dev_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->dev_sem); use_count = priv->cref + 1; if (use_count == 1) @@ -282,7 +272,6 @@ static int max44009_close(FAR struct file *filep) FAR struct inode *inode; FAR struct max44009_dev_s *priv; int use_count; - int ret; DEBUGASSERT(filep); inode = filep->f_inode; @@ -290,17 +279,7 @@ static int max44009_close(FAR struct file *filep) DEBUGASSERT(inode && inode->i_private); priv = (FAR struct max44009_dev_s *)inode->i_private; - do - { - ret = nxsem_wait(&priv->dev_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->dev_sem); use_count = priv->cref - 1; if (use_count == 0) @@ -309,7 +288,7 @@ static int max44009_close(FAR struct file *filep) /* Last user, do power off. */ - (void)priv->config->set_power(priv->config, false); + priv->config->set_power(priv->config, false); priv->cref = use_count; } else @@ -339,17 +318,7 @@ static ssize_t max44009_read(FAR struct file *filep, FAR char *buffer, DEBUGASSERT(inode && inode->i_private); priv = (FAR struct max44009_dev_s *)inode->i_private; - do - { - ret = nxsem_wait(&priv->dev_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->dev_sem); ret = max44009_read_data(priv, &data); if (ret < 0) @@ -748,17 +717,7 @@ static int max44009_ioctl(FAR struct file *filep, int cmd, unsigned long arg) DEBUGASSERT(inode && inode->i_private); priv = (FAR struct max44009_dev_s *)inode->i_private; - do - { - ret = nxsem_wait(&priv->dev_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->dev_sem); switch (cmd) { @@ -819,7 +778,7 @@ static int max44009_poll(FAR struct file *filep, FAR struct pollfd *fds, { FAR struct inode *inode; FAR struct max44009_dev_s *priv; - int ret; + int ret = OK; int i; DEBUGASSERT(filep && fds); @@ -828,17 +787,7 @@ static int max44009_poll(FAR struct file *filep, FAR struct pollfd *fds, DEBUGASSERT(inode && inode->i_private); priv = (FAR struct max44009_dev_s *)inode->i_private; - do - { - ret = nxsem_wait(&priv->dev_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->dev_sem); if (setup) { diff --git a/drivers/sensors/max6675.c b/drivers/sensors/max6675.c index 336d81ee55..ea6866be8b 100644 --- a/drivers/sensors/max6675.c +++ b/drivers/sensors/max6675.c @@ -121,10 +121,10 @@ static const struct file_operations g_max6675fops = static void max6675_lock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); SPI_SETMODE(spi, SPIDEV_MODE0); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); + SPI_HWFEATURES(spi, 0); SPI_SETFREQUENCY(spi, 4000000); } @@ -138,7 +138,7 @@ static void max6675_lock(FAR struct spi_dev_s *spi) static void max6675_unlock(FAR struct spi_dev_s *spi) { - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } /**************************************************************************** diff --git a/drivers/sensors/mpl115a.c b/drivers/sensors/mpl115a.c index 2f89b66fbc..1ae035794d 100644 --- a/drivers/sensors/mpl115a.c +++ b/drivers/sensors/mpl115a.c @@ -122,8 +122,8 @@ static inline void mpl115a_configspi(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, SPIDEV_MODE0); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, MPL115A_SPI_MAXFREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, MPL115A_SPI_MAXFREQUENCY); } /**************************************************************************** @@ -140,7 +140,7 @@ static uint8_t mpl115a_getreg8(FAR struct mpl115a_dev_s *priv, uint8_t regaddr) /* If SPI bus is shared then lock and configure it */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); mpl115a_configspi(priv->spi); /* Select the MPL115A */ @@ -149,7 +149,7 @@ static uint8_t mpl115a_getreg8(FAR struct mpl115a_dev_s *priv, uint8_t regaddr) /* Send register to read and get the next byte */ - (void)SPI_SEND(priv->spi, regaddr); + SPI_SEND(priv->spi, regaddr); SPI_RECVBLOCK(priv->spi, ®val, 1); /* Deselect the MPL115A */ @@ -158,7 +158,7 @@ static uint8_t mpl115a_getreg8(FAR struct mpl115a_dev_s *priv, uint8_t regaddr) /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); #ifdef CONFIG_MPL115A_REGDEBUG _err("%02x->%02x\n", regaddr, regval); diff --git a/drivers/sensors/scd30.c b/drivers/sensors/scd30.c index f314fffb1a..28dacb2d0c 100644 --- a/drivers/sensors/scd30.c +++ b/drivers/sensors/scd30.c @@ -560,17 +560,17 @@ static int scd30_configure(FAR struct scd30_dev_s *priv, bool start) /* Set measurement interval. */ scd30_set_command_param(¶m, priv->interval); - (void)scd30_write_cmd(priv, SCD30_CMD_SET_INTERVAL, ¶m, 1); + scd30_write_cmd(priv, SCD30_CMD_SET_INTERVAL, ¶m, 1); /* Set altitude compensation. */ scd30_set_command_param(¶m, priv->altitude_comp); - (void)scd30_write_cmd(priv, SCD30_CMD_SET_ALT_COMPENSATION, ¶m, 1); + scd30_write_cmd(priv, SCD30_CMD_SET_ALT_COMPENSATION, ¶m, 1); /* Set temperature offset. */ scd30_set_command_param(¶m, priv->temperature_offset); - (void)scd30_write_cmd(priv, SCD30_CMD_SET_TEMP_OFFSET, ¶m, 1); + scd30_write_cmd(priv, SCD30_CMD_SET_TEMP_OFFSET, ¶m, 1); if (!start) { @@ -610,21 +610,11 @@ static int scd30_open(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct scd30_dev_s *priv = inode->i_private; - int ret; + int ret = OK; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Increment the count of open references on the driver */ @@ -659,21 +649,10 @@ static int scd30_close(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct scd30_dev_s *priv = inode->i_private; - int ret; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Decrement the count of open references on the driver */ @@ -716,17 +695,7 @@ static ssize_t scd30_read(FAR struct file *filep, FAR char *buffer, /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS if (priv->unlinked) @@ -796,17 +765,7 @@ static int scd30_ioctl(FAR struct file *filep, int cmd, unsigned long arg) /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS if (priv->unlinked) @@ -1013,24 +972,13 @@ static int scd30_ioctl(FAR struct file *filep, int cmd, unsigned long arg) static int scd30_unlink(FAR struct inode *inode) { FAR struct scd30_dev_s *priv; - int ret; DEBUGASSERT(inode != NULL && inode->i_private != NULL); priv = (FAR struct scd30_dev_s *)inode->i_private; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Are there open references to the driver data structure? */ @@ -1047,7 +995,7 @@ static int scd30_unlink(FAR struct inode *inode) priv->unlinked = true; nxsem_post(&priv->devsem); - return ret; + return OK; } #endif diff --git a/drivers/sensors/sgp30.c b/drivers/sensors/sgp30.c index 73e8d3d4d3..ad0f515fe1 100644 --- a/drivers/sensors/sgp30.c +++ b/drivers/sensors/sgp30.c @@ -515,21 +515,11 @@ static int sgp30_open(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct sgp30_dev_s *priv = inode->i_private; - int ret; + int ret = OK; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Increment the count of open references on the driver */ @@ -593,21 +583,10 @@ static int sgp30_close(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct sgp30_dev_s *priv = inode->i_private; - int ret; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Decrement the count of open references on the driver */ @@ -647,17 +626,7 @@ static ssize_t sgp30_read(FAR struct file *filep, FAR char *buffer, /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS if (priv->unlinked) @@ -752,17 +721,7 @@ static int sgp30_ioctl(FAR struct file *filep, int cmd, unsigned long arg) /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS if (priv->unlinked) @@ -926,24 +885,13 @@ static int sgp30_ioctl(FAR struct file *filep, int cmd, unsigned long arg) static int sgp30_unlink(FAR struct inode *inode) { FAR struct sgp30_dev_s *priv; - int ret; DEBUGASSERT(inode != NULL && inode->i_private != NULL); priv = (FAR struct sgp30_dev_s *)inode->i_private; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Are there open references to the driver data structure? */ @@ -960,7 +908,7 @@ static int sgp30_unlink(FAR struct inode *inode) priv->unlinked = true; nxsem_post(&priv->devsem); - return ret; + return OK; } #endif diff --git a/drivers/sensors/sht21.c b/drivers/sensors/sht21.c index d5fe53e801..7b843481cc 100644 --- a/drivers/sensors/sht21.c +++ b/drivers/sensors/sht21.c @@ -382,21 +382,10 @@ static int sht21_open(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct sht21_dev_s *priv = inode->i_private; - int ret; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Increment the count of open references on the driver */ @@ -421,21 +410,10 @@ static int sht21_close(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct sht21_dev_s *priv = inode->i_private; - int ret; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Decrement the count of open references on the driver */ @@ -473,17 +451,7 @@ static ssize_t sht21_read(FAR struct file *filep, FAR char *buffer, size_t bufle /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS if (priv->unlinked) @@ -539,17 +507,7 @@ static int sht21_ioctl(FAR struct file *filep, int cmd, unsigned long arg) /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS if (priv->unlinked) @@ -624,24 +582,13 @@ static int sht21_ioctl(FAR struct file *filep, int cmd, unsigned long arg) static int sht21_unlink(FAR struct inode *inode) { FAR struct sht21_dev_s *priv; - int ret; DEBUGASSERT(inode != NULL && inode->i_private != NULL); priv = (FAR struct sht21_dev_s *)inode->i_private; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Are there open references to the driver data structure? */ @@ -658,7 +605,7 @@ static int sht21_unlink(FAR struct inode *inode) priv->unlinked = true; nxsem_post(&priv->devsem); - return ret; + return OK; } #endif diff --git a/drivers/sensors/sht3x.c b/drivers/sensors/sht3x.c index 3f254392c9..0d7b57acc7 100644 --- a/drivers/sensors/sht3x.c +++ b/drivers/sensors/sht3x.c @@ -453,21 +453,10 @@ static int sht3x_open(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct sht3x_dev_s *priv = inode->i_private; - int ret; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Increment the count of open references on the driver */ @@ -492,21 +481,10 @@ static int sht3x_close(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct sht3x_dev_s *priv = inode->i_private; - int ret; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Decrement the count of open references on the driver */ @@ -563,17 +541,7 @@ static int sht3x_ioctl(FAR struct file *filep, int cmd, unsigned long arg) /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS if (priv->unlinked) @@ -641,24 +609,13 @@ static int sht3x_ioctl(FAR struct file *filep, int cmd, unsigned long arg) static int sht3x_unlink(FAR struct inode *inode) { FAR struct sht3x_dev_s *priv; - int ret; DEBUGASSERT(inode != NULL && inode->i_private != NULL); priv = (FAR struct sht3x_dev_s *)inode->i_private; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Are there open references to the driver data structure? */ @@ -675,7 +632,7 @@ static int sht3x_unlink(FAR struct inode *inode) priv->unlinked = true; nxsem_post(&priv->devsem); - return ret; + return OK; } #endif diff --git a/drivers/sensors/sps30.c b/drivers/sensors/sps30.c index d988cc5710..105472033a 100644 --- a/drivers/sensors/sps30.c +++ b/drivers/sensors/sps30.c @@ -675,17 +675,7 @@ static int sps30_open(FAR struct file *filep) /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Increment the count of open references on the driver */ @@ -748,21 +738,10 @@ static int sps30_close(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct sps30_dev_s *priv = inode->i_private; - int ret; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Decrement the count of open references on the driver */ @@ -801,17 +780,7 @@ static ssize_t sps30_read(FAR struct file *filep, FAR char *buffer, /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS if (priv->unlinked) @@ -896,17 +865,7 @@ static int sps30_ioctl(FAR struct file *filep, int cmd, unsigned long arg) /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS if (priv->unlinked) @@ -1030,24 +989,13 @@ static int sps30_ioctl(FAR struct file *filep, int cmd, unsigned long arg) static int sps30_unlink(FAR struct inode *inode) { FAR struct sps30_dev_s *priv; - int ret; DEBUGASSERT(inode != NULL && inode->i_private != NULL); priv = (FAR struct sps30_dev_s *)inode->i_private; /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* Are there open references to the driver data structure? */ @@ -1064,7 +1012,7 @@ static int sps30_unlink(FAR struct inode *inode) priv->unlinked = true; nxsem_post(&priv->devsem); - return ret; + return OK; } #endif diff --git a/drivers/sensors/t67xx.c b/drivers/sensors/t67xx.c index 156c36ee09..7bb00ff9be 100644 --- a/drivers/sensors/t67xx.c +++ b/drivers/sensors/t67xx.c @@ -635,17 +635,7 @@ static ssize_t t67xx_read(FAR struct file *filep, FAR char *buffer, /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); /* How many samples were requested to get? */ @@ -701,17 +691,7 @@ static int t67xx_ioctl(FAR struct file *filep, int cmd, unsigned long arg) /* Get exclusive access */ - do - { - ret = nxsem_wait(&priv->devsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->devsem); switch (cmd) { diff --git a/drivers/sensors/xen1210.c b/drivers/sensors/xen1210.c index c7ace723f8..e7fa8847e2 100644 --- a/drivers/sensors/xen1210.c +++ b/drivers/sensors/xen1210.c @@ -103,8 +103,8 @@ static inline void xen1210_configspi(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, SPIDEV_MODE1); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, XEN1210_SPI_MAXFREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, XEN1210_SPI_MAXFREQUENCY); } /**************************************************************************** @@ -177,7 +177,6 @@ static ssize_t xen1210_read(FAR struct file *filep, FAR char *buffer, /* This should only happen if the wait was canceled by an signal */ snerr("Failed: Cannot get exclusive access to driver structure!\n"); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -412,7 +411,7 @@ void xen1210_getdata(FAR struct xen1210_dev_s *priv) /* If SPI bus is shared then lock and configure it */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); xen1210_configspi(priv->spi); /* Select the XEN1210 */ @@ -436,7 +435,7 @@ void xen1210_getdata(FAR struct xen1210_dev_s *priv) /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); #ifdef CONFIG_XEN1210_REGDEBUG _err("%02x->%02x\n", regaddr, regval); @@ -465,7 +464,7 @@ void xen1210_putdata(FAR struct xen1210_dev_s *priv, uint32_t regval) /* If SPI bus is shared then lock and configure it */ - (void)SPI_LOCK(priv->spi, true); + SPI_LOCK(priv->spi, true); xen1210_configspi(priv->spi); /* Select the XEN1210 */ @@ -476,9 +475,9 @@ void xen1210_putdata(FAR struct xen1210_dev_s *priv, uint32_t regval) /* Write three times 3 bytes */ - (void)SPI_SNDBLOCK(priv->spi, ®val, 3); - (void)SPI_SNDBLOCK(priv->spi, ®val, 3); - (void)SPI_SNDBLOCK(priv->spi, ®val, 3); + SPI_SNDBLOCK(priv->spi, ®val, 3); + SPI_SNDBLOCK(priv->spi, ®val, 3); + SPI_SNDBLOCK(priv->spi, ®val, 3); /* Deselect the XEN1210 */ @@ -486,7 +485,7 @@ void xen1210_putdata(FAR struct xen1210_dev_s *priv, uint32_t regval) /* Unlock bus */ - (void)SPI_LOCK(priv->spi, false); + SPI_LOCK(priv->spi, false); } #endif /* CONFIG_SENSORS_XEN1210 */ diff --git a/drivers/serial/lowconsole.c b/drivers/serial/lowconsole.c index 6e02ea78c6..173efe049d 100644 --- a/drivers/serial/lowconsole.c +++ b/drivers/serial/lowconsole.c @@ -130,5 +130,5 @@ static ssize_t lowconsole_write(struct file *filep, const char *buffer, size_t b void lowconsole_init(void) { - (void)register_driver("/dev/console", &g_consoleops, 0666, NULL); + register_driver("/dev/console", &g_consoleops, 0666, NULL); } diff --git a/drivers/serial/ptmx.c b/drivers/serial/ptmx.c index f8559ac9bd..16dc180636 100644 --- a/drivers/serial/ptmx.c +++ b/drivers/serial/ptmx.c @@ -127,21 +127,7 @@ static struct ptmx_dev_s g_ptmx; static void ptmx_semtake(void) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_ptmx.px_exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_ptmx.px_exclsem); } #define ptmx_semgive() nxsem_post(&g_ptmx.px_exclsem) diff --git a/drivers/serial/pty.c b/drivers/serial/pty.c index fcff8435d6..8693778017 100644 --- a/drivers/serial/pty.c +++ b/drivers/serial/pty.c @@ -222,21 +222,7 @@ static const struct file_operations g_pty_fops = static void pty_semtake(FAR struct pty_devpair_s *devpair) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&devpair->pp_exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&devpair->pp_exclsem); } /**************************************************************************** @@ -261,21 +247,21 @@ static void pty_destroy(FAR struct pty_devpair_s *devpair) #else snprintf(devname, 16, "/dev/pts/%d", devpair->pp_minor); #endif - (void)unregister_driver(devname); + unregister_driver(devname); /* Un-register the master device (/dev/ptyN may have already been * unlinked). */ snprintf(devname, 16, "/dev/pty%d", (int)devpair->pp_minor); - (void)unregister_driver(devname); + unregister_driver(devname); /* Close the contained file structures */ - (void)file_close(&devpair->pp_master.pd_src); - (void)file_close(&devpair->pp_master.pd_sink); - (void)file_close(&devpair->pp_slave.pd_src); - (void)file_close(&devpair->pp_slave.pd_sink); + file_close(&devpair->pp_master.pd_src); + file_close(&devpair->pp_master.pd_sink); + file_close(&devpair->pp_slave.pd_src); + file_close(&devpair->pp_slave.pd_sink); #ifdef CONFIG_PSEUDOTERM_SUSV1 /* Free this minor number so that it can be reused */ @@ -324,7 +310,7 @@ static int pty_open(FAR struct file *filep) { /* Wait until unlocked. We will also most certainly suspend here. */ - (void)nxsem_wait(&devpair->pp_slavesem); + nxsem_wait(&devpair->pp_slavesem); /* Get exclusive access to the device structure. This might also * cause suspension. @@ -1204,7 +1190,7 @@ errout_with_slave: #else snprintf(devname, 16, "/dev/pts/%d", minor); #endif - (void)unregister_driver(devname); + unregister_driver(devname); errout_with_pipeb: if (pipe_b[0] >= 0) @@ -1213,7 +1199,7 @@ errout_with_pipeb: } else { - (void)file_close(&devpair->pp_master.pd_src); + file_close(&devpair->pp_master.pd_src); } if (pipe_b[1] >= 0) @@ -1222,7 +1208,7 @@ errout_with_pipeb: } else { - (void)file_close(&devpair->pp_slave.pd_sink); + file_close(&devpair->pp_slave.pd_sink); } errout_with_pipea: @@ -1232,7 +1218,7 @@ errout_with_pipea: } else { - (void)file_close(&devpair->pp_slave.pd_src); + file_close(&devpair->pp_slave.pd_src); } if (pipe_a[1] >= 0) @@ -1241,7 +1227,7 @@ errout_with_pipea: } else { - (void)file_close(&devpair->pp_master.pd_sink); + file_close(&devpair->pp_master.pd_sink); } errout_with_devpair: diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 7ccc119b85..4957fa4e0f 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -140,34 +140,14 @@ static const struct file_operations g_serialops = static int uart_takesem(FAR sem_t *sem, bool errout) { - int ret; - - do + if (errout) { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - if (ret < 0) - { - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - - /* When the signal is received, should we errout? Or should we just - * continue waiting until we have the semaphore? - */ - - if (errout) - { - return ret; - } - } + return nxsem_wait(sem); + } + else + { + return nxsem_wait_uninterruptible(sem); } - while (ret == -EINTR); - - return ret; } /************************************************************************************ @@ -684,7 +664,7 @@ static int uart_close(FAR struct file *filep) * a potential memory leak by ignoring signals in this case. */ - (void)uart_takesem(&dev->closesem, false); + uart_takesem(&dev->closesem, false); if (dev->open_count > 1) { dev->open_count--; @@ -706,7 +686,7 @@ static int uart_close(FAR struct file *filep) { /* Now we wait for the transmit buffer(s) to clear */ - (void)uart_tcdrain(dev, 4 * TICK_PER_SEC); + uart_tcdrain(dev, 4 * TICK_PER_SEC); } /* Free the IRQ and disable the UART */ @@ -1055,7 +1035,7 @@ static ssize_t uart_read(FAR struct file *filep, FAR char *buffer, size_t buflen * crossed. It will probably deactivate RX flow control. */ - (void)uart_rxflowcontrol(dev, nbuffered, false); + uart_rxflowcontrol(dev, nbuffered, false); } #else /* Is the RX buffer empty? */ @@ -1064,7 +1044,7 @@ static ssize_t uart_read(FAR struct file *filep, FAR char *buffer, size_t buflen { /* Deactivate RX flow control. */ - (void)uart_rxflowcontrol(dev, 0, false); + uart_rxflowcontrol(dev, 0, false); } #endif #endif @@ -1365,7 +1345,7 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_IFLOWCONTROL /* De-activate RX flow control. */ - (void)uart_rxflowcontrol(dev, 0, false); + uart_rxflowcontrol(dev, 0, false); #endif } @@ -1543,7 +1523,7 @@ static int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) */ eventset = 0; - (void)uart_takesem(&dev->xmit.sem, false); + uart_takesem(&dev->xmit.sem, false); ndx = dev->xmit.head + 1; if (ndx >= dev->xmit.size) @@ -1565,7 +1545,7 @@ static int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) * would be a little awkward). */ - (void)uart_takesem(&dev->recv.sem, false); + uart_takesem(&dev->recv.sem, false); if (dev->recv.head != dev->recv.tail) { eventset |= (fds->events & POLLIN); @@ -1689,7 +1669,7 @@ void uart_datareceived(FAR uart_dev_t *dev) /* Yes... wake it up */ dev->recvwaiting = false; - (void)nxsem_post(&dev->recvsem); + nxsem_post(&dev->recvsem); } /* Notify all poll/select waiters that they can read from the recv buffer */ @@ -1727,7 +1707,7 @@ void uart_datasent(FAR uart_dev_t *dev) /* Yes... wake it up */ dev->xmitwaiting = false; - (void)nxsem_post(&dev->xmitsem); + nxsem_post(&dev->xmitsem); } /* Notify all poll/select waiters that they can write to xmit buffer */ @@ -1779,7 +1759,7 @@ void uart_connected(FAR uart_dev_t *dev, bool connected) /* Yes... wake it up */ dev->xmitwaiting = false; - (void)nxsem_post(&dev->xmitsem); + nxsem_post(&dev->xmitsem); } /* Is there a thread waiting for read data? */ @@ -1789,7 +1769,7 @@ void uart_connected(FAR uart_dev_t *dev, bool connected) /* Yes... wake it up */ dev->recvwaiting = false; - (void)nxsem_post(&dev->recvsem); + nxsem_post(&dev->recvsem); } /* Notify all poll/select waiters that a hangup occurred */ diff --git a/drivers/serial/uart_16550.c b/drivers/serial/uart_16550.c index 9d421c03b1..a9050ef890 100644 --- a/drivers/serial/uart_16550.c +++ b/drivers/serial/uart_16550.c @@ -1325,19 +1325,19 @@ void up_earlyserialinit(void) void up_serialinit(void) { #ifdef CONSOLE_DEV - (void)uart_register("/dev/console", &CONSOLE_DEV); + uart_register("/dev/console", &CONSOLE_DEV); #endif #ifdef TTYS0_DEV - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); + uart_register("/dev/ttyS0", &TTYS0_DEV); #endif #ifdef TTYS1_DEV - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); + uart_register("/dev/ttyS1", &TTYS1_DEV); #endif #ifdef TTYS2_DEV - (void)uart_register("/dev/ttyS2", &TTYS2_DEV); + uart_register("/dev/ttyS2", &TTYS2_DEV); #endif #ifdef TTYS3_DEV - (void)uart_register("/dev/ttyS3", &TTYS3_DEV); + uart_register("/dev/ttyS3", &TTYS3_DEV); #endif } diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c index 249d3cd19a..f228d12f11 100644 --- a/drivers/spi/spi_bitbang.c +++ b/drivers/spi/spi_bitbang.c @@ -173,24 +173,11 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) spiinfo("lock=%d\n", lock); if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do - { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + ret = nxsem_wait_uninterruptible(&priv->exclsem); } else { - (void)nxsem_post(&priv->exclsem); - ret = OK; + ret = nxsem_post(&priv->exclsem); } return ret; diff --git a/drivers/spi/spi_driver.c b/drivers/spi/spi_driver.c index 2d43c8eec0..c3b2a57818 100644 --- a/drivers/spi/spi_driver.c +++ b/drivers/spi/spi_driver.c @@ -147,7 +147,6 @@ static int spidrvr_open(FAR struct file *filep) ret = nxsem_wait(&priv->exclsem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -185,7 +184,6 @@ static int spidrvr_close(FAR struct file *filep) ret = nxsem_wait(&priv->exclsem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -257,7 +255,6 @@ static int spidrvr_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = nxsem_wait(&priv->exclsem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } #endif @@ -316,7 +313,6 @@ static int spidrvr_unlink(FAR struct inode *inode) ret = nxsem_wait(&priv->exclsem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } diff --git a/drivers/spi/spi_transfer.c b/drivers/spi/spi_transfer.c index 5a5a54d0e9..be043bcd0d 100644 --- a/drivers/spi/spi_transfer.c +++ b/drivers/spi/spi_transfer.c @@ -85,7 +85,7 @@ int spi_transfer(FAR struct spi_dev_s *spi, FAR struct spi_sequence_s *seq) /* Establish the fixed SPI attributes for all transfers in the sequence */ - (void)SPI_SETFREQUENCY(spi, seq->frequency); + SPI_SETFREQUENCY(spi, seq->frequency); #ifdef CONFIG_SPI_CS_DELAY_CONTROL ret = SPI_SETDELAY(spi, seq->a, seq->b, seq->c); diff --git a/drivers/syslog/syslog_chardev.c b/drivers/syslog/syslog_chardev.c index e39d6722ea..d8fcd2366c 100644 --- a/drivers/syslog/syslog_chardev.c +++ b/drivers/syslog/syslog_chardev.c @@ -112,7 +112,7 @@ static ssize_t syslog_chardev_write(FAR struct file *filep, void syslog_register(void) { - (void)register_driver("/dev/syslog", &syslog_fops, 0222, NULL); + register_driver("/dev/syslog", &syslog_fops, 0222, NULL); } #endif /* CONFIG_SYSLOG_CHARDEV */ diff --git a/drivers/syslog/syslog_console.c b/drivers/syslog/syslog_console.c index eb8de226b7..59ed09dd9b 100644 --- a/drivers/syslog/syslog_console.c +++ b/drivers/syslog/syslog_console.c @@ -119,5 +119,5 @@ static ssize_t syslog_console_write(FAR struct file *filep, void syslog_console_init(void) { - (void)register_driver("/dev/console", &g_consoleops, 0666, NULL); + register_driver("/dev/console", &g_consoleops, 0666, NULL); } diff --git a/drivers/syslog/syslog_device.c b/drivers/syslog/syslog_device.c index dfd481d8c3..d6f66202f4 100644 --- a/drivers/syslog/syslog_device.c +++ b/drivers/syslog/syslog_device.c @@ -418,11 +418,11 @@ int syslog_dev_uninitialize(void) /* Attempt to flush any buffered data */ sched_lock(); - (void)syslog_dev_flush(); + syslog_dev_flush(); /* Close the detached file instance */ - (void)file_close(&g_syslog_dev.sl_file); + file_close(&g_syslog_dev.sl_file); /* Free the device path */ @@ -646,7 +646,7 @@ int syslog_dev_putc(int ch) #ifndef CONFIG_DISABLE_MOUNTPOINT if (nbytes > 0) { - (void)syslog_dev_flush(); + syslog_dev_flush(); } #endif } @@ -694,7 +694,7 @@ int syslog_dev_flush(void) * mountpoint does not support the sync() method. */ - (void)file_fsync(&g_syslog_dev.sl_file); + file_fsync(&g_syslog_dev.sl_file); #endif return OK; diff --git a/drivers/syslog/syslog_filechannel.c b/drivers/syslog/syslog_filechannel.c index b5c9dd648c..e7db19296b 100644 --- a/drivers/syslog/syslog_filechannel.c +++ b/drivers/syslog/syslog_filechannel.c @@ -167,7 +167,7 @@ int syslog_file_channel(FAR const char *devpath) * since it was not uninitialized (was it?) */ - (void)syslog_channel(saved_channel); + syslog_channel(saved_channel); goto errout_with_lock; } @@ -178,8 +178,8 @@ int syslog_file_channel(FAR const char *devpath) { /* We should still be able to back-up and re-initialized everything */ - (void)syslog_initialize(SYSLOG_INIT_EARLY); - (void)syslog_initialize(SYSLOG_INIT_LATE); + syslog_initialize(SYSLOG_INIT_EARLY); + syslog_initialize(SYSLOG_INIT_LATE); goto errout_with_lock; } diff --git a/drivers/syslog/syslog_flush.c b/drivers/syslog/syslog_flush.c index e236714a27..24e6f49736 100644 --- a/drivers/syslog/syslog_flush.c +++ b/drivers/syslog/syslog_flush.c @@ -86,7 +86,7 @@ int syslog_flush(void) * buffer. */ - (void)syslog_flush_intbuffer(g_syslog_channel, true); + syslog_flush_intbuffer(g_syslog_channel, true); #endif /* Then flush all of the buffered output to the SYSLOG device */ diff --git a/drivers/syslog/syslog_force.c b/drivers/syslog/syslog_force.c index caa3bb8b26..800c890187 100644 --- a/drivers/syslog/syslog_force.c +++ b/drivers/syslog/syslog_force.c @@ -77,7 +77,7 @@ int syslog_force(int ch) * buffer through the emergency channel */ - (void)syslog_flush_intbuffer(g_syslog_channel, true); + syslog_flush_intbuffer(g_syslog_channel, true); #endif /* Then send the character to the emergency channel */ diff --git a/drivers/syslog/syslog_putc.c b/drivers/syslog/syslog_putc.c index 437508c24a..ad1ebf44ee 100644 --- a/drivers/syslog/syslog_putc.c +++ b/drivers/syslog/syslog_putc.c @@ -107,7 +107,7 @@ int syslog_putc(int ch) * buffer. */ - (void)syslog_flush_intbuffer(g_syslog_channel, false); + syslog_flush_intbuffer(g_syslog_channel, false); #endif return g_syslog_channel->sc_putc(ch); diff --git a/drivers/syslog/syslog_write.c b/drivers/syslog/syslog_write.c index 3fe86b8409..a763dd0667 100644 --- a/drivers/syslog/syslog_write.c +++ b/drivers/syslog/syslog_write.c @@ -137,7 +137,7 @@ ssize_t syslog_write(FAR const char *buffer, size_t buflen) * buffer. */ - (void)syslog_flush_intbuffer(g_syslog_channel, false); + syslog_flush_intbuffer(g_syslog_channel, false); } #endif return syslog_default_write(buffer, buflen); diff --git a/drivers/timers/pwm.c b/drivers/timers/pwm.c index a6afc57a54..8e3e0814d4 100644 --- a/drivers/timers/pwm.c +++ b/drivers/timers/pwm.c @@ -361,8 +361,7 @@ static int pwm_start(FAR struct pwm_upperhalf_s *upper, unsigned int oflags) * clear the waiting flag. */ - int tmp = nxsem_wait(&upper->waitsem); - DEBUGASSERT(tmp == OK || tmp == -EINTR); + nxsem_wait_uninterruptible(&upper->waitsem); } } else diff --git a/drivers/timers/rpmsg_rtc.c b/drivers/timers/rpmsg_rtc.c index 38c2665e66..324815a479 100644 --- a/drivers/timers/rpmsg_rtc.c +++ b/drivers/timers/rpmsg_rtc.c @@ -265,17 +265,10 @@ static int rpmsg_rtc_send_recv(FAR struct rpmsg_rtc_lowerhalf_s *lower, goto fail; } - while (1) + ret = nxsem_wait_uninterruptible(&cookie.sem); + if (ret == 0) { - ret = nxsem_wait(&cookie.sem); - if (ret != -EINTR) - { - if (ret == 0) - { - ret = msg->result; - } - break; - } + ret = msg->result; } fail: diff --git a/drivers/timers/rtc.c b/drivers/timers/rtc.c index f671c73507..defd8d2d7e 100644 --- a/drivers/timers/rtc.c +++ b/drivers/timers/rtc.c @@ -471,7 +471,7 @@ static int rtc_ioctl(FAR struct file *filep, int cmd, unsigned long arg) if (ops->cancelalarm) { - (void)ops->cancelalarm(upper->lower, alarmid); + ops->cancelalarm(upper->lower, alarmid); } upperinfo->active = false; @@ -542,7 +542,7 @@ static int rtc_ioctl(FAR struct file *filep, int cmd, unsigned long arg) if (ops->cancelalarm) { - (void)ops->cancelalarm(upper->lower, alarmid); + ops->cancelalarm(upper->lower, alarmid); } upperinfo->active = false; @@ -676,7 +676,7 @@ static int rtc_ioctl(FAR struct file *filep, int cmd, unsigned long arg) if (ops->cancelperiodic) { - (void)ops->cancelperiodic(upper->lower, id); + ops->cancelperiodic(upper->lower, id); } upperinfo->active = false; diff --git a/drivers/timers/timer.c b/drivers/timers/timer.c index 7dc6c1197e..1be1837e17 100644 --- a/drivers/timers/timer.c +++ b/drivers/timers/timer.c @@ -567,12 +567,12 @@ void timer_unregister(FAR void *handle) /* Disable the timer */ DEBUGASSERT(lower->ops->stop); /* Required */ - (void)lower->ops->stop(lower); + lower->ops->stop(lower); nxsig_cancel_notification(&upper->work); /* Unregister the timer device */ - (void)unregister_driver(upper->path); + unregister_driver(upper->path); /* Then free all of the driver resources */ diff --git a/drivers/timers/watchdog.c b/drivers/timers/watchdog.c index 9eff36d2ac..d61098f560 100644 --- a/drivers/timers/watchdog.c +++ b/drivers/timers/watchdog.c @@ -687,11 +687,11 @@ void watchdog_unregister(FAR void *handle) /* Disable the watchdog timer */ DEBUGASSERT(lower->ops->stop); /* Required */ - (void)lower->ops->stop(lower); + lower->ops->stop(lower); /* Unregister the watchdog timer device */ - (void)unregister_driver(upper->path); + unregister_driver(upper->path); /* Then free all of the driver resources */ diff --git a/drivers/usbdev/cdcacm.c b/drivers/usbdev/cdcacm.c index b266b1289f..a373cc5a05 100644 --- a/drivers/usbdev/cdcacm.c +++ b/drivers/usbdev/cdcacm.c @@ -431,7 +431,7 @@ static int cdcacm_sndpacket(FAR struct cdcacm_dev_s *priv) { /* Remove the empty container from the request list */ - (void)sq_remfirst(&priv->txfree); + sq_remfirst(&priv->txfree); priv->nwrq--; /* Then submit the request to the endpoint */ @@ -595,7 +595,7 @@ static int cdcacm_recvpacket(FAR struct cdcacm_dev_s *priv, if (nexthead == recv->tail) { - (void)cdcuart_rxflowcontrol(&priv->serdev, recv->size - 1, true); + cdcuart_rxflowcontrol(&priv->serdev, recv->size - 1, true); } #endif @@ -728,7 +728,7 @@ static int cdcacm_release_rxpending(FAR struct cdcacm_dev_s *priv) * pending RX list and returned to the DCD. */ - (void)sq_remfirst(&priv->rxpending); + sq_remfirst(&priv->rxpending); ret = cdcacm_requeue_rdrequest(priv, rdcontainer); } } @@ -747,8 +747,8 @@ static int cdcacm_release_rxpending(FAR struct cdcacm_dev_s *priv) if (!sq_empty(&priv->rxpending)) { - (void)wd_start(priv->rxfailsafe, CDCACM_RXDELAY, cdcacm_rxtimeout, - 1, priv); + wd_start(priv->rxfailsafe, CDCACM_RXDELAY, cdcacm_rxtimeout, + 1, priv); } leave_critical_section(flags); @@ -772,7 +772,7 @@ static void cdcacm_rxtimeout(int argc, wdparm_t arg1, ...) FAR struct cdcacm_dev_s *priv = (FAR struct cdcacm_dev_s *)arg1; DEBUGASSERT(priv != NULL); - (void)cdcacm_release_rxpending(priv); + cdcacm_release_rxpending(priv); } /**************************************************************************** @@ -1207,7 +1207,7 @@ static void cdcacm_rdcomplete(FAR struct usbdev_ep_s *ep, * list */ - (void)cdcacm_release_rxpending(priv); + cdcacm_release_rxpending(priv); } break; @@ -2421,7 +2421,7 @@ static int cdcuart_ioctl(FAR struct file *filep, int cmd, unsigned long arg) * disabled) */ - (void)cdcacm_release_rxpending(priv); + cdcacm_release_rxpending(priv); } @@ -2621,7 +2621,7 @@ static void cdcuart_rxint(FAR struct uart_dev_s *dev, bool enable) * with enable == false , anyway the pend-list should be flushed */ - (void)cdcacm_release_rxpending(priv); + cdcacm_release_rxpending(priv); } /* RX "interrupts" are disabled. Nothing special needs to be done on a @@ -2707,7 +2707,7 @@ static bool cdcuart_rxflowcontrol(FAR struct uart_dev_s *dev, * set? */ - (void)cdcacm_serialstate(priv); + cdcacm_serialstate(priv); } /* Flow control is active */ @@ -2738,7 +2738,7 @@ static bool cdcuart_rxflowcontrol(FAR struct uart_dev_s *dev, * still clear? */ - (void)cdcacm_serialstate(priv); + cdcacm_serialstate(priv); } /* During the time that flow control ws disabled, incoming packets @@ -2749,7 +2749,7 @@ static bool cdcuart_rxflowcontrol(FAR struct uart_dev_s *dev, * upper == false. */ - (void)cdcacm_release_rxpending(priv); + cdcacm_release_rxpending(priv); } } else @@ -2767,7 +2767,7 @@ static bool cdcuart_rxflowcontrol(FAR struct uart_dev_s *dev, * not set? */ - (void)cdcacm_serialstate(priv); + cdcacm_serialstate(priv); /* Flow control is not active */ diff --git a/drivers/usbdev/cdcecm.c b/drivers/usbdev/cdcecm.c index 3ba11a8931..8c0d4f3f57 100644 --- a/drivers/usbdev/cdcecm.c +++ b/drivers/usbdev/cdcecm.c @@ -601,7 +601,7 @@ static void cdcecm_txdone(FAR struct cdcecm_driver_s *priv) /* In any event, poll the network for new TX data */ - (void)devif_poll(&priv->dev, cdcecm_txpoll); + devif_poll(&priv->dev, cdcecm_txpoll); } /**************************************************************************** @@ -699,12 +699,12 @@ static void cdcecm_poll_work(FAR void *arg) * become available. */ - (void)devif_timer(&self->dev, CDCECM_WDDELAY, cdcecm_txpoll); + devif_timer(&self->dev, CDCECM_WDDELAY, cdcecm_txpoll); /* Setup the watchdog poll timer again */ - (void)wd_start(self->txpoll, CDCECM_WDDELAY, cdcecm_poll_expiry, 1, - (wdparm_t)self); + wd_start(self->txpoll, CDCECM_WDDELAY, cdcecm_poll_expiry, 1, + (wdparm_t)self); net_unlock(); } @@ -784,8 +784,8 @@ static int cdcecm_ifup(FAR struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, CDCECM_WDDELAY, cdcecm_poll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->txpoll, CDCECM_WDDELAY, cdcecm_poll_expiry, 1, + (wdparm_t)priv); priv->bifup = true; return OK; @@ -867,7 +867,7 @@ static void cdcecm_txavail_work(FAR void *arg) if (self->bifup) { - (void)devif_poll(&self->dev, cdcecm_txpoll); + devif_poll(&self->dev, cdcecm_txpoll); } net_unlock(); @@ -1018,7 +1018,7 @@ static void cdcecm_ipv6multicast(FAR struct cdcecm_driver_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)cdcecm_addmac(dev, mac); + cdcecm_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -1026,7 +1026,7 @@ static void cdcecm_ipv6multicast(FAR struct cdcecm_driver_s *priv) * packets. */ - (void)cdcecm_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + cdcecm_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ @@ -1036,7 +1036,7 @@ static void cdcecm_ipv6multicast(FAR struct cdcecm_driver_s *priv) * packets. */ - (void)cdcecm_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + cdcecm_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } diff --git a/drivers/usbdev/pl2303.c b/drivers/usbdev/pl2303.c index 43848649c4..101a5d7986 100644 --- a/drivers/usbdev/pl2303.c +++ b/drivers/usbdev/pl2303.c @@ -639,7 +639,7 @@ static int usbclass_sndpacket(FAR struct pl2303_dev_s *priv) { /* Remove the empty container from the request list */ - (void)sq_remfirst(&priv->reqlist); + sq_remfirst(&priv->reqlist); priv->nwrq--; /* Then submit the request to the endpoint */ diff --git a/drivers/usbdev/rndis.c b/drivers/usbdev/rndis.c index 62b7237e16..1451b22f78 100644 --- a/drivers/usbdev/rndis.c +++ b/drivers/usbdev/rndis.c @@ -1119,8 +1119,8 @@ static void rndis_polltimer(int argc, uint32_t arg, ...) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, RNDIS_WDDELAY, rndis_polltimer, 1, - (wdparm_t)arg); + wd_start(priv->txpoll, RNDIS_WDDELAY, rndis_polltimer, 1, + (wdparm_t)arg); } /**************************************************************************** @@ -1135,8 +1135,8 @@ static int rndis_ifup(FAR struct net_driver_s *dev) { FAR struct rndis_dev_s *priv = (FAR struct rndis_dev_s *)dev->d_private; - (void)wd_start(priv->txpoll, RNDIS_WDDELAY, rndis_polltimer, - 1, (wdparm_t)priv); + wd_start(priv->txpoll, RNDIS_WDDELAY, rndis_polltimer, + 1, (wdparm_t)priv); return OK; } diff --git a/drivers/usbdev/usbdev_trace.c b/drivers/usbdev/usbdev_trace.c index f1dcaefe83..81ce7ff169 100644 --- a/drivers/usbdev/usbdev_trace.c +++ b/drivers/usbdev/usbdev_trace.c @@ -252,7 +252,7 @@ int usbtrace_enumerate(trace_callback_t callback, void *arg) /* Restore tracing state */ - (void)usbtrace_enable(idset); + usbtrace_enable(idset); return ret; } #endif /* CONFIG_USBDEV_TRACE */ diff --git a/drivers/usbdev/usbmsc.c b/drivers/usbdev/usbmsc.c index e28767c840..8c1b013df7 100644 --- a/drivers/usbdev/usbmsc.c +++ b/drivers/usbdev/usbmsc.c @@ -919,7 +919,7 @@ static void usbmsc_lununinitialize(struct usbmsc_lun_s *lun) { /* Close the block driver */ - (void)close_blockdriver(lun->inode); + close_blockdriver(lun->inode); } memset(lun, 0, sizeof(struct usbmsc_lun_s)); @@ -1292,14 +1292,7 @@ void usbmsc_deferredresponse(FAR struct usbmsc_dev_s *priv, bool failed) static inline void usbmsc_sync_wait(FAR struct usbmsc_dev_s *priv) { - int ret; - - do - { - ret = nxsem_wait(&priv->thsynch); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->thsynch); } /**************************************************************************** diff --git a/drivers/usbdev/usbmsc_scsi.c b/drivers/usbdev/usbmsc_scsi.c index 9ee740a32a..267e56c3e1 100644 --- a/drivers/usbdev/usbmsc_scsi.c +++ b/drivers/usbdev/usbmsc_scsi.c @@ -369,7 +369,6 @@ static void usbmsc_putle32(uint8_t *buf, uint32_t val) static void usbmsc_scsi_wait(FAR struct usbmsc_dev_s *priv) { irqstate_t flags; - int ret; /* We must hold the SCSI lock to call this function */ @@ -393,9 +392,7 @@ static void usbmsc_scsi_wait(FAR struct usbmsc_dev_s *priv) do { - ret = nxsem_wait(&priv->thwaitsem); - DEBUGASSERT(ret == OK || ret == -EINTR); - UNUSED(ret); /* Eliminate warnings when debug is off */ + nxsem_wait_uninterruptible(&priv->thwaitsem); } while (priv->thwaiting); @@ -720,8 +717,8 @@ static inline int usbmsc_cmdmodeselect6(FAR struct usbmsc_dev_s *priv) FAR struct scsicmd_modeselect6_s *modeselect = (FAR struct scsicmd_modeselect6_s *)priv->cdb; priv->u.alloclen = modeselect->plen; - (void)usbmsc_setupcmd(priv, SCSICMD_MODESELECT6_SIZEOF, - USBMSC_FLAGS_DIRHOST2DEVICE); + usbmsc_setupcmd(priv, SCSICMD_MODESELECT6_SIZEOF, + USBMSC_FLAGS_DIRHOST2DEVICE); /* Not supported */ @@ -1259,8 +1256,8 @@ static inline int usbmsc_cmdmodeselect10(FAR struct usbmsc_dev_s *priv) FAR struct scsicmd_modeselect10_s *modeselect = (FAR struct scsicmd_modeselect10_s *)priv->cdb; priv->u.alloclen = usbmsc_getbe16(modeselect->parmlen); - (void)usbmsc_setupcmd(priv, SCSICMD_MODESELECT10_SIZEOF, - USBMSC_FLAGS_DIRHOST2DEVICE); + usbmsc_setupcmd(priv, SCSICMD_MODESELECT10_SIZEOF, + USBMSC_FLAGS_DIRHOST2DEVICE); /* Not supported */ @@ -2469,13 +2466,13 @@ static int usbmsc_cmdfinishstate(FAR struct usbmsc_dev_s *priv) */ nxsig_usleep (100000); - (void)EP_STALL(priv->epbulkin); + EP_STALL(priv->epbulkin); /* now wait for stall to go away .... */ nxsig_usleep (100000); #else - (void)EP_STALL(priv->epbulkin); + EP_STALL(priv->epbulkin); #endif } } @@ -2615,7 +2612,7 @@ static int usbmsc_cmdstatusstate(FAR struct usbmsc_dev_s *priv) { usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_SNDSTATUSSUBMIT), (uint16_t)-ret); flags = enter_critical_section(); - (void)sq_addlast((FAR sq_entry_t *)privreq, &priv->wrreqlist); + sq_addlast((FAR sq_entry_t *)privreq, &priv->wrreqlist); leave_critical_section(flags); } @@ -2855,12 +2852,5 @@ void usbmsc_scsi_signal(FAR struct usbmsc_dev_s *priv) void usbmsc_scsi_lock(FAR struct usbmsc_dev_s *priv) { - int ret; - - do - { - ret = nxsem_wait(&priv->thlock); - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->thlock); } diff --git a/drivers/usbhost/usbhost_cdcacm.c b/drivers/usbhost/usbhost_cdcacm.c index 2f69822d9c..7b195e7614 100644 --- a/drivers/usbhost/usbhost_cdcacm.c +++ b/drivers/usbhost/usbhost_cdcacm.c @@ -474,21 +474,7 @@ static uint32_t g_devinuse; static void usbhost_takesem(FAR sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -655,7 +641,7 @@ static void usbhost_devno_free(FAR struct usbhost_cdcacm_s *priv) static inline void usbhost_mkdevname(FAR struct usbhost_cdcacm_s *priv, FAR char *devname) { - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->minor); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->minor); } /**************************************************************************** @@ -878,9 +864,9 @@ static void usbhost_notification_callback(FAR void *arg, ssize_t nbytes) if (work_available(&priv->ntwork)) { - (void)work_queue(HPWORK, &priv->ntwork, - (worker_t)usbhost_notification_work, - priv, delay); + work_queue(HPWORK, &priv->ntwork, + (worker_t)usbhost_notification_work, + priv, delay); } } } @@ -1602,7 +1588,7 @@ static int usbhost_cfgdesc(FAR struct usbhost_cdcacm_s *priv, if (ret < 0) { uerr("ERROR: Failed to allocate Bulk IN endpoint\n"); - (void)DRVR_EPFREE(hport->drvr, priv->bulkout); + DRVR_EPFREE(hport->drvr, priv->bulkout); return ret; } @@ -1824,27 +1810,27 @@ static void usbhost_free_buffers(FAR struct usbhost_cdcacm_s *priv) if (priv->ctrlreq) { - (void)DRVR_FREE(hport->drvr, priv->ctrlreq); + DRVR_FREE(hport->drvr, priv->ctrlreq); } if (priv->linecode) { - (void)DRVR_IOFREE(hport->drvr, priv->linecode); + DRVR_IOFREE(hport->drvr, priv->linecode); } if (priv->notification) { - (void)DRVR_IOFREE(hport->drvr, priv->notification); + DRVR_IOFREE(hport->drvr, priv->notification); } if (priv->inbuf) { - (void)DRVR_IOFREE(hport->drvr, priv->inbuf); + DRVR_IOFREE(hport->drvr, priv->inbuf); } if (priv->outbuf) { - (void)DRVR_IOFREE(hport->drvr, priv->outbuf); + DRVR_IOFREE(hport->drvr, priv->outbuf); } priv->pktsize = 0; @@ -2196,7 +2182,7 @@ static int usbhost_disconnected(FAR struct usbhost_class_s *usbclass) priv->ntwork.worker, usbhost_destroy); DEBUGASSERT(work_available(&priv->ntwork)); - (void)work_queue(HPWORK, &priv->ntwork, usbhost_destroy, priv, 0); + work_queue(HPWORK, &priv->ntwork, usbhost_destroy, priv, 0); } else { @@ -2584,7 +2570,7 @@ static void usbhost_rxint(FAR struct uart_dev_s *uartdev, bool enable) { /* Cancel any pending, delayed RX data reception work */ - (void)work_cancel(LPWORK, &priv->rxwork); + work_cancel(LPWORK, &priv->rxwork); /* Restart immediate RX data reception work (unless RX flow control * is in effect. @@ -2604,7 +2590,7 @@ static void usbhost_rxint(FAR struct uart_dev_s *uartdev, bool enable) { /* Cancel any pending RX data reception work */ - (void)work_cancel(LPWORK, &priv->rxwork); + work_cancel(LPWORK, &priv->rxwork); } /* Save the new RX enable state */ @@ -2683,11 +2669,11 @@ static bool usbhost_rxflowcontrol(FAR struct uart_dev_s *uartdev, * RTS. */ - priv->rts = false; + priv->rts = false; - /* Cancel any pending RX data reception work */ + /* Cancel any pending RX data reception work */ - (void)work_cancel(LPWORK, &priv->rxwork) + work_cancel(LPWORK, &priv->rxwork); return true; } else if (!priv->rts && !upper) @@ -2738,7 +2724,7 @@ static void usbhost_txint(FAR struct uart_dev_s *uartdev, bool enable) { /* Cancel any pending, delayed TX data transmission work */ - (void)work_cancel(LPWORK, &priv->txwork); + work_cancel(LPWORK, &priv->txwork); /* Restart immediate TX data transmission work */ @@ -2751,7 +2737,7 @@ static void usbhost_txint(FAR struct uart_dev_s *uartdev, bool enable) { /* Cancel any pending TX data transmission work */ - (void)work_cancel(LPWORK, &priv->txwork); + work_cancel(LPWORK, &priv->txwork); } /* Save the new RX enable state */ diff --git a/drivers/usbhost/usbhost_devaddr.c b/drivers/usbhost/usbhost_devaddr.c index 9ca1d9a2f7..5cb64fc4e9 100644 --- a/drivers/usbhost/usbhost_devaddr.c +++ b/drivers/usbhost/usbhost_devaddr.c @@ -67,21 +67,7 @@ static void usbhost_takesem(FAR struct usbhost_devaddr_s *devgen) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&devgen->exclsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&devgen->exclsem); } #define usbhost_givesem(devgen) nxsem_post(&devgen->exclsem) diff --git a/drivers/usbhost/usbhost_enumerate.c b/drivers/usbhost/usbhost_enumerate.c index cb45a191da..ae4251d41b 100644 --- a/drivers/usbhost/usbhost_enumerate.c +++ b/drivers/usbhost/usbhost_enumerate.c @@ -408,7 +408,7 @@ int usbhost_enumerate(FAR struct usbhost_hubport_s *hport, * a device to support multiple, different classes. */ - (void)usbhost_devdesc((struct usb_devdesc_s *)buffer, &id); + usbhost_devdesc((struct usb_devdesc_s *)buffer, &id); /* Assign a function address to the device connected to this port */ diff --git a/drivers/usbhost/usbhost_hidkbd.c b/drivers/usbhost/usbhost_hidkbd.c index 8afa119f68..0ac3c5b2a7 100644 --- a/drivers/usbhost/usbhost_hidkbd.c +++ b/drivers/usbhost/usbhost_hidkbd.c @@ -586,21 +586,7 @@ static const uint8_t lcmap[USBHID_NUMSCANCODES] = static void usbhost_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -723,7 +709,7 @@ static void usbhost_freedevno(FAR struct usbhost_state_s *priv) static inline void usbhost_mkdevname(FAR struct usbhost_state_s *priv, char *devname) { - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->devchar); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->devchar); } /**************************************************************************** @@ -757,7 +743,7 @@ static void usbhost_destroy(FAR void *arg) uinfo("Unregister driver\n"); usbhost_mkdevname(priv, devname); - (void)unregister_driver(devname); + unregister_driver(devname); /* Release the device name used by this connection */ @@ -1544,7 +1530,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv, if (ret < 0) { uerr("ERROR: Failed to allocate interrupt OUT endpoint\n"); - (void)DRVR_EPFREE(hport->drvr, priv->epin); + DRVR_EPFREE(hport->drvr, priv->epin); return ret; } } @@ -2018,7 +2004,7 @@ static int usbhost_disconnected(struct usbhost_class_s *usbclass) * perhaps, destroy the class instance. Then it will exit. */ - (void)nxsig_kill(priv->pollpid, SIGALRM); + nxsig_kill(priv->pollpid, SIGALRM); } else { @@ -2029,7 +2015,7 @@ static int usbhost_disconnected(struct usbhost_class_s *usbclass) */ DEBUGASSERT(priv->work.worker == NULL); - (void)work_queue(HPWORK, &priv->work, usbhost_destroy, priv, 0); + work_queue(HPWORK, &priv->work, usbhost_destroy, priv, 0); } return OK; @@ -2174,7 +2160,7 @@ static int usbhost_close(FAR struct file *filep) * signal that we use does not matter in this case. */ - (void)nxsig_kill(priv->pollpid, SIGALRM); + nxsig_kill(priv->pollpid, SIGALRM); } } } diff --git a/drivers/usbhost/usbhost_hidmouse.c b/drivers/usbhost/usbhost_hidmouse.c index 1fc68d7265..a1601ab910 100644 --- a/drivers/usbhost/usbhost_hidmouse.c +++ b/drivers/usbhost/usbhost_hidmouse.c @@ -446,21 +446,7 @@ static struct usbhost_state_s *g_priv; /* Data passed to thread */ static void usbhost_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -584,7 +570,7 @@ static void usbhost_freedevno(FAR struct usbhost_state_s *priv) static inline void usbhost_mkdevname(FAR struct usbhost_state_s *priv, FAR char *devname) { - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->devno); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->devno); } /**************************************************************************** @@ -618,7 +604,7 @@ static void usbhost_destroy(FAR void *arg) uinfo("Unregister driver\n"); usbhost_mkdevname(priv, devname); - (void)unregister_driver(devname); + unregister_driver(devname); /* Release the device name used by this connection */ @@ -1373,7 +1359,6 @@ static int usbhost_waitsample(FAR struct usbhost_state_s *priv, */ ierr("ERROR: nxsem_wait: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } @@ -2078,7 +2063,7 @@ static int usbhost_disconnected(struct usbhost_class_s *usbclass) * perhaps, destroy the class instance. Then it will exit. */ - (void)nxsig_kill(priv->pollpid, SIGALRM); + nxsig_kill(priv->pollpid, SIGALRM); } else { @@ -2089,7 +2074,7 @@ static int usbhost_disconnected(struct usbhost_class_s *usbclass) */ DEBUGASSERT(priv->work.worker == NULL); - (void)work_queue(HPWORK, &priv->work, usbhost_destroy, priv, 0); + work_queue(HPWORK, &priv->work, usbhost_destroy, priv, 0); } return OK; @@ -2254,7 +2239,7 @@ static int usbhost_close(FAR struct file *filep) * signal that we use does not matter in this case. */ - (void)nxsig_kill(priv->pollpid, SIGALRM); + nxsig_kill(priv->pollpid, SIGALRM); } } } diff --git a/drivers/usbhost/usbhost_hub.c b/drivers/usbhost/usbhost_hub.c index 6c9adbf57d..a22e877e51 100644 --- a/drivers/usbhost/usbhost_hub.c +++ b/drivers/usbhost/usbhost_hub.c @@ -476,7 +476,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_class_s *hubclass, if (ret < 0) { uerr("ERROR: Failed to allocate Interrupt IN endpoint: %d\n", ret); - (void)DRVR_EPFREE(hport->drvr, priv->intin); + DRVR_EPFREE(hport->drvr, priv->intin); return ret; } @@ -831,7 +831,7 @@ static void usbhost_hub_event(FAR void *arg) usbhost_putle16(ctrlreq->index, port); usbhost_putle16(ctrlreq->len, 0); - (void)DRVR_CTRLOUT(hport->drvr, hport->ep0, ctrlreq, NULL); + DRVR_CTRLOUT(hport->drvr, hport->ep0, ctrlreq, NULL); } debouncetime += 25; @@ -896,7 +896,7 @@ static void usbhost_hub_event(FAR void *arg) usbhost_putle16(ctrlreq->index, port); usbhost_putle16(ctrlreq->len, 0); - (void)DRVR_CTRLOUT(hport->drvr, hport->ep0, ctrlreq, NULL); + DRVR_CTRLOUT(hport->drvr, hport->ep0, ctrlreq, NULL); } connport = &priv->hport[port]; @@ -1052,7 +1052,7 @@ static void usbhost_disconnect_event(FAR void *arg) /* Disable power to all downstream ports */ - (void)usbhost_hubpwr(priv, hport, false); + usbhost_hubpwr(priv, hport, false); /* Free the allocated control request */ @@ -1219,8 +1219,8 @@ static void usbhost_callback(FAR void *arg, ssize_t nbytes) if (work_available(&priv->work) && !priv->disconnected) { - (void)work_queue(LPWORK, &priv->work, (worker_t)usbhost_hub_event, - hubclass, delay); + work_queue(LPWORK, &priv->work, (worker_t)usbhost_hub_event, + hubclass, delay); } } @@ -1420,7 +1420,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *hubclass, if (ret < 0) { uerr("ERROR: DRVR_ASYNCH failed: %d\n", ret); - (void)usbhost_hubpwr(priv, hport, false); + usbhost_hubpwr(priv, hport, false); } return ret; @@ -1472,7 +1472,7 @@ static int usbhost_disconnected(struct usbhost_class_s *hubclass) * hub interrupt pipe events. That work may be lost by this action. */ - (void)work_cancel(LPWORK, &priv->work); + work_cancel(LPWORK, &priv->work); /* Schedule the disconnection work */ diff --git a/drivers/usbhost/usbhost_max3421e.c b/drivers/usbhost/usbhost_max3421e.c index 8d8e0d4133..219094788b 100644 --- a/drivers/usbhost/usbhost_max3421e.c +++ b/drivers/usbhost/usbhost_max3421e.c @@ -707,10 +707,10 @@ static void max3421e_lock(FAR struct max3421e_usbhost_s *priv) DEBUGASSERT(lower != NULL && lower->spi != NULL && !priv->locked); spi = lower->spi; - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); SPI_SETMODE(spi, lower->mode); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); + SPI_HWFEATURES(spi, 0); SPI_SETFREQUENCY(spi, lower->frequency); #ifdef CONFIG_DEBUG_ASSERTIONS @@ -733,7 +733,7 @@ static void max3421e_unlock(FAR struct max3421e_usbhost_s *priv) FAR const struct max3421e_lowerhalf_s *lower = priv->lower; DEBUGASSERT(lower != NULL && lower->spi != NULL && priv->locked); - (void)SPI_LOCK(lower->spi, false); + SPI_LOCK(lower->spi, false); #ifdef CONFIG_DEBUG_ASSERTIONS /* Mark the SPI bus as unlocked (for debug only) */ @@ -874,7 +874,7 @@ static uint32_t max3421e_getreg(FAR struct max3421e_usbhost_s *priv, /* Send the read command byte */ cmd = max3421e_fmtcmd(priv, addr, MAX3421E_DIR_READ); - (void)SPI_SEND(spi, cmd); + SPI_SEND(spi, cmd); /* Read the value of the register */ @@ -927,11 +927,11 @@ static void max3421e_putreg(FAR struct max3421e_usbhost_s *priv, /* Send the write command byte */ cmd = max3421e_fmtcmd(priv, addr, MAX3421E_DIR_WRITE); - (void)SPI_SEND(spi, cmd); + SPI_SEND(spi, cmd); /* Send the new value for the register */ - (void)SPI_SEND(spi, value); + SPI_SEND(spi, value); /* De-select the MAX4321E */ @@ -990,7 +990,7 @@ static void max3421e_recvblock(FAR struct max3421e_usbhost_s *priv, /* Send the read command byte */ cmd = max3421e_fmtcmd(priv, addr, MAX3421E_DIR_READ); - (void)SPI_SEND(spi, cmd); + SPI_SEND(spi, cmd); /* Read the block of values from the register(s) */ @@ -1042,7 +1042,7 @@ static void max3421e_sndblock(FAR struct max3421e_usbhost_s *priv, /* Send the wrte command byte */ cmd = max3421e_fmtcmd(priv, addr, MAX3421E_DIR_WRITE); - (void)SPI_SEND(spi, cmd); + SPI_SEND(spi, cmd); /* Send the new value for the register */ @@ -1064,21 +1064,7 @@ static void max3421e_sndblock(FAR struct max3421e_usbhost_s *priv, static void max3421e_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -1323,13 +1309,7 @@ static int max3421e_chan_wait(FAR struct max3421e_usbhost_s *priv, * wait here. */ - ret = nxsem_wait(&priv->waitsem); - - /* nxsem_wait should succeed. But it is possible that we could be - * awakened by a signal too. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); + nxsem_wait_uninterruptible(&priv->waitsem); } while (priv->waiter != NULL); @@ -3227,7 +3207,7 @@ static int max3421e_interrupt(int irq, FAR void *context, FAR void *arg) /* And defer interrupt processing to the high priority work queue thread */ - (void)work_queue(LPWORK, &priv->irqwork, max3421e_irqwork, priv, 0); + work_queue(LPWORK, &priv->irqwork, max3421e_irqwork, priv, 0); return OK; } diff --git a/drivers/usbhost/usbhost_skeleton.c b/drivers/usbhost/usbhost_skeleton.c index 2c877840cc..a6348d592d 100644 --- a/drivers/usbhost/usbhost_skeleton.c +++ b/drivers/usbhost/usbhost_skeleton.c @@ -214,21 +214,7 @@ static uint32_t g_devinuse; static void usbhost_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -331,7 +317,7 @@ static void usbhost_freedevno(FAR struct usbhost_state_s *priv) static inline void usbhost_mkdevname(FAR struct usbhost_state_s *priv, FAR char *devname) { - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->devchar); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->devchar); } /**************************************************************************** @@ -601,7 +587,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv, if (ret < 0) { uerr("ERROR: Failed to allocate Bulk IN endpoint\n"); - (void)DRVR_EPFREE(hport->drvr, priv->epout); + DRVR_EPFREE(hport->drvr, priv->epout); return ret; } @@ -1032,7 +1018,7 @@ static int usbhost_disconnected(struct usbhost_class_s *usbclass) uinfo("Queuing destruction: worker %p->%p\n", priv->work.worker, usbhost_destroy); DEBUGASSERT(priv->work.worker == NULL); - (void)work_queue(HPWORK, &priv->work, usbhost_destroy, priv, 0); + work_queue(HPWORK, &priv->work, usbhost_destroy, priv, 0); } else { diff --git a/drivers/usbhost/usbhost_storage.c b/drivers/usbhost/usbhost_storage.c index d2691f9f63..404821680b 100644 --- a/drivers/usbhost/usbhost_storage.c +++ b/drivers/usbhost/usbhost_storage.c @@ -329,21 +329,7 @@ static uint32_t g_devinuse; static void usbhost_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -490,7 +476,7 @@ static void usbhost_freedevno(FAR struct usbhost_state_s *priv) static inline void usbhost_mkdevname(FAR struct usbhost_state_s *priv, char *devname) { - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->sdchar); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->sdchar); } /**************************************************************************** @@ -931,7 +917,7 @@ static void usbhost_destroy(FAR void *arg) /* Unregister the block driver */ usbhost_mkdevname(priv, devname); - (void)unregister_blockdriver(devname); + unregister_blockdriver(devname); /* Release the device name used by this connection */ @@ -1187,7 +1173,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv, if (ret < 0) { uerr("ERROR: Failed to allocate Bulk IN endpoint\n"); - (void)DRVR_EPFREE(hport->drvr, priv->bulkout); + DRVR_EPFREE(hport->drvr, priv->bulkout); return ret; } @@ -1850,7 +1836,7 @@ static int usbhost_disconnected(struct usbhost_class_s *usbclass) uinfo("Queuing destruction: worker %p->%p\n", priv->work.worker, usbhost_destroy); DEBUGASSERT(priv->work.worker == NULL); - (void)work_queue(HPWORK, &priv->work, usbhost_destroy, priv, 0); + work_queue(HPWORK, &priv->work, usbhost_destroy, priv, 0); } else { diff --git a/drivers/usbhost/usbhost_xboxcontroller.c b/drivers/usbhost/usbhost_xboxcontroller.c index 88299d6057..b34861094c 100644 --- a/drivers/usbhost/usbhost_xboxcontroller.c +++ b/drivers/usbhost/usbhost_xboxcontroller.c @@ -336,21 +336,7 @@ static struct usbhost_state_s *g_priv; /* Data passed to thread */ static void usbhost_takesem(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -453,7 +439,7 @@ static void usbhost_freedevno(FAR struct usbhost_state_s *priv) static inline void usbhost_mkdevname(FAR struct usbhost_state_s *priv, FAR char *devname) { - (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->devchar); + snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->devchar); } /**************************************************************************** @@ -491,7 +477,7 @@ static void usbhost_destroy(FAR void *arg) uinfo("Unregister driver\n"); usbhost_mkdevname(priv, devname); - (void)unregister_driver(devname); + unregister_driver(devname); /* Release the device name used by this connection */ @@ -995,12 +981,7 @@ static int usbhost_waitsample(FAR struct usbhost_state_s *priv, if (ret < 0) { - /* If we are awakened by a signal, then we need to return - * the failure now. - */ - ierr("ERROR: nxsem_wait: %d\n", ret); - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); goto errout; } @@ -1264,7 +1245,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv, if (ret < 0) { uerr("ERROR: Failed to allocate Interrupt IN endpoint\n"); - (void)DRVR_EPFREE(hport->drvr, priv->epout); + DRVR_EPFREE(hport->drvr, priv->epout); return ret; } @@ -1726,7 +1707,7 @@ static int usbhost_disconnected(struct usbhost_class_s *usbclass) * perhaps, destroy the class instance. Then it will exit. */ - (void)nxsig_kill(priv->pollpid, SIGALRM); + nxsig_kill(priv->pollpid, SIGALRM); } else { @@ -1737,7 +1718,7 @@ static int usbhost_disconnected(struct usbhost_class_s *usbclass) */ DEBUGASSERT(priv->work.worker == NULL); - (void)work_queue(HPWORK, &priv->work, usbhost_destroy, priv, 0); + work_queue(HPWORK, &priv->work, usbhost_destroy, priv, 0); } return OK; @@ -1903,7 +1884,7 @@ static int usbhost_close(FAR struct file *filep) * signal that we use does not matter in this case. */ - (void)nxsig_kill(priv->pollpid, SIGALRM); + nxsig_kill(priv->pollpid, SIGALRM); } } } diff --git a/drivers/usbmisc/fusb301.c b/drivers/usbmisc/fusb301.c index bd46ae5d96..00cbf4a831 100644 --- a/drivers/usbmisc/fusb301.c +++ b/drivers/usbmisc/fusb301.c @@ -496,7 +496,7 @@ static int fusb301_open(FAR struct file *filep) { fusb301_info("device id: 0x%02X\n", ret); - (void)fusb301_clear_interrupts(priv); + fusb301_clear_interrupts(priv); priv->config->irq_enable(priv->config, true); } @@ -554,7 +554,7 @@ static ssize_t fusb301_read(FAR struct file *filep, FAR char *buffer, size_t buf priv->int_pending = false; leave_critical_section(flags); - (void)fusb301_clear_interrupts(priv); + fusb301_clear_interrupts(priv); ptr->status = fusb301_getreg(priv, FUSB301_STATUS_REG); ptr->dev_type = fusb301_getreg(priv, FUSB301_TYPE_REG); diff --git a/drivers/usbmisc/fusb303.c b/drivers/usbmisc/fusb303.c index cb2e14ea15..a2c966b826 100644 --- a/drivers/usbmisc/fusb303.c +++ b/drivers/usbmisc/fusb303.c @@ -667,7 +667,7 @@ static int fusb303_open(FAR struct file *filep) { fusb303_info("device id: 0x%02X type: 0x%02X\n", dev_id, dev_type); - (void)fusb303_clear_interrupts(priv); + fusb303_clear_interrupts(priv); priv->config->irq_enable(priv->config, true); } @@ -743,7 +743,7 @@ static ssize_t fusb303_read(FAR struct file *filep, FAR char *buffer, fusb303_dumpregs("fusb303_read", priv); #endif - (void)fusb303_clear_interrupts(priv); + fusb303_clear_interrupts(priv); nxsem_post(&priv->devsem); return sizeof(struct fusb303_result_s); diff --git a/drivers/usbmonitor/usbmonitor.c b/drivers/usbmonitor/usbmonitor.c index f7e133eb7f..5fc6a2c520 100644 --- a/drivers/usbmonitor/usbmonitor.c +++ b/drivers/usbmonitor/usbmonitor.c @@ -170,10 +170,10 @@ static int usbmonitor_daemon(int argc, char **argv) { nxsig_sleep(CONFIG_USBMONITOR_INTERVAL); #ifdef CONFIG_USBDEV_TRACE - (void)usbtrace_enumerate(usbmonitor_tracecallback, NULL); + usbtrace_enumerate(usbmonitor_tracecallback, NULL); #endif #ifdef CONFIG_USBHOST_TRACE - (void)usbhost_trdump(); + usbhost_trdump(); #endif } diff --git a/drivers/video/fb.c b/drivers/video/fb.c index 2caac78749..4b7255bad1 100644 --- a/drivers/video/fb.c +++ b/drivers/video/fb.c @@ -660,11 +660,11 @@ int fb_register(int display, int plane) if (nplanes < 2) { - (void)snprintf(devname, 16, "/dev/fb%d", display); + snprintf(devname, 16, "/dev/fb%d", display); } else { - (void)snprintf(devname, 16, "/dev/fb%d.%d", display, plane); + snprintf(devname, 16, "/dev/fb%d.%d", display, plane); } ret = register_driver(devname, &fb_fops, 0666, (FAR void *)fb); diff --git a/drivers/video/ov2640.c b/drivers/video/ov2640.c index 1ee4e1ef5d..79bc0c7ae3 100644 --- a/drivers/video/ov2640.c +++ b/drivers/video/ov2640.c @@ -1120,6 +1120,6 @@ int ov2640_initialize(FAR struct i2c_master_s *i2c) errout: gerr("ERROR: Failed to initialize the OV2640: %d\n", ret); - (void)ov2640_reset(i2c); + ov2640_reset(i2c); return ret; } diff --git a/drivers/video/video.c b/drivers/video/video.c index 228e1d44d9..b2cb88d2e6 100644 --- a/drivers/video/video.c +++ b/drivers/video/video.c @@ -247,32 +247,12 @@ static bool is_initialized = false; ****************************************************************************/ static int video_lock(FAR sem_t *sem) { - int ret; - int l_errno; - if (sem == NULL) { return -EINVAL; } - while (1) - { - ret = sem_wait(sem); - if (ret == ERROR) - { - l_errno = errno; - if (l_errno == EINTR) - { - continue; - } - - videoerr("sem_wait() failed:%d\n", l_errno); - } - - break; - } - - return ret; + return nxsem_wait_uninterruptible(sem); } static int video_unlock(FAR sem_t *sem) @@ -282,9 +262,7 @@ static int video_unlock(FAR sem_t *sem) return -EINVAL; } - sem_post(sem); - - return OK; + return nxsem_post(sem); } static FAR video_type_inf_t *get_video_type_inf @@ -421,8 +399,8 @@ static void initialize_streamresources(FAR video_type_inf_t *type_inf) { memset(type_inf, 0, sizeof(video_type_inf_t)); type_inf->remaining_capnum = VIDEO_REMAINING_CAPNUM_INFINITY; - sem_init(&type_inf->lock_state, 0, 1); - sem_init(&type_inf->wait_dma.dqbuf_wait_flg, 0, 0); + nxsem_init(&type_inf->lock_state, 0, 1); + nxsem_init(&type_inf->wait_dma.dqbuf_wait_flg, 0, 0); video_framebuff_init(&type_inf->bufinf); return; @@ -439,8 +417,8 @@ static void initialize_resources(FAR video_mng_t *vmng) static void cleanup_streamresources(FAR video_type_inf_t *type_inf) { video_framebuff_uninit(&type_inf->bufinf); - sem_destroy(&type_inf->wait_dma.dqbuf_wait_flg); - sem_destroy(&type_inf->lock_state); + nxsem_destroy(&type_inf->wait_dma.dqbuf_wait_flg); + nxsem_destroy(&type_inf->lock_state); memset(type_inf, 0, sizeof(video_type_inf_t)); type_inf->remaining_capnum = VIDEO_REMAINING_CAPNUM_INFINITY; @@ -470,7 +448,7 @@ static bool is_sem_waited(FAR sem_t *sem) int ret; int semcount; - ret = sem_getvalue(sem, &semcount); + ret = nxsem_getvalue(sem, &semcount); if ((ret == OK) && (semcount < 0)) { return true; @@ -684,7 +662,7 @@ static int video_dqbuf(FAR struct video_mng_s *vmng, leave_critical_section(flags); } - sem_wait(dqbuf_wait_flg); + nxsem_wait(dqbuf_wait_flg); } while (type_inf->wait_dma.waitend_cause == VIDEO_WAITEND_CAUSE_STILLSTOP); @@ -734,9 +712,9 @@ static int video_cancel_dqbuf(FAR struct video_mng_s *vmng, type_inf->wait_dma.waitend_cause = VIDEO_WAITEND_CAUSE_DQCANCEL; - /* If DMA is done before sem_post, cause is overwritten */ + /* If DMA is done before nxsem_post, cause is overwritten */ - sem_post(&type_inf->wait_dma.dqbuf_wait_flg); + nxsem_post(&type_inf->wait_dma.dqbuf_wait_flg); return OK; } @@ -1380,7 +1358,7 @@ static int video_poll_setup(FAR struct video_mng_s *priv, return -EDEADLK; } - /* TODO: If data exists, get and sem_post If no data, wait dma */ + /* TODO: If data exists, get and nxsem_post If no data, wait dma */ return OK; } @@ -1458,7 +1436,7 @@ static FAR void *video_register(FAR const char *devpath) /* Initialize semaphore */ - sem_init(&priv->lock_open_num, 0, 1); + nxsem_init(&priv->lock_open_num, 0, 1); /* Register the character driver */ @@ -1484,7 +1462,7 @@ static int video_unregister(FAR video_mng_t *v_mgr) } else { - sem_destroy(&v_mgr->lock_open_num); + nxsem_destroy(&v_mgr->lock_open_num); unregister_driver((const char *)v_mgr->devpath); @@ -1568,7 +1546,7 @@ int video_common_notify_dma_done(uint8_t err_code, = video_framebuff_pop_curr_container(&type_inf->bufinf); type_inf->wait_dma.waitend_cause = VIDEO_WAITEND_CAUSE_DMADONE; - sem_post(&type_inf->wait_dma.dqbuf_wait_flg); + nxsem_post(&type_inf->wait_dma.dqbuf_wait_flg); /* TODO: in poll wait, unlock wait */ } @@ -1585,7 +1563,7 @@ int video_common_notify_dma_done(uint8_t err_code, { vmng->video_inf.wait_dma.waitend_cause = VIDEO_WAITEND_CAUSE_STILLSTOP; - sem_post(&vmng->video_inf.wait_dma.dqbuf_wait_flg); + nxsem_post(&vmng->video_inf.wait_dma.dqbuf_wait_flg); } } else diff --git a/drivers/video/video_framebuff.c b/drivers/video/video_framebuff.c index 440efd4f57..564f9b3ef8 100644 --- a/drivers/video/video_framebuff.c +++ b/drivers/video/video_framebuff.c @@ -114,13 +114,13 @@ void video_framebuff_init(video_framebuff_t *fbuf) fbuf->vbuf_tail = NULL; fbuf->vbuf_next_dma = NULL; - sem_init(&fbuf->lock_empty, 0, 1); + nxsem_init(&fbuf->lock_empty, 0, 1); } void video_framebuff_uninit(video_framebuff_t *fbuf) { video_framebuff_realloc_container(fbuf, 0); - sem_destroy(&fbuf->lock_empty); + nxsem_destroy(&fbuf->lock_empty); } int video_framebuff_realloc_container(video_framebuff_t *fbuf, int sz) @@ -162,14 +162,14 @@ vbuf_container_t *video_framebuff_get_container(video_framebuff_t *fbuf) { vbuf_container_t *ret; - sem_wait(&fbuf->lock_empty); + nxsem_wait(&fbuf->lock_empty); ret = fbuf->vbuf_empty; if (ret) { fbuf->vbuf_empty = ret->next; ret->next = NULL; } - sem_post(&fbuf->lock_empty); + nxsem_post(&fbuf->lock_empty); return ret; } @@ -177,10 +177,10 @@ vbuf_container_t *video_framebuff_get_container(video_framebuff_t *fbuf) void video_framebuff_free_container(video_framebuff_t *fbuf, vbuf_container_t *cnt) { - sem_wait(&fbuf->lock_empty); + nxsem_wait(&fbuf->lock_empty); cnt->next = fbuf->vbuf_empty; fbuf->vbuf_empty = cnt; - sem_post(&fbuf->lock_empty); + nxsem_post(&fbuf->lock_empty); } void video_framebuff_queue_container(video_framebuff_t *fbuf, diff --git a/drivers/wireless/bluetooth/bt_uart.c b/drivers/wireless/bluetooth/bt_uart.c index 96f994278f..d7b4125d22 100644 --- a/drivers/wireless/bluetooth/bt_uart.c +++ b/drivers/wireless/bluetooth/bt_uart.c @@ -372,7 +372,7 @@ int btuart_open(FAR const struct bt_driver_s *dev) /* Drain any cached Rx data */ - (void)lower->rxdrain(lower); + lower->rxdrain(lower); /* Attach the Rx event handler */ diff --git a/drivers/wireless/bluetooth/bt_uart_bcm4343x.c b/drivers/wireless/bluetooth/bt_uart_bcm4343x.c index 60d890727d..2cdb5571fc 100644 --- a/drivers/wireless/bluetooth/bt_uart_bcm4343x.c +++ b/drivers/wireless/bluetooth/bt_uart_bcm4343x.c @@ -168,33 +168,29 @@ static int uartwriteconf(FAR const struct btuart_lowerhalf_s *lower, din = kmm_malloc(maxl); while (gotlen < maxl) { - do + ret = clock_gettime(CLOCK_REALTIME, &abstime); + if (ret < 0) { - ret = clock_gettime(CLOCK_REALTIME, &abstime); - if (ret < 0) - { - goto exit_uartwriteconf; - } - - /* Add the offset to the time in the future */ - - abstime.tv_nsec += NSEC_PER_SEC / 10; - if (abstime.tv_nsec >= NSEC_PER_SEC) - { - abstime.tv_nsec -= NSEC_PER_SEC; - abstime.tv_sec++; - } - - ret = nxsem_timedwait(rxsem, &abstime); - if (ret == -ETIMEDOUT) - { - /* We didn't receive enough message, so fall out */ - - wlerr("Response timed out\n"); - goto exit_uartwriteconf; - } + goto exit_uartwriteconf; + } + + /* Add the offset to the time in the future */ + + abstime.tv_nsec += NSEC_PER_SEC / 10; + if (abstime.tv_nsec >= NSEC_PER_SEC) + { + abstime.tv_nsec -= NSEC_PER_SEC; + abstime.tv_sec++; + } + + ret = nxsem_timedwait_uninterruptible(rxsem, &abstime); + if (ret == -ETIMEDOUT) + { + /* We didn't receive enough message, so fall out */ + + wlerr("Response timed out\n"); + goto exit_uartwriteconf; } - while (ret == -EINTR); ret = lower->read(lower, &din[gotlen], maxl - gotlen); if (ret < 0) diff --git a/drivers/wireless/cc1101.c b/drivers/wireless/cc1101.c index afca72b60c..d2777f6708 100644 --- a/drivers/wireless/cc1101.c +++ b/drivers/wireless/cc1101.c @@ -329,18 +329,7 @@ static const struct file_operations g_cc1101ops = static int cc1101_takesem(FAR sem_t *sem) { - int ret; - - /* Take a count from the semaphore, possibly waiting */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - return ret; + return nxsem_wait(sem); } /**************************************************************************** @@ -376,9 +365,6 @@ static int cc1101_file_open(FAR struct file *filep) ret = cc1101_takesem(&dev->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -427,9 +413,6 @@ static int cc1101_file_close(FAR struct file *filep) ret = cc1101_takesem(&dev->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -472,9 +455,6 @@ static ssize_t cc1101_file_write(FAR struct file *filep, ret = cc1101_takesem(&dev->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -500,9 +480,6 @@ static void fifo_put(FAR struct cc1101_dev_s *dev, FAR uint8_t *buffer, ret = cc1101_takesem(&dev->sem_rx_buffer); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return; } @@ -539,9 +516,6 @@ static uint8_t fifo_get(FAR struct cc1101_dev_s *dev, FAR uint8_t *buffer, ret = cc1101_takesem(&dev->sem_rx_buffer); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -591,9 +565,6 @@ static ssize_t cc1101_file_read(FAR struct file *filep, FAR char *buffer, ret = cc1101_takesem(&dev->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -609,9 +580,6 @@ static ssize_t cc1101_file_read(FAR struct file *filep, FAR char *buffer, if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -648,9 +616,6 @@ static int cc1101_file_poll(FAR struct file *filep, FAR struct pollfd *fds, ret = cc1101_takesem(&dev->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -683,7 +648,7 @@ static int cc1101_file_poll(FAR struct file *filep, FAR struct pollfd *fds, * don't wait for RX. */ - (void)cc1101_takesem(&dev->sem_rx_buffer); + cc1101_takesem(&dev->sem_rx_buffer); if (dev->fifo_len > 0) { dev->pfd->revents |= POLLIN; /* Data available for input */ @@ -711,11 +676,11 @@ errout: void cc1101_access_begin(FAR struct cc1101_dev_s *dev) { - (void)SPI_LOCK(dev->spi, true); + SPI_LOCK(dev->spi, true); SPI_SELECT(dev->spi, dev->dev_id, true); SPI_SETMODE(dev->spi, SPIDEV_MODE0); /* CPOL=0, CPHA=0 */ SPI_SETBITS(dev->spi, 8); - (void)SPI_HWFEATURES(dev->spi, 0); + SPI_HWFEATURES(dev->spi, 0); if (dev->ops.wait) { @@ -737,7 +702,7 @@ void cc1101_access_begin(FAR struct cc1101_dev_s *dev) void cc1101_access_end(FAR struct cc1101_dev_s *dev) { SPI_SELECT(dev->spi, dev->dev_id, false); - (void)SPI_LOCK(dev->spi, false); + SPI_LOCK(dev->spi, false); } /**************************************************************************** @@ -922,7 +887,7 @@ void cc1101_dumpregs(struct cc1101_dev_s *dev, uint8_t addr, uint8_t length) for (i = 0, j = 0; i < readsize; i++, j += 3) { - (void)sprintf(&outbuf[j], " %02x", regbuf[i]); + sprintf(&outbuf[j], " %02x", regbuf[i]); } /* Dump the formatted data to the syslog output */ diff --git a/drivers/wireless/gs2200m.c b/drivers/wireless/gs2200m.c index 88f9a78807..f3eeb466f3 100644 --- a/drivers/wireless/gs2200m.c +++ b/drivers/wireless/gs2200m.c @@ -667,21 +667,7 @@ errout: static void gs2200m_lock(FAR struct gs2200m_dev_s *dev) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&dev->dev_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&dev->dev_sem); } /**************************************************************************** @@ -760,7 +746,7 @@ static ssize_t gs2200m_write(FAR struct file *filep, FAR const char *buffer, static int gs2200m_spi_init(FAR struct gs2200m_dev_s *dev) { - (void)SPI_LOCK(dev->spi, true); + SPI_LOCK(dev->spi, true); /* SPI settings (mode1/8bits/max freq) */ @@ -768,7 +754,7 @@ static int gs2200m_spi_init(FAR struct gs2200m_dev_s *dev) SPI_SETBITS(dev->spi, 8); SPI_SETFREQUENCY(dev->spi, SPI_MAXFREQ); - (void)SPI_LOCK(dev->spi, false); + SPI_LOCK(dev->spi, false); return 0; } @@ -2485,11 +2471,7 @@ static int gs2200m_ioctl_ifreq(FAR struct gs2200m_dev_s *dev, strncpy(addr[1], inet_ntoa(in[1]), sizeof(addr[1])); strncpy(addr[2], inet_ntoa(in[2]), sizeof(addr[2])); - (void)gs2200m_set_addresses(dev, - addr[0], - addr[1], - addr[2] - ); + gs2200m_set_addresses(dev, addr[0], addr[1], addr[2]); } wlinfo("+++ end: \n"); @@ -2829,7 +2811,7 @@ static int gs2200m_irq(int irq, FAR void *context, FAR void *arg) DEBUGASSERT(arg != NULL); dev = (FAR struct gs2200m_dev_s *)arg; - (void)dev->lower->dready(&ec); + dev->lower->dready(&ec); ASSERT(0 < ec); wlinfo(">>>> \n"); @@ -2864,7 +2846,7 @@ static int gs2200m_start(FAR struct gs2200m_dev_s *dev) while (dev->lower->dready(NULL)) { - (void)gs2200m_recv_pkt(dev, NULL); + gs2200m_recv_pkt(dev, NULL); break; } diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c index 7f8bef223d..ad3716e1a6 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c +++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c @@ -1117,8 +1117,8 @@ int bcmf_wl_start_scan(FAR struct bcmf_dev_s *priv, struct iwreq *iwr) /* Start scan_timeout timer */ - (void)wd_start(priv->scan_timeout, BCMF_SCAN_TIMEOUT_TICK, - bcmf_wl_scan_timeout, 1, (wdparm_t)priv); + wd_start(priv->scan_timeout, BCMF_SCAN_TIMEOUT_TICK, + bcmf_wl_scan_timeout, 1, (wdparm_t)priv); return OK; diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c index 33b10e4e95..041a83b305 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c +++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c @@ -618,12 +618,12 @@ static void bcmf_poll_work(FAR void *arg) priv->bc_dev.d_buf = priv->cur_tx_frame->data; priv->bc_dev.d_len = 0; - (void)devif_timer(&priv->bc_dev, BCMF_WDDELAY, bcmf_txpoll); + devif_timer(&priv->bc_dev, BCMF_WDDELAY, bcmf_txpoll); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->bc_txpoll, BCMF_WDDELAY, bcmf_poll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->bc_txpoll, BCMF_WDDELAY, bcmf_poll_expiry, 1, + , (wdparm_t)priv); exit_unlock: net_unlock(); } @@ -698,8 +698,8 @@ static int bcmf_ifup(FAR struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->bc_txpoll, BCMF_WDDELAY, bcmf_poll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->bc_txpoll, BCMF_WDDELAY, bcmf_poll_expiry, 1, + (wdparm_t)priv); /* Enable the hardware interrupt */ @@ -793,7 +793,7 @@ static void bcmf_txavail_work(FAR void *arg) priv->bc_dev.d_buf = priv->cur_tx_frame->data; priv->bc_dev.d_len = 0; - (void)devif_poll(&priv->bc_dev, bcmf_txpoll); + devif_poll(&priv->bc_dev, bcmf_txpoll); } exit_unlock: @@ -946,7 +946,7 @@ static void bcmf_ipv6multicast(FAR struct bcmf_dev_s *priv) ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - (void)bcmf_addmac(dev, mac); + bcmf_addmac(dev, mac); #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Add the IPv6 all link-local nodes Ethernet address. This is the @@ -954,7 +954,7 @@ static void bcmf_ipv6multicast(FAR struct bcmf_dev_s *priv) * packets. */ - (void)bcmf_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + bcmf_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ #ifdef CONFIG_NET_ICMPv6_ROUTER @@ -963,7 +963,7 @@ static void bcmf_ipv6multicast(FAR struct bcmf_dev_s *priv) * packets. */ - (void)bcmf_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + bcmf_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_ROUTER */ } #endif /* CONFIG_NET_ICMPv6 */ @@ -1159,7 +1159,7 @@ int bcmf_netdev_register(FAR struct bcmf_dev_s *priv) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->bc_dev, NET_LL_IEEE80211); + netdev_register(&priv->bc_dev, NET_LL_IEEE80211); return OK; } diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c index fbb2e677d8..8ef869e70c 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c +++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c @@ -755,8 +755,8 @@ int bcmf_bus_sdio_initialize(FAR struct bcmf_dev_s *priv, /* Start the waitdog timer */ - (void)wd_start(sbus->waitdog, BCMF_WAITDOG_TIMEOUT_TICK, - bcmf_sdio_waitdog_timeout, 1, (wdparm_t)priv); + wd_start(sbus->waitdog, BCMF_WAITDOG_TIMEOUT_TICK, + bcmf_sdio_waitdog_timeout, 1, (wdparm_t)priv); /* Spawn bcmf daemon thread */ @@ -864,8 +864,8 @@ int bcmf_sdio_thread(int argc, char **argv) /* Restart the waitdog timer */ - (void)wd_start(sbus->waitdog, BCMF_WAITDOG_TIMEOUT_TICK, - bcmf_sdio_waitdog_timeout, 1, (wdparm_t)priv); + wd_start(sbus->waitdog, BCMF_WAITDOG_TIMEOUT_TICK, + bcmf_sdio_waitdog_timeout, 1, (wdparm_t)priv); /* Wake up device */ diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_utils.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_utils.c index 870cc38dfb..3e49de9d2e 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_utils.c +++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_utils.c @@ -108,7 +108,7 @@ int bcmf_sem_wait(sem_t *sem, unsigned int timeout_ms) /* Get the current time */ - (void)clock_gettime(CLOCK_REALTIME, &abstime); + clock_gettime(CLOCK_REALTIME, &abstime); timeout_sec = timeout_ms / 1000; abstime.tv_sec += timeout_sec; diff --git a/drivers/wireless/ieee802154/xbee/xbee.c b/drivers/wireless/ieee802154/xbee/xbee.c index ade8590860..ac5c8c2418 100644 --- a/drivers/wireless/ieee802154/xbee/xbee.c +++ b/drivers/wireless/ieee802154/xbee/xbee.c @@ -1178,8 +1178,8 @@ static void xbee_lockupcheck_reschedule(FAR struct xbee_priv_s *priv) * multiple attempts, we restart the XBee to get it back in a working state */ - (void)wd_start(priv->lockup_wd, XBEE_LOCKUP_QUERYTIME, xbee_lockupcheck_timeout, - 1, (wdparm_t)priv); + wd_start(priv->lockup_wd, XBEE_LOCKUP_QUERYTIME, xbee_lockupcheck_timeout, + 1, (wdparm_t)priv); } #endif @@ -1519,7 +1519,6 @@ int xbee_atquery(FAR struct xbee_priv_s *priv, FAR const char *atcommand) ret = nxsem_wait(&priv->atquery_sem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1546,8 +1545,8 @@ int xbee_atquery(FAR struct xbee_priv_s *priv, FAR const char *atcommand) { /* Setup a timeout */ - (void)wd_start(priv->atquery_wd, XBEE_ATQUERY_TIMEOUT, xbee_atquery_timeout, - 1, (wdparm_t)priv); + wd_start(priv->atquery_wd, XBEE_ATQUERY_TIMEOUT, xbee_atquery_timeout, + 1, (wdparm_t)priv); } /* Send the query */ @@ -1561,7 +1560,6 @@ int xbee_atquery(FAR struct xbee_priv_s *priv, FAR const char *atcommand) ret = nxsem_wait(&priv->atresp_sem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); wd_cancel(priv->atquery_wd); priv->querycmd[0] = 0; priv->querycmd[1] = 0; diff --git a/drivers/wireless/ieee802154/xbee/xbee_mac.c b/drivers/wireless/ieee802154/xbee/xbee_mac.c index 15963356c1..b4545505dd 100644 --- a/drivers/wireless/ieee802154/xbee/xbee_mac.c +++ b/drivers/wireless/ieee802154/xbee/xbee_mac.c @@ -124,7 +124,7 @@ static void xbee_assoctimer(int argc, uint32_t arg, ...) */ ret = work_queue(HPWORK, &priv->assocwork, xbee_assocworker, (FAR void *)priv, 0); - (void)ret; + UNUSED(ret); DEBUGASSERT(ret == OK); } @@ -154,8 +154,8 @@ static void xbee_assocworker(FAR void *arg) { xbee_send_atquery(priv, "AI"); - (void)wd_start(priv->assocwd, XBEE_ASSOC_POLLDELAY, xbee_assoctimer, - 1, (wdparm_t)arg); + wd_start(priv->assocwd, XBEE_ASSOC_POLLDELAY, xbee_assoctimer, + 1, (wdparm_t)arg); } } @@ -380,8 +380,8 @@ int xbee_req_data(XBEEHANDLE xbee, { /* Setup a timeout in case the XBee never responds with a tx status */ - (void)wd_start(priv->reqdata_wd, XBEE_RESPONSE_TIMEOUT, xbee_reqdata_timeout, - 1, (wdparm_t)priv); + wd_start(priv->reqdata_wd, XBEE_RESPONSE_TIMEOUT, xbee_reqdata_timeout, + 1, (wdparm_t)priv); /* Send the frame */ diff --git a/drivers/wireless/ieee802154/xbee/xbee_netdev.c b/drivers/wireless/ieee802154/xbee/xbee_netdev.c index 913efbd81c..ded1a5ed28 100644 --- a/drivers/wireless/ieee802154/xbee/xbee_netdev.c +++ b/drivers/wireless/ieee802154/xbee/xbee_netdev.c @@ -611,12 +611,12 @@ static void xbeenet_txpoll_work(FAR void *arg) /* Then perform the poll */ - (void)devif_timer(&priv->xd_dev.r_dev, TXPOLL_WDDELAY, xbeenet_txpoll_callback); + devif_timer(&priv->xd_dev.r_dev, TXPOLL_WDDELAY, xbeenet_txpoll_callback); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->xd_txpoll, TXPOLL_WDDELAY, xbeenet_txpoll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->xd_txpoll, TXPOLL_WDDELAY, xbeenet_txpoll_expiry, 1, + (wdparm_t)priv); net_unlock(); } @@ -766,8 +766,8 @@ static int xbeenet_ifup(FAR struct net_driver_s *dev) #endif /* Set and activate a timer process */ - (void)wd_start(priv->xd_txpoll, TXPOLL_WDDELAY, xbeenet_txpoll_expiry, - 1, (wdparm_t)priv); + wd_start(priv->xd_txpoll, TXPOLL_WDDELAY, xbeenet_txpoll_expiry, + 1, (wdparm_t)priv); /* The interface is now up */ @@ -862,7 +862,7 @@ static void xbeenet_txavail_work(FAR void *arg) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->xd_dev.r_dev, xbeenet_txpoll_callback); + devif_poll(&priv->xd_dev.r_dev, xbeenet_txpoll_callback); } net_unlock(); @@ -1078,7 +1078,6 @@ static int xbeenet_ioctl(FAR struct net_driver_s *dev, int cmd, ret = nxsem_wait(&priv->xd_eventsem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); priv->xd_eventpending = false; return ret; } @@ -1287,10 +1286,10 @@ static int xbeenet_properties(FAR struct radio_driver_s *netdev, */ #ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR - (void)xbeenet_coord_eaddr(netdev, properties->sp_hubnode.nv_addr); + xbeenet_coord_eaddr(netdev, properties->sp_hubnode.nv_addr); properties->sp_hubnode.nv_addrlen = NET_6LOWPAN_EADDRSIZE; #else - (void)xbeenet_coord_saddr(netdev, properties->sp_hubnode.nv_addr); + xbeenet_coord_saddr(netdev, properties->sp_hubnode.nv_addr); properties->sp_hubnode.nv_addrlen = NET_6LOWPAN_SADDRSIZE; #endif #endif @@ -1428,7 +1427,7 @@ int xbee_netdev_register(XBEEHANDLE xbee) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->xd_dev.r_dev, NET_LL_IEEE802154); + netdev_register(&priv->xd_dev.r_dev, NET_LL_IEEE802154); return OK; } diff --git a/drivers/wireless/lpwan/sx127x/sx127x.c b/drivers/wireless/lpwan/sx127x/sx127x.c index a9718a683a..7deba67765 100644 --- a/drivers/wireless/lpwan/sx127x/sx127x.c +++ b/drivers/wireless/lpwan/sx127x/sx127x.c @@ -763,9 +763,6 @@ static int sx127x_open(FAR struct file *filep) ret = nxsem_wait(&dev->dev_sem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -821,9 +818,6 @@ static int sx127x_close(FAR struct file *filep) ret = nxsem_wait(&dev->dev_sem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -867,9 +861,6 @@ static ssize_t sx127x_read(FAR struct file *filep, FAR char *buffer, ret = nxsem_wait(&dev->dev_sem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -885,9 +876,6 @@ static ssize_t sx127x_read(FAR struct file *filep, FAR char *buffer, if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -928,9 +916,6 @@ static ssize_t sx127x_write(FAR struct file *filep, FAR const char *buffer, ret = nxsem_wait(&dev->dev_sem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1006,9 +991,6 @@ static int sx127x_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = nxsem_wait(&dev->dev_sem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1127,7 +1109,7 @@ static int sx127x_ioctl(FAR struct file *filep, int cmd, unsigned long arg) = (FAR struct sx127x_chanscan_ioc_s *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); - (void)sx127x_channel_scan(dev, ptr); + sx127x_channel_scan(dev, ptr); break; } @@ -1224,9 +1206,6 @@ static int sx127x_poll(FAR struct file *filep, FAR struct pollfd *fds, ret = nxsem_wait(&dev->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1259,7 +1238,7 @@ static int sx127x_poll(FAR struct file *filep, FAR struct pollfd *fds, * don't wait for RX. */ - (void)nxsem_wait(&dev->rx_buffer_sem); + nxsem_wait(&dev->rx_buffer_sem); if (dev->rx_fifo_len > 0) { /* Data available for input */ @@ -1759,9 +1738,6 @@ static ssize_t sx127x_rxfifo_get(FAR struct sx127x_dev_s *dev, ret = nxsem_wait(&dev->rx_buffer_sem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1816,9 +1792,6 @@ static void sx127x_rxfifo_put(FAR struct sx127x_dev_s *dev, ret = nxsem_wait(&dev->rx_buffer_sem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return; } diff --git a/drivers/wireless/nrf24l01.c b/drivers/wireless/nrf24l01.c index 32f6136f43..a479948c6f 100644 --- a/drivers/wireless/nrf24l01.c +++ b/drivers/wireless/nrf24l01.c @@ -273,7 +273,7 @@ static void nrf24l01_lock(FAR struct spi_dev_s *spi) * SPI bus */ - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); /* We have the lock. Now make sure that the SPI bus is configured for the * NRF24L01 (it might have gotten configured for a different device while @@ -283,8 +283,8 @@ static void nrf24l01_lock(FAR struct spi_dev_s *spi) SPI_SELECT(spi, SPIDEV_WIRELESS(0), true); SPI_SETMODE(spi, SPIDEV_MODE0); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, NRF24L01_SPIFREQ); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, NRF24L01_SPIFREQ); SPI_SELECT(spi, SPIDEV_WIRELESS(0), false); } @@ -309,7 +309,7 @@ static void nrf24l01_unlock(FAR struct spi_dev_s *spi) { /* Relinquish the SPI bus. */ - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } /**************************************************************************** @@ -335,8 +335,8 @@ static inline void nrf24l01_configspi(FAR struct spi_dev_s *spi) SPI_SELECT(spi, SPIDEV_WIRELESS(0), true); /* Useful ? */ SPI_SETMODE(spi, SPIDEV_MODE0); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, NRF24L01_SPIFREQ); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, NRF24L01_SPIFREQ); SPI_SELECT(spi, SPIDEV_WIRELESS(0), false); } @@ -509,7 +509,7 @@ static uint8_t nrf24l01_setregbit(FAR struct nrf24l01_dev_s *dev, static void fifoput(FAR struct nrf24l01_dev_s *dev, uint8_t pipeno, FAR uint8_t *buffer, uint8_t buflen) { - (void)nxsem_wait(&dev->sem_fifo); + nxsem_wait(&dev->sem_fifo); while (dev->fifo_len + buflen + 1 > CONFIG_WL_NRF24L01_RXFIFO_LEN) { /* TODO: Set fifo overrun flag ! */ @@ -546,7 +546,7 @@ static uint8_t fifoget(FAR struct nrf24l01_dev_s *dev, FAR uint8_t *buffer, uint8_t pktlen; uint8_t i; - (void)nxsem_wait(&dev->sem_fifo); + nxsem_wait(&dev->sem_fifo); /* sem_rx contains count of inserted packets in FIFO, but FIFO can * overflow - fail smart. @@ -970,9 +970,6 @@ static int nrf24l01_open(FAR struct file *filep) ret = nxsem_wait(&dev->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1017,9 +1014,6 @@ static int nrf24l01_close(FAR struct file *filep) ret = nxsem_wait(&dev->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1053,9 +1047,6 @@ static ssize_t nrf24l01_read(FAR struct file *filep, FAR char *buffer, ret = nxsem_wait(&dev->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1106,9 +1097,6 @@ static ssize_t nrf24l01_write(FAR struct file *filep, FAR const char *buffer, ret = nxsem_wait(&dev->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1140,9 +1128,6 @@ static int nrf24l01_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = nxsem_wait(&dev->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1404,9 +1389,6 @@ static int nrf24l01_poll(FAR struct file *filep, FAR struct pollfd *fds, ret = nxsem_wait(&dev->devsem); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -1439,7 +1421,7 @@ static int nrf24l01_poll(FAR struct file *filep, FAR struct pollfd *fds, * don't wait for RX. */ - (void)nxsem_wait(&dev->sem_fifo); + nxsem_wait(&dev->sem_fifo); if (dev->fifo_len > 0) { dev->pfd->revents |= POLLIN; /* Data available for input */ @@ -2076,9 +2058,6 @@ ssize_t nrf24l01_recv(FAR struct nrf24l01_dev_s *dev, FAR uint8_t *buffer, int ret = nxsem_wait(&dev->sem_rx); if (ret < 0) { - /* This should only happen if the wait was canceled by an signal */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } diff --git a/drivers/wireless/spirit/drivers/spirit_netdev.c b/drivers/wireless/spirit/drivers/spirit_netdev.c index a06e522cdd..3d2d91a736 100644 --- a/drivers/wireless/spirit/drivers/spirit_netdev.c +++ b/drivers/wireless/spirit/drivers/spirit_netdev.c @@ -486,21 +486,7 @@ static struct spirit_pktstack_address_s g_addrinit = static void spirit_rxlock(FAR struct spirit_driver_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->rxsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->rxsem); } /**************************************************************************** @@ -538,21 +524,7 @@ static inline void spirit_rxunlock(FAR struct spirit_driver_s *priv) static void spirit_txlock(FAR struct spirit_driver_s *priv) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&priv->txsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->txsem); } /**************************************************************************** @@ -937,18 +909,18 @@ static void spirit_transmit_work(FAR void *arg) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, SPIRIT_TXTIMEOUT, - spirit_txtimeout_expiry, 1, (wdparm_t)priv); + wd_start(priv->txtimeout, SPIRIT_TXTIMEOUT, + spirit_txtimeout_expiry, 1, (wdparm_t)priv); } spirit_txunlock(priv); return; errout_with_rxtimeout: - (void)spirit_timer_set_rxtimeout_counter(spirit, 0); + spirit_timer_set_rxtimeout_counter(spirit, 0); errout_with_csma: - (void)spirit_csma_enable(spirit, S_DISABLE); + spirit_csma_enable(spirit, S_DISABLE); errout_with_lock: spirit_txunlock(priv); @@ -1812,18 +1784,18 @@ static void spirit_txpoll_work(FAR void *arg) /* Perform the periodic poll */ priv->needpoll = false; - (void)devif_timer(&priv->radio.r_dev, SPIRIT_WDDELAY, spirit_txpoll_callback); + devif_timer(&priv->radio.r_dev, SPIRIT_WDDELAY, spirit_txpoll_callback); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, SPIRIT_WDDELAY, spirit_txpoll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->txpoll, SPIRIT_WDDELAY, spirit_txpoll_expiry, 1, + (wdparm_t)priv); } else { /* Perform a normal, asynchronous poll for new TX data */ - (void)devif_poll(&priv->radio.r_dev, spirit_txpoll_callback); + devif_poll(&priv->radio.r_dev, spirit_txpoll_callback); } net_unlock(); @@ -1954,8 +1926,8 @@ static int spirit_ifup(FAR struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, SPIRIT_WDDELAY, spirit_txpoll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->txpoll, SPIRIT_WDDELAY, spirit_txpoll_expiry, 1, + (wdparm_t)priv); /* Enables the interrupts from the SPIRIT1 */ @@ -1971,7 +1943,7 @@ static int spirit_ifup(FAR struct net_driver_s *dev) error_with_ifalmostup: priv->ifup = true; - (void)spirit_ifdown(dev); + spirit_ifdown(dev); return ret; } @@ -2890,7 +2862,7 @@ int spirit_netdev_initialize(FAR struct spi_dev_s *spi, return OK; errout_with_attach: - (void)lower->attach(lower, NULL, NULL); + lower->attach(lower, NULL, NULL); errout_with_alloc: kmm_free(priv); diff --git a/drivers/wireless/spirit/lib/spirit_calibration.c b/drivers/wireless/spirit/lib/spirit_calibration.c index 33b96016f2..8eb44eda3f 100644 --- a/drivers/wireless/spirit/lib/spirit_calibration.c +++ b/drivers/wireless/spirit/lib/spirit_calibration.c @@ -252,7 +252,7 @@ uint8_t spirit_calib_get_vcocal(FAR struct spirit_library_s *spirit) /* Reads the register value */ - (void)spirit_reg_read(spirit, RCO_VCO_CALIBR_OUT0_BASE, ®val, 1); + spirit_reg_read(spirit, RCO_VCO_CALIBR_OUT0_BASE, ®val, 1); /* Build and return the VCO calibration data value */ @@ -318,7 +318,7 @@ uint8_t spirit_calib_get_vcotxcal(FAR struct spirit_library_s *spirit) /* Reads the register containing the calibration data word used in TX mode */ - (void)spirit_reg_read(spirit, RCO_VCO_CALIBR_IN1_BASE, ®val, 1); + spirit_reg_read(spirit, RCO_VCO_CALIBR_IN1_BASE, ®val, 1); /* Mask the VCO_CALIBR_TX field and returns the value */ @@ -384,7 +384,7 @@ uint8_t spirit_calib_get_vcorxcal(FAR struct spirit_library_s *spirit) /* Reads the register containing the calibration data word used in TX mode */ - (void)spirit_reg_read(spirit, RCO_VCO_CALIBR_IN0_BASE, ®val, 1); + spirit_reg_read(spirit, RCO_VCO_CALIBR_IN0_BASE, ®val, 1); /* Mask the VCO_CALIBR_RX field and returns the value */ @@ -467,11 +467,11 @@ enum spirit_vcowin_e /* Reads the register containing the REFWORD value */ - (void)spirit_reg_read(spirit, SYNTH_CONFIG1_BASE, ®val1, 1); + spirit_reg_read(spirit, SYNTH_CONFIG1_BASE, ®val1, 1); /* Reads the Xtal configuration */ - (void)spirit_reg_read(spirit, ANA_FUNC_CONF0_BASE, ®val2, 1); + spirit_reg_read(spirit, ANA_FUNC_CONF0_BASE, ®val2, 1); /* Mask the REFWORD field */ @@ -595,7 +595,7 @@ enum spirit_vcoselect_e spirit_calib_get_vco(FAR struct spirit_library_s *spirit { uint8_t regval; - (void)spirit_reg_read(spirit, SYNTH_CONFIG1_BASE, ®val, 1); + spirit_reg_read(spirit, SYNTH_CONFIG1_BASE, ®val, 1); regval = (regval >> 1) & 0x3; if (regval == 0x01) diff --git a/drivers/wireless/spirit/lib/spirit_csma.c b/drivers/wireless/spirit/lib/spirit_csma.c index e9b4de8e9d..9ced049753 100644 --- a/drivers/wireless/spirit/lib/spirit_csma.c +++ b/drivers/wireless/spirit/lib/spirit_csma.c @@ -267,7 +267,7 @@ enum spirit_functional_state_e /* Reads the PROTOCOL1 register value */ - (void)spirit_reg_read(spirit, PROTOCOL1_BASE, ®val, 1); + spirit_reg_read(spirit, PROTOCOL1_BASE, ®val, 1); /* Return if set or reset */ @@ -352,7 +352,7 @@ enum spirit_functional_state_e /* Reads the PROTOCOL1 register value */ - (void)spirit_reg_read(spirit, PROTOCOL1_BASE, ®val, 1); + spirit_reg_read(spirit, PROTOCOL1_BASE, ®val, 1); /* Return if set or reset */ @@ -438,7 +438,7 @@ enum spirit_functional_state_e /* Reads the PROTOCOL1 register value */ - (void)spirit_reg_read(spirit, PROTOCOL1_BASE, ®val, 1); + spirit_reg_read(spirit, PROTOCOL1_BASE, ®val, 1); /* Return if set or reset */ @@ -511,7 +511,7 @@ uint16_t spirit_csma_get_bucounterseed(FAR struct spirit_library_s *spirit) /* Reads the CSMA_CONFIGx registers value */ - (void)spirit_reg_read(spirit, CSMA_CONFIG3_BASE, regval, 2); + spirit_reg_read(spirit, CSMA_CONFIG3_BASE, regval, 2); /* Build the counter seed and return it */ @@ -582,7 +582,7 @@ uint8_t spirit_csma_get_buprescaler(FAR struct spirit_library_s *spirit) /* Reads the CSMA_CONFIG1 register value */ - (void)spirit_reg_read(spirit, CSMA_CONFIG1_BASE, ®val, 1); + spirit_reg_read(spirit, CSMA_CONFIG1_BASE, ®val, 1); /* Build and return the BU prescaler value */ @@ -654,7 +654,7 @@ enum spirit_cca_period_e /* Reads the CSMA_CONFIG1 register value */ - (void)spirit_reg_read(spirit, CSMA_CONFIG1_BASE, ®val, 1); + spirit_reg_read(spirit, CSMA_CONFIG1_BASE, ®val, 1); /* Build and return the CCA period value */ @@ -726,7 +726,7 @@ uint8_t spirit_csma_get_ccalen(FAR struct spirit_library_s *spirit) /* Reads the CSMA_CONFIG0 register value */ - (void)spirit_reg_read(spirit, CSMA_CONFIG0_BASE, ®val, 1); + spirit_reg_read(spirit, CSMA_CONFIG0_BASE, ®val, 1); /* Build and return the CCA length */ @@ -796,7 +796,7 @@ uint8_t spirit_csma_get_maxbackoff(FAR struct spirit_library_s *spirit) /* Reads the CSMA_CONFIG0 register value */ - (void)spirit_reg_read(spirit, CSMA_CONFIG0_BASE, ®val, 1); + spirit_reg_read(spirit, CSMA_CONFIG0_BASE, ®val, 1); /* Build and return the max number of back-off */ diff --git a/drivers/wireless/spirit/lib/spirit_directrf.c b/drivers/wireless/spirit/lib/spirit_directrf.c index 61dc69e75c..096675eacb 100644 --- a/drivers/wireless/spirit/lib/spirit_directrf.c +++ b/drivers/wireless/spirit/lib/spirit_directrf.c @@ -111,7 +111,7 @@ enum spirit_directrx_e /* Reads the register value and mask the RX_Mode field */ - (void)spirit_reg_read(spirit, PCKTCTRL3_BASE, ®val, 1); + spirit_reg_read(spirit, PCKTCTRL3_BASE, ®val, 1); /* Rebuild and return value */ @@ -182,7 +182,7 @@ enum spirit_directtx_e /* Reads the register value and mask the RX_Mode field */ - (void)spirit_reg_read(spirit, PCKTCTRL1_BASE, ®val, 1); + spirit_reg_read(spirit, PCKTCTRL1_BASE, ®val, 1); /* Returns value */ diff --git a/drivers/wireless/spirit/lib/spirit_general.c b/drivers/wireless/spirit/lib/spirit_general.c index 7f1ca17878..73a600d9d9 100644 --- a/drivers/wireless/spirit/lib/spirit_general.c +++ b/drivers/wireless/spirit/lib/spirit_general.c @@ -177,7 +177,7 @@ enum battery_level_e /* Reads the ANA_FUNC_CONF1_BASE register value */ - (void)spirit_reg_read(spirit, ANA_FUNC_CONF1_BASE, ®val, 1); + spirit_reg_read(spirit, ANA_FUNC_CONF1_BASE, ®val, 1); /* Mask the battery level field and returns the settled battery level */ @@ -352,7 +352,7 @@ enum mode_extref_e /* Reads the ANA_FUNC_CONF0_BASE register value and return the result */ - (void)spirit_reg_read(spirit, ANA_FUNC_CONF0_BASE, ®val, 1); + spirit_reg_read(spirit, ANA_FUNC_CONF0_BASE, ®val, 1); /* Mask the EXT_REF field field and returns the settled reference signal */ @@ -455,7 +455,7 @@ enum gm_conf_e spirit_general_get_xogm(FAR struct spirit_library_s *spirit) /* Reads the ANA_FUNC_CONF1_BASE register value */ - (void)spirit_reg_read(spirit, ANA_FUNC_CONF1_BASE, ®val, 1); + spirit_reg_read(spirit, ANA_FUNC_CONF1_BASE, ®val, 1); /* Mask the GM_CONF field field and returns the settled transconductance of * the XO at startup. @@ -485,7 +485,7 @@ enum packet_type_e /* Reads the PROTOCOL1 register */ - (void)spirit_reg_read(spirit, PCKTCTRL3_BASE, ®val, 1); + spirit_reg_read(spirit, PCKTCTRL3_BASE, ®val, 1); /* cast and return value */ @@ -512,7 +512,7 @@ uint16_t spirit_general_get_partnumber(FAR struct spirit_library_s *spirit) /* Reads the register value containing the device part number */ - (void)spirit_reg_read(spirit, DEVICE_INFO1_PARTNUM, regval, 2); + spirit_reg_read(spirit, DEVICE_INFO1_PARTNUM, regval, 2); return (((uint16_t)regval[0] << 8) | (uint16_t)regval[1]); } @@ -535,6 +535,6 @@ uint8_t spirit_general_get_version(FAR struct spirit_library_s *spirit) { uint8_t ver; - (void)spirit_reg_read(spirit, DEVICE_INFO0_VERSION, &ver, 1); + spirit_reg_read(spirit, DEVICE_INFO0_VERSION, &ver, 1); return ver; } diff --git a/drivers/wireless/spirit/lib/spirit_gpio.c b/drivers/wireless/spirit/lib/spirit_gpio.c index df6b965f62..fc1425b5da 100644 --- a/drivers/wireless/spirit/lib/spirit_gpio.c +++ b/drivers/wireless/spirit/lib/spirit_gpio.c @@ -237,7 +237,7 @@ enum spirit_outputlevel_e /* Reads the SPIRIT_GPIOx register */ - (void)spirit_reg_read(spirit, gpio, ®val, 1); + spirit_reg_read(spirit, gpio, ®val, 1); /* Mask the GPIO_SELECT field and returns the value according */ @@ -415,7 +415,7 @@ enum spirit_clockoutput_xoprescaler_e /* Reads the MCU_CLK_CONFIG register */ - (void)spirit_reg_read(spirit, MCU_CK_CONF_BASE, ®val, 1); + spirit_reg_read(spirit, MCU_CK_CONF_BASE, ®val, 1); /* Mask the XO_RATIO field and return the value */ @@ -488,7 +488,7 @@ enum spirit_clockoutput_rcoprescaler_e /* Reads the MCU_CLK_CONFIG register */ - (void)spirit_reg_read(spirit, MCU_CK_CONF_BASE, ®val, 1); + spirit_reg_read(spirit, MCU_CK_CONF_BASE, ®val, 1); /* Mask the RCO_RATIO field and returns the value */ @@ -564,7 +564,7 @@ enum spirit_extra_clockcycles_e /* Reads the MCU_CLK_CONFIG register */ - (void)spirit_reg_read(spirit, MCU_CK_CONF_BASE, ®val, 1); + spirit_reg_read(spirit, MCU_CK_CONF_BASE, ®val, 1); /* Mask the CLOCK_TAIL field and returns the value */ diff --git a/drivers/wireless/spirit/lib/spirit_linearfifo.c b/drivers/wireless/spirit/lib/spirit_linearfifo.c index b19001e95c..69434c9d3f 100644 --- a/drivers/wireless/spirit/lib/spirit_linearfifo.c +++ b/drivers/wireless/spirit/lib/spirit_linearfifo.c @@ -67,7 +67,7 @@ uint8_t spirit_fifo_get_rxcount(FAR struct spirit_library_s *spirit) /* Reads the register value */ - (void)spirit_reg_read(spirit, LINEAR_FIFO_STATUS0_BASE, ®val, 1); + spirit_reg_read(spirit, LINEAR_FIFO_STATUS0_BASE, ®val, 1); /* Build and return value */ @@ -94,7 +94,7 @@ uint8_t spirit_fifo_get_txcount(FAR struct spirit_library_s *spirit) /* Reads the number of elements in TX FIFO and return the value */ - (void)spirit_reg_read(spirit, LINEAR_FIFO_STATUS1_BASE, ®val, 1); + spirit_reg_read(spirit, LINEAR_FIFO_STATUS1_BASE, ®val, 1); /* Build and return value */ @@ -164,7 +164,7 @@ uint8_t spirit_fifo_get_rxalmostfull(FAR struct spirit_library_s *spirit) /* Reads the almost full threshold for RX FIFO and return the value */ - (void)spirit_reg_read(spirit, FIFO_CONFIG3_RXAFTHR_BASE, ®val, 1); + spirit_reg_read(spirit, FIFO_CONFIG3_RXAFTHR_BASE, ®val, 1); /* Build and return value */ @@ -226,7 +226,7 @@ uint8_t spirit_fifo_get_rxalmostempty(FAR struct spirit_library_s *spirit) /* Reads the almost empty threshold for RX FIFO and returns the value */ - (void)spirit_reg_read(spirit, FIFO_CONFIG2_RXAETHR_BASE, ®val, 1); + spirit_reg_read(spirit, FIFO_CONFIG2_RXAETHR_BASE, ®val, 1); /* Build and return value */ @@ -306,7 +306,7 @@ uint8_t spirit_fifo_get_txalmostfull(FAR struct spirit_library_s *spirit) /* Reads the almost full threshold for Tx FIFO and returns the value */ - (void)spirit_reg_read(spirit, FIFO_CONFIG1_TXAFTHR_BASE, ®val, 1); + spirit_reg_read(spirit, FIFO_CONFIG1_TXAFTHR_BASE, ®val, 1); /* Build and returns value */ @@ -378,7 +378,7 @@ uint8_t spirit_fifo_get_txalmostempty(FAR struct spirit_library_s *spirit) /* Reads the almost empty threshold for TX FIFO and returns the value */ - (void)spirit_reg_read(spirit, FIFO_CONFIG0_TXAETHR_BASE, ®val, 1); + spirit_reg_read(spirit, FIFO_CONFIG0_TXAETHR_BASE, ®val, 1); /* Build and return value */ diff --git a/drivers/wireless/spirit/lib/spirit_pktbasic.c b/drivers/wireless/spirit/lib/spirit_pktbasic.c index 470171f0b0..105bbf2e78 100644 --- a/drivers/wireless/spirit/lib/spirit_pktbasic.c +++ b/drivers/wireless/spirit/lib/spirit_pktbasic.c @@ -572,7 +572,7 @@ enum spirit_functional_state_e /* Reads the PCKTCTRL4 register value */ - (void)spirit_reg_read(spirit, PCKTCTRL4_BASE, ®val, 1); + spirit_reg_read(spirit, PCKTCTRL4_BASE, ®val, 1); /* Returns the address field value */ @@ -665,7 +665,7 @@ uint16_t spirit_pktbase_get_payloadlen(FAR struct spirit_library_s *spirit) /* Reads the packet length registers */ - (void)spirit_reg_read(spirit, PCKTLEN1_BASE, regval, 2); + spirit_reg_read(spirit, PCKTLEN1_BASE, regval, 2); /* Returns the packet length */ @@ -702,7 +702,7 @@ uint16_t spirit_pktbasic_get_rxpktlen(FAR struct spirit_library_s *spirit) /* Reads the RX_PCKT_LENx registers value */ - (void)spirit_reg_read(spirit, RX_PCKT_LEN1_BASE, regval, 2); + spirit_reg_read(spirit, RX_PCKT_LEN1_BASE, regval, 2); /* Rebuild and return the length field */ diff --git a/drivers/wireless/spirit/lib/spirit_pktcommon.c b/drivers/wireless/spirit/lib/spirit_pktcommon.c index c17f65d721..a67d8b6186 100644 --- a/drivers/wireless/spirit/lib/spirit_pktcommon.c +++ b/drivers/wireless/spirit/lib/spirit_pktcommon.c @@ -110,7 +110,7 @@ uint8_t spirit_pktcommon_get_controllen(FAR struct spirit_library_s *spirit) /* Read the PCKTCTRL4 register value */ - (void)spirit_reg_read(spirit, PCKTCTRL4_BASE, ®val, 1); + spirit_reg_read(spirit, PCKTCTRL4_BASE, ®val, 1); /* Rebuild and return value */ @@ -180,7 +180,7 @@ uint8_t spirit_pktcommon_get_preamblen(FAR struct spirit_library_s *spirit) /* Read the PCKTCTRL2 register value */ - (void)spirit_reg_read(spirit, PCKTCTRL2_BASE, ®val, 1); + spirit_reg_read(spirit, PCKTCTRL2_BASE, ®val, 1); /* Rebuild and return value */ @@ -250,7 +250,7 @@ uint8_t spirit_pktcommon_get_synclen(FAR struct spirit_library_s *spirit) /* Read the PCKTCTRL2 register value */ - (void)spirit_reg_read(spirit, PCKTCTRL2_BASE, ®val, 1); + spirit_reg_read(spirit, PCKTCTRL2_BASE, ®val, 1); /* Rebuild and return value */ @@ -375,7 +375,7 @@ enum spirit_functional_state_e /* Read the PCKT_FLT_OPTIONS register value */ - (void)spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, ®val, 1); + spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, ®val, 1); /* Check the CRC filtering bit */ @@ -453,7 +453,7 @@ enum pkt_crcmode_e /* Read the PCKTCTRL1 register */ - (void)spirit_reg_read(spirit, PCKTCTRL1_BASE, ®val, 1); + spirit_reg_read(spirit, PCKTCTRL1_BASE, ®val, 1); /* Rebuild and return value */ @@ -657,7 +657,7 @@ uint8_t spirit_pktcommon_get_syncword(FAR struct spirit_library_s *spirit, /* Read the selected register value */ - (void)spirit_reg_read(spirit, regaddr, ®val, 1); + spirit_reg_read(spirit, regaddr, ®val, 1); /* Returns the read value */ @@ -733,7 +733,7 @@ uint32_t spirit_pktcommon_get_syncwords(FAR struct spirit_library_s *spirit, /* Read the SYNCx registers value */ - (void)spirit_reg_read(spirit, SYNC4_BASE, regval, 4); + spirit_reg_read(spirit, SYNC4_BASE, regval, 4); /* Rebuild the SYNC words */ @@ -770,7 +770,7 @@ uint8_t spirit_pktcommon_get_varlen(FAR struct spirit_library_s *spirit) /* Read the PCKTCTRL3 register value */ - (void)spirit_reg_read(spirit, PCKTCTRL3_BASE, ®val, 1); + spirit_reg_read(spirit, PCKTCTRL3_BASE, ®val, 1); /* Rebuild and return value */ @@ -820,7 +820,7 @@ uint8_t spirit_pktcommon_get_txdestaddr(FAR struct spirit_library_s *spirit) /* Read value from the PCKT_FLT_GOALS_SOURCE_ADDR register */ - (void)spirit_reg_read(spirit, PCKT_FLT_GOALS_SOURCE_ADDR_BASE, ®val, 1); + spirit_reg_read(spirit, PCKT_FLT_GOALS_SOURCE_ADDR_BASE, ®val, 1); /* Return value */ @@ -873,7 +873,7 @@ uint8_t spirit_pktcommon_get_nodeaddress(FAR struct spirit_library_s *spirit) /* Read value from the PCKT_FLT_GOALS_TX_ADDR register */ - (void)spirit_reg_read(spirit, PCKT_FLT_GOALS_TX_ADDR_BASE, ®val, 1); + spirit_reg_read(spirit, PCKT_FLT_GOALS_TX_ADDR_BASE, ®val, 1); /* Return value */ @@ -925,7 +925,7 @@ uint8_t spirit_pktcommon_get_bcastaddr(FAR struct spirit_library_s *spirit) /* Read value from the PCKT_FLT_GOALS_BROADCAST register */ - (void)spirit_reg_read(spirit, PCKT_FLT_GOALS_BROADCAST_BASE, ®val, 1); + spirit_reg_read(spirit, PCKT_FLT_GOALS_BROADCAST_BASE, ®val, 1); /* Return value */ @@ -977,7 +977,7 @@ uint8_t spirit_pktcommon_get_mcastaddr(FAR struct spirit_library_s *spirit) /* Read value from the PCKT_FLT_GOALS_MULTICAST register */ - (void)spirit_reg_read(spirit, PCKT_FLT_GOALS_MULTICAST_BASE, ®val, 1); + spirit_reg_read(spirit, PCKT_FLT_GOALS_MULTICAST_BASE, ®val, 1); /* Return value */ @@ -1040,7 +1040,7 @@ uint32_t spirit_pktcommon_get_ctrlmask(FAR struct spirit_library_s *spirit) /* Read the PCKT_FLT_GOALS_CONTROLx_MASK registers */ - (void)spirit_reg_read(spirit, PCKT_FLT_GOALS_CONTROL0_MASK_BASE, regval, 4); + spirit_reg_read(spirit, PCKT_FLT_GOALS_CONTROL0_MASK_BASE, regval, 4); /* Rebuild the control mask value on a 32-bit integer variable */ @@ -1110,7 +1110,7 @@ uint32_t spirit_pktcommon_get_ctrlref(FAR struct spirit_library_s *spirit) /* Read the PCKT_FLT_GOALS_CONTROLx_FIELD registers */ - (void)spirit_reg_read(spirit, PCKT_FLT_GOALS_CONTROL0_FIELD_BASE, regval, 4); + spirit_reg_read(spirit, PCKT_FLT_GOALS_CONTROL0_FIELD_BASE, regval, 4); /* Rebuild the control mask value on a 32-bit integer variable */ @@ -1178,7 +1178,7 @@ uint32_t spirit_pktcommon_get_txctrl(FAR struct spirit_library_s *spirit) /* Read the TX_CTRL_FIELDx registers */ - (void)spirit_reg_read(spirit, TX_CTRL_FIELD3_BASE, regval, 4); + spirit_reg_read(spirit, TX_CTRL_FIELD3_BASE, regval, 4); /* Rebuild value: build a 32-bit value from the read bytes */ @@ -1363,7 +1363,7 @@ enum spirit_functional_state_e /* Read the register value */ - (void)spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, ®val, 1); + spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, ®val, 1); /* Gets the enable/disable bit in form of enum spirit_functional_state_e type */ @@ -1398,7 +1398,7 @@ enum spirit_functional_state_e /* Read the register value */ - (void)spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, ®val, 1); + spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, ®val, 1); /* Get the enable/disable bit in form of enum spirit_functional_state_e type */ @@ -1433,7 +1433,7 @@ enum spirit_functional_state_e /* Read the register value */ - (void)spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, ®val, 1); + spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, ®val, 1); /* Get the enable/disable bit in form of enum spirit_functional_state_e type */ @@ -1467,7 +1467,7 @@ uint8_t spirit_pktcommon_get_rxdestaddr(FAR struct spirit_library_s *spirit) /* Read the RX_ADDR_FIELD0 register value */ - (void)spirit_reg_read(spirit, RX_ADDR_FIELD0_BASE, ®val, 1); + spirit_reg_read(spirit, RX_ADDR_FIELD0_BASE, ®val, 1); /* Return value */ @@ -1496,7 +1496,7 @@ uint32_t spirit_pktcommon_get_rxctrl(FAR struct spirit_library_s *spirit) /* Read the PCKT_FLT_GOALS_CONTROLx_MASK registers */ - (void)spirit_reg_read(spirit, RX_CTRL_FIELD0_BASE, regval, 4); + spirit_reg_read(spirit, RX_CTRL_FIELD0_BASE, regval, 4); /* Rebuild the control mask value on a 32-bit integer variable */ @@ -1805,7 +1805,7 @@ uint8_t spirit_pktcommon_get_maxretx(FAR struct spirit_library_s *spirit) /* Read the PROTOCOL0 register value */ - (void)spirit_reg_read(spirit, PROTOCOL0_BASE, ®val, 1); + spirit_reg_read(spirit, PROTOCOL0_BASE, ®val, 1); /* Build the value to be written */ @@ -1833,7 +1833,7 @@ enum spirit_functional_state_e /* Read the PROTOCOL0 register value */ - (void)spirit_reg_read(spirit, RX_PCKT_INFO_BASE, ®val, 1); + spirit_reg_read(spirit, RX_PCKT_INFO_BASE, ®val, 1); /* Build the value to be written */ @@ -1860,7 +1860,7 @@ uint8_t spirit_pktcommon_get_rxsrcaddr(FAR struct spirit_library_s *spirit) /* Read the RX_ADDR_FIELD1 register value */ - (void)spirit_reg_read(spirit, RX_ADDR_FIELD1_BASE, ®val, 1); + spirit_reg_read(spirit, RX_ADDR_FIELD1_BASE, ®val, 1); /* Returns value */ @@ -1887,7 +1887,7 @@ uint8_t spirit_pktcommon_get_rxseqno(FAR struct spirit_library_s *spirit) /* Read the RX_PCKT_INFO register value */ - (void)spirit_reg_read(spirit, RX_PCKT_INFO_BASE, ®val, 1); + spirit_reg_read(spirit, RX_PCKT_INFO_BASE, ®val, 1); /* Obtains and returns the sequence number */ @@ -1914,7 +1914,7 @@ uint8_t spirit_pktcommon_get_rxnak(FAR struct spirit_library_s *spirit) /* Read the RX_PCKT_INFO register value */ - (void)spirit_reg_read(spirit, RX_PCKT_INFO_BASE, ®val, 1); + spirit_reg_read(spirit, RX_PCKT_INFO_BASE, ®val, 1); /* Obtains and returns the RX nack bit */ @@ -1941,7 +1941,7 @@ uint8_t spirit_pktcommon_get_txseqno(FAR struct spirit_library_s *spirit) /* Read the TX_PCKT_INFO register value */ - (void)spirit_reg_read(spirit, TX_PCKT_INFO_BASE, ®val, 1); + spirit_reg_read(spirit, TX_PCKT_INFO_BASE, ®val, 1); /* Obtains and returns the TX sequence number */ @@ -1968,7 +1968,7 @@ uint8_t spirit_pktcommon_get_nretx(FAR struct spirit_library_s *spirit) /* Read the TX_PCKT_INFO register value */ - (void)spirit_reg_read(spirit, TX_PCKT_INFO_BASE, ®val, 1); + spirit_reg_read(spirit, TX_PCKT_INFO_BASE, ®val, 1); /* Obtains and returns the number of retransmission done */ @@ -2052,7 +2052,7 @@ enum spirit_functional_state_e /* Read the register value */ - (void)spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, ®val, 1); + spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, ®val, 1); /* Gets the enable/disable bit in form of enum spirit_functional_state_e type */ diff --git a/drivers/wireless/spirit/lib/spirit_pktmbus.c b/drivers/wireless/spirit/lib/spirit_pktmbus.c index 1d604db4b4..3b10af7901 100644 --- a/drivers/wireless/spirit/lib/spirit_pktmbus.c +++ b/drivers/wireless/spirit/lib/spirit_pktmbus.c @@ -251,7 +251,7 @@ uint8_t spirit_pktmbus_get_preamble(FAR struct spirit_library_s *spirit) /* Modifies the MBUS_PRMBL register value */ - (void)spirit_reg_read(spirit, MBUS_PRMBL_BASE, ®val, 1); + spirit_reg_read(spirit, MBUS_PRMBL_BASE, ®val, 1); /* Return value */ @@ -301,7 +301,7 @@ uint8_t spirit_pktmbus_get_postamble(FAR struct spirit_library_s *spirit) /* Reads the MBUS_PSTMBL register */ - (void)spirit_reg_read(spirit, MBUS_PSTMBL_BASE, ®val, 1); + spirit_reg_read(spirit, MBUS_PSTMBL_BASE, ®val, 1); /* Returns value */ @@ -352,7 +352,7 @@ enum spirit_mbus_submode_e /* Reads the MBUS_CTRL register value */ - (void)spirit_reg_read(spirit, MBUS_CTRL_BASE, ®val, 1); + spirit_reg_read(spirit, MBUS_CTRL_BASE, ®val, 1); /* Returns value */ @@ -412,7 +412,7 @@ uint16_t spirit_pktmbus_get_payloadlen(FAR struct spirit_library_s *spirit) /* Reads the packet length registers */ - (void)spirit_reg_read(spirit, PCKTLEN1_BASE, regval, 2); + spirit_reg_read(spirit, PCKTLEN1_BASE, regval, 2); /* Returns the packet length */ diff --git a/drivers/wireless/spirit/lib/spirit_pktstack.c b/drivers/wireless/spirit/lib/spirit_pktstack.c index c6f292b909..ad37e85b87 100644 --- a/drivers/wireless/spirit/lib/spirit_pktstack.c +++ b/drivers/wireless/spirit/lib/spirit_pktstack.c @@ -707,7 +707,7 @@ uint16_t spirit_pktstack_get_payloadlen(FAR struct spirit_library_s *spirit) /* Read the PCKTLEN1 registers value */ - (void)spirit_reg_read(spirit, PCKTLEN1_BASE, regval, 2); + spirit_reg_read(spirit, PCKTLEN1_BASE, regval, 2); /* Rebuild and return the payload length value */ @@ -823,7 +823,7 @@ uint8_t spirit_pktstack_get_rxsource_addrmask(FAR struct spirit_library_s *spiri /* Write value to the PCKT_FLT_GOALS_SOURCE_MASK register */ - (void)spirit_reg_read(spirit, PCKT_FLT_GOALS_SOURCE_MASK_BASE, ®val, 1); + spirit_reg_read(spirit, PCKT_FLT_GOALS_SOURCE_MASK_BASE, ®val, 1); /* Return the read value */ @@ -851,7 +851,7 @@ uint16_t spirit_pktstack_get_rxpktlen(FAR struct spirit_library_s *spirit) /* Read the RX_PCKT_LENx registers value */ - (void)spirit_reg_read(spirit, RX_PCKT_LEN1_BASE, regval, 2); + spirit_reg_read(spirit, RX_PCKT_LEN1_BASE, regval, 2); /* Rebuild and return the the length field */ diff --git a/drivers/wireless/spirit/lib/spirit_qi.c b/drivers/wireless/spirit/lib/spirit_qi.c index 29220669d5..ef4c79da9d 100644 --- a/drivers/wireless/spirit/lib/spirit_qi.c +++ b/drivers/wireless/spirit/lib/spirit_qi.c @@ -215,7 +215,7 @@ enum spirit_pqi_threshold_e /* Reads the QI register value */ - (void)spirit_reg_read(spirit, QI_BASE, ®val, 1); + spirit_reg_read(spirit, QI_BASE, ®val, 1); /* Rebuild and return the PQI threshold value */ @@ -291,7 +291,7 @@ enum spirit_sqi_threshold_e /* Read the QI register value */ - (void)spirit_reg_read(spirit, QI_BASE, ®val, 1); + spirit_reg_read(spirit, QI_BASE, ®val, 1); /* Return the SQI threshold value */ @@ -318,7 +318,7 @@ uint8_t spirit_qi_get_pqi(FAR struct spirit_library_s *spirit) /* Reads the LINK_QUALIF2 register value */ - (void)spirit_reg_read(spirit, LINK_QUALIF2_BASE, ®val, 1); + spirit_reg_read(spirit, LINK_QUALIF2_BASE, ®val, 1); /* Returns the PQI value */ @@ -345,7 +345,7 @@ uint8_t spirit_qi_get_sqi(FAR struct spirit_library_s *spirit) /* Reads the register LINK_QUALIF1 value */ - (void)spirit_reg_read(spirit, LINK_QUALIF1_BASE, ®val, 1); + spirit_reg_read(spirit, LINK_QUALIF1_BASE, ®val, 1); /* Rebuild and return the SQI value */ @@ -372,7 +372,7 @@ uint8_t spirit_qi_get_lqi(FAR struct spirit_library_s *spirit) /* Reads the LINK_QUALIF0 register value */ - (void)spirit_reg_read(spirit, LINK_QUALIF0_BASE, ®val, 1); + spirit_reg_read(spirit, LINK_QUALIF0_BASE, ®val, 1); /* Rebuild and return the LQI value */ @@ -399,7 +399,7 @@ enum spirit_flag_status_e spirit_qi_get_cs(FAR struct spirit_library_s *spirit) /* Reads the LINK_QUALIF1 register value */ - (void)spirit_reg_read(spirit, LINK_QUALIF1_BASE, ®val, 1); + spirit_reg_read(spirit, LINK_QUALIF1_BASE, ®val, 1); /* Rebuild and returns the CS status value */ @@ -435,7 +435,7 @@ uint8_t spirit_qi_get_rssi(FAR struct spirit_library_s *spirit) /* Reads the RSSI_LEVEL register value */ - (void)spirit_reg_read(spirit, RSSI_LEVEL_BASE, ®val, 1); + spirit_reg_read(spirit, RSSI_LEVEL_BASE, ®val, 1); /* Returns the RSSI value */ @@ -486,7 +486,7 @@ uint8_t spirit_qi_get_rssithreshold(FAR struct spirit_library_s *spirit) /* Reads the RSSI_TH register value */ - (void)spirit_reg_read(spirit, RSSI_TH_BASE, ®val, 1); + spirit_reg_read(spirit, RSSI_TH_BASE, ®val, 1); /* Returns RSSI threshold */ @@ -618,7 +618,7 @@ enum spirit_rssi_filtergain_e /* Reads the RSSI_FLT register */ - (void)spirit_reg_read(spirit, RSSI_FLT_BASE, ®val, 1); + spirit_reg_read(spirit, RSSI_FLT_BASE, ®val, 1); /* Rebuild and returns the filter gain value */ @@ -695,7 +695,7 @@ enum spirit_csmode_e spirit_qi_get_csmode(FAR struct spirit_library_s *spirit) /* Reads the RSSI_FLT register */ - (void)spirit_reg_read(spirit, RSSI_FLT_BASE, ®val, 1); + spirit_reg_read(spirit, RSSI_FLT_BASE, ®val, 1); /* Rebuild and returns the CS mode value */ diff --git a/drivers/wireless/spirit/lib/spirit_radio.c b/drivers/wireless/spirit/lib/spirit_radio.c index 3b6a1685b0..995a03884e 100644 --- a/drivers/wireless/spirit/lib/spirit_radio.c +++ b/drivers/wireless/spirit/lib/spirit_radio.c @@ -729,7 +729,7 @@ enum xtal_flag_e spirit_radio_get_xtalflag(FAR struct spirit_library_s *spirit) * the value. */ - (void)spirit_reg_read(spirit, ANA_FUNC_CONF0_BASE, ®val, 1); + spirit_reg_read(spirit, ANA_FUNC_CONF0_BASE, ®val, 1); return (enum xtal_flag_e)((regval & 0x40) >> 6); } @@ -835,7 +835,7 @@ uint32_t spirit_radio_get_synthword(FAR struct spirit_library_s *spirit) /* Read the SYNTH registers, build the synth word and return it */ - (void)spirit_reg_read(spirit, SYNT3_BASE, regvalues, 4); + spirit_reg_read(spirit, SYNT3_BASE, regvalues, 4); return ((((uint32_t)(regvalues[0] & 0x1f)) << 21) + (((uint32_t)(regvalues[1])) << 13) + (((uint32_t)(regvalues[2])) << 5) + @@ -962,7 +962,7 @@ enum spirit_bandselect_e /* Read the SYNT0 register */ - (void)spirit_reg_read(spirit, SYNT0_BASE, ®val, 1); + spirit_reg_read(spirit, SYNT0_BASE, ®val, 1); /* Mask the Band selected field */ @@ -1028,7 +1028,7 @@ uint8_t spirit_radio_get_channel(FAR struct spirit_library_s *spirit) /* Read the CHNUM register and return the value */ - (void)spirit_reg_read(spirit, CHNUM_BASE, ®val, 1); + spirit_reg_read(spirit, CHNUM_BASE, ®val, 1); return regval; } @@ -1087,7 +1087,7 @@ uint32_t spirit_radio_get_chspace(FAR struct spirit_library_s *spirit) /* Read the CHSPACE register, calculate the channel space and return it */ - (void)spirit_reg_read(spirit, CHSPACE_BASE, &factor, 1); + spirit_reg_read(spirit, CHSPACE_BASE, &factor, 1); /* Compute the Hertz value and return it */ @@ -1224,7 +1224,7 @@ int32_t spirit_radio_get_foffset(FAR struct spirit_library_s *spirit) /* Read the FC_OFFSET registers */ - (void)spirit_reg_read(spirit, FC_OFFSET1_BASE, tmp, 2); + spirit_reg_read(spirit, FC_OFFSET1_BASE, tmp, 2); /* Calculates the Offset Factor */ @@ -1808,7 +1808,7 @@ uint32_t spirit_radio_get_datarate(FAR struct spirit_library_s *spirit) /* Read the datarate registers for mantissa and exponent */ - (void)spirit_reg_read(spirit, MOD1_BASE, regval, 2); + spirit_reg_read(spirit, MOD1_BASE, regval, 2); /* Calculates the datarate */ @@ -1898,7 +1898,7 @@ uint32_t spirit_radio_get_freqdev(FAR struct spirit_library_s *spirit) /* Read the frequency deviation register for mantissa and exponent */ - (void)spirit_reg_read(spirit, FDEV0_BASE, ®val, 1); + spirit_reg_read(spirit, FDEV0_BASE, ®val, 1); fdevm = regval & 0x07; fdeve = (regval & 0xf0) >> 4; @@ -1985,7 +1985,7 @@ uint32_t spirit_radio_get_chfilterbw(FAR struct spirit_library_s *spirit) /* Read the channel filter register for mantissa and exponent */ - (void)spirit_reg_read(spirit, CHFLT_BASE, ®val, 1); + spirit_reg_read(spirit, CHFLT_BASE, ®val, 1); bwm = (regval & 0xf0) >> 4; bwe = regval & 0x0f; @@ -2055,7 +2055,7 @@ enum modulation_select_e /* Read the modulation register MOD0 */ - (void)spirit_reg_read(spirit, MOD0_BASE, ®val, 1); + spirit_reg_read(spirit, MOD0_BASE, ®val, 1); /* Return the modulation type */ @@ -2171,7 +2171,7 @@ enum spirit_ookpeakdelay_e /* Read the OOK peak decay register RSSI_FLT_BASE */ - (void)spirit_reg_read(spirit, RSSI_FLT_BASE, ®val, 1); + spirit_reg_read(spirit, RSSI_FLT_BASE, ®val, 1); /* Returns the OOK peak decay */ @@ -2524,7 +2524,7 @@ float spirit_radio_get_palevel_dbm(FAR struct spirit_library_s *spirit, /* Reads the PA_LEVEL[ndx] register */ - (void)spirit_reg_read(spirit, regaddr, &value, 1); + spirit_reg_read(spirit, regaddr, &value, 1); return spirit_radio_convert_reg2power(spirit, spirit_radio_get_basefrequency(spirit), @@ -2714,7 +2714,7 @@ uint8_t spirit_radio_get_palevel(FAR struct spirit_library_s *spirit, /* Reads the PA_LEVEL[ndx] register and return the value */ - (void)spirit_reg_read(spirit, regaddr, ®val, 1); + spirit_reg_read(spirit, regaddr, ®val, 1); return regval; } @@ -2791,7 +2791,7 @@ enum spirit_paload_capacitor_e /* Read the PA_POWER_0 register */ - (void)spirit_reg_read(spirit, PA_POWER0_BASE, ®val, 1); + spirit_reg_read(spirit, PA_POWER0_BASE, ®val, 1); /* Mask the CWC[1:0] field and return the value */ @@ -2862,7 +2862,7 @@ uint8_t spirit_radio_get_palevel_maxindex(FAR struct spirit_library_s *spirit) /* Read the PA_POWER_0 register */ - (void)spirit_reg_read(spirit, PA_POWER0_BASE, ®val, 1); + spirit_reg_read(spirit, PA_POWER0_BASE, ®val, 1); /* Mask the PA_LEVEL_MAX_INDEX[1:0] field and return the value */ @@ -2934,7 +2934,7 @@ uint8_t spirit_radio_get_pastep_width(FAR struct spirit_library_s *spirit) /* Read the PA_POWER_0 register */ - (void)spirit_reg_read(spirit, PA_POWER0_BASE, ®val, 1); + spirit_reg_read(spirit, PA_POWER0_BASE, ®val, 1); /* Mask the PA_RAMP_STEP_WIDTH[1:0] field and return the value */ @@ -3013,7 +3013,7 @@ enum spirit_functional_state_e /* Read the PA_POWER_0 register and configure the PA_RAMP_ENABLE field */ - (void)spirit_reg_read(spirit, PA_POWER0_BASE, ®val, 1); + spirit_reg_read(spirit, PA_POWER0_BASE, ®val, 1); /* Mask and return data */ @@ -3192,7 +3192,7 @@ enum spirit_afcmode_e /* Read the AFC_2 register */ - (void)spirit_reg_read(spirit, AFC2_BASE, ®val, 1); + spirit_reg_read(spirit, AFC2_BASE, ®val, 1); /* Mask the AFC Mode field and returns the value */ @@ -3261,7 +3261,7 @@ uint8_t spirit_radio_get_afcpdleakage(FAR struct spirit_library_s *spirit) /* Read the AFC_2 register */ - (void)spirit_reg_read(spirit, AFC2_BASE, ®val, 1); + spirit_reg_read(spirit, AFC2_BASE, ®val, 1); /* Mask the AFC PD leakage field and return the value */ @@ -3311,7 +3311,7 @@ uint8_t spirit_radio_get_afcfastperiod(FAR struct spirit_library_s *spirit) /* Read the AFC 1 register and return the value */ - (void)spirit_reg_read(spirit, AFC1_BASE, ®val, 1); + spirit_reg_read(spirit, AFC1_BASE, ®val, 1); return regval; } @@ -3381,7 +3381,7 @@ uint8_t spirit_radio_get_afcfastgain(FAR struct spirit_library_s *spirit) * value. */ - (void)spirit_reg_read(spirit, AFC0_BASE, ®val, 1); + spirit_reg_read(spirit, AFC0_BASE, ®val, 1); return ((regval & 0xf0) >> 4); } @@ -3450,7 +3450,7 @@ uint8_t spirit_radio_get_afclowgain(FAR struct spirit_library_s *spirit) * value. */ - (void)spirit_reg_read(spirit, AFC0_BASE, ®val, 1); + spirit_reg_read(spirit, AFC0_BASE, ®val, 1); return (regval & 0x0f); } @@ -3478,7 +3478,7 @@ int8_t spirit_radio_get_afccorrection(FAR struct spirit_library_s *spirit) * it. */ - (void)spirit_reg_read(spirit, AFC_CORR_BASE, ®val, 1); + spirit_reg_read(spirit, AFC_CORR_BASE, ®val, 1); return (int8_t)regval; } @@ -3643,7 +3643,7 @@ enum spirit_agcmode_e /* Read the AGCCTRL_0 register, mask the AGC Mode field and return the value */ - (void)spirit_reg_read(spirit, AGCCTRL0_BASE, ®val, 1); + spirit_reg_read(spirit, AGCCTRL0_BASE, ®val, 1); return (enum spirit_agcmode_e)(regval & 0x40); } @@ -3867,7 +3867,7 @@ uint16_t spirit_radio_get_agcmeasure_us(FAR struct spirit_library_s *spirit) /* Read the AGCCTRL_2 register */ - (void)spirit_reg_read(spirit, AGCCTRL2_BASE, &measure, 1); + spirit_reg_read(spirit, AGCCTRL2_BASE, &measure, 1); /* Mask the MEAS_TIME field */ @@ -3945,7 +3945,7 @@ uint8_t spirit_radio_get_agcmeasure(FAR struct spirit_library_s *spirit) * value. */ - (void)spirit_reg_read(spirit, AGCCTRL2_BASE, ®val, 1); + spirit_reg_read(spirit, AGCCTRL2_BASE, ®val, 1); return (regval & 0x0f); } @@ -4016,7 +4016,7 @@ uint8_t spirit_radio_get_agcholdtime_us(FAR struct spirit_library_s *spirit) /* Read the AGCCTRL_0 register */ - (void)spirit_reg_read(spirit, AGCCTRL0_BASE, ®val, 1); + spirit_reg_read(spirit, AGCCTRL0_BASE, ®val, 1); /* Mask the HOLD_TIME field */ @@ -4094,7 +4094,7 @@ uint8_t spirit_radio_get_agcholdtime(FAR struct spirit_library_s *spirit) * value. */ - (void)spirit_reg_read(spirit, AGCCTRL0_BASE, ®val, 1); + spirit_reg_read(spirit, AGCCTRL0_BASE, ®val, 1); return (regval & 0x3f); } @@ -4162,7 +4162,7 @@ uint8_t spirit_radio_get_agchighthres(FAR struct spirit_library_s *spirit) * value. */ - (void)spirit_reg_read(spirit, AGCCTRL1_BASE, ®val, 1); + spirit_reg_read(spirit, AGCCTRL1_BASE, ®val, 1); return ((regval & 0xf0) >> 4); } @@ -4230,7 +4230,7 @@ uint8_t spirit_radio_get_agclowthres(FAR struct spirit_library_s *spirit) * value. */ - (void)spirit_reg_read(spirit, AGCCTRL1_BASE, ®val, 1); + spirit_reg_read(spirit, AGCCTRL1_BASE, ®val, 1); return (regval & 0x0f); } @@ -4304,7 +4304,7 @@ enum spirit_clkrecmode_e * the value. */ - (void)spirit_reg_read(spirit, FDEV0_BASE, ®val, 1); + spirit_reg_read(spirit, FDEV0_BASE, ®val, 1); return (enum spirit_clkrecmode_e)(regval & 0x08); } @@ -4373,7 +4373,7 @@ uint8_t spirit_radio_get_clkrecgain(FAR struct spirit_library_s *spirit) * value. */ - (void)spirit_reg_read(spirit, CLOCKREC_BASE, ®val, 1); + spirit_reg_read(spirit, CLOCKREC_BASE, ®val, 1); return ((regval & 0xef) >> 5); } @@ -4441,7 +4441,7 @@ uint8_t spirit_radio_get_clkrecigain(FAR struct spirit_library_s *spirit) * value. */ - (void)spirit_reg_read(spirit, CLOCKREC_BASE, ®val, 1); + spirit_reg_read(spirit, CLOCKREC_BASE, ®val, 1); return (regval & 0x0f); } @@ -4515,7 +4515,7 @@ enum spirit_pstfltlen_e * value. */ - (void)spirit_reg_read(spirit, CLOCKREC_BASE, ®val, 1); + spirit_reg_read(spirit, CLOCKREC_BASE, ®val, 1); return (enum spirit_pstfltlen_e)(regval & 0x10); } @@ -4681,7 +4681,7 @@ enum spirit_functional_state_e { uint8_t regval; - (void)spirit_reg_read(spirit, SYNTH_CONFIG1_BASE, ®val, 1); + spirit_reg_read(spirit, SYNTH_CONFIG1_BASE, ®val, 1); if (((regval >> 7) & 0x1) != 0) { @@ -4759,7 +4759,7 @@ enum spirit_functional_state_e { uint8_t regval; - (void)spirit_reg_read(spirit, XO_RCO_TEST_BASE, ®val, 1); + spirit_reg_read(spirit, XO_RCO_TEST_BASE, ®val, 1); if (((regval >> 3) & 0x1) != 0) { diff --git a/drivers/wireless/spirit/lib/spirit_spi.c b/drivers/wireless/spirit/lib/spirit_spi.c index f084925a11..78e4650d9f 100644 --- a/drivers/wireless/spirit/lib/spirit_spi.c +++ b/drivers/wireless/spirit/lib/spirit_spi.c @@ -201,7 +201,7 @@ static void spirit_lock(FAR struct spi_dev_s *spi) * SPI bus */ - (void)SPI_LOCK(spi, true); + SPI_LOCK(spi, true); /* We have the lock. Now make sure that the SPI bus is configured for the * Spirit (it might have gotten configured for a different device while @@ -216,8 +216,8 @@ static void spirit_lock(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, SPIDEV_MODE0); SPI_SETBITS(spi, 8); - (void)SPI_HWFEATURES(spi, 0); - (void)SPI_SETFREQUENCY(spi, CONFIG_WL_SPIRIT_SPIFREQUENCY); + SPI_HWFEATURES(spi, 0); + SPI_SETFREQUENCY(spi, CONFIG_WL_SPIRIT_SPIFREQUENCY); } /****************************************************************************** @@ -241,7 +241,7 @@ static void spirit_unlock(FAR struct spi_dev_s *spi) { /* Relinquish the SPI bus. */ - (void)SPI_LOCK(spi, false); + SPI_LOCK(spi, false); } /****************************************************************************** @@ -427,7 +427,7 @@ int spirit_reg_modify(FAR struct spirit_library_s *spirit, uint8_t regaddr, /* Write the register value */ - (void)SPI_SEND(spirit->spi, regval); + SPI_SEND(spirit->spi, regval); /* Deselect the Spirit device and return the result */ diff --git a/drivers/wireless/spirit/lib/spirit_timer.c b/drivers/wireless/spirit/lib/spirit_timer.c index 713b75e2ef..c5bd86eab8 100644 --- a/drivers/wireless/spirit/lib/spirit_timer.c +++ b/drivers/wireless/spirit/lib/spirit_timer.c @@ -169,7 +169,7 @@ enum spirit_functional_state_e /* Reads the register value */ - (void)spirit_reg_read(spirit, PROTOCOL1_BASE, ®val, 1); + spirit_reg_read(spirit, PROTOCOL1_BASE, ®val, 1); return (enum spirit_functional_state_e)(regval & 0x80); } @@ -730,7 +730,7 @@ uint16_t spirit_timer_get_rcofrequency(FAR struct spirit_library_s *spirit) if (xtal_frequency == 25000000) { - (void)spirit_reg_read(spirit, 0x01, &xtal_flag, 1); + spirit_reg_read(spirit, 0x01, &xtal_flag, 1); xtal_flag = (xtal_flag & 0x40); if (xtal_flag == 0) diff --git a/fs/aio/aio_cancel.c b/fs/aio/aio_cancel.c index 65a86da10e..b8cd392e47 100644 --- a/fs/aio/aio_cancel.c +++ b/fs/aio/aio_cancel.c @@ -144,14 +144,14 @@ int aio_cancel(int fildes, FAR struct aiocb *aiocbp) /* Remove the container from the list of pending transfers */ pid = aioc->aioc_pid; - (void)aioc_decant(aioc); + aioc_decant(aioc); aiocbp->aio_result = -ECANCELED; ret = AIO_CANCELED; /* Signal the client */ - (void)aio_signal(pid, aiocbp); + aio_signal(pid, aiocbp); } else { @@ -211,7 +211,7 @@ int aio_cancel(int fildes, FAR struct aiocb *aiocbp) /* Signal the client */ - (void)aio_signal(pid, aiocbp); + aio_signal(pid, aiocbp); } else { diff --git a/fs/aio/aio_fsync.c b/fs/aio/aio_fsync.c index 29c08f16f7..687e8ef259 100644 --- a/fs/aio/aio_fsync.c +++ b/fs/aio/aio_fsync.c @@ -109,7 +109,7 @@ static void aio_fsync_worker(FAR void *arg) /* Signal the client */ - (void)aio_signal(pid, aiocbp); + aio_signal(pid, aiocbp); #ifdef CONFIG_PRIORITY_INHERITANCE /* Restore the low priority worker thread default priority */ diff --git a/fs/aio/aio_initialize.c b/fs/aio/aio_initialize.c index 8917c1c03a..0b892c77be 100644 --- a/fs/aio/aio_initialize.c +++ b/fs/aio/aio_initialize.c @@ -109,9 +109,9 @@ void aio_initialize(void) /* Initialize counting semaphores */ - (void)nxsem_init(&g_aioc_freesem, 0, CONFIG_FS_NAIOC); - (void)nxsem_setprotocol(&g_aioc_freesem, SEM_PRIO_NONE); - (void)nxsem_init(&g_aio_exclsem, 0, 1); + nxsem_init(&g_aioc_freesem, 0, CONFIG_FS_NAIOC); + nxsem_setprotocol(&g_aioc_freesem, SEM_PRIO_NONE); + nxsem_init(&g_aio_exclsem, 0, 1); g_aio_holder = INVALID_PROCESS_ID; @@ -159,21 +159,7 @@ void aio_lock(void) } else { - int ret; - - /* No.. take the semaphore */ - - do - { - ret = nxsem_wait(&g_aio_exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_aio_exclsem); /* And mark it as ours */ @@ -226,25 +212,12 @@ void aio_unlock(void) FAR struct aio_container_s *aioc_alloc(void) { FAR struct aio_container_s *aioc; - int ret; /* Take a count from semaphore, thus guaranteeing that we have an AIO * container set aside for us. */ - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_aioc_freesem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_aioc_freesem); /* Get our AIO container */ diff --git a/fs/aio/aio_read.c b/fs/aio/aio_read.c index 58ff62c915..52056e825d 100644 --- a/fs/aio/aio_read.c +++ b/fs/aio/aio_read.c @@ -137,7 +137,7 @@ static void aio_read_worker(FAR void *arg) /* Signal the client */ - (void)aio_signal(pid, aiocbp); + aio_signal(pid, aiocbp); #ifdef CONFIG_PRIORITY_INHERITANCE /* Restore the low priority worker thread default priority */ diff --git a/fs/aio/aio_write.c b/fs/aio/aio_write.c index c984da6dea..840b7e9228 100644 --- a/fs/aio/aio_write.c +++ b/fs/aio/aio_write.c @@ -164,7 +164,7 @@ errout: /* Signal the client */ - (void)aio_signal(pid, aiocbp); + aio_signal(pid, aiocbp); #ifdef CONFIG_PRIORITY_INHERITANCE /* Restore the low priority worker thread default priority */ diff --git a/fs/driver/fs_blockproxy.c b/fs/driver/fs_blockproxy.c index 1a8e246744..65141c2755 100644 --- a/fs/driver/fs_blockproxy.c +++ b/fs/driver/fs_blockproxy.c @@ -101,17 +101,7 @@ static FAR char *unique_chardev(void) { /* Get the semaphore protecting the path number */ - do - { - ret = nxsem_wait(&g_devno_sem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_devno_sem); /* Get the next device number and release the semaphore */ @@ -231,7 +221,7 @@ int block_proxy(FAR const char *blkdev, int oflags) return fd; errout_with_bchdev: - (void)unlink(chardev); + unlink(chardev); errout_with_chardev: kmm_free(chardev); diff --git a/fs/driver/fs_mtdproxy.c b/fs/driver/fs_mtdproxy.c index 01109b8221..c790b0ce27 100644 --- a/fs/driver/fs_mtdproxy.c +++ b/fs/driver/fs_mtdproxy.c @@ -96,17 +96,7 @@ static FAR char *unique_blkdev(void) { /* Get the semaphore protecting the path number */ - do - { - ret = nxsem_wait(&g_devno_sem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_devno_sem); /* Get the next device number and release the semaphore */ diff --git a/fs/fat/fs_fat32.c b/fs/fat/fs_fat32.c index 92e6416e89..705e504535 100644 --- a/fs/fat/fs_fat32.c +++ b/fs/fat/fs_fat32.c @@ -625,7 +625,7 @@ fat_read_restart: * the safest thing to do is just invalidate it */ - (void)fat_ffcacheinvalidate(fs, ff); + fat_ffcacheinvalidate(fs, ff); /* Read all of the sectors directly into user memory */ @@ -885,7 +885,7 @@ fat_write_restart: * and invalidate the current cache content. */ - (void)fat_ffcacheinvalidate(fs, ff); + fat_ffcacheinvalidate(fs, ff); /* Write all of the sectors directly from user memory */ @@ -1236,7 +1236,7 @@ static off_t fat_seek(FAR struct file *filep, off_t offset, int whence) * into the cluster from the position */ - (void)fat_currentsector(fs, ff, filep->f_pos); + fat_currentsector(fs, ff, filep->f_pos); /* Load the sector corresponding to the position */ @@ -2181,7 +2181,7 @@ static int fat_unbind(FAR void *handle, FAR struct inode **blkdriver, { if (inode->u.i_bops && inode->u.i_bops->close) { - (void)inode->u.i_bops->close(inode); + inode->u.i_bops->close(inode); } /* We hold a reference to the block driver but should not but diff --git a/fs/fat/fs_fat32dirent.c b/fs/fat/fs_fat32dirent.c index 71983f6a25..28235026fe 100644 --- a/fs/fat/fs_fat32dirent.c +++ b/fs/fat/fs_fat32dirent.c @@ -2261,7 +2261,7 @@ static int fat_putsfdirentry(struct fat_mountpt_s *fs, /* Directory name info */ - (void)fat_putsfname(fs, dirinfo); + fat_putsfname(fs, dirinfo); /* Set the attribute attribute, write time, creation time */ diff --git a/fs/fat/fs_fat32util.c b/fs/fat/fs_fat32util.c index f2881693fe..0b718fc9cf 100644 --- a/fs/fat/fs_fat32util.c +++ b/fs/fat/fs_fat32util.c @@ -368,21 +368,7 @@ void fat_putuint32(FAR uint8_t *ptr, uint32_t value32) void fat_semtake(struct fat_mountpt_s *fs) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&fs->fs_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&fs->fs_sem); } /**************************************************************************** diff --git a/fs/hostfs/hostfs.c b/fs/hostfs/hostfs.c index 09093ac7cd..4dff06d995 100644 --- a/fs/hostfs/hostfs.c +++ b/fs/hostfs/hostfs.c @@ -175,21 +175,7 @@ const struct mountpt_operations hostfs_operations = void hostfs_semtake(FAR struct hostfs_mountpt_s *fs) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(fs->fs_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(fs->fs_sem); } /**************************************************************************** diff --git a/fs/hostfs/hostfs_rpmsg.c b/fs/hostfs/hostfs_rpmsg.c index afbe8abaef..5855f4e690 100644 --- a/fs/hostfs/hostfs_rpmsg.c +++ b/fs/hostfs/hostfs_rpmsg.c @@ -333,18 +333,10 @@ static int hostfs_rpmsg_send_recv(uint32_t command, bool copy, goto fail; } - while (1) + ret = nxsem_wait_uninterruptible(&cookie.sem); + if (ret == 0) { - ret = nxsem_wait(&cookie.sem); - if (ret != -EINTR) - { - if (ret == 0) - { - ret = cookie.result; - } - - break; - } + ret = cookie.result; } fail: diff --git a/fs/inode/fs_filedetach.c b/fs/inode/fs_filedetach.c index 601e9da2cc..58722a3512 100644 --- a/fs/inode/fs_filedetach.c +++ b/fs/inode/fs_filedetach.c @@ -58,21 +58,7 @@ static inline void _files_semtake(FAR struct filelist *list) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&list->fl_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&list->fl_sem); } /**************************************************************************** diff --git a/fs/inode/fs_fileopen.c b/fs/inode/fs_fileopen.c index df8b12253b..a7b6aa63cf 100644 --- a/fs/inode/fs_fileopen.c +++ b/fs/inode/fs_fileopen.c @@ -102,7 +102,7 @@ int file_open(FAR struct file *filep, FAR const char *path, int oflags, ...) ret = file_detach(fd, filep); if (ret < 0) { - (void)close(fd); + close(fd); return ret; } diff --git a/fs/inode/fs_files.c b/fs/inode/fs_files.c index b32d3fcb1e..58bab7a74a 100644 --- a/fs/inode/fs_files.c +++ b/fs/inode/fs_files.c @@ -62,21 +62,7 @@ static void _files_semtake(FAR struct filelist *list) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&list->fl_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&list->fl_sem); } /**************************************************************************** @@ -157,7 +143,7 @@ void files_initlist(FAR struct filelist *list) /* Initialize the list access mutex */ - (void)nxsem_init(&list->fl_sem, 0, 1); + nxsem_init(&list->fl_sem, 0, 1); } /**************************************************************************** @@ -181,12 +167,12 @@ void files_releaselist(FAR struct filelist *list) for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { - (void)_files_close(&list->fl_files[i]); + _files_close(&list->fl_files[i]); } /* Destroy the semaphore */ - (void)nxsem_destroy(&list->fl_sem); + nxsem_destroy(&list->fl_sem); } /**************************************************************************** diff --git a/fs/inode/fs_inode.c b/fs/inode/fs_inode.c index 9dbeb1783c..5c9423df39 100644 --- a/fs/inode/fs_inode.c +++ b/fs/inode/fs_inode.c @@ -99,7 +99,7 @@ void inode_initialize(void) * inode tree). */ - (void)nxsem_init(&g_inode_sem.sem, 0, 1); + nxsem_init(&g_inode_sem.sem, 0, 1); g_inode_sem.holder = NO_HOLDER; g_inode_sem.count = 0; @@ -140,19 +140,7 @@ void inode_semtake(void) else { - int ret; - - do - { - ret = nxsem_wait(&g_inode_sem.sem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_inode_sem.sem); /* No we hold the semaphore */ diff --git a/fs/inode/fs_inodesearch.c b/fs/inode/fs_inodesearch.c index a53508baa7..8740d36875 100644 --- a/fs/inode/fs_inodesearch.c +++ b/fs/inode/fs_inodesearch.c @@ -553,8 +553,8 @@ int inode_search(FAR struct inode_search_s *desc) if (desc->relpath != NULL && *desc->relpath != '\0') { - (void)asprintf(&buffer, "%s/%s", - desc->linktgt, desc->relpath); + asprintf(&buffer, "%s/%s", + desc->linktgt, desc->relpath); } else { diff --git a/fs/littlefs/lfs_vfs.c b/fs/littlefs/lfs_vfs.c index a3017baaf8..eb09210eb0 100644 --- a/fs/littlefs/lfs_vfs.c +++ b/fs/littlefs/lfs_vfs.c @@ -188,21 +188,7 @@ const struct mountpt_operations littlefs_operations = static void littlefs_semtake(FAR struct littlefs_mountpt_s *fs) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&fs->sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&fs->sem); } /**************************************************************************** diff --git a/fs/mount/fs_automount.c b/fs/mount/fs_automount.c index 58e5bb2779..52d69a2722 100644 --- a/fs/mount/fs_automount.c +++ b/fs/mount/fs_automount.c @@ -429,7 +429,7 @@ static void automount_worker(FAR void *arg) { /* We are unmounting */ - (void)automount_unmount(priv); + automount_unmount(priv); } /* Re-enable interrupts */ @@ -476,7 +476,7 @@ static int automount_interrupt(FAR const struct automount_lower_s *lower, * there is no work to be canceled. No other errors are expected. */ - (void)work_cancel(LPWORK, &priv->work); + work_cancel(LPWORK, &priv->work); /* Set the media insertion/removal state */ @@ -502,7 +502,7 @@ static int automount_interrupt(FAR const struct automount_lower_s *lower, { /* Cancel any retry delays */ - (void)wd_cancel(priv->wdog); + wd_cancel(priv->wdog); } return OK; @@ -617,11 +617,11 @@ void automount_uninitialize(FAR void *handle) /* Disable and detach interrupts */ AUTOMOUNT_DISABLE(lower); - (void)AUTOMOUNT_DETACH(lower); + AUTOMOUNT_DETACH(lower); /* Release resources */ - (void)wd_delete(priv->wdog); + wd_delete(priv->wdog); /* And free the state structure */ diff --git a/fs/mount/fs_procfs_mount.c b/fs/mount/fs_procfs_mount.c index f27867c2d5..f2e0eca11b 100644 --- a/fs/mount/fs_procfs_mount.c +++ b/fs/mount/fs_procfs_mount.c @@ -532,7 +532,7 @@ static ssize_t mount_read(FAR struct file *filep, FAR char *buffer, /* Generate each entry in the routing table */ - (void)foreach_mountpoint(handler, &info); + foreach_mountpoint(handler, &info); ret = info.totalsize; /* Update the file offset */ diff --git a/fs/nfs/nfs_util.c b/fs/nfs/nfs_util.c index 6c022b750e..c2c2e26066 100644 --- a/fs/nfs/nfs_util.c +++ b/fs/nfs/nfs_util.c @@ -128,21 +128,7 @@ static inline int nfs_pathsegment(FAR const char **path, FAR char *buffer, void nfs_semtake(struct nfsmount *nmp) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&nmp->nm_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&nmp->nm_sem); } /**************************************************************************** diff --git a/fs/nfs/nfs_vfsops.c b/fs/nfs/nfs_vfsops.c index f134b5617e..c02fd8e595 100644 --- a/fs/nfs/nfs_vfsops.c +++ b/fs/nfs/nfs_vfsops.c @@ -2226,7 +2226,7 @@ static int nfs_statfs(FAR struct inode *mountpt, FAR struct statfs *sbp) sbp->f_type = NFS_SUPER_MAGIC; - (void)nfs_fsinfo(nmp); + nfs_fsinfo(nmp); fsstat = &nmp->nm_msgbuffer.fsstat; fsstat->fs.fsroot.length = txdr_unsigned(nmp->nm_fhsize); diff --git a/fs/nfs/rpc_clnt.c b/fs/nfs/rpc_clnt.c index 279f8fcf1d..a8d7c593e9 100644 --- a/fs/nfs/rpc_clnt.c +++ b/fs/nfs/rpc_clnt.c @@ -584,7 +584,7 @@ void rpcclnt_disconnect(struct rpcclnt *rpc) { if (rpc->rc_so != NULL) { - (void)psock_close(rpc->rc_so); + psock_close(rpc->rc_so); } } diff --git a/fs/procfs/fs_procfsmeminfo.c b/fs/procfs/fs_procfsmeminfo.c index e681baefa5..2a9d4bbe69 100644 --- a/fs/procfs/fs_procfsmeminfo.c +++ b/fs/procfs/fs_procfsmeminfo.c @@ -315,7 +315,7 @@ static ssize_t meminfo_read(FAR struct file *filep, FAR char *buffer, #ifdef CONFIG_CAN_PASS_STRUCTS mem = kmm_mallinfo(); #else - (void)kmm_mallinfo(&mem); + kmm_mallinfo(&mem); #endif linesize = snprintf(procfile->line, MEMINFO_LINELEN, @@ -341,7 +341,7 @@ static ssize_t meminfo_read(FAR struct file *filep, FAR char *buffer, #ifdef CONFIG_CAN_PASS_STRUCTS mem = kumm_mallinfo(); #else - (void)kumm_mallinfo(&mem); + kumm_mallinfo(&mem); #endif linesize = snprintf(procfile->line, MEMINFO_LINELEN, diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c index 42d8e5b517..88f4d9c973 100644 --- a/fs/procfs/fs_procfsproc.c +++ b/fs/procfs/fs_procfsproc.c @@ -745,7 +745,7 @@ static ssize_t proc_loadavg(FAR struct proc_file_s *procfile, * after the procfs entry was opened. */ - (void)clock_cpuload(procfile->pid, &cpuload); + clock_cpuload(procfile->pid, &cpuload); /* On the simulator, you may hit cpuload.total == 0, but probably never on * real hardware. @@ -1255,7 +1255,7 @@ static ssize_t proc_groupenv(FAR struct proc_file_s *procfile, /* Generate output for each environment variable */ - (void)env_foreach(group, proc_groupenv_callback, &info); + env_foreach(group, proc_groupenv_callback, &info); return info.totalsize; } #endif diff --git a/fs/romfs/fs_romfs.c b/fs/romfs/fs_romfs.c index 16b3d078ec..81c8630abe 100644 --- a/fs/romfs/fs_romfs.c +++ b/fs/romfs/fs_romfs.c @@ -1086,7 +1086,7 @@ static int romfs_unbind(FAR void *handle, FAR struct inode **blkdriver, { if (INODE_IS_BLOCK(inode) && inode->u.i_bops->close != NULL) { - (void)inode->u.i_bops->close(inode); + inode->u.i_bops->close(inode); } /* We hold a reference to the block driver but should diff --git a/fs/romfs/fs_romfsutil.c b/fs/romfs/fs_romfsutil.c index f69c01e515..fa500fcbe6 100644 --- a/fs/romfs/fs_romfsutil.c +++ b/fs/romfs/fs_romfsutil.c @@ -332,21 +332,7 @@ static inline int romfs_searchdir(struct romfs_mountpt_s *rm, void romfs_semtake(struct romfs_mountpt_s *rm) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&rm->rm_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&rm->rm_sem); } /**************************************************************************** diff --git a/fs/smartfs/smartfs_utils.c b/fs/smartfs/smartfs_utils.c index c76f55fc8e..8731f7b3f6 100644 --- a/fs/smartfs/smartfs_utils.c +++ b/fs/smartfs/smartfs_utils.c @@ -75,21 +75,7 @@ static struct smartfs_mountpt_s *g_mounthead = NULL; void smartfs_semtake(struct smartfs_mountpt_s *fs) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(fs->fs_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(fs->fs_sem); } /**************************************************************************** @@ -415,7 +401,7 @@ int smartfs_unmount(struct smartfs_mountpt_s *fs) { if (inode->u.i_bops && inode->u.i_bops->close) { - (void)inode->u.i_bops->close(inode); + inode->u.i_bops->close(inode); } } } @@ -453,7 +439,7 @@ int smartfs_unmount(struct smartfs_mountpt_s *fs) { if (inode->u.i_bops && inode->u.i_bops->close) { - (void)inode->u.i_bops->close(inode); + inode->u.i_bops->close(inode); } } } @@ -1914,7 +1900,7 @@ int smartfs_extendfile(FAR struct smartfs_mountpt_s *fs, */ savepos = sf->filepos; - (void)smartfs_seek_internal(fs, sf, 0, SEEK_END); + smartfs_seek_internal(fs, sf, 0, SEEK_END); while (remaining > 0) { @@ -2091,7 +2077,7 @@ errout_with_buffer: #endif /* Restore the original file position */ - (void)smartfs_seek_internal(fs, sf, savepos, SEEK_SET); + smartfs_seek_internal(fs, sf, savepos, SEEK_SET); return ret; } diff --git a/fs/spiffs/src/spiffs_core.c b/fs/spiffs/src/spiffs_core.c index b95e0855f2..29c13082a2 100644 --- a/fs/spiffs/src/spiffs_core.c +++ b/fs/spiffs/src/spiffs_core.c @@ -755,7 +755,7 @@ int spiffs_erase_block(FAR struct spiffs_s *fs, int16_t blkndx) finfo("erase %08lx:%d\n", (unsigned long)addr, SPIFFS_GEO_EBLOCK_SIZE(fs)); - (void)spiffs_mtd_erase(fs, addr, SPIFFS_GEO_EBLOCK_SIZE(fs)); + spiffs_mtd_erase(fs, addr, SPIFFS_GEO_EBLOCK_SIZE(fs)); addr += SPIFFS_GEO_EBLOCK_SIZE(fs); size -= SPIFFS_GEO_EBLOCK_SIZE(fs); diff --git a/fs/spiffs/src/spiffs_vfs.c b/fs/spiffs/src/spiffs_vfs.c index 09e2253e78..1befd98fca 100644 --- a/fs/spiffs/src/spiffs_vfs.c +++ b/fs/spiffs/src/spiffs_vfs.c @@ -195,19 +195,7 @@ static void spiffs_lock_reentrant(FAR struct spiffs_sem_s *rsem) else { - int ret; - - do - { - ret = nxsem_wait(&rsem->sem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret >= 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&rsem->sem); /* No we hold the semaphore */ @@ -1447,7 +1435,7 @@ static int spiffs_bind(FAR struct inode *mtdinode, FAR const void *data, fs->lu_work = &work[SPIFFS_GEO_PAGE_SIZE(fs)]; fs->mtd_work = &work[2 * SPIFFS_GEO_PAGE_SIZE(fs)]; - (void)nxsem_init(&fs->exclsem.sem, 0, 1); + nxsem_init(&fs->exclsem.sem, 0, 1); /* Check the file system */ diff --git a/fs/tmpfs/fs_tmpfs.c b/fs/tmpfs/fs_tmpfs.c index 00d61c055e..5700a9fff2 100644 --- a/fs/tmpfs/fs_tmpfs.c +++ b/fs/tmpfs/fs_tmpfs.c @@ -228,19 +228,7 @@ static void tmpfs_lock_reentrant(FAR struct tmpfs_sem_s *sem) else { - int ret; - - do - { - ret = nxsem_wait(&sem->ts_sem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&sem->ts_sem); /* No we hold the semaphore */ diff --git a/fs/unionfs/fs_unionfs.c b/fs/unionfs/fs_unionfs.c index 08f062df18..7b57eb7805 100644 --- a/fs/unionfs/fs_unionfs.c +++ b/fs/unionfs/fs_unionfs.c @@ -253,23 +253,14 @@ const struct mountpt_operations unionfs_operations = static int unionfs_semtake(FAR struct unionfs_inode_s *ui, bool noint) { - int ret; - - do + if (noint) { - ret = nxsem_wait(&ui->ui_exclsem); - if (ret < 0) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - if (!noint) - { - return ret; - } - } + return nxsem_wait_uninterruptible(&ui->ui_exclsem); + } + else + { + return nxsem_wait(&ui->ui_exclsem); } - while (ret == -EINTR); - - return ret; } /**************************************************************************** @@ -814,8 +805,8 @@ static void unionfs_destroy(FAR struct unionfs_inode_s *ui) /* Unbind the contained file systems */ - (void)unionfs_unbind_child(&ui->ui_fs[0]); - (void)unionfs_unbind_child(&ui->ui_fs[1]); + unionfs_unbind_child(&ui->ui_fs[0]); + unionfs_unbind_child(&ui->ui_fs[1]); /* Free any allocated prefix strings */ @@ -946,7 +937,7 @@ static int unionfs_close(FAR struct file *filep) /* Get exclusive access to the file system data structures */ - (void)unionfs_semtake(ui, false); + unionfs_semtake(ui, false); DEBUGASSERT(ui != NULL && filep->f_priv != NULL); uf = (FAR struct unionfs_file_s *)filep->f_priv; @@ -1620,7 +1611,7 @@ static int unionfs_closedir(FAR struct inode *mountpt, /* Get exclusive access to the file system data structures */ - (void)unionfs_semtake(ui, true); + unionfs_semtake(ui, true); DEBUGASSERT(dir); fu = &dir->u.unionfs; @@ -2075,7 +2066,7 @@ static int unionfs_unbind(FAR void *handle, FAR struct inode **blkdriver, /* Get exclusive access to the file system data structures */ - (void)unionfs_semtake(ui, true); + unionfs_semtake(ui, true); /* Mark the file system as unmounted. */ @@ -2754,8 +2745,8 @@ static int unionfs_dobind(FAR const char *fspath1, FAR const char *prefix1, * this logic calls inode_release() in the unionfs_destroy() function. */ - (void)inode_remove(fspath1); - (void)inode_remove(fspath2); + inode_remove(fspath1); + inode_remove(fspath2); *handle = ui; return OK; diff --git a/fs/userfs/fs_userfs.c b/fs/userfs/fs_userfs.c index c80b1ba7bb..2bcadf6cdd 100644 --- a/fs/userfs/fs_userfs.c +++ b/fs/userfs/fs_userfs.c @@ -222,7 +222,7 @@ static int userfs_open(FAR struct file *filep, FAR const char *relpath, /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -244,7 +244,7 @@ static int userfs_open(FAR struct file *filep, FAR const char *relpath, if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -252,7 +252,7 @@ static int userfs_open(FAR struct file *filep, FAR const char *relpath, nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -299,7 +299,7 @@ static int userfs_close(FAR struct file *filep) /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -318,7 +318,7 @@ static int userfs_close(FAR struct file *filep) if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -326,7 +326,7 @@ static int userfs_close(FAR struct file *filep) nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -379,7 +379,7 @@ static ssize_t userfs_read(FAR struct file *filep, char *buffer, /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -399,7 +399,7 @@ static ssize_t userfs_read(FAR struct file *filep, char *buffer, if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -407,7 +407,7 @@ static ssize_t userfs_read(FAR struct file *filep, char *buffer, nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -479,7 +479,7 @@ static ssize_t userfs_write(FAR struct file *filep, FAR const char *buffer, /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -500,7 +500,7 @@ static ssize_t userfs_write(FAR struct file *filep, FAR const char *buffer, if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -508,7 +508,7 @@ static ssize_t userfs_write(FAR struct file *filep, FAR const char *buffer, nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -554,7 +554,7 @@ static off_t userfs_seek(FAR struct file *filep, off_t offset, int whence) /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -575,7 +575,7 @@ static off_t userfs_seek(FAR struct file *filep, off_t offset, int whence) if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -583,7 +583,7 @@ static off_t userfs_seek(FAR struct file *filep, off_t offset, int whence) nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -629,7 +629,7 @@ static int userfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -650,7 +650,7 @@ static int userfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -658,7 +658,7 @@ static int userfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -702,7 +702,7 @@ static int userfs_sync(FAR struct file *filep) /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -721,7 +721,7 @@ static int userfs_sync(FAR struct file *filep) if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -729,7 +729,7 @@ static int userfs_sync(FAR struct file *filep) nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -779,7 +779,7 @@ static int userfs_dup(FAR const struct file *oldp, FAR struct file *newp) /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -798,7 +798,7 @@ static int userfs_dup(FAR const struct file *oldp, FAR struct file *newp) if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -806,7 +806,7 @@ static int userfs_dup(FAR const struct file *oldp, FAR struct file *newp) nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -856,7 +856,7 @@ static int userfs_fstat(FAR const struct file *filep, FAR struct stat *buf) /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -875,7 +875,7 @@ static int userfs_fstat(FAR const struct file *filep, FAR struct stat *buf) if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -883,7 +883,7 @@ static int userfs_fstat(FAR const struct file *filep, FAR struct stat *buf) nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -935,7 +935,7 @@ static int userfs_truncate(FAR struct file *filep, off_t length) /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -955,7 +955,7 @@ static int userfs_truncate(FAR struct file *filep, off_t length) if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -963,7 +963,7 @@ static int userfs_truncate(FAR struct file *filep, off_t length) nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -1025,7 +1025,7 @@ static int userfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -1045,7 +1045,7 @@ static int userfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -1053,7 +1053,7 @@ static int userfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -1105,7 +1105,7 @@ static int userfs_closedir(FAR struct inode *mountpt, /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -1124,7 +1124,7 @@ static int userfs_closedir(FAR struct inode *mountpt, if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -1132,7 +1132,7 @@ static int userfs_closedir(FAR struct inode *mountpt, nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -1179,7 +1179,7 @@ static int userfs_readdir(FAR struct inode *mountpt, /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -1198,7 +1198,7 @@ static int userfs_readdir(FAR struct inode *mountpt, if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -1206,7 +1206,7 @@ static int userfs_readdir(FAR struct inode *mountpt, nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -1257,7 +1257,7 @@ static int userfs_rewinddir(FAR struct inode *mountpt, /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -1276,7 +1276,7 @@ static int userfs_rewinddir(FAR struct inode *mountpt, if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -1284,7 +1284,7 @@ static int userfs_rewinddir(FAR struct inode *mountpt, nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -1345,7 +1345,7 @@ static int userfs_bind(FAR struct inode *blkdriver, FAR const void *data, * the entire request-response sequence. */ - sem_init(&priv->exclsem, 0, 1); + nxsem_init(&priv->exclsem, 0, 1); /* Copy the configuration data into the allocated structure. Why? First * we can't be certain of the life time of the memory underlying the config @@ -1423,7 +1423,7 @@ static int userfs_unbind(FAR void *handle, FAR struct inode **blkdriver, /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -1441,7 +1441,7 @@ static int userfs_unbind(FAR void *handle, FAR struct inode **blkdriver, if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -1449,7 +1449,7 @@ static int userfs_unbind(FAR void *handle, FAR struct inode **blkdriver, nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -1507,7 +1507,7 @@ static int userfs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf) /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -1525,7 +1525,7 @@ static int userfs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf) if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -1533,7 +1533,7 @@ static int userfs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf) nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -1595,7 +1595,7 @@ static int userfs_unlink(FAR struct inode *mountpt, /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -1615,7 +1615,7 @@ static int userfs_unlink(FAR struct inode *mountpt, if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -1623,7 +1623,7 @@ static int userfs_unlink(FAR struct inode *mountpt, nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -1681,7 +1681,7 @@ static int userfs_mkdir(FAR struct inode *mountpt, /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -1702,7 +1702,7 @@ static int userfs_mkdir(FAR struct inode *mountpt, if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -1710,7 +1710,7 @@ static int userfs_mkdir(FAR struct inode *mountpt, nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -1768,7 +1768,7 @@ static int userfs_rmdir(FAR struct inode *mountpt, /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -1788,7 +1788,7 @@ static int userfs_rmdir(FAR struct inode *mountpt, if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -1796,7 +1796,7 @@ static int userfs_rmdir(FAR struct inode *mountpt, nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -1858,7 +1858,7 @@ static int userfs_rename(FAR struct inode *mountpt, /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -1880,7 +1880,7 @@ static int userfs_rename(FAR struct inode *mountpt, if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -1888,7 +1888,7 @@ static int userfs_rename(FAR struct inode *mountpt, nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { @@ -1946,7 +1946,7 @@ static int userfs_stat(FAR struct inode *mountpt, FAR const char *relpath, /* Get exclusive access */ - ret = sem_wait(&priv->exclsem); + ret = nxsem_wait(&priv->exclsem); if (ret < 0) { return ret; @@ -1966,7 +1966,7 @@ static int userfs_stat(FAR struct inode *mountpt, FAR const char *relpath, if (nsent < 0) { ferr("ERROR: psock_sendto failed: %d\n", (int)nsent); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); return (int)nsent; } @@ -1974,7 +1974,7 @@ static int userfs_stat(FAR struct inode *mountpt, FAR const char *relpath, nrecvd = psock_recvfrom(&priv->psock, priv->iobuffer, IOBUFFER_SIZE(priv), 0, NULL, NULL); - sem_post(&priv->exclsem); + nxsem_post(&priv->exclsem); if (nrecvd < 0) { diff --git a/fs/vfs/fs_close.c b/fs/vfs/fs_close.c index 9a5b59dd38..6425a2ce8b 100644 --- a/fs/vfs/fs_close.c +++ b/fs/vfs/fs_close.c @@ -86,7 +86,7 @@ int close(int fd) /* close() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Did we get a valid file descriptor? */ diff --git a/fs/vfs/fs_fcntl.c b/fs/vfs/fs_fcntl.c index aac679b042..e8555496ad 100644 --- a/fs/vfs/fs_fcntl.c +++ b/fs/vfs/fs_fcntl.c @@ -285,7 +285,7 @@ int fcntl(int fd, int cmd, ...) /* fcntl() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Setup to access the variable argument list */ diff --git a/fs/vfs/fs_fdopen.c b/fs/vfs/fs_fdopen.c index c660570af4..f054d51938 100644 --- a/fs/vfs/fs_fdopen.c +++ b/fs/vfs/fs_fdopen.c @@ -222,7 +222,7 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb) #ifndef CONFIG_STDIO_DISABLE_BUFFERING /* Initialize the semaphore the manages access to the buffer */ - (void)nxsem_init(&stream->fs_sem, 0, 1); + nxsem_init(&stream->fs_sem, 0, 1); #if CONFIG_STDIO_BUFFER_SIZE > 0 /* Allocate the IO buffer at the appropriate privilege level for diff --git a/fs/vfs/fs_fsync.c b/fs/vfs/fs_fsync.c index c2783dc436..2e85fa022e 100644 --- a/fs/vfs/fs_fsync.c +++ b/fs/vfs/fs_fsync.c @@ -110,7 +110,7 @@ int fsync(int fd) /* fsync() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Get the file structure corresponding to the file descriptor. */ diff --git a/fs/vfs/fs_open.c b/fs/vfs/fs_open.c index 0516b5db6e..5193c4b97f 100644 --- a/fs/vfs/fs_open.c +++ b/fs/vfs/fs_open.c @@ -339,7 +339,7 @@ int open(FAR const char *path, int oflags, ...) /* open() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Let nx_vopen() do most of the work */ diff --git a/fs/vfs/fs_poll.c b/fs/vfs/fs_poll.c index 68ab040696..4781347dbf 100644 --- a/fs/vfs/fs_poll.c +++ b/fs/vfs/fs_poll.c @@ -72,18 +72,7 @@ static int poll_semtake(FAR sem_t *sem) { - int ret; - - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait were - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - return ret; + return nxsem_wait(sem); } /**************************************************************************** @@ -204,16 +193,16 @@ static inline int poll_setup(FAR struct pollfd *fds, nfds_t nfds, switch (fds[j].events & POLLMASK) { case POLLFD: - (void)poll_fdsetup(fds[j].fd, &fds[j], false); + poll_fdsetup(fds[j].fd, &fds[j], false); break; case POLLFILE: - (void)file_poll(fds[j].ptr, &fds[j], false); + file_poll(fds[j].ptr, &fds[j], false); break; #ifdef CONFIG_NET case POLLSOCK: - (void)psock_poll(fds[j].ptr, &fds[j], false); + psock_poll(fds[j].ptr, &fds[j], false); break; #endif @@ -452,7 +441,7 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout) /* poll() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* This semaphore is used for signaling and, hence, should not have * priority inheritance enabled. diff --git a/fs/vfs/fs_pread.c b/fs/vfs/fs_pread.c index cb54ed3d2b..044eef29d5 100644 --- a/fs/vfs/fs_pread.c +++ b/fs/vfs/fs_pread.c @@ -143,7 +143,7 @@ ssize_t pread(int fd, FAR void *buf, size_t nbytes, off_t offset) /* pread() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Get the file structure corresponding to the file descriptor. */ diff --git a/fs/vfs/fs_pwrite.c b/fs/vfs/fs_pwrite.c index 5364985f90..aaf4997e77 100644 --- a/fs/vfs/fs_pwrite.c +++ b/fs/vfs/fs_pwrite.c @@ -146,7 +146,7 @@ ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset) /* pread() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Get the file structure corresponding to the file descriptor. */ diff --git a/fs/vfs/fs_read.c b/fs/vfs/fs_read.c index c1c3bbab8c..9422183f2e 100644 --- a/fs/vfs/fs_read.c +++ b/fs/vfs/fs_read.c @@ -199,7 +199,7 @@ ssize_t read(int fd, FAR void *buf, size_t nbytes) /* read() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Let nx_read() do the real work */ diff --git a/fs/vfs/fs_readlink.c b/fs/vfs/fs_readlink.c index 77b4afa9a1..8b287b443e 100644 --- a/fs/vfs/fs_readlink.c +++ b/fs/vfs/fs_readlink.c @@ -122,7 +122,7 @@ ssize_t readlink(FAR const char *path, FAR char *buf, size_t bufsize) /* Copy the link target pathto the user-provided buffer. */ *buf = '\0'; - (void)strncpy(buf, node->u.i_link, bufsize); + strncpy(buf, node->u.i_link, bufsize); /* Release our reference on the inode and return the length */ diff --git a/fs/vfs/fs_rename.c b/fs/vfs/fs_rename.c index ec54a66687..e610f326d2 100644 --- a/fs/vfs/fs_rename.c +++ b/fs/vfs/fs_rename.c @@ -115,7 +115,7 @@ static int pseudorename(FAR const char *oldpath, FAR struct inode *oldinode, subdirname = basename((FAR char *)oldpath); - (void)asprintf(&subdir, "/%s", subdirname); + asprintf(&subdir, "/%s", subdirname); if (subdir == NULL) { ret = -ENOMEM; @@ -179,7 +179,7 @@ next_subdir: tmp = subdir; subdir = NULL; - (void)asprintf(&subdir, "%s/%s", newpath, subdirname); + asprintf(&subdir, "%s/%s", newpath, subdirname); if (tmp != NULL) { @@ -213,7 +213,7 @@ next_subdir: * won't really be removed until we call inode_release(); */ - (void)inode_remove(newpath); + inode_remove(newpath); } inode_release(newinode); @@ -274,7 +274,7 @@ next_subdir: { /* Remove the new node we just recreated */ - (void)inode_remove(newpath); + inode_remove(newpath); goto errout_with_sem; } @@ -415,8 +415,8 @@ next_subdir: FAR char *tmp = subdir; subdir = NULL; - (void)asprintf(&subdir, "%s/%s", newrelpath, - subdirname); + asprintf(&subdir, "%s/%s", newrelpath, + subdirname); if (tmp != NULL) { @@ -450,7 +450,7 @@ next_subdir: * should check that. */ - (void)oldinode->u.i_mops->unlink(oldinode, newrelpath); + oldinode->u.i_mops->unlink(oldinode, newrelpath); } } } diff --git a/fs/vfs/fs_select.c b/fs/vfs/fs_select.c index 1acd40d0fe..86fdc5aa61 100644 --- a/fs/vfs/fs_select.c +++ b/fs/vfs/fs_select.c @@ -103,7 +103,7 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds, /* select() is cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* How many pollfd structures do we need to allocate? */ diff --git a/fs/vfs/fs_write.c b/fs/vfs/fs_write.c index 9085244904..d99ed2d173 100644 --- a/fs/vfs/fs_write.c +++ b/fs/vfs/fs_write.c @@ -232,7 +232,7 @@ ssize_t write(int fd, FAR const void *buf, size_t nbytes) /* write() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Let nx_write() do all of the work */ diff --git a/graphics/nxglib/lcd/nxglib_copyrectangle.c b/graphics/nxglib/lcd/nxglib_copyrectangle.c index 69b973d7f7..40213ec087 100644 --- a/graphics/nxglib/lcd/nxglib_copyrectangle.c +++ b/graphics/nxglib/lcd/nxglib_copyrectangle.c @@ -100,7 +100,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX) if (remainder != 0) { NXGL_FUNCNAME(nxgl_copyrun, NXGLIB_SUFFIX)(sline, pinfo->buffer, remainder, ncols); - (void)pinfo->putrun(row, dest->pt1.x, pinfo->buffer, ncols); + pinfo->putrun(row, dest->pt1.x, pinfo->buffer, ncols); } else #endif @@ -109,7 +109,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX) * the image memory. */ - (void)pinfo->putrun(row, dest->pt1.x, sline, ncols); + pinfo->putrun(row, dest->pt1.x, sline, ncols); } /* Then adjust the source pointer to refer to the next line in the source diff --git a/graphics/nxglib/lcd/nxglib_fillrectangle.c b/graphics/nxglib/lcd/nxglib_fillrectangle.c index bcef2c1502..28be11fa63 100644 --- a/graphics/nxglib/lcd/nxglib_fillrectangle.c +++ b/graphics/nxglib/lcd/nxglib_fillrectangle.c @@ -90,6 +90,6 @@ void NXGL_FUNCNAME(nxgl_fillrectangle, NXGLIB_SUFFIX) { /* Draw the raster line at this row */ - (void)pinfo->putrun(row, rect->pt1.x, pinfo->buffer, ncols); + pinfo->putrun(row, rect->pt1.x, pinfo->buffer, ncols); } } diff --git a/graphics/nxglib/lcd/nxglib_filltrapezoid.c b/graphics/nxglib/lcd/nxglib_filltrapezoid.c index 5da7418b2b..1d460fd6e9 100644 --- a/graphics/nxglib/lcd/nxglib_filltrapezoid.c +++ b/graphics/nxglib/lcd/nxglib_filltrapezoid.c @@ -232,7 +232,7 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX) /* Then draw the run from ix1 to ix2 at row */ ncols = ix2 - ix1 + 1; - (void)pinfo->putrun(row, ix1, pinfo->buffer, ncols); + pinfo->putrun(row, ix1, pinfo->buffer, ncols); } /* Add the dx/dy value to get the run positions on the next row */ diff --git a/graphics/nxglib/lcd/nxglib_getrectangle.c b/graphics/nxglib/lcd/nxglib_getrectangle.c index 129a7dc5ed..1eb927375c 100644 --- a/graphics/nxglib/lcd/nxglib_getrectangle.c +++ b/graphics/nxglib/lcd/nxglib_getrectangle.c @@ -79,7 +79,7 @@ void NXGL_FUNCNAME(nxgl_getrectangle, NXGLIB_SUFFIX) for (srcrow = rect->pt1.y; srcrow <= rect->pt2.y; srcrow++) { - (void)pinfo->getrun(srcrow, rect->pt1.x, dline, ncols); + pinfo->getrun(srcrow, rect->pt1.x, dline, ncols); dline += deststride; } } diff --git a/graphics/nxglib/lcd/nxglib_moverectangle.c b/graphics/nxglib/lcd/nxglib_moverectangle.c index 1956ff17d3..f03ed919fb 100644 --- a/graphics/nxglib/lcd/nxglib_moverectangle.c +++ b/graphics/nxglib/lcd/nxglib_moverectangle.c @@ -85,8 +85,8 @@ void NXGL_FUNCNAME(nxgl_moverectangle, NXGLIB_SUFFIX) srcrow <= rect->pt2.y; srcrow++, destrow++) { - (void)pinfo->getrun(srcrow, rect->pt1.x, pinfo->buffer, ncols); - (void)pinfo->putrun(destrow, offset->x, pinfo->buffer, ncols); + pinfo->getrun(srcrow, rect->pt1.x, pinfo->buffer, ncols); + pinfo->putrun(destrow, offset->x, pinfo->buffer, ncols); } } @@ -104,8 +104,8 @@ void NXGL_FUNCNAME(nxgl_moverectangle, NXGLIB_SUFFIX) srcrow >= rect->pt1.y; srcrow--, destrow--) { - (void)pinfo->getrun(srcrow, rect->pt1.x, pinfo->buffer, ncols); - (void)pinfo->putrun(destrow, offset->x, pinfo->buffer, ncols); + pinfo->getrun(srcrow, rect->pt1.x, pinfo->buffer, ncols); + pinfo->putrun(destrow, offset->x, pinfo->buffer, ncols); } } } diff --git a/graphics/nxglib/lcd/nxglib_setpixel.c b/graphics/nxglib/lcd/nxglib_setpixel.c index 402d4f64da..f5e5c0b9a6 100644 --- a/graphics/nxglib/lcd/nxglib_setpixel.c +++ b/graphics/nxglib/lcd/nxglib_setpixel.c @@ -81,7 +81,7 @@ void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX) /* Read the byte that contains the pixel to be changed */ - (void)pinfo->getrun(pos->y, pos->x, &pixel, 8 / NXGLIB_BITSPERPIXEL); + pinfo->getrun(pos->y, pos->x, &pixel, 8 / NXGLIB_BITSPERPIXEL); /* Shift the color into the proper position */ @@ -128,10 +128,10 @@ void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX) /* Write the modified byte back to graphics memory */ - (void)pinfo->putrun(pos->y, pos->x, (FAR uint8_t *)&pixel, 8 / NXGLIB_BITSPERPIXEL); + pinfo->putrun(pos->y, pos->x, (FAR uint8_t *)&pixel, 8 / NXGLIB_BITSPERPIXEL); #else /* Draw a single pixel at this position raster line at this row */ - (void)pinfo->putrun(pos->y, pos->x, (FAR uint8_t *)&color, 1); + pinfo->putrun(pos->y, pos->x, (FAR uint8_t *)&color, 1); #endif } diff --git a/graphics/nxmu/nxmu_kbdin.c b/graphics/nxmu/nxmu_kbdin.c index 554bed4895..5aa16704c8 100644 --- a/graphics/nxmu/nxmu_kbdin.c +++ b/graphics/nxmu/nxmu_kbdin.c @@ -90,7 +90,7 @@ void nxmu_kbdin(FAR struct nxmu_state_s *nxmu, uint8_t nch, FAR uint8_t *ch) outmsg->ch[i] = ch[i]; } - (void)nxmu_sendclientwindow(nxmu->be.topwnd, outmsg, size); + nxmu_sendclientwindow(nxmu->be.topwnd, outmsg, size); kmm_free(outmsg); } } diff --git a/graphics/nxmu/nxmu_redraw.c b/graphics/nxmu/nxmu_redraw.c index 2291784737..672a93a905 100644 --- a/graphics/nxmu/nxmu_redraw.c +++ b/graphics/nxmu/nxmu_redraw.c @@ -150,8 +150,8 @@ void nxmu_redrawreq(FAR struct nxbe_window_s *wnd, nxgl_rectoffset(&outmsg.rect, rect, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y); - (void)nxmu_sendclientwindow(wnd, &outmsg, - sizeof(struct nxclimsg_redraw_s)); + nxmu_sendclientwindow(wnd, &outmsg, + sizeof(struct nxclimsg_redraw_s)); } /**************************************************************************** diff --git a/graphics/nxmu/nxmu_server.c b/graphics/nxmu/nxmu_server.c index bd980f7819..2d846cf61b 100644 --- a/graphics/nxmu/nxmu_server.c +++ b/graphics/nxmu/nxmu_server.c @@ -79,7 +79,7 @@ static inline void nxmu_disconnect(FAR struct nxmu_conn_s *conn) /* Close the outgoing client message queue */ - (void)mq_close(conn->swrmq); + mq_close(conn->swrmq); } /**************************************************************************** @@ -133,7 +133,7 @@ static inline void nxmu_shutdown(FAR struct nxmu_state_s *nxmu) for (wnd = nxmu->be.topwnd; wnd; wnd = wnd->below) { - (void)nxmu_disconnect(wnd->conn); + nxmu_disconnect(wnd->conn); } } diff --git a/graphics/nxmu/nxmu_start.c b/graphics/nxmu/nxmu_start.c index 9a854ba44b..b723a401cb 100644 --- a/graphics/nxmu/nxmu_start.c +++ b/graphics/nxmu/nxmu_start.c @@ -119,7 +119,7 @@ static int nx_server(int argc, char *argv[]) /* Turn the LCD on at 75% power */ - (void)dev->setpower(dev, ((3 * CONFIG_LCD_MAXPOWER + 3) / 4)); + dev->setpower(dev, ((3 * CONFIG_LCD_MAXPOWER + 3) / 4)); #else /* CONFIG_NX_LCDDRIVER */ /* Initialize the frame buffer device. */ diff --git a/graphics/nxterm/nxterm_putc.c b/graphics/nxterm/nxterm_putc.c index 418eb8582a..3061ee8462 100644 --- a/graphics/nxterm/nxterm_putc.c +++ b/graphics/nxterm/nxterm_putc.c @@ -183,5 +183,5 @@ void nxterm_showcursor(FAR struct nxterm_state_s *priv) void nxterm_hidecursor(FAR struct nxterm_state_s *priv) { - (void)nxterm_hidechar(priv, &priv->cursor); + nxterm_hidechar(priv, &priv->cursor); } diff --git a/graphics/nxterm/nxterm_redraw.c b/graphics/nxterm/nxterm_redraw.c index 22aaafa87e..f7d6c5b35f 100644 --- a/graphics/nxterm/nxterm_redraw.c +++ b/graphics/nxterm/nxterm_redraw.c @@ -94,17 +94,6 @@ void nxterm_redraw(NXTERM handle, FAR const struct nxgl_rect_s *rect, bool more) do { ret = nxterm_semwait(priv); - - /* Check for errors */ - - if (ret < 0) - { - /* The only expected error is if the wait failed because of it - * was interrupted by a signal. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } } while (ret < 0); @@ -125,5 +114,5 @@ void nxterm_redraw(NXTERM handle, FAR const struct nxgl_rect_s *rect, bool more) nxterm_fillchar(priv, rect, &priv->bm[i]); } - (void)nxterm_sempost(priv); + nxterm_sempost(priv); } diff --git a/graphics/nxterm/nxterm_resize.c b/graphics/nxterm/nxterm_resize.c index c4730fa413..26bbf8eb69 100644 --- a/graphics/nxterm/nxterm_resize.c +++ b/graphics/nxterm/nxterm_resize.c @@ -88,11 +88,6 @@ int nxterm_resize(NXTERM handle, FAR const struct nxgl_size_s *size) ret = nxterm_semwait(priv); if (ret < 0) { - /* The only expected error is if the wait failed because of it was - * interrupted by a signal or if the thread was canceled. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } @@ -103,6 +98,6 @@ int nxterm_resize(NXTERM handle, FAR const struct nxgl_size_s *size) priv->wndo.wsize.w = size->w; priv->wndo.wsize.h = size->h; - (void)nxterm_sempost(priv); + nxterm_sempost(priv); return true; } diff --git a/graphics/nxterm/nxterm_unregister.c b/graphics/nxterm/nxterm_unregister.c index 88378cfb46..cc2a6a9fa6 100644 --- a/graphics/nxterm/nxterm_unregister.c +++ b/graphics/nxterm/nxterm_unregister.c @@ -90,7 +90,7 @@ void nxterm_unregister(FAR struct nxterm_state_s *priv) /* Unregister the driver */ snprintf(devname, NX_DEVNAME_SIZE, NX_DEVNAME_FORMAT, priv->minor); - (void)unregister_driver(devname); + unregister_driver(devname); /* Free the private data structure */ diff --git a/graphics/vnc/server/vnc_fbdev.c b/graphics/vnc/server/vnc_fbdev.c index 551ce3b564..6c21d16fe5 100644 --- a/graphics/vnc/server/vnc_fbdev.c +++ b/graphics/vnc/server/vnc_fbdev.c @@ -452,7 +452,7 @@ static int vnc_start_server(int display) /* Format the kernel thread arguments (ASCII.. yech) */ - (void)itoa(display, str, 10); + itoa(display, str, 10); argv[0] = str; argv[1] = NULL; @@ -486,8 +486,6 @@ static int vnc_start_server(int display) static inline int vnc_wait_start(int display) { - int ret = OK; - /* Check if there has been a session allocated yet. This is one of the * first things that the VNC server will do with the kernel thread is * started. But we might be here before the thread has gotten that far. @@ -506,20 +504,10 @@ static inline int vnc_wait_start(int display) * conditions here, but I think none that are fatal. */ - do - { - ret = nxsem_wait(&g_fbstartup[display].fbinit); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_fbstartup[display].fbinit); } - return ret; + return OK; } /**************************************************************************** @@ -564,20 +552,11 @@ static inline int vnc_wait_connect(int display) * conditions here, but I think none that are fatal. */ - do + ret = nxsem_wait_uninterruptible(&g_fbstartup[display].fbconnect); + if (ret < 0) { - ret = nxsem_wait(&g_fbstartup[display].fbconnect); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - if (ret < 0 && ret != -EINTR) - { - return ret; - } + return ret; } - while (ret == -EINTR); /* We were awakened. A result of -EBUSY means that the negotiation * is not complete. Why would we be awakened in that case? Some diff --git a/graphics/vnc/server/vnc_keymap.c b/graphics/vnc/server/vnc_keymap.c index 5e828d8da1..410e85efba 100644 --- a/graphics/vnc/server/vnc_keymap.c +++ b/graphics/vnc/server/vnc_keymap.c @@ -648,7 +648,7 @@ void vnc_key_map(FAR struct vnc_session_s *session, uint16_t keysym, void vnc_kbdout(FAR void *arg, uint8_t nch, FAR const uint8_t *ch) { DEBUGASSERT(arg != NULL); - (void)nx_kbdin((NXHANDLE)arg, nch, ch); + nx_kbdin((NXHANDLE)arg, nch, ch); } #endif /* CONFIG_NX_KBD */ diff --git a/graphics/vnc/server/vnc_receiver.c b/graphics/vnc/server/vnc_receiver.c index 1d41f73400..d3cf818b41 100644 --- a/graphics/vnc/server/vnc_receiver.c +++ b/graphics/vnc/server/vnc_receiver.c @@ -516,6 +516,6 @@ void vnc_mouseout(FAR void *arg, nxgl_coord_t x, nxgl_coord_t y, uint8_t buttons) { DEBUGASSERT(arg != NULL); - (void)nx_mousein((NXHANDLE)arg, x, y, buttons); + nx_mousein((NXHANDLE)arg, x, y, buttons); } #endif diff --git a/graphics/vnc/server/vnc_updater.c b/graphics/vnc/server/vnc_updater.c index f12badcd6b..7f06c9a80a 100644 --- a/graphics/vnc/server/vnc_updater.c +++ b/graphics/vnc/server/vnc_updater.c @@ -129,21 +129,8 @@ static void vnc_sem_debug(FAR struct vnc_session_s *session, int queuecount; int freewaiting; int queuewaiting; - int ret; - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_errsem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_errsem); /* Count structures in the list */ @@ -207,7 +194,6 @@ static FAR struct vnc_fbupdate_s * vnc_alloc_update(FAR struct vnc_session_s *session) { FAR struct vnc_fbupdate_s *update; - int ret; /* Reserve one element from the free list. Lock the scheduler to assure * that the sq_remfirst() and the successful return from nxsem_wait are @@ -217,19 +203,7 @@ vnc_alloc_update(FAR struct vnc_session_s *session) sched_lock(); vnc_sem_debug(session, "Before alloc", 0); - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&session->freesem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&session->freesem); /* It is reserved.. go get it */ @@ -300,7 +274,6 @@ static FAR struct vnc_fbupdate_s * vnc_remove_queue(FAR struct vnc_session_s *session) { FAR struct vnc_fbupdate_s *rect; - int ret; /* Reserve one element from the list of queued rectangle. Lock the * scheduler to assure that the sq_remfirst() and the successful return @@ -311,19 +284,7 @@ vnc_remove_queue(FAR struct vnc_session_s *session) sched_lock(); vnc_sem_debug(session, "Before remove", 0); - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&session->queuesem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&session->queuesem); /* It is reserved.. go get it */ diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h index 5ad141b4c1..e86ebadb33 100644 --- a/include/nuttx/net/net.h +++ b/include/nuttx/net/net.h @@ -403,6 +403,44 @@ int net_timedwait(sem_t *sem, FAR const struct timespec *abstime); int net_lockedwait(sem_t *sem); +/**************************************************************************** + * Name: net_timedwait_uninterruptible + * + * Description: + * This function is wrapped version of net_timedwait(), which is + * uninterruptible and convenient for use. + * + * Input Parameters: + * sem - A reference to the semaphore to be taken. + * abstime - The absolute time to wait until a timeout is declared. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure. + * + ****************************************************************************/ + +int net_timedwait_uninterruptible(sem_t *sem, + FAR const struct timespec *abstime); + +/**************************************************************************** + * Name: net_lockedwait_uninterruptible + * + * Description: + * This function is wrapped version of net_lockedwait(), which is + * uninterruptible and convenient for use. + * + * Input Parameters: + * sem - A reference to the semaphore to be taken. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure. + * + ****************************************************************************/ + +int net_lockedwait_uninterruptible(sem_t *sem); + /**************************************************************************** * Name: net_ioballoc * diff --git a/include/nuttx/semaphore.h b/include/nuttx/semaphore.h index 598ff46088..d599e85842 100644 --- a/include/nuttx/semaphore.h +++ b/include/nuttx/semaphore.h @@ -191,7 +191,7 @@ int nxsem_init(FAR sem_t *sem, int pshared, unsigned int value); * ****************************************************************************/ -int nxsem_destroy (FAR sem_t *sem); +int nxsem_destroy(FAR sem_t *sem); /**************************************************************************** * Name: nxsem_wait @@ -554,6 +554,84 @@ static inline int nxsem_wait_uninterruptible(FAR sem_t *sem) return ret; } +/**************************************************************************** + * Name: nxsem_timedwait_uninterruptible + * + * Description: + * This function is wrapped version of nxsem_timedwait(), which is + * uninterruptible and convenient for use. + * + * Input Parameters: + * sem - Semaphore object + * abstime - The absolute time to wait until a timeout is declared. + * + * Returned Value: + * EINVAL The sem argument does not refer to a valid semaphore. Or the + * thread would have blocked, and the abstime parameter specified + * a nanoseconds field value less than zero or greater than or + * equal to 1000 million. + * ETIMEDOUT The semaphore could not be locked before the specified timeout + * expired. + * EDEADLK A deadlock condition was detected. + * + ****************************************************************************/ + +static inline int +nxsem_timedwait_uninterruptible(FAR sem_t *sem, + FAR const struct timespec *abstime) +{ + int ret; + + do + { + /* Take the semaphore (perhaps waiting) */ + + ret = nxsem_timedwait(sem, abstime); + } + while (ret == -EINTR || ret == -ECANCELED); + + return ret; +} + +/**************************************************************************** + * Name: nxsem_tickwait_uninterruptible + * + * Description: + * This function is wrapped version of nxsem_tickwait(), which is + * uninterruptible and convenient for use. + * + * Input Parameters: + * sem - Semaphore object + * start - The system time that the delay is relative to. If the + * current time is not the same as the start time, then the + * delay will be adjust so that the end time will be the same + * in any event. + * delay - Ticks to wait from the start time until the semaphore is + * posted. If ticks is zero, then this function is equivalent + * to sem_trywait(). + * + * Returned Value: + * Zero (OK) is returned on success. A negated errno value is returned + * on failure. -ETIMEDOUT is returned on the timeout condition. + * + ****************************************************************************/ + +static inline int +nxsem_tickwait_uninterruptible(FAR sem_t *sem, clock_t start, uint32_t delay) +{ + int ret; + + do + { + /* Take the semaphore (perhaps waiting) */ + + ret = nxsem_tickwait(sem, start, delay); + } + while (ret == -EINTR || ret == -ECANCELED); + + return ret; +} + #undef EXTERN #ifdef __cplusplus } diff --git a/include/strings.h b/include/strings.h index 54be5dd380..6aa3a71d69 100644 --- a/include/strings.h +++ b/include/strings.h @@ -90,12 +90,12 @@ static inline int bcmp(FAR const void *b1, FAR const void *b2, size_t len) static inline void bcopy(FAR const void *b1, FAR void *b2, size_t len) { - (void)memmove(b2, b1, len); + memmove(b2, b1, len); } static inline void bzero(FAR void *s, size_t len) { - (void)memset(s, 0, len); + memset(s, 0, len); } static inline FAR char *index(FAR const char *s, int c) diff --git a/libs/libc/aio/lio_listio.c b/libs/libc/aio/lio_listio.c index 79312f8519..1274c727da 100644 --- a/libs/libc/aio/lio_listio.c +++ b/libs/libc/aio/lio_listio.c @@ -183,11 +183,11 @@ static void lio_sighandler(int signo, siginfo_t *info, void *ucontext) /* All pending I/O has completed */ /* Restore the signal handler */ - (void)sigaction(SIGPOLL, &sighand->oact, NULL); + sigaction(SIGPOLL, &sighand->oact, NULL); /* Restore the sigprocmask */ - (void)sigprocmask(SIG_SETMASK, &sighand->oprocmask, NULL); + sigprocmask(SIG_SETMASK, &sighand->oprocmask, NULL); /* Signal the client */ @@ -273,8 +273,8 @@ static int lio_sigsetup(FAR struct aiocb * const *list, int nent, /* Make sure that SIGPOLL is not blocked */ - (void)sigemptyset(&set); - (void)sigaddset(&set, SIGPOLL); + sigemptyset(&set); + sigaddset(&set, SIGPOLL); status = sigprocmask(SIG_UNBLOCK, &set, &sighand->oprocmask); if (status != OK) { @@ -291,8 +291,8 @@ static int lio_sigsetup(FAR struct aiocb * const *list, int nent, act.sa_sigaction = lio_sighandler; act.sa_flags = SA_SIGINFO; - (void)sigfillset(&act.sa_mask); - (void)sigdelset(&act.sa_mask, SIGPOLL); + sigfillset(&act.sa_mask); + sigdelset(&act.sa_mask, SIGPOLL); status = sigaction(SIGPOLL, &act, &sighand->oact); if (status != OK) diff --git a/libs/libc/dlfcn/lib_dlclose.c b/libs/libc/dlfcn/lib_dlclose.c index 8737c9306a..bcadafc217 100644 --- a/libs/libc/dlfcn/lib_dlclose.c +++ b/libs/libc/dlfcn/lib_dlclose.c @@ -154,7 +154,7 @@ static inline int dlremove(FAR void *handle) #if CONFIG_MODLIB_MAXDEPEND > 0 /* Eliminate any dependencies that this module has on other modules */ - (void)modlib_undepend(modp); + modlib_undepend(modp); #endif modlib_registry_unlock(); diff --git a/libs/libc/dlfcn/lib_dlopen.c b/libs/libc/dlfcn/lib_dlopen.c index 905266ab8f..dc98d172e2 100644 --- a/libs/libc/dlfcn/lib_dlopen.c +++ b/libs/libc/dlfcn/lib_dlopen.c @@ -256,7 +256,7 @@ static inline FAR void *dlinsert(FAR const char *filename) errout_with_load: modlib_unload(&loadinfo); - (void)modlib_undepend(modp); + modlib_undepend(modp); errout_with_registry_entry: lib_free(modp); errout_with_loadinfo: diff --git a/libs/libc/math/lib_floor.c b/libs/libc/math/lib_floor.c index f1a5e6312e..1ecc48dd9d 100644 --- a/libs/libc/math/lib_floor.c +++ b/libs/libc/math/lib_floor.c @@ -55,7 +55,7 @@ double floor(double x) * -2.0 -2.0 -2.0 */ - (void)modf(x, &modx); + modf(x, &modx); if (x < 0.0 && x < modx) { modx -= 1.0; diff --git a/libs/libc/math/lib_floorf.c b/libs/libc/math/lib_floorf.c index 4f73070aef..c98634f99d 100644 --- a/libs/libc/math/lib_floorf.c +++ b/libs/libc/math/lib_floorf.c @@ -51,7 +51,7 @@ float floorf(float x) * -2.0 -2.0 -2.0 */ - (void)modff(x, &modx); + modff(x, &modx); if (x < 0.0F && x < modx) { modx -= 1.0F; diff --git a/libs/libc/math/lib_floorl.c b/libs/libc/math/lib_floorl.c index 94cff4ca06..265822f57c 100644 --- a/libs/libc/math/lib_floorl.c +++ b/libs/libc/math/lib_floorl.c @@ -55,7 +55,7 @@ long double floorl(long double x) * -2.0 -2.0 -2.0 */ - (void)modfl(x, &modx); + modfl(x, &modx); if (x < 0.0 && x < modx) { modx -= 1.0; diff --git a/libs/libc/math/lib_trunc.c b/libs/libc/math/lib_trunc.c index dbdf096799..53c733fde6 100644 --- a/libs/libc/math/lib_trunc.c +++ b/libs/libc/math/lib_trunc.c @@ -75,7 +75,7 @@ double trunc(double x) /* Force Evaluation */ __x = (x + 0x1p120f); - (void)__x; + UNUSED(__x); u.i &= ~m; return u.f; diff --git a/libs/libc/math/lib_truncf.c b/libs/libc/math/lib_truncf.c index b467c18e10..324e0e5c21 100644 --- a/libs/libc/math/lib_truncf.c +++ b/libs/libc/math/lib_truncf.c @@ -74,7 +74,7 @@ float truncf(float x) /* Force Eval */ __x = (x + 0x1p120f); - (void)__x; + UNUSED(__x); u.i &= ~m; return u.f; diff --git a/libs/libc/math/lib_truncl.c b/libs/libc/math/lib_truncl.c index f4c40eb2d0..81bfe78d0c 100644 --- a/libs/libc/math/lib_truncl.c +++ b/libs/libc/math/lib_truncl.c @@ -77,7 +77,7 @@ long double truncl(long double x) /* Force Eval */ __x = (x + 0x1p120f); - (void)__x; + UNUSED(__x); return x*0; } diff --git a/libs/libc/misc/lib_filesem.c b/libs/libc/misc/lib_filesem.c index f8efe75ee5..247b7b3b04 100644 --- a/libs/libc/misc/lib_filesem.c +++ b/libs/libc/misc/lib_filesem.c @@ -70,7 +70,7 @@ void lib_sem_initialize(FAR struct file_struct *stream) * to private data sets. */ - (void)nxsem_init(&stream->fs_sem, 0, 1); + nxsem_init(&stream->fs_sem, 0, 1); stream->fs_holder = -1; stream->fs_counts = 0; diff --git a/libs/libc/misc/lib_stream.c b/libs/libc/misc/lib_stream.c index 243542520f..ece452647f 100644 --- a/libs/libc/misc/lib_stream.c +++ b/libs/libc/misc/lib_stream.c @@ -84,7 +84,7 @@ void lib_stream_initialize(FAR struct task_group_s *group) /* Initialize the list access mutex */ - (void)nxsem_init(&list->sl_sem, 0, 1); + nxsem_init(&list->sl_sem, 0, 1); /* Initialize each FILE structure */ @@ -138,7 +138,7 @@ void lib_stream_release(FAR struct task_group_s *group) /* Destroy the semaphore and release the filelist */ - (void)_SEM_DESTROY(&list->sl_sem); + _SEM_DESTROY(&list->sl_sem); #ifndef CONFIG_STDIO_DISABLE_BUFFERING /* Release each stream in the list */ @@ -149,7 +149,7 @@ void lib_stream_release(FAR struct task_group_s *group) /* Destroy the semaphore that protects the IO buffer */ - (void)_SEM_DESTROY(&stream->fs_sem); + _SEM_DESTROY(&stream->fs_sem); /* Release the IO buffer */ diff --git a/libs/libc/misc/lib_streamsem.c b/libs/libc/misc/lib_streamsem.c index efeb5a4a48..11f0f6fab4 100644 --- a/libs/libc/misc/lib_streamsem.c +++ b/libs/libc/misc/lib_streamsem.c @@ -73,5 +73,5 @@ void stream_semtake(FAR struct streamlist *list) void stream_semgive(FAR struct streamlist *list) { - (void)_SEM_POST(&list->sl_sem); + _SEM_POST(&list->sl_sem); } diff --git a/libs/libc/modlib/modlib_registry.c b/libs/libc/modlib/modlib_registry.c index 2b1712fa5e..384e3e3cf9 100644 --- a/libs/libc/modlib/modlib_registry.c +++ b/libs/libc/modlib/modlib_registry.c @@ -165,7 +165,7 @@ void modlib_registry_unlock(void) { g_modlock.holder = NO_HOLDER; g_modlock.count = 0; - (void)_SEM_POST(&g_modlock.lock); + _SEM_POST(&g_modlock.lock); } } diff --git a/libs/libc/net/lib_inetpton.c b/libs/libc/net/lib_inetpton.c index 1f1a91677e..3fc0cd4918 100644 --- a/libs/libc/net/lib_inetpton.c +++ b/libs/libc/net/lib_inetpton.c @@ -104,7 +104,7 @@ static int inet_ipv4_pton(FAR const char *src, FAR void *dest) char numstr[4]; uint8_t *ip; - (void)memset(dest, 0, sizeof(struct in_addr)); + memset(dest, 0, sizeof(struct in_addr)); ip = (uint8_t *)dest; srcoffset = 0; @@ -217,7 +217,7 @@ static int inet_ipv6_pton(FAR const char *src, FAR void *dest) uint8_t rip[sizeof(struct in6_addr)]; bool rtime; - (void)memset(dest, 0, sizeof(struct in6_addr)); + memset(dest, 0, sizeof(struct in6_addr)); srcoffset = 0; numoffset = 0; diff --git a/libs/libc/netdb/lib_dnscache.c b/libs/libc/netdb/lib_dnscache.c index ba4ebdd8bf..fef1488c6c 100644 --- a/libs/libc/netdb/lib_dnscache.c +++ b/libs/libc/netdb/lib_dnscache.c @@ -165,7 +165,7 @@ void dns_save_answer(FAR const char *hostname, #if CONFIG_NETDB_DNSCLIENT_LIFESEC > 0 /* Get the current time, using CLOCK_MONOTONIC if possible */ - (void)clock_gettime(DNS_CLOCK, &now); + clock_gettime(DNS_CLOCK, &now); entry->ctime = (time_t)now.tv_sec; #endif diff --git a/libs/libc/netdb/lib_getnameinfo.c b/libs/libc/netdb/lib_getnameinfo.c index c867b1cde8..74bf06572e 100644 --- a/libs/libc/netdb/lib_getnameinfo.c +++ b/libs/libc/netdb/lib_getnameinfo.c @@ -99,7 +99,7 @@ int getnameinfo(FAR const struct sockaddr *addr, socklen_t addrlen, /* Fall-back to numeric for the host name. */ flags |= NI_NUMERICHOST; - (void)saddr_len; + UNUSED(saddr_len); #else struct hostent hostent; int h_errno; diff --git a/libs/libc/netdb/lib_parsehostfile.c b/libs/libc/netdb/lib_parsehostfile.c index 39928788a5..bb13f2f031 100644 --- a/libs/libc/netdb/lib_parsehostfile.c +++ b/libs/libc/netdb/lib_parsehostfile.c @@ -351,7 +351,7 @@ ssize_t lib_parse_hostfile(FAR FILE *stream, FAR struct hostent *host, { /* Conversion failed. Entry is corrupted */ - (void)lib_skipline(stream, &nread); + lib_skipline(stream, &nread); return -EAGAIN; } @@ -372,7 +372,7 @@ ssize_t lib_parse_hostfile(FAR FILE *stream, FAR struct hostent *host, { /* Conversion failed. Entry is corrupted */ - (void)lib_skipline(stream, &nread); + lib_skipline(stream, &nread); return -EAGAIN; } @@ -476,7 +476,7 @@ ssize_t lib_parse_hostfile(FAR FILE *stream, FAR struct hostent *host, * additional aliases. */ - (void)lib_skipline(stream, &nread); + lib_skipline(stream, &nread); return nread; } diff --git a/libs/libc/pthread/pthread_barrierwait.c b/libs/libc/pthread/pthread_barrierwait.c index be274256c2..adece0c909 100644 --- a/libs/libc/pthread/pthread_barrierwait.c +++ b/libs/libc/pthread/pthread_barrierwait.c @@ -124,8 +124,8 @@ int pthread_barrier_wait(FAR pthread_barrier_t *barrier) while (semcount < 0) { - (void)sem_post(&barrier->sem); - (void)sem_getvalue(&barrier->sem, &semcount); + sem_post(&barrier->sem); + sem_getvalue(&barrier->sem, &semcount); } /* Then return PTHREAD_BARRIER_SERIAL_THREAD to the final thread */ diff --git a/libs/libc/pthread/pthread_rwlock_rdlock.c b/libs/libc/pthread/pthread_rwlock_rdlock.c index 31f743f1fb..20553b6959 100644 --- a/libs/libc/pthread/pthread_rwlock_rdlock.c +++ b/libs/libc/pthread/pthread_rwlock_rdlock.c @@ -55,7 +55,7 @@ static void rdlock_cleanup(FAR void *arg) { FAR pthread_rwlock_t *rw_lock = (FAR pthread_rwlock_t *)arg; - (void)pthread_mutex_unlock(&rw_lock->lock); + pthread_mutex_unlock(&rw_lock->lock); } #endif diff --git a/libs/libc/pthread/pthread_rwlock_wrlock.c b/libs/libc/pthread/pthread_rwlock_wrlock.c index 3be244638e..e5c65f9190 100644 --- a/libs/libc/pthread/pthread_rwlock_wrlock.c +++ b/libs/libc/pthread/pthread_rwlock_wrlock.c @@ -56,7 +56,7 @@ static void wrlock_cleanup(FAR void *arg) FAR pthread_rwlock_t *rw_lock = (FAR pthread_rwlock_t *)arg; rw_lock->num_writers--; - (void)pthread_mutex_unlock(&rw_lock->lock); + pthread_mutex_unlock(&rw_lock->lock); } #endif @@ -151,7 +151,7 @@ int pthread_rwlock_timedwrlock(FAR pthread_rwlock_t *rw_lock, { /* In case of error, notify any blocked readers. */ - (void) pthread_cond_broadcast(&rw_lock->cv); + pthread_cond_broadcast(&rw_lock->cv); } rw_lock->num_writers--; diff --git a/libs/libc/pthread/pthread_yield.c b/libs/libc/pthread/pthread_yield.c index aaa52871b7..c92574a4fd 100644 --- a/libs/libc/pthread/pthread_yield.c +++ b/libs/libc/pthread/pthread_yield.c @@ -63,5 +63,5 @@ void pthread_yield(void) { - (void)sched_yield(); + sched_yield(); } diff --git a/libs/libc/signal/sig_hold.c b/libs/libc/signal/sig_hold.c index 921b089ee9..42314e0402 100644 --- a/libs/libc/signal/sig_hold.c +++ b/libs/libc/signal/sig_hold.c @@ -59,7 +59,7 @@ int sighold(int signo) /* Create a set of signals with only the signal to be blocked */ - (void)sigemptyset(&set); + sigemptyset(&set); ret = sigaddset(&set, signo); if (ret == OK) { diff --git a/libs/libc/signal/sig_psignal.c b/libs/libc/signal/sig_psignal.c index c07e0f4bec..329268f8f6 100644 --- a/libs/libc/signal/sig_psignal.c +++ b/libs/libc/signal/sig_psignal.c @@ -80,22 +80,22 @@ void psignal(int signum, FAR const char *message) if (message != NULL) { - (void)fprintf(stderr, "%s: %s\n", message, strsignal(signum)); + fprintf(stderr, "%s: %s\n", message, strsignal(signum)); } else { - (void)fprintf(stderr, "%s\n", strsignal(signum)); + fprintf(stderr, "%s\n", strsignal(signum)); } #else /* No stderr! Write to whatever alternative console is available */ if (message != NULL) { - (void)printf("%s: %s\n", message, strsignal(signum)); + printf("%s: %s\n", message, strsignal(signum)); } else { - (void)printf("%s\n", strsignal(signum)); + printf("%s\n", strsignal(signum)); } #endif } diff --git a/libs/libc/signal/sig_relse.c b/libs/libc/signal/sig_relse.c index b5ff3b586e..f35529453c 100644 --- a/libs/libc/signal/sig_relse.c +++ b/libs/libc/signal/sig_relse.c @@ -59,7 +59,7 @@ int sigrelse(int signo) /* Create a set of signals with only the signal to be unblocked */ - (void)sigemptyset(&set); + sigemptyset(&set); ret = sigaddset(&set, signo); if (ret == OK) { diff --git a/libs/libc/signal/sig_set.c b/libs/libc/signal/sig_set.c index 04aa4178f0..de35313123 100644 --- a/libs/libc/signal/sig_set.c +++ b/libs/libc/signal/sig_set.c @@ -117,8 +117,8 @@ _sa_handler_t sigset(int signo, _sa_handler_t func) DEBUGASSERT(GOOD_SIGNO(signo) && func != SIG_ERR); - (void)sigemptyset(&set); - (void)sigaddset(&set, signo); + sigemptyset(&set); + sigaddset(&set, signo); /* Check if we are being asked to block the signal */ @@ -146,7 +146,7 @@ _sa_handler_t sigset(int signo, _sa_handler_t func) * error. */ - (void)signal(signo, disposition); + signal(signo, disposition); disposition = SIG_ERR; } } diff --git a/libs/libc/signal/sig_signal.c b/libs/libc/signal/sig_signal.c index b645f65849..4a1d17b201 100644 --- a/libs/libc/signal/sig_signal.c +++ b/libs/libc/signal/sig_signal.c @@ -82,7 +82,7 @@ _sa_handler_t signal(int signo, _sa_handler_t func) act.sa_handler = func; act.sa_flags = 0; - (void)sigemptyset(&act.sa_mask); + sigemptyset(&act.sa_mask); /* Check for SIG_IGN and SIG_DFL (and someday SIG_HOLD) * diff --git a/libs/libc/stdio/legacy_libvsprintf.c b/libs/libc/stdio/legacy_libvsprintf.c index a220dae09b..a2474cf6b8 100644 --- a/libs/libc/stdio/legacy_libvsprintf.c +++ b/libs/libc/stdio/legacy_libvsprintf.c @@ -1220,7 +1220,7 @@ int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const IPTR char *src, { /* Should return an error on a failure to flush */ - (void)obj->flush(obj); + obj->flush(obj); } /* Process the next character in the format */ diff --git a/libs/libc/stdio/lib_fopen.c b/libs/libc/stdio/lib_fopen.c index 2006fb7e7d..6ef6533c33 100644 --- a/libs/libc/stdio/lib_fopen.c +++ b/libs/libc/stdio/lib_fopen.c @@ -128,7 +128,7 @@ FAR FILE *fopen(FAR const char *path, FAR const char *mode) * failures are reported by fdopen(). */ - (void)close(fd); + close(fd); } } diff --git a/libs/libc/stdio/lib_freopen.c b/libs/libc/stdio/lib_freopen.c index 4aea1a4f63..b4a5e3f979 100644 --- a/libs/libc/stdio/lib_freopen.c +++ b/libs/libc/stdio/lib_freopen.c @@ -98,7 +98,7 @@ FAR FILE *freopen(FAR const char *path, FAR const char *mode, if (stream) { - (void)fclose(stream); + fclose(stream); } /* And attempt to reopen the file at the provided path */ diff --git a/libs/libc/stdio/lib_libvsprintf.c b/libs/libc/stdio/lib_libvsprintf.c index 6b9dfb5a3d..af7916434b 100644 --- a/libs/libc/stdio/lib_libvsprintf.c +++ b/libs/libc/stdio/lib_libvsprintf.c @@ -846,7 +846,7 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream, #else /* !CONFIG_LIBC_FLOATINGPOINT */ if ((c >= 'E' && c <= 'G') || (c >= 'e' && c <= 'g')) { - (void)va_arg(ap, double_t); + va_arg(ap, double_t); pnt = "*float*"; size = sizeof("*float*") - 1; goto str_lpad; diff --git a/libs/libc/stdio/lib_perror.c b/libs/libc/stdio/lib_perror.c index 28bd96379d..5a93513f67 100644 --- a/libs/libc/stdio/lib_perror.c +++ b/libs/libc/stdio/lib_perror.c @@ -72,9 +72,9 @@ void perror(FAR const char *s) /* If strerror() is not enabled, then just print the error number */ #ifdef CONFIG_LIBC_STRERROR - (void)fprintf(PERROR_STREAM, "%s: %s\n", s, strerror(errno)); + fprintf(PERROR_STREAM, "%s: %s\n", s, strerror(errno)); #else - (void)fprintf(PERROR_STREAM, "%s: Error %d\n", s, errno); + fprintf(PERROR_STREAM, "%s: Error %d\n", s, errno); #endif } diff --git a/libs/libc/stdio/lib_setbuf.c b/libs/libc/stdio/lib_setbuf.c index cd5010e2b6..bdfa997d2b 100644 --- a/libs/libc/stdio/lib_setbuf.c +++ b/libs/libc/stdio/lib_setbuf.c @@ -79,7 +79,7 @@ void setbuf(FAR FILE *stream, FAR char *buf) DEBUGASSERT(stream != NULL); mode = (buf != NULL) ? _IOFBF : _IONBF; - (void)setvbuf(stream, buf, mode, BUFSIZ); + setvbuf(stream, buf, mode, BUFSIZ); #else DEBUGASSERT(stream != NULL); diff --git a/libs/libc/stdio/lib_tempnam.c b/libs/libc/stdio/lib_tempnam.c index e4eef4c46e..fcb3ad6bcf 100644 --- a/libs/libc/stdio/lib_tempnam.c +++ b/libs/libc/stdio/lib_tempnam.c @@ -88,7 +88,7 @@ FAR char *tempnam(FAR const char *dir, FAR const char *pfx) FAR char *path; int ret; - (void)asprintf(&path, "%s/%s-XXXXXX.tmp", dir, pfx); + asprintf(&path, "%s/%s-XXXXXX.tmp", dir, pfx); if (path) { ret = mktemp(path); diff --git a/libs/libc/stdio/lib_tmpnam.c b/libs/libc/stdio/lib_tmpnam.c index c6c0a313af..67d0eb8de7 100644 --- a/libs/libc/stdio/lib_tmpnam.c +++ b/libs/libc/stdio/lib_tmpnam.c @@ -89,7 +89,7 @@ FAR char *tmpnam(FAR char *s) s = path; } - (void)snprintf(s, L_tmpnam, "%s/XXXXXX.tmp", P_tmpdir); + snprintf(s, L_tmpnam, "%s/XXXXXX.tmp", P_tmpdir); ret = mktemp(s); return (ret == OK) ? s : NULL; } diff --git a/libs/libc/stdio/lib_vasprintf.c b/libs/libc/stdio/lib_vasprintf.c index 335355550b..8c11621b8e 100644 --- a/libs/libc/stdio/lib_vasprintf.c +++ b/libs/libc/stdio/lib_vasprintf.c @@ -111,7 +111,7 @@ int vasprintf(FAR char **ptr, FAR const IPTR char *fmt, va_list ap) */ lib_nulloutstream(&nulloutstream); - (void)lib_vsprintf((FAR struct lib_outstream_s *)&nulloutstream, fmt, ap1); + lib_vsprintf((FAR struct lib_outstream_s *)&nulloutstream, fmt, ap1); /* Then allocate a buffer to hold that number of characters, adding one * for the null terminator. diff --git a/libs/libc/stdlib/lib_mkstemp.c b/libs/libc/stdlib/lib_mkstemp.c index 62df2b625d..2d1c198219 100644 --- a/libs/libc/stdlib/lib_mkstemp.c +++ b/libs/libc/stdlib/lib_mkstemp.c @@ -160,7 +160,7 @@ static void get_base62(FAR uint8_t *ptr) memcpy(ptr, g_base62, MAX_XS); incr_base62(); - (void)_SEM_POST(&g_b62sem); + _SEM_POST(&g_b62sem); } /**************************************************************************** diff --git a/libs/libc/stdlib/lib_srand.c b/libs/libc/stdlib/lib_srand.c index 46e07ca999..9f758f9391 100644 --- a/libs/libc/stdlib/lib_srand.c +++ b/libs/libc/stdlib/lib_srand.c @@ -242,10 +242,10 @@ void srand(unsigned int seed) g_randint1 = seed; #if (CONFIG_LIB_RAND_ORDER > 1) g_randint2 = seed; - (void)fgenerate1(); + fgenerate1(); #if (CONFIG_LIB_RAND_ORDER > 2) g_randint3 = seed; - (void)fgenerate2(); + fgenerate2(); #endif #endif } diff --git a/libs/libc/string/lib_strerrorr.c b/libs/libc/string/lib_strerrorr.c index f960e127f4..c4193284aa 100644 --- a/libs/libc/string/lib_strerrorr.c +++ b/libs/libc/string/lib_strerrorr.c @@ -69,6 +69,6 @@ int strerror_r(int errnum, FAR char *buf, size_t buflen) FAR const char *errstr = strerror(errnum); DEBUGASSERT(buf != NULL); - (void)strncpy(buf, errstr, buflen); + strncpy(buf, errstr, buflen); return OK; } diff --git a/libs/libc/time/lib_localtime.c b/libs/libc/time/lib_localtime.c index 260d53a008..e18b3b5723 100644 --- a/libs/libc/time/lib_localtime.c +++ b/libs/libc/time/lib_localtime.c @@ -1589,12 +1589,12 @@ static int tzparse(FAR const char *name, FAR struct state_s *const sp, } cp = sp->chars; - (void)strncpy(cp, stdname, stdlen); + strncpy(cp, stdname, stdlen); cp += stdlen; *cp++ = '\0'; if (dstlen != 0) { - (void)strncpy(cp, dstname, dstlen); + strncpy(cp, dstname, dstlen); *(cp + dstlen) = '\0'; } @@ -1605,7 +1605,7 @@ static void gmtload(FAR struct state_s *const sp) { if (tzload(GMT, sp, TRUE) != 0) { - (void)tzparse(GMT, sp, TRUE); + tzparse(GMT, sp, TRUE); } } @@ -2476,7 +2476,7 @@ void tzset(void) g_lcl_isset = strlen(name) < sizeof g_lcl_tzname; if (g_lcl_isset) { - (void)strcpy(g_lcl_tzname, name); + strcpy(g_lcl_tzname, name); } if (lclptr == NULL) @@ -2499,13 +2499,13 @@ void tzset(void) lclptr->ttis[0].tt_isdst = 0; lclptr->ttis[0].tt_gmtoff = 0; lclptr->ttis[0].tt_abbrind = 0; - (void)strcpy(lclptr->chars, GMT); + strcpy(lclptr->chars, GMT); } else if (tzload(name, lclptr, TRUE) != 0) { if (name[0] == ':' || tzparse(name, lclptr, FALSE) != 0) { - (void)gmtload(lclptr); + gmtload(lclptr); } } diff --git a/libs/libc/uio/lib_writev.c b/libs/libc/uio/lib_writev.c index d8e70ac602..00da0a8e46 100644 --- a/libs/libc/uio/lib_writev.c +++ b/libs/libc/uio/lib_writev.c @@ -132,7 +132,7 @@ ssize_t writev(int fildes, FAR const struct iovec *iov, int iovcnt) /* Restore the file position */ - (void)lseek(fildes, pos, SEEK_SET); + lseek(fildes, pos, SEEK_SET); /* Restore the errno value */ diff --git a/libs/libc/unistd/lib_daemon.c b/libs/libc/unistd/lib_daemon.c index 2292453662..903414034a 100644 --- a/libs/libc/unistd/lib_daemon.c +++ b/libs/libc/unistd/lib_daemon.c @@ -135,15 +135,15 @@ int daemon(int nochdir, int noclose) #if CONFIG_NFILE_STREAMS > 0 /* Make sure the stdin, stdout, and stderr are closed */ - (void)fclose(stdin); - (void)fclose(stdout); - (void)fclose(stderr); + fclose(stdin); + fclose(stdout); + fclose(stderr); #endif /* Dup the fd to create standard fd 0-2 */ - (void)dup2(fd, 0); - (void)dup2(fd, 1); - (void)dup2(fd, 2); + dup2(fd, 0); + dup2(fd, 1); + dup2(fd, 2); /* fdopen to get the stdin, stdout and stderr streams. The * following logic depends on the fact that the library layer @@ -155,9 +155,9 @@ int daemon(int nochdir, int noclose) * fd = 2 is stderr (write-only, append) */ - (void)fdopen(0, "r"); - (void)fdopen(1, "a"); - (void)fdopen(2, "a"); + fdopen(0, "r"); + fdopen(1, "a"); + fdopen(2, "a"); /* We can close the original file descriptor now (unless it was * one of* 0-2) @@ -165,7 +165,7 @@ int daemon(int nochdir, int noclose) if (fd > 2) { - (void)close(fd); + close(fd); } } diff --git a/libs/libc/wqueue/work_lock.c b/libs/libc/wqueue/work_lock.c index 705a4e4051..ef10e15972 100644 --- a/libs/libc/wqueue/work_lock.c +++ b/libs/libc/wqueue/work_lock.c @@ -109,9 +109,9 @@ int work_lock(void) void work_unlock(void) { #ifdef CONFIG_BUILD_PROTECTED - (void)sem_post(&g_usrsem); + sem_post(&g_usrsem); #else - (void)pthread_mutex_unlock(&g_usrmutex); + pthread_mutex_unlock(&g_usrmutex); #endif } diff --git a/libs/libc/wqueue/work_usrthread.c b/libs/libc/wqueue/work_usrthread.c index 42ee091eb5..98f09d75ad 100644 --- a/libs/libc/wqueue/work_usrthread.c +++ b/libs/libc/wqueue/work_usrthread.c @@ -177,7 +177,7 @@ void work_process(FAR struct usr_wqueue_s *wqueue) { /* Remove the ready-to-execute work from the list */ - (void)dq_rem((struct dq_entry_s *)work, &wqueue->q); + dq_rem((struct dq_entry_s *)work, &wqueue->q); /* Extract the work description from the entry (in case the work * instance by the re-used after it has been de-queued). @@ -269,7 +269,7 @@ void work_process(FAR struct usr_wqueue_s *wqueue) * signals directed to the worker thread to pend. */ - (void)sigprocmask(SIG_BLOCK, &sigset, &oldset); + sigprocmask(SIG_BLOCK, &sigset, &oldset); work_unlock(); if (next == WORK_DELAY_MAX) @@ -295,7 +295,7 @@ void work_process(FAR struct usr_wqueue_s *wqueue) sigtimedwait(&sigset, NULL, &rqtp); } - (void)sigprocmask(SIG_SETMASK, &oldset, NULL); + sigprocmask(SIG_SETMASK, &oldset, NULL); } /**************************************************************************** @@ -368,7 +368,7 @@ int work_usrstart(void) { /* Set up the work queue lock */ - (void)nxsem_init(&g_usrsem, 0, 1); + nxsem_init(&g_usrsem, 0, 1); /* Start a user-mode worker thread for use by applications. */ @@ -397,12 +397,12 @@ int work_usrstart(void) /* Set up the work queue lock */ - (void)pthread_mutex_init(&g_usrmutex, NULL); + pthread_mutex_init(&g_usrmutex, NULL); /* Start a user-mode worker thread for use by applications. */ - (void)pthread_attr_init(&attr); - (void)pthread_attr_setstacksize(&attr, CONFIG_LIB_USRWORKSTACKSIZE); + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, CONFIG_LIB_USRWORKSTACKSIZE); #ifdef CONFIG_SCHED_SPORADIC /* Get the current sporadic scheduling parameters. Those will not be @@ -418,7 +418,7 @@ int work_usrstart(void) #endif param.sched_priority = CONFIG_LIB_USRWORKPRIORITY; - (void)pthread_attr_setschedparam(&attr, ¶m); + pthread_attr_setschedparam(&attr, ¶m); ret = pthread_create(&usrwork, &attr, work_usrthread, NULL); if (ret != 0) @@ -430,7 +430,7 @@ int work_usrstart(void) * requested. */ - (void)pthread_detach(usrwork); + pthread_detach(usrwork); g_usrwork.pid = (pid_t)usrwork; return g_usrwork.pid; diff --git a/libs/libnx/nxfonts/nxfonts_cache.c b/libs/libnx/nxfonts/nxfonts_cache.c index 1399fe923e..bca20ef883 100644 --- a/libs/libnx/nxfonts/nxfonts_cache.c +++ b/libs/libnx/nxfonts/nxfonts_cache.c @@ -755,7 +755,7 @@ FCACHE nxf_cache_connect(enum nx_fontid_e fontid, /* Initialize the mutual exclusion semaphore */ - (void)nxsem_init(&priv->fsem, 0, 1); + nxsem_init(&priv->fsem, 0, 1); /* Add the new font cache to the list of font caches */ diff --git a/libs/libnx/nxmu/nx_bitmap.c b/libs/libnx/nxmu/nx_bitmap.c index 3f995a3731..3ee9b433a5 100644 --- a/libs/libnx/nxmu/nx_bitmap.c +++ b/libs/libnx/nxmu/nx_bitmap.c @@ -123,7 +123,7 @@ int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest, * priority inheritance enabled. */ - (void)_SEM_SETPROTOCOL(&sem_done, SEM_PRIO_NONE); + _SEM_SETPROTOCOL(&sem_done, SEM_PRIO_NONE); /* Forward the fill command to the server */ @@ -138,7 +138,7 @@ int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest, /* Destroy the semaphore and return. */ - (void)_SEM_DESTROY(&sem_done); + _SEM_DESTROY(&sem_done); return ret; } diff --git a/libs/libnx/nxmu/nx_disconnect.c b/libs/libnx/nxmu/nx_disconnect.c index 17ce7a5927..ed9441d841 100644 --- a/libs/libnx/nxmu/nx_disconnect.c +++ b/libs/libnx/nxmu/nx_disconnect.c @@ -90,6 +90,6 @@ void nx_disconnect(NXHANDLE handle) { snprintf(climqname, sizeof(climqname), NX_CLIENT_MQNAMEFMT, conn->cid); - (void)mq_unlink(climqname); + mq_unlink(climqname); } } diff --git a/libs/libnx/nxmu/nx_eventhandler.c b/libs/libnx/nxmu/nx_eventhandler.c index 4aa1b5a880..d5c3a219c9 100644 --- a/libs/libnx/nxmu/nx_eventhandler.c +++ b/libs/libnx/nxmu/nx_eventhandler.c @@ -80,8 +80,8 @@ static inline void nx_disconnected(FAR struct nxmu_conn_s *conn) { /* Close the server and client MQs */ - (void)mq_close(conn->cwrmq); - (void)mq_close(conn->crdmq); + mq_close(conn->cwrmq); + mq_close(conn->crdmq); /* And free the client structure */ diff --git a/libs/libnx/nxmu/nx_getrectangle.c b/libs/libnx/nxmu/nx_getrectangle.c index b5640d6534..cc92506207 100644 --- a/libs/libnx/nxmu/nx_getrectangle.c +++ b/libs/libnx/nxmu/nx_getrectangle.c @@ -116,7 +116,7 @@ int nx_getrectangle(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect, * priority inheritance enabled. */ - (void)nxsem_setprotocol(&sem_done, SEM_PRIO_NONE); + nxsem_setprotocol(&sem_done, SEM_PRIO_NONE); /* Forward the fill command to the server */ diff --git a/libs/libnx/nxtk/nxtk_closetoolbar.c b/libs/libnx/nxtk/nxtk_closetoolbar.c index e3b060205b..1849ca192c 100644 --- a/libs/libnx/nxtk/nxtk_closetoolbar.c +++ b/libs/libnx/nxtk/nxtk_closetoolbar.c @@ -98,7 +98,7 @@ int nxtk_closetoolbar(NXTKWINDOW hfwnd) /* Then re-draw the frame */ - (void)nxtk_drawframe(fwnd, &relbounds); /* Does not fail */ + nxtk_drawframe(fwnd, &relbounds); /* Does not fail */ } else #endif diff --git a/libs/libnx/nxtk/nxtk_opentoolbar.c b/libs/libnx/nxtk/nxtk_opentoolbar.c index 5d00f37659..592d83a54a 100644 --- a/libs/libnx/nxtk/nxtk_opentoolbar.c +++ b/libs/libnx/nxtk/nxtk_opentoolbar.c @@ -112,7 +112,7 @@ int nxtk_opentoolbar(NXTKWINDOW hfwnd, nxgl_coord_t height, /* Then re-draw the frame */ - (void)nxtk_drawframe(fwnd, &relbounds); /* Does not fail */ + nxtk_drawframe(fwnd, &relbounds); /* Does not fail */ } else #endif diff --git a/libs/libnx/nxtk/nxtk_setsize.c b/libs/libnx/nxtk/nxtk_setsize.c index 577ec1f6f0..a1334c15de 100644 --- a/libs/libnx/nxtk/nxtk_setsize.c +++ b/libs/libnx/nxtk/nxtk_setsize.c @@ -112,7 +112,7 @@ int nxtk_setsize(NXTKWINDOW hfwnd, FAR const struct nxgl_size_s *size) /* Then re-draw the frame */ - (void)nxtk_drawframe(fwnd, &relbounds); /* Does not fail */ + nxtk_drawframe(fwnd, &relbounds); /* Does not fail */ } #endif diff --git a/mm/iob/iob_alloc.c b/mm/iob/iob_alloc.c index d6f4140383..3aa995ff48 100644 --- a/mm/iob/iob_alloc.c +++ b/mm/iob/iob_alloc.c @@ -146,26 +146,8 @@ static FAR struct iob_s *iob_allocwait(bool throttled, * list. */ - ret = nxsem_wait(sem); - if (ret < 0) - { - /* EINTR is not an error! EINTR simply means that we were - * awakened by a signal and we should try again. - * - * REVISIT: Many end-user interfaces are required to return with - * an error if EINTR is set. Most uses of this function are in - * internal, non-user logic. But are there cases where the error - * should be returned. - */ - - if (ret == -EINTR) - { - /* Force a success indication so that we will continue looping. */ - - ret = OK; - } - } - else + ret = nxsem_wait_uninterruptible(sem); + if (ret >= 0) { /* When we wake up from wait successfully, an I/O buffer was * freed and we hold a count for one IOB. diff --git a/mm/iob/iob_alloc_qentry.c b/mm/iob/iob_alloc_qentry.c index b9d23db546..1c969289cc 100644 --- a/mm/iob/iob_alloc_qentry.c +++ b/mm/iob/iob_alloc_qentry.c @@ -130,26 +130,8 @@ static FAR struct iob_qentry_s *iob_allocwait_qentry(void) * semaphore count will be incremented. */ - ret = nxsem_wait(&g_qentry_sem); - if (ret < 0) - { - /* EINTR is not an error! EINTR simply means that we were - * awakened by a signal and we should try again. - * - * REVISIT: Many end-user interfaces are required to return - * with an error if EINTR is set. Most uses of this function - * is in internal, non-user logic. But are there cases where - * the error should be returned. - */ - - if (ret == -EINTR) - { - /* Force a success indication so that we will continue looping. */ - - ret = OK; - } - } - else + ret = nxsem_wait_uninterruptible(&g_qentry_sem); + if (ret >= 0) { /* When we wake up from wait successfully, an I/O buffer chain container was * freed and we hold a count for one IOB. Unless somehting diff --git a/mm/iob/iob_trimhead.c b/mm/iob/iob_trimhead.c index 90865bfc0b..371b7ce3dc 100644 --- a/mm/iob/iob_trimhead.c +++ b/mm/iob/iob_trimhead.c @@ -115,7 +115,7 @@ FAR struct iob_s *iob_trimhead(FAR struct iob_s *iob, unsigned int trimlen, /* Free this entry and set the next I/O buffer as the head */ iobinfo("iob=%p: Freeing\n", iob); - (void)iob_free(iob, producerid); + iob_free(iob, producerid); iob = next; } else diff --git a/mm/mm_gran/mm_grancritical.c b/mm/mm_gran/mm_grancritical.c index bf35e63e58..8dc9648ce1 100644 --- a/mm/mm_gran/mm_grancritical.c +++ b/mm/mm_gran/mm_grancritical.c @@ -74,19 +74,7 @@ void gran_enter_critical(FAR struct gran_s *priv) #ifdef CONFIG_GRAN_INTR priv->irqstate = enter_critical_section(); #else - int ret; - - /* Continue waiting if we are awakened by a signal */ - - do - { - ret = nxsem_wait(&priv->exclsem); - if (ret < 0) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&priv->exclsem); #endif } diff --git a/mm/mm_heap/mm_sem.c b/mm/mm_heap/mm_sem.c index f59018ef94..4f6d1d9af4 100644 --- a/mm/mm_heap/mm_sem.c +++ b/mm/mm_heap/mm_sem.c @@ -121,7 +121,7 @@ void mm_seminitialize(FAR struct mm_heap_s *heap) * private data sets). */ - (void)nxsem_init(&heap->mm_semaphore, 0, 1); + nxsem_init(&heap->mm_semaphore, 0, 1); heap->mm_holder = NO_HOLDER; heap->mm_counts_held = 0; diff --git a/net/arp/arp_notify.c b/net/arp/arp_notify.c index d735386540..628ced4d2c 100644 --- a/net/arp/arp_notify.c +++ b/net/arp/arp_notify.c @@ -94,7 +94,7 @@ void arp_wait_setup(in_addr_t ipaddr, FAR struct arp_notify_s *notify) * priority inheritance enabled. */ - (void)nxsem_init(¬ify->nt_sem, 0, 0); + nxsem_init(¬ify->nt_sem, 0, 0); nxsem_setprotocol(¬ify->nt_sem, SEM_PRIO_NONE); /* Add the wait structure to the list with interrupts disabled */ @@ -150,7 +150,7 @@ int arp_wait_cancel(FAR struct arp_notify_s *notify) } leave_critical_section(flags); - (void)nxsem_destroy(¬ify->nt_sem); + nxsem_destroy(¬ify->nt_sem); return ret; } @@ -172,7 +172,6 @@ int arp_wait(FAR struct arp_notify_s *notify, FAR struct timespec *timeout) { struct timespec abstime; irqstate_t flags; - int errcode; int ret; /* And wait for the ARP response (or a timeout). Interrupts will be re- @@ -192,16 +191,7 @@ int arp_wait(FAR struct arp_notify_s *notify, FAR struct timespec *timeout) /* Wait to get either the correct response or a timeout. */ - do - { - /* The only errors that we expect would be if the abstime timeout - * expires or if the wait were interrupted by a signal. - */ - - ret = net_timedwait(¬ify->nt_sem, &abstime); - errcode = ((ret < 0) ? -ret : 0); - } - while (ret < 0 && errcode == EINTR); + net_timedwait_uninterruptible(¬ify->nt_sem, &abstime); /* Then get the real result of the transfer */ @@ -211,7 +201,7 @@ int arp_wait(FAR struct arp_notify_s *notify, FAR struct timespec *timeout) * head of the list). */ - (void)arp_wait_cancel(notify); + arp_wait_cancel(notify); /* Re-enable interrupts and return the result of the wait */ diff --git a/net/arp/arp_poll.c b/net/arp/arp_poll.c index 9a023af347..e28c97651b 100644 --- a/net/arp/arp_poll.c +++ b/net/arp/arp_poll.c @@ -75,7 +75,7 @@ int arp_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback) /* Perform the ARP callbacks */ - (void)devif_conn_event(dev, NULL, ARP_POLL, dev->d_conncb); + devif_conn_event(dev, NULL, ARP_POLL, dev->d_conncb); /* Call back into the driver */ diff --git a/net/arp/arp_send.c b/net/arp/arp_send.c index 5474b49607..7339c27616 100644 --- a/net/arp/arp_send.c +++ b/net/arp/arp_send.c @@ -308,7 +308,7 @@ int arp_send(in_addr_t ipaddr) * priority inheritance enabled. */ - (void)nxsem_init(&state.snd_sem, 0, 0); /* Doesn't really fail */ + nxsem_init(&state.snd_sem, 0, 0); /* Doesn't really fail */ nxsem_setprotocol(&state.snd_sem, SEM_PRIO_NONE); state.snd_retries = 0; /* No retries yet */ @@ -369,7 +369,7 @@ int arp_send(in_addr_t ipaddr) do { - (void)net_lockedwait(&state.snd_sem); + net_lockedwait(&state.snd_sem); } while (!state.snd_sent); diff --git a/net/arp/arp_table.c b/net/arp/arp_table.c index 1cad0cfba9..7bf780796a 100644 --- a/net/arp/arp_table.c +++ b/net/arp/arp_table.c @@ -261,7 +261,7 @@ void arp_hdr_update(FAR uint16_t *pipaddr, FAR uint8_t *ethaddr) /* Update the ARP table */ - (void)arp_update(ipaddr, ethaddr); + arp_update(ipaddr, ethaddr); } /**************************************************************************** diff --git a/net/bluetooth/bluetooth_input.c b/net/bluetooth/bluetooth_input.c index 607ec38fff..483390cf0c 100644 --- a/net/bluetooth/bluetooth_input.c +++ b/net/bluetooth/bluetooth_input.c @@ -279,7 +279,7 @@ int bluetooth_input(FAR struct radio_driver_s *radio, * was not consumed. */ - (void)bluetooth_callback(radio, conn, BLUETOOTH_NEWDATA); + bluetooth_callback(radio, conn, BLUETOOTH_NEWDATA); } else { diff --git a/net/bluetooth/bluetooth_poll.c b/net/bluetooth/bluetooth_poll.c index af08d51a73..2165fde490 100644 --- a/net/bluetooth/bluetooth_poll.c +++ b/net/bluetooth/bluetooth_poll.c @@ -100,7 +100,7 @@ void bluetooth_poll(FAR struct net_driver_s *dev, /* Perform the application callback */ - (void)bluetooth_callback(radio, conn, BLUETOOTH_POLL); + bluetooth_callback(radio, conn, BLUETOOTH_POLL); } } diff --git a/net/bluetooth/bluetooth_recvfrom.c b/net/bluetooth/bluetooth_recvfrom.c index cb781e3f53..60964680fe 100644 --- a/net/bluetooth/bluetooth_recvfrom.c +++ b/net/bluetooth/bluetooth_recvfrom.c @@ -384,8 +384,8 @@ ssize_t bluetooth_recvfrom(FAR struct socket *psock, FAR void *buf, * hence, should not have priority inheritance enabled. */ - (void)nxsem_init(&state.ir_sem, 0, 0); /* Doesn't really fail */ - (void)nxsem_setprotocol(&state.ir_sem, SEM_PRIO_NONE); + nxsem_init(&state.ir_sem, 0, 0); /* Doesn't really fail */ + nxsem_setprotocol(&state.ir_sem, SEM_PRIO_NONE); /* Set up the callback in the connection */ @@ -402,7 +402,7 @@ ssize_t bluetooth_recvfrom(FAR struct socket *psock, FAR void *buf, * the task sleeps and automatically re-locked when the task restarts. */ - (void)net_lockedwait(&state.ir_sem); + net_lockedwait(&state.ir_sem); /* Make sure that no further events are processed */ diff --git a/net/bluetooth/bluetooth_sendto.c b/net/bluetooth/bluetooth_sendto.c index 03ec6a2ad5..931e26809c 100644 --- a/net/bluetooth/bluetooth_sendto.c +++ b/net/bluetooth/bluetooth_sendto.c @@ -296,8 +296,8 @@ ssize_t psock_bluetooth_sendto(FAR struct socket *psock, FAR const void *buf, * priority inheritance enabled. */ - (void)nxsem_init(&state.is_sem, 0, 0); /* Doesn't really fail */ - (void)nxsem_setprotocol(&state.is_sem, SEM_PRIO_NONE); + nxsem_init(&state.is_sem, 0, 0); /* Doesn't really fail */ + nxsem_setprotocol(&state.is_sem, SEM_PRIO_NONE); state.is_sock = psock; /* Socket descriptor to use */ state.is_buflen = len; /* Number of bytes to send */ diff --git a/net/icmp/icmp_conn.c b/net/icmp/icmp_conn.c index daebad426b..3aabb8bf53 100644 --- a/net/icmp/icmp_conn.c +++ b/net/icmp/icmp_conn.c @@ -151,24 +151,13 @@ FAR struct icmp_conn_s *icmp_alloc(void) void icmp_free(FAR struct icmp_conn_s *conn) { - int ret; - /* The free list is protected by a semaphore (that behaves like a mutex). */ DEBUGASSERT(conn->crefs == 0); /* Take the semaphore (perhaps waiting) */ - while ((ret = net_lockedwait(&g_free_sem)) < 0) - { - /* The only case that an error should occur here is if - * the wait was awakened by a signal. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } - - UNUSED(ret); + net_lockedwait_uninterruptible(&g_free_sem); /* Is this the last reference on the connection? It might not be if the * socket was cloned. diff --git a/net/icmp/icmp_input.c b/net/icmp/icmp_input.c index f800f00f83..2bb83f3449 100644 --- a/net/icmp/icmp_input.c +++ b/net/icmp/icmp_input.c @@ -199,7 +199,7 @@ static uint16_t icmp_datahandler(FAR struct net_driver_s *dev, return buflen; drop_with_chain: - (void)iob_free_chain(iob, IOBUSER_NET_SOCK_ICMP); + iob_free_chain(iob, IOBUSER_NET_SOCK_ICMP); drop: dev->d_len = 0; diff --git a/net/icmp/icmp_poll.c b/net/icmp/icmp_poll.c index 5a55a00a2b..d4c89a6038 100644 --- a/net/icmp/icmp_poll.c +++ b/net/icmp/icmp_poll.c @@ -82,7 +82,7 @@ void icmp_poll(FAR struct net_driver_s *dev, FAR struct icmp_conn_s *conn) /* Perform the application callback */ - (void)devif_conn_event(dev, conn, ICMP_POLL, conn->list); + devif_conn_event(dev, conn, ICMP_POLL, conn->list); } #endif /* CONFIG_NET && CONFIG_NET_ICMP && CONFIG_NET_ICMP_SOCKET */ diff --git a/net/icmp/icmp_recvfrom.c b/net/icmp/icmp_recvfrom.c index 4555903a69..8ef86d1230 100644 --- a/net/icmp/icmp_recvfrom.c +++ b/net/icmp/icmp_recvfrom.c @@ -369,7 +369,7 @@ out: /* And free the I/O buffer chain */ - (void)iob_free_chain(iob, IOBUSER_NET_SOCK_ICMP); + iob_free_chain(iob, IOBUSER_NET_SOCK_ICMP); } return ret; diff --git a/net/icmpv6/icmpv6_autoconfig.c b/net/icmpv6/icmpv6_autoconfig.c index 9cd3c31efa..6edd23fbee 100644 --- a/net/icmpv6/icmpv6_autoconfig.c +++ b/net/icmpv6/icmpv6_autoconfig.c @@ -209,7 +209,7 @@ static int icmpv6_send_message(FAR struct net_driver_s *dev, bool advertise) * priority inheritance enabled. */ - (void)nxsem_init(&state.snd_sem, 0, 0); /* Doesn't really fail */ + nxsem_init(&state.snd_sem, 0, 0); /* Doesn't really fail */ nxsem_setprotocol(&state.snd_sem, SEM_PRIO_NONE); /* Remember the routing device name */ @@ -249,7 +249,7 @@ static int icmpv6_send_message(FAR struct net_driver_s *dev, bool advertise) do { - (void)net_lockedwait(&state.snd_sem); + net_lockedwait(&state.snd_sem); } while (!state.snd_sent); diff --git a/net/icmpv6/icmpv6_conn.c b/net/icmpv6/icmpv6_conn.c index b780147578..f0c80c5410 100644 --- a/net/icmpv6/icmpv6_conn.c +++ b/net/icmpv6/icmpv6_conn.c @@ -151,24 +151,13 @@ FAR struct icmpv6_conn_s *icmpv6_alloc(void) void icmpv6_free(FAR struct icmpv6_conn_s *conn) { - int ret; - /* The free list is protected by a semaphore (that behaves like a mutex). */ DEBUGASSERT(conn->crefs == 0); /* Take the semaphore (perhaps waiting) */ - while ((ret = net_lockedwait(&g_free_sem)) < 0) - { - /* The only case that an error should occur here is if - * the wait was awakened by a signal. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } - - UNUSED(ret); + net_lockedwait_uninterruptible(&g_free_sem); /* Remove the connection from the active list */ diff --git a/net/icmpv6/icmpv6_input.c b/net/icmpv6/icmpv6_input.c index bb2c1db77b..a6d4cb0496 100644 --- a/net/icmpv6/icmpv6_input.c +++ b/net/icmpv6/icmpv6_input.c @@ -204,7 +204,7 @@ static uint16_t icmpv6_datahandler(FAR struct net_driver_s *dev, return buflen; drop_with_chain: - (void)iob_free_chain(iob, IOBUSER_NET_SOCK_ICMPv6); + iob_free_chain(iob, IOBUSER_NET_SOCK_ICMPv6); drop: dev->d_len = 0; diff --git a/net/icmpv6/icmpv6_neighbor.c b/net/icmpv6/icmpv6_neighbor.c index cef79f36e9..8de2dbc575 100644 --- a/net/icmpv6/icmpv6_neighbor.c +++ b/net/icmpv6/icmpv6_neighbor.c @@ -280,7 +280,7 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr) * priority inheritance enabled. */ - (void)nxsem_init(&state.snd_sem, 0, 0); /* Doesn't really fail */ + nxsem_init(&state.snd_sem, 0, 0); /* Doesn't really fail */ nxsem_setprotocol(&state.snd_sem, SEM_PRIO_NONE); state.snd_retries = 0; /* No retries yet */ @@ -342,7 +342,7 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr) do { - (void)net_lockedwait(&state.snd_sem); + net_lockedwait(&state.snd_sem); } while (!state.snd_sent); diff --git a/net/icmpv6/icmpv6_notify.c b/net/icmpv6/icmpv6_notify.c index 6f9a190e28..5c514f89ea 100644 --- a/net/icmpv6/icmpv6_notify.c +++ b/net/icmpv6/icmpv6_notify.c @@ -107,7 +107,7 @@ void icmpv6_wait_setup(const net_ipv6addr_t ipaddr, * priority inheritance enabled. */ - (void)nxsem_init(¬ify->nt_sem, 0, 0); + nxsem_init(¬ify->nt_sem, 0, 0); nxsem_setprotocol(¬ify->nt_sem, SEM_PRIO_NONE); /* Add the wait structure to the list with interrupts disabled */ @@ -164,7 +164,7 @@ int icmpv6_wait_cancel(FAR struct icmpv6_notify_s *notify) } leave_critical_section(flags); - (void)nxsem_destroy(¬ify->nt_sem); + nxsem_destroy(¬ify->nt_sem); return ret; } @@ -208,14 +208,14 @@ int icmpv6_wait(FAR struct icmpv6_notify_s *notify, * the wrong error code. */ - (void)net_timedwait(¬ify->nt_sem, &abstime); + net_timedwait(¬ify->nt_sem, &abstime); ret = notify->nt_result; /* Remove our wait structure from the list (we may no longer be at the * head of the list). */ - (void)icmpv6_wait_cancel(notify); + icmpv6_wait_cancel(notify); /* Re-enable interrupts and return the result of the wait */ diff --git a/net/icmpv6/icmpv6_recvfrom.c b/net/icmpv6/icmpv6_recvfrom.c index b26d056245..db2d435948 100644 --- a/net/icmpv6/icmpv6_recvfrom.c +++ b/net/icmpv6/icmpv6_recvfrom.c @@ -376,7 +376,7 @@ out: /* And free the I/O buffer chain */ - (void)iob_free_chain(iob, IOBUSER_NET_SOCK_ICMPv6); + iob_free_chain(iob, IOBUSER_NET_SOCK_ICMPv6); } return ret; diff --git a/net/icmpv6/icmpv6_rnotify.c b/net/icmpv6/icmpv6_rnotify.c index dbc6e24b06..38de50ea1f 100644 --- a/net/icmpv6/icmpv6_rnotify.c +++ b/net/icmpv6/icmpv6_rnotify.c @@ -189,7 +189,7 @@ void icmpv6_rwait_setup(FAR struct net_driver_s *dev, * priority inheritance enabled. */ - (void)nxsem_init(¬ify->rn_sem, 0, 0); + nxsem_init(¬ify->rn_sem, 0, 0); nxsem_setprotocol(¬ify->rn_sem, SEM_PRIO_NONE); /* Add the wait structure to the list with interrupts disabled */ @@ -248,7 +248,7 @@ int icmpv6_rwait_cancel(FAR struct icmpv6_rnotify_s *notify) } leave_critical_section(flags); - (void)nxsem_destroy(¬ify->rn_sem); + nxsem_destroy(¬ify->rn_sem); return ret; } @@ -294,14 +294,14 @@ int icmpv6_rwait(FAR struct icmpv6_rnotify_s *notify, * the wrong error code. */ - (void)net_timedwait(¬ify->rn_sem, &abstime); + net_timedwait(¬ify->rn_sem, &abstime); ret = notify->rn_result; /* Remove our wait structure from the list (we may no longer be at the * head of the list). */ - (void)icmpv6_rwait_cancel(notify); + icmpv6_rwait_cancel(notify); /* Re-enable interrupts and return the result of the wait */ diff --git a/net/ieee802154/ieee802154_input.c b/net/ieee802154/ieee802154_input.c index ae6ba95b40..21382e4f1a 100644 --- a/net/ieee802154/ieee802154_input.c +++ b/net/ieee802154/ieee802154_input.c @@ -289,7 +289,7 @@ int ieee802154_input(FAR struct radio_driver_s *radio, * was not consumed. */ - (void)ieee802154_callback(radio, conn, IEEE802154_NEWDATA); + ieee802154_callback(radio, conn, IEEE802154_NEWDATA); } else { diff --git a/net/ieee802154/ieee802154_poll.c b/net/ieee802154/ieee802154_poll.c index 9d49c99003..c555b58641 100644 --- a/net/ieee802154/ieee802154_poll.c +++ b/net/ieee802154/ieee802154_poll.c @@ -100,7 +100,7 @@ void ieee802154_poll(FAR struct net_driver_s *dev, /* Perform the application callback */ - (void)ieee802154_callback(radio, conn, IEEE802154_POLL); + ieee802154_callback(radio, conn, IEEE802154_POLL); } } diff --git a/net/ieee802154/ieee802154_recvfrom.c b/net/ieee802154/ieee802154_recvfrom.c index 2ab12fb3ef..ee35d890b8 100644 --- a/net/ieee802154/ieee802154_recvfrom.c +++ b/net/ieee802154/ieee802154_recvfrom.c @@ -382,8 +382,8 @@ ssize_t ieee802154_recvfrom(FAR struct socket *psock, FAR void *buf, * hence, should not have priority inheritance enabled. */ - (void)nxsem_init(&state.ir_sem, 0, 0); /* Doesn't really fail */ - (void)nxsem_setprotocol(&state.ir_sem, SEM_PRIO_NONE); + nxsem_init(&state.ir_sem, 0, 0); /* Doesn't really fail */ + nxsem_setprotocol(&state.ir_sem, SEM_PRIO_NONE); /* Set up the callback in the connection */ @@ -400,7 +400,7 @@ ssize_t ieee802154_recvfrom(FAR struct socket *psock, FAR void *buf, * the task sleeps and automatically re-locked when the task restarts. */ - (void)net_lockedwait(&state.ir_sem); + net_lockedwait(&state.ir_sem); /* Make sure that no further events are processed */ diff --git a/net/ieee802154/ieee802154_sendto.c b/net/ieee802154/ieee802154_sendto.c index 66c35d73cd..b2f28cfa13 100644 --- a/net/ieee802154/ieee802154_sendto.c +++ b/net/ieee802154/ieee802154_sendto.c @@ -485,8 +485,8 @@ ssize_t psock_ieee802154_sendto(FAR struct socket *psock, FAR const void *buf, * priority inheritance enabled. */ - (void)nxsem_init(&state.is_sem, 0, 0); /* Doesn't really fail */ - (void)nxsem_setprotocol(&state.is_sem, SEM_PRIO_NONE); + nxsem_init(&state.is_sem, 0, 0); /* Doesn't really fail */ + nxsem_setprotocol(&state.is_sem, SEM_PRIO_NONE); state.is_sock = psock; /* Socket descriptor to use */ state.is_buflen = len; /* Number of bytes to send */ diff --git a/net/igmp/igmp_group.c b/net/igmp/igmp_group.c index 0c6aa68d32..db173d365c 100644 --- a/net/igmp/igmp_group.c +++ b/net/igmp/igmp_group.c @@ -238,7 +238,7 @@ void igmp_grpfree(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group) /* Destroy the wait semaphore */ - (void)nxsem_destroy(&group->sem); + nxsem_destroy(&group->sem); /* Destroy the wdog */ diff --git a/net/igmp/igmp_initialize.c b/net/igmp/igmp_initialize.c index 97a69781f3..def18f26b8 100644 --- a/net/igmp/igmp_initialize.c +++ b/net/igmp/igmp_initialize.c @@ -98,7 +98,7 @@ void igmp_devinit(struct net_driver_s *dev) /* Add the all systems address to the group */ - (void)igmp_grpalloc(dev, &g_ipv4_allsystems); + igmp_grpalloc(dev, &g_ipv4_allsystems); /* Allow the IGMP messages at the MAC level */ diff --git a/net/igmp/igmp_msg.c b/net/igmp/igmp_msg.c index 2cb7cc031c..e4d0a5d6f1 100644 --- a/net/igmp/igmp_msg.c +++ b/net/igmp/igmp_msg.c @@ -133,19 +133,10 @@ int igmp_waitmsg(FAR struct igmp_group_s *group, uint8_t msgid) { /* Wait for the semaphore to be posted */ - while ((ret = net_lockedwait(&group->sem)) < 0) + ret = net_lockedwait_uninterruptible(&group->sem); + if (ret < 0) { - /* The only error that should occur from net_lockedwait() is if - * the wait is awakened by a signal or, perhaps, canceled. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - if (ret != -EINTR) - { - break; - } - - ret = OK; + break; } } diff --git a/net/inet/inet_close.c b/net/inet/inet_close.c index 66a9b5c88d..632483b2ed 100644 --- a/net/inet/inet_close.c +++ b/net/inet/inet_close.c @@ -328,7 +328,7 @@ static inline int tcp_close_disconnect(FAR struct socket *psock) /* Wait for the disconnect event */ - (void)net_lockedwait(&state.cl_sem); + net_lockedwait(&state.cl_sem); /* We are now disconnected */ diff --git a/net/inet/inet_recvfrom.c b/net/inet/inet_recvfrom.c index b1d6cb9555..e4edc5cd0d 100644 --- a/net/inet/inet_recvfrom.c +++ b/net/inet/inet_recvfrom.c @@ -232,7 +232,7 @@ static inline void inet_tcp_newdata(FAR struct net_driver_s *dev, nsaved = tcp_datahandler(conn, buffer, buflen); #else - (void)tcp_datahandler(conn, buffer, buflen); + tcp_datahandler(conn, buffer, buflen); #endif /* There are complicated buffering issues that are not addressed fully @@ -287,7 +287,7 @@ static inline void inet_udp_newdata(FAR struct net_driver_s *dev, { /* Take as much data from the packet as we can */ - (void)inet_recvfrom_newdata(dev, pstate); + inet_recvfrom_newdata(dev, pstate); /* Indicate no data in the buffer */ @@ -359,7 +359,7 @@ static inline void inet_tcp_readahead(struct inet_recvfrom_s *pstate) /* And free the I/O buffer chain */ - (void)iob_free_chain(iob, IOBUSER_NET_TCP_READAHEAD); + iob_free_chain(iob, IOBUSER_NET_TCP_READAHEAD); } else { @@ -368,8 +368,8 @@ static inline void inet_tcp_readahead(struct inet_recvfrom_s *pstate) * buffer queue). */ - (void)iob_trimhead_queue(&conn->readahead, recvlen, - IOBUSER_NET_TCP_READAHEAD); + iob_trimhead_queue(&conn->readahead, recvlen, + IOBUSER_NET_TCP_READAHEAD); } } } @@ -458,7 +458,7 @@ out: /* And free the I/O buffer chain */ - (void)iob_free_chain(iob, IOBUSER_NET_UDP_READAHEAD); + iob_free_chain(iob, IOBUSER_NET_UDP_READAHEAD); } } #endif @@ -1099,8 +1099,8 @@ static void inet_recvfrom_initialize(FAR struct socket *psock, FAR void *buf, * priority inheritance enabled. */ - (void)nxsem_init(&pstate->ir_sem, 0, 0); /* Doesn't really fail */ - (void)nxsem_setprotocol(&pstate->ir_sem, SEM_PRIO_NONE); + nxsem_init(&pstate->ir_sem, 0, 0); /* Doesn't really fail */ + nxsem_setprotocol(&pstate->ir_sem, SEM_PRIO_NONE); pstate->ir_buflen = len; pstate->ir_buffer = buf; diff --git a/net/ipforward/ipv4_forward.c b/net/ipforward/ipv4_forward.c index 8c4f2724d2..e24c6dd118 100644 --- a/net/ipforward/ipv4_forward.c +++ b/net/ipforward/ipv4_forward.c @@ -548,7 +548,7 @@ void ipv4_forward_broadcast(FAR struct net_driver_s *dev, * of course, the device that received the packet. */ - (void)netdev_foreach(ipv4_forward_callback, dev); + netdev_foreach(ipv4_forward_callback, dev); } } #endif diff --git a/net/ipforward/ipv6_forward.c b/net/ipforward/ipv6_forward.c index 0622e5fbce..95a0313a88 100644 --- a/net/ipforward/ipv6_forward.c +++ b/net/ipforward/ipv6_forward.c @@ -710,7 +710,7 @@ void ipv6_forward_broadcast(FAR struct net_driver_s *dev, * of course, the device that received the packet. */ - (void)netdev_foreach(ipv6_forward_callback, dev); + netdev_foreach(ipv6_forward_callback, dev); } } #endif diff --git a/net/local/local_accept.c b/net/local/local_accept.c index 151491da64..24d509a4e0 100644 --- a/net/local/local_accept.c +++ b/net/local/local_accept.c @@ -73,7 +73,6 @@ static int local_waitlisten(FAR struct local_conn_s *server) ret = net_lockedwait(&server->lc_waitsem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } } diff --git a/net/local/local_bind.c b/net/local/local_bind.c index c831f11f70..391c07dc72 100644 --- a/net/local/local_bind.c +++ b/net/local/local_bind.c @@ -107,7 +107,7 @@ int psock_local_bind(FAR struct socket *psock, /* Copy the path into the connection structure */ - (void)strncpy(conn->lc_path, unaddr->sun_path, UNIX_PATH_MAX - 1); + strncpy(conn->lc_path, unaddr->sun_path, UNIX_PATH_MAX - 1); conn->lc_path[UNIX_PATH_MAX - 1] = '\0'; conn->lc_instance_id = -1; } diff --git a/net/local/local_connect.c b/net/local/local_connect.c index 7d54f0bafa..5df1700780 100644 --- a/net/local/local_connect.c +++ b/net/local/local_connect.c @@ -91,21 +91,7 @@ static int32_t local_generate_instance_id(void) static inline void _local_semtake(sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = net_lockedwait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + net_lockedwait_uninterruptible(sem); } #define _local_semgive(sem) nxsem_post(sem) @@ -233,11 +219,11 @@ static int inline local_stream_connect(FAR struct local_conn_s *client, return OK; errout_with_outfd: - (void)file_close(&client->lc_outfile); + file_close(&client->lc_outfile); client->lc_outfile.f_inode = NULL; errout_with_fifos: - (void)local_release_fifos(client); + local_release_fifos(client); client->lc_state = LOCAL_STATE_BOUND; return ret; } diff --git a/net/local/local_fifo.c b/net/local/local_fifo.c index d48313df1f..4165fd7b93 100644 --- a/net/local/local_fifo.c +++ b/net/local/local_fifo.c @@ -82,13 +82,13 @@ static inline void local_cs_name(FAR struct local_conn_s *conn, { if (conn->lc_instance_id < 0) { - (void)snprintf(path, LOCAL_FULLPATH_LEN - 1, "%s" LOCAL_CS_SUFFIX, - conn->lc_path); + snprintf(path, LOCAL_FULLPATH_LEN - 1, "%s" LOCAL_CS_SUFFIX, + conn->lc_path); } else { - (void)snprintf(path, LOCAL_FULLPATH_LEN - 1, "%s" LOCAL_CS_SUFFIX "%x", - conn->lc_path, conn->lc_instance_id); + snprintf(path, LOCAL_FULLPATH_LEN - 1, "%s" LOCAL_CS_SUFFIX "%x", + conn->lc_path, conn->lc_instance_id); } path[LOCAL_FULLPATH_LEN - 1] = '\0'; @@ -109,13 +109,13 @@ static inline void local_sc_name(FAR struct local_conn_s *conn, { if (conn->lc_instance_id < 0) { - (void)snprintf(path, LOCAL_FULLPATH_LEN - 1, "%s" LOCAL_SC_SUFFIX, - conn->lc_path); + snprintf(path, LOCAL_FULLPATH_LEN - 1, "%s" LOCAL_SC_SUFFIX, + conn->lc_path); } else { - (void)snprintf(path, LOCAL_FULLPATH_LEN - 1, "%s" LOCAL_SC_SUFFIX "%x", - conn->lc_path, conn->lc_instance_id); + snprintf(path, LOCAL_FULLPATH_LEN - 1, "%s" LOCAL_SC_SUFFIX "%x", + conn->lc_path, conn->lc_instance_id); } path[LOCAL_FULLPATH_LEN - 1] = '\0'; @@ -133,8 +133,8 @@ static inline void local_sc_name(FAR struct local_conn_s *conn, #ifdef CONFIG_NET_LOCAL_DGRAM static inline void local_hd_name(FAR const char *inpath, FAR char *outpath) { - (void)snprintf(outpath, LOCAL_FULLPATH_LEN - 1, "%s" LOCAL_HD_SUFFIX, - inpath); + snprintf(outpath, LOCAL_FULLPATH_LEN - 1, "%s" LOCAL_HD_SUFFIX, + inpath); outpath[LOCAL_FULLPATH_LEN - 1] = '\0'; } #endif /* CONFIG_NET_LOCAL_DGRAM */ diff --git a/net/local/local_netpoll.c b/net/local/local_netpoll.c index bf038c3af8..8506301b2b 100644 --- a/net/local/local_netpoll.c +++ b/net/local/local_netpoll.c @@ -248,7 +248,7 @@ int local_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds) ret = file_poll(&conn->lc_outfile, &shadowfds[1], true); if (ret < 0) { - (void)file_poll(&conn->lc_infile, &shadowfds[0], false); + file_poll(&conn->lc_infile, &shadowfds[0], false); } } diff --git a/net/local/local_recvfrom.c b/net/local/local_recvfrom.c index 6f4444a400..c34e9e0bb7 100644 --- a/net/local/local_recvfrom.c +++ b/net/local/local_recvfrom.c @@ -353,7 +353,7 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, /* Release our reference to the half duplex FIFO */ - (void)local_release_halfduplex(conn); + local_release_halfduplex(conn); /* Return the address family */ @@ -379,7 +379,7 @@ errout_with_halfduplex: /* Release our reference to the half duplex FIFO */ - (void)local_release_halfduplex(conn); + local_release_halfduplex(conn); return ret; } #endif /* CONFIG_NET_LOCAL_STREAM */ diff --git a/net/local/local_sendto.c b/net/local/local_sendto.c index 63c2ea7d48..4ac35b4ee1 100644 --- a/net/local/local_sendto.c +++ b/net/local/local_sendto.c @@ -171,7 +171,7 @@ errout_with_halfduplex: /* Release our reference to the half duplex FIFO */ - (void)local_release_halfduplex(conn); + local_release_halfduplex(conn); return nsent; } diff --git a/net/local/local_sockif.c b/net/local/local_sockif.c index bf5508be3a..97f0922ab4 100644 --- a/net/local/local_sockif.c +++ b/net/local/local_sockif.c @@ -409,7 +409,7 @@ static int local_getsockname(FAR struct socket *psock, /* Copy the path into the user address structure */ - (void)strncpy(unaddr->sun_path, conn->lc_path, namelen); + strncpy(unaddr->sun_path, conn->lc_path, namelen); unaddr->sun_path[pathlen - 1] = '\0'; *addrlen = sizeof(sa_family_t) + namelen; diff --git a/net/mld/mld_group.c b/net/mld/mld_group.c index 47c47b41e5..f1c0f34a23 100644 --- a/net/mld/mld_group.c +++ b/net/mld/mld_group.c @@ -166,7 +166,7 @@ FAR struct mld_group_s *mld_grpalloc(FAR struct net_driver_s *dev, return group; errout_with_sem: - (void)nxsem_destroy(&group->sem); + nxsem_destroy(&group->sem); kmm_free(group); return NULL; } @@ -260,7 +260,7 @@ void mld_grpfree(FAR struct net_driver_s *dev, FAR struct mld_group_s *group) /* Destroy the wait semaphore */ - (void)nxsem_destroy(&group->sem); + nxsem_destroy(&group->sem); /* Destroy the timers */ diff --git a/net/mld/mld_initialize.c b/net/mld/mld_initialize.c index c9ef9caae1..ee246c7b13 100644 --- a/net/mld/mld_initialize.c +++ b/net/mld/mld_initialize.c @@ -97,7 +97,7 @@ void mld_devinit(struct net_driver_s *dev) * probably is not relevant here. */ - (void)mld_grpalloc(dev, g_ipv6_allnodes); + mld_grpalloc(dev, g_ipv6_allnodes); /* Allow the MLD messages at the MAC level */ diff --git a/net/mld/mld_msg.c b/net/mld/mld_msg.c index 0c00630bc2..26751da19e 100644 --- a/net/mld/mld_msg.c +++ b/net/mld/mld_msg.c @@ -127,19 +127,10 @@ int mld_waitmsg(FAR struct mld_group_s *group, uint8_t msgtype) { /* Wait for the semaphore to be posted */ - while ((ret = net_lockedwait(&group->sem)) < 0) + ret = net_lockedwait_uninterruptible(&group->sem); + if (ret < 0) { - /* The only error that should occur from net_lockedwait() is if - * the wait is awakened by a signal or, perhaps, canceled. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - if (ret != -EINTR) - { - break; - } - - ret = OK; + break; } } diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c index dd740e01cb..e8720affdd 100644 --- a/net/netdev/netdev_ioctl.c +++ b/net/netdev/netdev_ioctl.c @@ -1785,7 +1785,7 @@ void netdev_ifdown(FAR struct net_driver_s *dev) /* Notify clients that the network has been taken down */ - (void)devif_dev_event(dev, NULL, NETDEV_DOWN); + devif_dev_event(dev, NULL, NETDEV_DOWN); #ifdef CONFIG_NETDOWN_NOTIFIER /* Provide signal notifications to threads that want to be diff --git a/net/netdev/netdev_txnotify.c b/net/netdev/netdev_txnotify.c index 51881f9e06..35fbec98c0 100644 --- a/net/netdev/netdev_txnotify.c +++ b/net/netdev/netdev_txnotify.c @@ -81,7 +81,7 @@ void netdev_ipv4_txnotify(in_addr_t lipaddr, in_addr_t ripaddr) { /* Notify the device driver that new TX data is available. */ - (void)dev->d_txavail(dev); + dev->d_txavail(dev); } } #endif /* CONFIG_NET_IPv4 */ @@ -115,7 +115,7 @@ void netdev_ipv6_txnotify(FAR const net_ipv6addr_t lipaddr, { /* Notify the device driver that new TX data is available. */ - (void)dev->d_txavail(dev); + dev->d_txavail(dev); } } #endif /* CONFIG_NET_IPv6 */ @@ -142,7 +142,7 @@ void netdev_txnotify_dev(FAR struct net_driver_s *dev) { /* Notify the device driver that new TX data is available. */ - (void)dev->d_txavail(dev); + dev->d_txavail(dev); } } diff --git a/net/netlink/netlink_conn.c b/net/netlink/netlink_conn.c index 00d4fc1af6..6fad4bca56 100644 --- a/net/netlink/netlink_conn.c +++ b/net/netlink/netlink_conn.c @@ -90,23 +90,12 @@ static dq_queue_t g_active_netlink_connections; static void _netlink_semtake(FAR sem_t *sem) { - int ret; - - /* Take the semaphore (perhaps waiting) */ - - while ((ret = net_lockedwait(sem)) < 0) - { - /* The only case that an error should occur here is if - * the wait was awakened by a signal. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } + net_lockedwait_uninterruptible(sem); } static void _netlink_semgive(FAR sem_t *sem) { - (void)nxsem_post(sem); + nxsem_post(sem); } /**************************************************************************** diff --git a/net/pkt/pkt_conn.c b/net/pkt/pkt_conn.c index 1a21528f16..8e6f949065 100644 --- a/net/pkt/pkt_conn.c +++ b/net/pkt/pkt_conn.c @@ -89,20 +89,7 @@ static dq_queue_t g_active_pkt_connections; static inline void _pkt_semtake(sem_t *sem) { - int ret; - - /* Take the semaphore (perhaps waiting) */ - - while ((ret = net_lockedwait(sem)) < 0) - { - /* The only case that an error should occur here is if - * the wait was awakened by a signal. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } - - UNUSED(ret); + net_lockedwait_uninterruptible(sem); } #define _pkt_semgive(sem) nxsem_post(sem) diff --git a/net/pkt/pkt_poll.c b/net/pkt/pkt_poll.c index 0379d9b294..6e99eac084 100644 --- a/net/pkt/pkt_poll.c +++ b/net/pkt/pkt_poll.c @@ -90,7 +90,7 @@ void pkt_poll(FAR struct net_driver_s *dev, FAR struct pkt_conn_s *conn) /* Perform the application callback */ - (void)pkt_callback(dev, conn, PKT_POLL); + pkt_callback(dev, conn, PKT_POLL); /* Check if the application has data to send */ diff --git a/net/pkt/pkt_recvfrom.c b/net/pkt/pkt_recvfrom.c index 8b8a5106ed..70f99de3e6 100644 --- a/net/pkt/pkt_recvfrom.c +++ b/net/pkt/pkt_recvfrom.c @@ -264,8 +264,8 @@ static void pkt_recvfrom_initialize(FAR struct socket *psock, FAR void *buf, * priority inheritance enabled. */ - (void)nxsem_init(&pstate->pr_sem, 0, 0); /* Doesn't really fail */ - (void)nxsem_setprotocol(&pstate->pr_sem, SEM_PRIO_NONE); + nxsem_init(&pstate->pr_sem, 0, 0); /* Doesn't really fail */ + nxsem_setprotocol(&pstate->pr_sem, SEM_PRIO_NONE); pstate->pr_buflen = len; pstate->pr_buffer = buf; diff --git a/net/pkt/pkt_send.c b/net/pkt/pkt_send.c index aec0e724db..71e3436bcc 100644 --- a/net/pkt/pkt_send.c +++ b/net/pkt/pkt_send.c @@ -204,8 +204,8 @@ ssize_t psock_pkt_send(FAR struct socket *psock, FAR const void *buf, * priority inheritance enabled. */ - (void)nxsem_init(&state.snd_sem, 0, 0); /* Doesn't really fail */ - (void)nxsem_setprotocol(&state.snd_sem, SEM_PRIO_NONE); + nxsem_init(&state.snd_sem, 0, 0); /* Doesn't really fail */ + nxsem_setprotocol(&state.snd_sem, SEM_PRIO_NONE); state.snd_sock = psock; /* Socket descriptor to use */ state.snd_buflen = len; /* Number of bytes to send */ diff --git a/net/procfs/net_procfs_route.c b/net/procfs/net_procfs_route.c index 7da4c6c2ef..9be762318a 100644 --- a/net/procfs/net_procfs_route.c +++ b/net/procfs/net_procfs_route.c @@ -318,9 +318,9 @@ static int route_ipv4_entry(FAR struct net_route_ipv4_s *route, FAR void *arg) /* Generate routing table entry on one line */ - (void)inet_ntop(AF_INET, &route->target, target, INET_ADDRSTRLEN); - (void)inet_ntop(AF_INET, &route->netmask, netmask, INET_ADDRSTRLEN); - (void)inet_ntop(AF_INET, &route->router, router, INET_ADDRSTRLEN); + inet_ntop(AF_INET, &route->target, target, INET_ADDRSTRLEN); + inet_ntop(AF_INET, &route->netmask, netmask, INET_ADDRSTRLEN); + inet_ntop(AF_INET, &route->router, router, INET_ADDRSTRLEN); info->index++; route_sprintf(info, "%4u. %-16s%-16s%-16s\n", @@ -355,7 +355,7 @@ static int route_ipv6_entry(FAR struct net_route_ipv6_s *route, FAR void *arg) /* Generate routing table entry on three lines */ info->index++; - (void)inet_ntop(AF_INET6, route->target, addr, INET6_ADDRSTRLEN); + inet_ntop(AF_INET6, route->target, addr, INET6_ADDRSTRLEN); route_sprintf(info, "%4u. TARGET %s\n", info->index, addr); if (info->totalsize >= info->buflen) @@ -363,14 +363,14 @@ static int route_ipv6_entry(FAR struct net_route_ipv6_s *route, FAR void *arg) return 1; } - (void)inet_ntop(AF_INET6, route->netmask, addr, INET6_ADDRSTRLEN); + inet_ntop(AF_INET6, route->netmask, addr, INET6_ADDRSTRLEN); route_sprintf(info, " NETMASK %s\n", addr); if (info->totalsize >= info->buflen) { return 1; } - (void)inet_ntop(AF_INET6, route->router, addr, INET6_ADDRSTRLEN); + inet_ntop(AF_INET6, route->router, addr, INET6_ADDRSTRLEN); route_sprintf(info, " ROUTER %s\n", addr); return (info->totalsize >= info->buflen) ? 1 : 0; } @@ -405,7 +405,7 @@ static ssize_t route_ipv4_table(FAR struct route_file_s *procfile, /* Generate each entry in the routing table */ - (void)net_foreachroute_ipv4(route_ipv4_entry, &info); + net_foreachroute_ipv4(route_ipv4_entry, &info); return info.totalsize; } #endif @@ -430,7 +430,7 @@ static ssize_t route_ipv6_table(FAR struct route_file_s *procfile, /* Generate each entry in the routing table */ - (void)net_foreachroute_ipv6(route_ipv6_entry, &info); + net_foreachroute_ipv6(route_ipv6_entry, &info); return info.totalsize; } #endif diff --git a/net/route/net_add_fileroute.c b/net/route/net_add_fileroute.c index 20673a54a9..1b0ba9d406 100644 --- a/net/route/net_add_fileroute.c +++ b/net/route/net_add_fileroute.c @@ -98,7 +98,7 @@ int net_addroute_ipv4(in_addr_t target, in_addr_t netmask, in_addr_t router) nwritten = net_writeroute_ipv4(&fshandle, &route); - (void)net_closeroute_ipv4(&fshandle); + net_closeroute_ipv4(&fshandle); return nwritten >= 0 ? 0 : (int)nwritten; } #endif @@ -132,7 +132,7 @@ int net_addroute_ipv6(net_ipv6addr_t target, net_ipv6addr_t netmask, nwritten = net_writeroute_ipv6(&fshandle, &route); - (void)net_closeroute_ipv6(&fshandle); + net_closeroute_ipv6(&fshandle); return nwritten >= 0 ? 0 : (int)nwritten; } #endif diff --git a/net/route/net_cacheroute.c b/net/route/net_cacheroute.c index 7cce8ba31d..77966295db 100644 --- a/net/route/net_cacheroute.c +++ b/net/route/net_cacheroute.c @@ -179,8 +179,8 @@ static sem_t g_ipv6_cachelock; * ****************************************************************************/ -#define net_lock_ipv4_cache() nxsem_wait(&g_ipv4_cachelock); -#define net_lock_ipv6_cache() nxsem_wait(&g_ipv6_cachelock); +#define net_lock_ipv4_cache() nxsem_wait_uninterruptible(&g_ipv4_cachelock) +#define net_lock_ipv6_cache() nxsem_wait_uninterruptible(&g_ipv6_cachelock) /**************************************************************************** * Name: net_unlock_ipv4_cache and net_unlock_ipv6_cache @@ -786,16 +786,9 @@ int net_foreachcache_ipv6(route_handler_ipv6_t handler, FAR void *arg) #ifdef CONFIG_ROUTE_IPv4_CACHEROUTE void net_flushcache_ipv4(void) { - int ret; - /* Get exclusive access to the cache */ - do - { - ret = net_lock_ipv4_cache(); - } - while (ret == -EINTR); - DEBUGASSERT(ret == OK); + net_lock_ipv4_cache(); /* Reset the cache */ @@ -810,16 +803,9 @@ void net_flushcache_ipv4(void) #ifdef CONFIG_ROUTE_IPv6_CACHEROUTE void net_flushcache_ipv6(void) { - int ret; - /* Get exclusive access to the cache */ - do - { - ret = net_lock_ipv6_cache(); - } - while (ret == -EINTR); - DEBUGASSERT(ret == OK); + net_lock_ipv6_cache(); /* Reset the cache */ diff --git a/net/route/net_del_fileroute.c b/net/route/net_del_fileroute.c index b09227e236..12b5a2fe92 100644 --- a/net/route/net_del_fileroute.c +++ b/net/route/net_del_fileroute.c @@ -325,10 +325,10 @@ int net_delroute_ipv4(in_addr_t target, in_addr_t netmask) ret = file_truncate(&fshandle, filesize); errout_with_fshandle: - (void)net_closeroute_ipv4(&fshandle); + net_closeroute_ipv4(&fshandle); errout_with_lock: - (void)net_unlockroute_ipv4(); + net_unlockroute_ipv4(); return ret; } #endif @@ -474,10 +474,10 @@ int net_delroute_ipv6(net_ipv6addr_t target, net_ipv6addr_t netmask) ret = file_truncate(&fshandle, filesize); errout_with_fshandle: - (void)net_closeroute_ipv6(&fshandle); + net_closeroute_ipv6(&fshandle); errout_with_lock: - (void)net_unlockroute_ipv6(); + net_unlockroute_ipv6(); return ret; } #endif diff --git a/net/route/net_del_ramroute.c b/net/route/net_del_ramroute.c index 785e32a42b..1a6d3032bc 100644 --- a/net/route/net_del_ramroute.c +++ b/net/route/net_del_ramroute.c @@ -114,12 +114,12 @@ static int net_match_ipv4(FAR struct net_route_ipv4_s *route, FAR void *arg) if (match->prev) { - (void)ramroute_ipv4_remafter((FAR struct net_route_ipv4_entry_s *)match->prev, - &g_ipv4_routes); + ramroute_ipv4_remafter((FAR struct net_route_ipv4_entry_s *)match->prev, + &g_ipv4_routes); } else { - (void)ramroute_ipv4_remfirst(&g_ipv4_routes); + ramroute_ipv4_remfirst(&g_ipv4_routes); } /* And free the routing table entry by adding it to the free list */ @@ -167,12 +167,12 @@ static int net_match_ipv6(FAR struct net_route_ipv6_s *route, FAR void *arg) if (match->prev) { - (void)ramroute_ipv6_remafter((FAR struct net_route_ipv6_entry_s *)match->prev, - &g_ipv6_routes); + ramroute_ipv6_remafter((FAR struct net_route_ipv6_entry_s *)match->prev, + &g_ipv6_routes); } else { - (void)ramroute_ipv6_remfirst(&g_ipv6_routes); + ramroute_ipv6_remfirst(&g_ipv6_routes); } /* And free the routing table entry by adding it to the free list */ diff --git a/net/route/net_fileroute.c b/net/route/net_fileroute.c index afca9a138a..a212f63c5f 100644 --- a/net/route/net_fileroute.c +++ b/net/route/net_fileroute.c @@ -269,7 +269,7 @@ int net_openroute_ipv4(int oflags, FAR struct file *filep) } } - (void)net_unlockroute_ipv4(); + net_unlockroute_ipv4(); return ret; } #endif @@ -299,7 +299,7 @@ int net_openroute_ipv6(int oflags, FAR struct file *filep) } } - (void)net_unlockroute_ipv6(); + net_unlockroute_ipv6(); return ret; } #endif @@ -364,7 +364,7 @@ ssize_t net_readroute_ipv4(FAR struct file *filep, } while (ntotal < sizeof(struct net_route_ipv4_s)); - (void)net_unlockroute_ipv4(); + net_unlockroute_ipv4(); return ntotal; } #endif @@ -412,7 +412,7 @@ ssize_t net_readroute_ipv6(FAR struct file *filep, } while (ntotal < sizeof(struct net_route_ipv6_s)); - (void)net_unlockroute_ipv6(); + net_unlockroute_ipv6(); return ntotal; } #endif @@ -476,7 +476,7 @@ ssize_t net_writeroute_ipv4(FAR struct file *filep, } while (ntotal < sizeof(struct net_route_ipv4_s)); - (void)net_unlockroute_ipv4(); + net_unlockroute_ipv4(); return ntotal; } #endif @@ -524,7 +524,7 @@ ssize_t net_writeroute_ipv6(FAR struct file *filep, } while (ntotal < sizeof(struct net_route_ipv6_s)); - (void)net_unlockroute_ipv6(); + net_unlockroute_ipv6(); return ret; } #endif diff --git a/net/route/net_foreach_fileroute.c b/net/route/net_foreach_fileroute.c index 7f59a335bf..b253a3650e 100644 --- a/net/route/net_foreach_fileroute.c +++ b/net/route/net_foreach_fileroute.c @@ -136,7 +136,7 @@ int net_foreachroute_ipv4(route_handler_ipv4_t handler, FAR void *arg) } } - (void)net_closeroute_ipv4(&fshandle); + net_closeroute_ipv4(&fshandle); return ret; } #endif @@ -205,7 +205,7 @@ int net_foreachroute_ipv6(route_handler_ipv6_t handler, FAR void *arg) } } - (void)net_closeroute_ipv6(&fshandle); + net_closeroute_ipv6(&fshandle); return ret; } #endif diff --git a/net/route/net_router.c b/net/route/net_router.c index cecb4ec529..090d1c4bc3 100644 --- a/net/route/net_router.c +++ b/net/route/net_router.c @@ -256,7 +256,7 @@ int net_ipv4_router(in_addr_t target, FAR in_addr_t *router) * will update it to the most recently accessed. */ - (void)net_addcache_ipv4(&match.entry); + net_addcache_ipv4(&match.entry); #endif /* Return the router address. */ @@ -331,7 +331,7 @@ int net_ipv6_router(const net_ipv6addr_t target, net_ipv6addr_t router) * will update it to the most recently accessed. */ - (void)net_addcache_ipv6(&match.entry); + net_addcache_ipv6(&match.entry); #endif /* Return the router address. */ diff --git a/net/sixlowpan/sixlowpan_framelist.c b/net/sixlowpan/sixlowpan_framelist.c index c1911c1098..f9581abaa0 100644 --- a/net/sixlowpan/sixlowpan_framelist.c +++ b/net/sixlowpan/sixlowpan_framelist.c @@ -271,7 +271,7 @@ static int sixlowpan_ieee802154_metadata(FAR struct radio_driver_s *radio, * PAN IDs are the same. */ - (void)sixlowpan_src_panid(radio, pktmeta.dpanid); + sixlowpan_src_panid(radio, pktmeta.dpanid); /* Based on the collected attributes and addresses, construct the MAC meta * data structure that we need to interface with the IEEE802.15.4 MAC (we diff --git a/net/sixlowpan/sixlowpan_icmpv6send.c b/net/sixlowpan/sixlowpan_icmpv6send.c index a4ef1dc79a..09df100a42 100644 --- a/net/sixlowpan/sixlowpan_icmpv6send.c +++ b/net/sixlowpan/sixlowpan_icmpv6send.c @@ -145,7 +145,7 @@ void sixlowpan_icmpv6_send(FAR struct net_driver_s *dev, buf = (FAR uint8_t *)ipv6 + hdrlen; buflen = dev->d_len - hdrlen; - (void)sixlowpan_queue_frames( + sixlowpan_queue_frames( (FAR struct radio_driver_s *)fwddev, &ipv6icmpv6->ipv6, buf, buflen, &destmac); } diff --git a/net/sixlowpan/sixlowpan_send.c b/net/sixlowpan/sixlowpan_send.c index 16ec94466a..13b76495da 100644 --- a/net/sixlowpan/sixlowpan_send.c +++ b/net/sixlowpan/sixlowpan_send.c @@ -283,7 +283,7 @@ int sixlowpan_send(FAR struct net_driver_s *dev, /* Initialize the send state structure */ nxsem_init(&sinfo.s_waitsem, 0, 0); - (void)nxsem_setprotocol(&sinfo.s_waitsem, SEM_PRIO_NONE); + nxsem_setprotocol(&sinfo.s_waitsem, SEM_PRIO_NONE); sinfo.s_result = -EBUSY; sinfo.s_timeout = timeout; diff --git a/net/sixlowpan/sixlowpan_tcpsend.c b/net/sixlowpan/sixlowpan_tcpsend.c index 67d83e4bb7..3b695cdcdc 100644 --- a/net/sixlowpan/sixlowpan_tcpsend.c +++ b/net/sixlowpan/sixlowpan_tcpsend.c @@ -685,7 +685,7 @@ static int sixlowpan_send_packet(FAR struct socket *psock, /* Initialize the send state structure */ nxsem_init(&sinfo.s_waitsem, 0, 0); - (void)nxsem_setprotocol(&sinfo.s_waitsem, SEM_PRIO_NONE); + nxsem_setprotocol(&sinfo.s_waitsem, SEM_PRIO_NONE); sinfo.s_sock = psock; sinfo.s_result = -EBUSY; @@ -983,7 +983,7 @@ void sixlowpan_tcp_send(FAR struct net_driver_s *dev, buf = (FAR uint8_t *)ipv6 + hdrlen; buflen = dev->d_len - hdrlen; - (void)sixlowpan_queue_frames( + sixlowpan_queue_frames( (FAR struct radio_driver_s *)fwddev, &ipv6hdr->ipv6, buf, buflen, &destmac); } diff --git a/net/sixlowpan/sixlowpan_udpsend.c b/net/sixlowpan/sixlowpan_udpsend.c index ffb62bd44d..1d111a2cd9 100644 --- a/net/sixlowpan/sixlowpan_udpsend.c +++ b/net/sixlowpan/sixlowpan_udpsend.c @@ -486,7 +486,7 @@ void sixlowpan_udp_send(FAR struct net_driver_s *dev, buf = (FAR uint8_t *)ipv6 + hdrlen; buflen = dev->d_len - hdrlen; - (void)sixlowpan_queue_frames( + sixlowpan_queue_frames( (FAR struct radio_driver_s *)fwddev, &ipv6udp->ipv6, buf, buflen, &destmac); } diff --git a/net/socket/accept.c b/net/socket/accept.c index 39ed7a826f..eebf563189 100644 --- a/net/socket/accept.c +++ b/net/socket/accept.c @@ -245,7 +245,7 @@ int accept(int sockfd, FAR struct sockaddr *addr, FAR socklen_t *addrlen) /* accept() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Verify that the sockfd corresponds to valid, allocated socket */ diff --git a/net/socket/connect.c b/net/socket/connect.c index 3fdaac807f..9e3ff5b114 100644 --- a/net/socket/connect.c +++ b/net/socket/connect.c @@ -235,7 +235,7 @@ int connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen) /* accept() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Get the underlying socket structure */ diff --git a/net/socket/net_clone.c b/net/socket/net_clone.c index 4e77f3a84f..93900c933a 100644 --- a/net/socket/net_clone.c +++ b/net/socket/net_clone.c @@ -140,7 +140,7 @@ int net_clone(FAR struct socket *psock1, FAR struct socket *psock2) * count decrements to zero. */ - (void)inet_close(psock2); + inet_close(psock2); /* Then release our reference on the socket structure containing * the connection. diff --git a/net/socket/net_sockets.c b/net/socket/net_sockets.c index e827af0d4b..0e8b8a34ba 100644 --- a/net/socket/net_sockets.c +++ b/net/socket/net_sockets.c @@ -57,20 +57,7 @@ static void _net_semtake(FAR struct socketlist *list) { - int ret; - - /* Take the semaphore (perhaps waiting) */ - - while ((ret = net_lockedwait(&list->sl_sem)) < 0) - { - /* The only case that an error should occr here is if - * the wait was awakened by a signal. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } - - UNUSED(ret); + net_lockedwait_uninterruptible(&list->sl_sem); } #define _net_semgive(list) nxsem_post(&list->sl_sem) @@ -97,7 +84,7 @@ void net_initlist(FAR struct socketlist *list) { /* Initialize the list access mutex */ - (void)nxsem_init(&list->sl_sem, 0, 1); + nxsem_init(&list->sl_sem, 0, 1); } /**************************************************************************** @@ -127,13 +114,13 @@ void net_releaselist(FAR struct socketlist *list) FAR struct socket *psock = &list->sl_sockets[ndx]; if (psock->s_crefs > 0) { - (void)psock_close(psock); + psock_close(psock); } } /* Destroy the semaphore */ - (void)nxsem_destroy(&list->sl_sem); + nxsem_destroy(&list->sl_sem); } /**************************************************************************** diff --git a/net/socket/recvfrom.c b/net/socket/recvfrom.c index 60a95352e1..807710f463 100644 --- a/net/socket/recvfrom.c +++ b/net/socket/recvfrom.c @@ -220,7 +220,7 @@ ssize_t recvfrom(int sockfd, FAR void *buf, size_t len, int flags, /* recvfrom() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Get the underlying socket structure */ diff --git a/net/socket/send.c b/net/socket/send.c index f75fdc32f7..afab5f2945 100644 --- a/net/socket/send.c +++ b/net/socket/send.c @@ -230,7 +230,7 @@ ssize_t send(int sockfd, FAR const void *buf, size_t len, int flags) /* send() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Get the underlying socket structure */ diff --git a/net/socket/sendto.c b/net/socket/sendto.c index 417afb9517..cfb64dfe97 100644 --- a/net/socket/sendto.c +++ b/net/socket/sendto.c @@ -243,7 +243,7 @@ ssize_t sendto(int sockfd, FAR const void *buf, size_t len, int flags, /* sendto() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Get the underlying socket structure */ diff --git a/net/tcp/tcp_backlog.c b/net/tcp/tcp_backlog.c index 28bcb315e6..e0314b1d72 100644 --- a/net/tcp/tcp_backlog.c +++ b/net/tcp/tcp_backlog.c @@ -374,7 +374,7 @@ int tcp_backlogdelete(FAR struct tcp_conn_s *conn, * pending connections */ - (void)sq_remafter(&prev->bc_node, &bls->bl_pending); + sq_remafter(&prev->bc_node, &bls->bl_pending); } else { @@ -382,7 +382,7 @@ int tcp_backlogdelete(FAR struct tcp_conn_s *conn, * pending connections */ - (void)sq_remfirst(&bls->bl_pending); + sq_remfirst(&bls->bl_pending); } /* Put container in the free list */ diff --git a/net/tcp/tcp_callback.c b/net/tcp/tcp_callback.c index c9f8c55d92..73f49f1d3e 100644 --- a/net/tcp/tcp_callback.c +++ b/net/tcp/tcp_callback.c @@ -271,7 +271,7 @@ uint16_t tcp_datahandler(FAR struct tcp_conn_s *conn, FAR uint8_t *buffer, */ nerr("ERROR: Failed to add data to the I/O buffer chain: %d\n", ret); - (void)iob_free_chain(iob, IOBUSER_NET_TCP_READAHEAD); + iob_free_chain(iob, IOBUSER_NET_TCP_READAHEAD); return 0; } @@ -283,7 +283,7 @@ uint16_t tcp_datahandler(FAR struct tcp_conn_s *conn, FAR uint8_t *buffer, if (ret < 0) { nerr("ERROR: Failed to queue the I/O buffer chain: %d\n", ret); - (void)iob_free_chain(iob, IOBUSER_NET_TCP_READAHEAD); + iob_free_chain(iob, IOBUSER_NET_TCP_READAHEAD); return 0; } diff --git a/net/tcp/tcp_connect.c b/net/tcp/tcp_connect.c index 8ab964568a..1a8c4e77d3 100644 --- a/net/tcp/tcp_connect.c +++ b/net/tcp/tcp_connect.c @@ -106,8 +106,8 @@ static inline int psock_setup_callbacks(FAR struct socket *psock, * priority inheritance enabled. */ - (void)nxsem_init(&pstate->tc_sem, 0, 0); /* Doesn't really fail */ - (void)nxsem_setprotocol(&pstate->tc_sem, SEM_PRIO_NONE); + nxsem_init(&pstate->tc_sem, 0, 0); /* Doesn't really fail */ + nxsem_setprotocol(&pstate->tc_sem, SEM_PRIO_NONE); pstate->tc_conn = conn; pstate->tc_psock = psock; @@ -345,7 +345,7 @@ int psock_tcp_connect(FAR struct socket *psock, /* Uninitialize the state structure */ - (void)nxsem_destroy(&state.tc_sem); + nxsem_destroy(&state.tc_sem); /* If net_lockedwait failed, negated errno was returned. */ diff --git a/net/tcp/tcp_input.c b/net/tcp/tcp_input.c index c1f94d8ac7..db718be9df 100644 --- a/net/tcp/tcp_input.c +++ b/net/tcp/tcp_input.c @@ -379,7 +379,7 @@ found: if (listener != NULL) { - (void)tcp_callback(dev, listener, TCP_ABORT); + tcp_callback(dev, listener, TCP_ABORT); } goto drop; @@ -731,7 +731,7 @@ found: /* Inform the application that the connection failed */ - (void)tcp_callback(dev, conn, TCP_ABORT); + tcp_callback(dev, conn, TCP_ABORT); /* The connection is closed after we send the RST */ @@ -788,7 +788,7 @@ found: flags |= TCP_NEWDATA; } - (void)tcp_callback(dev, conn, flags); + tcp_callback(dev, conn, flags); conn->tcpstateflags = TCP_LAST_ACK; conn->tx_unacked = 1; @@ -926,7 +926,7 @@ found: conn->tcpstateflags = TCP_CLOSED; ninfo("TCP_LAST_ACK TCP state: TCP_CLOSED\n"); - (void)tcp_callback(dev, conn, TCP_CLOSE); + tcp_callback(dev, conn, TCP_CLOSE); } break; @@ -956,7 +956,7 @@ found: } net_incr32(conn->rcvseq, 1); - (void)tcp_callback(dev, conn, TCP_CLOSE); + tcp_callback(dev, conn, TCP_CLOSE); tcp_send(dev, conn, TCP_ACK, tcpiplen); return; } @@ -988,7 +988,7 @@ found: ninfo("TCP state: TCP_TIME_WAIT\n"); net_incr32(conn->rcvseq, 1); - (void)tcp_callback(dev, conn, TCP_CLOSE); + tcp_callback(dev, conn, TCP_CLOSE); tcp_send(dev, conn, TCP_ACK, tcpiplen); return; } diff --git a/net/tcp/tcp_listen.c b/net/tcp/tcp_listen.c index 362eb33211..f43d5d5e98 100644 --- a/net/tcp/tcp_listen.c +++ b/net/tcp/tcp_listen.c @@ -301,7 +301,7 @@ int tcp_accept_connection(FAR struct net_driver_s *dev, ret = tcp_backlogadd(listener, conn); if (ret == OK) { - (void)tcp_callback(dev, listener, TCP_BACKLOG); + tcp_callback(dev, listener, TCP_BACKLOG); } } #endif diff --git a/net/tcp/tcp_monitor.c b/net/tcp/tcp_monitor.c index 3a1ecf930d..633337dc2f 100644 --- a/net/tcp/tcp_monitor.c +++ b/net/tcp/tcp_monitor.c @@ -217,7 +217,7 @@ static void tcp_shutdown_monitor(FAR struct tcp_conn_s *conn, uint16_t flags) */ net_lock(); - (void)tcp_callback(conn->dev, conn, flags); + tcp_callback(conn->dev, conn, flags); /* Free all allocated connection event callback structures */ @@ -393,7 +393,7 @@ void tcp_close_monitor(FAR struct socket *psock) { if (cb->event != NULL && (cb->flags & TCP_CLOSE) != 0) { - (void)cb->event(conn->dev, conn, cb->priv, TCP_CLOSE); + cb->event(conn->dev, conn, cb->priv, TCP_CLOSE); } } #endif diff --git a/net/tcp/tcp_send_unbuffered.c b/net/tcp/tcp_send_unbuffered.c index b2a09da6f8..1a77821214 100644 --- a/net/tcp/tcp_send_unbuffered.c +++ b/net/tcp/tcp_send_unbuffered.c @@ -723,8 +723,8 @@ ssize_t psock_tcp_send(FAR struct socket *psock, * priority inheritance enabled. */ - (void)nxsem_init(&state.snd_sem, 0, 0); /* Doesn't really fail */ - (void)nxsem_setprotocol(&state.snd_sem, SEM_PRIO_NONE); + nxsem_init(&state.snd_sem, 0, 0); /* Doesn't really fail */ + nxsem_setprotocol(&state.snd_sem, SEM_PRIO_NONE); state.snd_sock = psock; /* Socket descriptor to use */ state.snd_buflen = len; /* Number of bytes to send */ diff --git a/net/tcp/tcp_txdrain.c b/net/tcp/tcp_txdrain.c index b3fd7220f0..dfd9d14fd9 100644 --- a/net/tcp/tcp_txdrain.c +++ b/net/tcp/tcp_txdrain.c @@ -159,11 +159,7 @@ int tcp_txdrain(FAR struct socket *psock, * wait for it to drain or be be disconnected. */ - do - { - ret = net_timedwait(&waitsem, abstime); - } - while (ret == -EINTR); + ret = net_timedwait_uninterruptible(&waitsem, abstime); /* Tear down the disconnect notifier */ diff --git a/net/udp/udp_callback.c b/net/udp/udp_callback.c index 3343f40d0e..8b882a69d1 100644 --- a/net/udp/udp_callback.c +++ b/net/udp/udp_callback.c @@ -187,7 +187,7 @@ static uint16_t udp_datahandler(FAR struct net_driver_s *dev, */ nerr("ERROR: Failed to add data to the I/O buffer chain: %d\n", ret); - (void)iob_free_chain(iob, IOBUSER_NET_UDP_READAHEAD); + iob_free_chain(iob, IOBUSER_NET_UDP_READAHEAD); return 0; } @@ -200,7 +200,7 @@ static uint16_t udp_datahandler(FAR struct net_driver_s *dev, */ nerr("ERROR: Failed to add data to the I/O buffer chain: %d\n", ret); - (void)iob_free_chain(iob, IOBUSER_NET_UDP_READAHEAD); + iob_free_chain(iob, IOBUSER_NET_UDP_READAHEAD); return 0; } @@ -219,7 +219,7 @@ static uint16_t udp_datahandler(FAR struct net_driver_s *dev, nerr("ERROR: Failed to add data to the I/O buffer chain: %d\n", ret); - (void)iob_free_chain(iob, IOBUSER_NET_UDP_READAHEAD); + iob_free_chain(iob, IOBUSER_NET_UDP_READAHEAD); return 0; } } @@ -230,7 +230,7 @@ static uint16_t udp_datahandler(FAR struct net_driver_s *dev, if (ret < 0) { nerr("ERROR: Failed to queue the I/O buffer chain: %d\n", ret); - (void)iob_free_chain(iob, IOBUSER_NET_UDP_READAHEAD); + iob_free_chain(iob, IOBUSER_NET_UDP_READAHEAD); return 0; } diff --git a/net/udp/udp_conn.c b/net/udp/udp_conn.c index acaf5a89b1..83e1fd7f35 100644 --- a/net/udp/udp_conn.c +++ b/net/udp/udp_conn.c @@ -108,20 +108,7 @@ static uint16_t g_last_udp_port; static inline void _udp_semtake(FAR sem_t *sem) { - int ret; - - /* Take the semaphore (perhaps waiting) */ - - while ((ret = net_lockedwait(sem)) < 0) - { - /* The only case that an error should occur here is if - * the wait was awakened by a signal. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } - - UNUSED(ret); + net_lockedwait_uninterruptible(sem); } #define _udp_semgive(sem) nxsem_post(sem) diff --git a/net/udp/udp_devpoll.c b/net/udp/udp_devpoll.c index de8a9ad155..a60e9c53c4 100644 --- a/net/udp/udp_devpoll.c +++ b/net/udp/udp_devpoll.c @@ -98,7 +98,7 @@ void udp_poll(FAR struct net_driver_s *dev, FAR struct udp_conn_s *conn) /* Perform the application callback */ - (void)udp_callback(dev, conn, UDP_POLL); + udp_callback(dev, conn, UDP_POLL); /* If the application has data to send, setup the UDP/IP header */ diff --git a/net/udp/udp_psock_sendto_buffered.c b/net/udp/udp_psock_sendto_buffered.c index d987886831..047355d495 100644 --- a/net/udp/udp_psock_sendto_buffered.c +++ b/net/udp/udp_psock_sendto_buffered.c @@ -823,7 +823,7 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf, ret = sendto_next_transfer(psock, conn); if (ret < 0) { - (void)sq_remlast(&conn->write_q); + sq_remlast(&conn->write_q); goto errout_with_wrb; } } diff --git a/net/udp/udp_txdrain.c b/net/udp/udp_txdrain.c index ed8f2e5841..c8b9ace05b 100644 --- a/net/udp/udp_txdrain.c +++ b/net/udp/udp_txdrain.c @@ -126,11 +126,7 @@ int udp_txdrain(FAR struct socket *psock, /* There is pending write data.. wait for it to drain. */ - do - { - ret = net_timedwait(&waitsem, abstime); - } - while (ret == -EINTR); + ret = net_timedwait_uninterruptible(&waitsem, abstime); /* Tear down the notifier (in case we timed out or were canceled) */ diff --git a/net/usrsock/usrsock_accept.c b/net/usrsock/usrsock_accept.c index 6a2261859a..edb20ede82 100644 --- a/net/usrsock/usrsock_accept.c +++ b/net/usrsock/usrsock_accept.c @@ -443,11 +443,7 @@ int usrsock_accept(FAR struct socket *psock, FAR struct sockaddr *addr, { /* Wait for completion of request. */ - while ((ret = net_lockedwait(&state.reqstate.recvsem)) < 0) - { - DEBUGASSERT(ret == -EINTR); - } - + net_lockedwait_uninterruptible(&state.reqstate.recvsem); ret = state.reqstate.result; DEBUGASSERT(state.valuelen <= inaddrlen); diff --git a/net/usrsock/usrsock_bind.c b/net/usrsock/usrsock_bind.c index 829c81edfd..fad6fe398d 100644 --- a/net/usrsock/usrsock_bind.c +++ b/net/usrsock/usrsock_bind.c @@ -209,11 +209,7 @@ int usrsock_bind(FAR struct socket *psock, { /* Wait for completion of request. */ - while ((ret = net_lockedwait(&state.recvsem)) < 0) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } - + net_lockedwait_uninterruptible(&state.recvsem); ret = state.result; } diff --git a/net/usrsock/usrsock_close.c b/net/usrsock/usrsock_close.c index a672eee964..e744e2749d 100644 --- a/net/usrsock/usrsock_close.c +++ b/net/usrsock/usrsock_close.c @@ -179,10 +179,7 @@ int usrsock_close(FAR struct usrsock_conn_s *conn) { /* Wait for completion of request. */ - while ((ret = net_lockedwait(&state.recvsem)) < OK) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } + net_lockedwait_uninterruptible(&state.recvsem); ret = state.result; if (ret < 0) diff --git a/net/usrsock/usrsock_conn.c b/net/usrsock/usrsock_conn.c index ddcb0cf737..a9f0907aae 100644 --- a/net/usrsock/usrsock_conn.c +++ b/net/usrsock/usrsock_conn.c @@ -85,23 +85,12 @@ static dq_queue_t g_active_usrsock_connections; static void _usrsock_semtake(FAR sem_t *sem) { - int ret; - - /* Take the semaphore (perhaps waiting) */ - - while ((ret = net_lockedwait(sem)) < 0) - { - /* The only case that an error should occur here is if - * the wait was awakened by a signal. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } + net_lockedwait_uninterruptible(sem); } static void _usrsock_semgive(FAR sem_t *sem) { - (void)nxsem_post(sem); + nxsem_post(sem); } /**************************************************************************** @@ -257,7 +246,7 @@ int usrsock_setup_request_callback(FAR struct usrsock_conn_s *conn, { int ret = -EBUSY; - (void)nxsem_init(&pstate->recvsem, 0, 0); + nxsem_init(&pstate->recvsem, 0, 0); nxsem_setprotocol(&pstate->recvsem, SEM_PRIO_NONE); pstate->conn = conn; diff --git a/net/usrsock/usrsock_connect.c b/net/usrsock/usrsock_connect.c index 7d0fccb52b..7ebd904409 100644 --- a/net/usrsock/usrsock_connect.c +++ b/net/usrsock/usrsock_connect.c @@ -236,8 +236,6 @@ int usrsock_connect(FAR struct socket *psock, ret = net_lockedwait(&state.recvsem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - /* Wait interrupted, exit early. */ goto errout_teardown; diff --git a/net/usrsock/usrsock_dev.c b/net/usrsock/usrsock_dev.c index 081d2b9c08..cab8f59ff2 100644 --- a/net/usrsock/usrsock_dev.c +++ b/net/usrsock/usrsock_dev.c @@ -293,26 +293,12 @@ static uint8_t usrsockdev_get_xid(FAR struct usrsock_conn_s *conn) static void usrsockdev_semtake(FAR sem_t *sem) { - int ret; - - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } static void usrsockdev_semgive(FAR sem_t *sem) { - (void)nxsem_post(sem); + nxsem_post(sem); } /**************************************************************************** @@ -570,7 +556,7 @@ static ssize_t usrsockdev_handle_response(FAR struct usrsockdev_s *dev, /* Done with request/response. */ - (void)usrsock_event(conn, USRSOCK_EVENT_REQ_COMPLETE); + usrsock_event(conn, USRSOCK_EVENT_REQ_COMPLETE); } return sizeof(*hdr); @@ -640,7 +626,7 @@ usrsockdev_handle_datareq_response(FAR struct usrsockdev_s *dev, /* Done with request/response. */ - (void)usrsock_event(conn, USRSOCK_EVENT_REQ_COMPLETE); + usrsock_event(conn, USRSOCK_EVENT_REQ_COMPLETE); ret = sizeof(*datahdr); goto unlock_out; @@ -914,7 +900,7 @@ static ssize_t usrsockdev_write(FAR struct file *filep, /* Done with data response. */ - (void)usrsock_event(conn, USRSOCK_EVENT_REQ_COMPLETE); + usrsock_event(conn, USRSOCK_EVENT_REQ_COMPLETE); } } @@ -1210,10 +1196,7 @@ int usrsockdev_do_request(FAR struct usrsock_conn_s *conn, /* Set outstanding request for daemon to handle. */ - while ((ret = net_lockedwait(&dev->req.sem)) < 0) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } + net_lockedwait_uninterruptible(&dev->req.sem); if (usrsockdev_is_opened(dev)) { @@ -1229,10 +1212,7 @@ int usrsockdev_do_request(FAR struct usrsock_conn_s *conn, /* Wait ack for request. */ - while ((ret = net_lockedwait(&dev->req.acksem)) < 0) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } + net_lockedwait_uninterruptible(&dev->req.acksem); } else { @@ -1269,8 +1249,8 @@ void usrsockdev_register(void) nxsem_init(&g_usrsockdev.req.acksem, 0, 0); nxsem_setprotocol(&g_usrsockdev.req.acksem, SEM_PRIO_NONE); - (void)register_driver("/dev/usrsock", &g_usrsockdevops, 0666, - &g_usrsockdev); + register_driver("/dev/usrsock", &g_usrsockdevops, 0666, + &g_usrsockdev); } #endif /* CONFIG_NET && CONFIG_NET_USRSOCK */ diff --git a/net/usrsock/usrsock_event.c b/net/usrsock/usrsock_event.c index e34d012ca2..f05df9e814 100644 --- a/net/usrsock/usrsock_event.c +++ b/net/usrsock/usrsock_event.c @@ -127,7 +127,7 @@ int usrsock_event(FAR struct usrsock_conn_s *conn, uint16_t events) /* Send events to callbacks */ - (void)devif_conn_event(NULL, conn, events, conn->list); + devif_conn_event(NULL, conn, events, conn->list); net_unlock(); return OK; diff --git a/net/usrsock/usrsock_getpeername.c b/net/usrsock/usrsock_getpeername.c index 52f44425a7..3518d16625 100644 --- a/net/usrsock/usrsock_getpeername.c +++ b/net/usrsock/usrsock_getpeername.c @@ -219,11 +219,7 @@ int usrsock_getpeername(FAR struct socket *psock, { /* Wait for completion of request. */ - while ((ret = net_lockedwait(&state.reqstate.recvsem)) < 0) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } - + net_lockedwait_uninterruptible(&state.reqstate.recvsem); ret = state.reqstate.result; DEBUGASSERT(state.valuelen <= *addrlen); diff --git a/net/usrsock/usrsock_getsockname.c b/net/usrsock/usrsock_getsockname.c index 6e4c295961..47931b0d33 100644 --- a/net/usrsock/usrsock_getsockname.c +++ b/net/usrsock/usrsock_getsockname.c @@ -219,11 +219,7 @@ int usrsock_getsockname(FAR struct socket *psock, { /* Wait for completion of request. */ - while ((ret = net_lockedwait(&state.reqstate.recvsem)) < 0) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } - + net_lockedwait_uninterruptible(&state.reqstate.recvsem); ret = state.reqstate.result; DEBUGASSERT(state.valuelen <= *addrlen); diff --git a/net/usrsock/usrsock_getsockopt.c b/net/usrsock/usrsock_getsockopt.c index c2c531f134..cc91165061 100644 --- a/net/usrsock/usrsock_getsockopt.c +++ b/net/usrsock/usrsock_getsockopt.c @@ -232,11 +232,7 @@ int usrsock_getsockopt(FAR struct usrsock_conn_s *conn, int level, int option, { /* Wait for completion of request. */ - while ((ret = net_lockedwait(&state.reqstate.recvsem)) < 0) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } - + net_lockedwait_uninterruptible(&state.reqstate.recvsem); ret = state.reqstate.result; DEBUGASSERT(state.valuelen <= *value_len); diff --git a/net/usrsock/usrsock_ioctl.c b/net/usrsock/usrsock_ioctl.c index b86680262e..4f5b225aee 100644 --- a/net/usrsock/usrsock_ioctl.c +++ b/net/usrsock/usrsock_ioctl.c @@ -210,11 +210,7 @@ int usrsock_ioctl(FAR struct socket *psock, int cmd, FAR void *arg, { /* Wait for completion of request. */ - while ((ret = net_lockedwait(&state.reqstate.recvsem)) < 0) - { - DEBUGASSERT(ret == -EINTR); - } - + net_lockedwait_uninterruptible(&state.reqstate.recvsem); ret = state.reqstate.result; DEBUGASSERT(state.valuelen <= arglen); diff --git a/net/usrsock/usrsock_listen.c b/net/usrsock/usrsock_listen.c index 296c9dfebe..d1e5b5daf2 100644 --- a/net/usrsock/usrsock_listen.c +++ b/net/usrsock/usrsock_listen.c @@ -229,8 +229,6 @@ int usrsock_listen(FAR struct socket *psock, int backlog) ret = net_lockedwait(&state.recvsem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR); - /* Wait interrupted, exit early. */ goto errout_teardown; diff --git a/net/usrsock/usrsock_recvfrom.c b/net/usrsock/usrsock_recvfrom.c index af2ea6fea8..00f9829129 100644 --- a/net/usrsock/usrsock_recvfrom.c +++ b/net/usrsock/usrsock_recvfrom.c @@ -427,11 +427,7 @@ ssize_t usrsock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, { /* Wait for completion of request. */ - while ((ret = net_lockedwait(&state.reqstate.recvsem)) < 0) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } - + net_lockedwait_uninterruptible(&state.reqstate.recvsem); ret = state.reqstate.result; DEBUGASSERT(ret <= (ssize_t)len); diff --git a/net/usrsock/usrsock_sendto.c b/net/usrsock/usrsock_sendto.c index 53f8f51fd1..14c05a88d2 100644 --- a/net/usrsock/usrsock_sendto.c +++ b/net/usrsock/usrsock_sendto.c @@ -406,11 +406,7 @@ ssize_t usrsock_sendto(FAR struct socket *psock, FAR const void *buf, { /* Wait for completion of request. */ - while ((ret = net_lockedwait(&state.recvsem)) < 0) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } - + net_lockedwait_uninterruptible(&state.recvsem); ret = state.result; DEBUGASSERT(ret <= (ssize_t)len); diff --git a/net/usrsock/usrsock_setsockopt.c b/net/usrsock/usrsock_setsockopt.c index e81bd8fb0c..a1db18e4ba 100644 --- a/net/usrsock/usrsock_setsockopt.c +++ b/net/usrsock/usrsock_setsockopt.c @@ -219,11 +219,7 @@ int usrsock_setsockopt(FAR struct usrsock_conn_s *conn, int level, int option, { /* Wait for completion of request. */ - while ((ret = net_lockedwait(&state.recvsem)) < 0) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } - + net_lockedwait_uninterruptible(&state.recvsem); ret = state.result; } diff --git a/net/usrsock/usrsock_socket.c b/net/usrsock/usrsock_socket.c index 2262bc6107..a515a647f7 100644 --- a/net/usrsock/usrsock_socket.c +++ b/net/usrsock/usrsock_socket.c @@ -204,7 +204,6 @@ int usrsock_socket(int domain, int type, int protocol, FAR struct usrsock_conn_s *conn; int err; - int ret; /* Allocate the usrsock socket connection structure and save in the new * socket instance. @@ -240,10 +239,7 @@ int usrsock_socket(int domain, int type, int protocol, /* Wait for completion of request. */ - while ((ret = net_lockedwait(&state.recvsem)) < 0) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - } + net_lockedwait_uninterruptible(&state.recvsem); if (state.result < 0) { diff --git a/net/utils/net_lock.c b/net/utils/net_lock.c index 2b372f407e..f95d408883 100644 --- a/net/utils/net_lock.c +++ b/net/utils/net_lock.c @@ -82,22 +82,68 @@ static unsigned int g_count = 0; static int _net_takesem(void) { - int ret; + return nxsem_wait_uninterruptible(&g_netlock); +} - do +/**************************************************************************** + * Name: _net_timedwait + ****************************************************************************/ + +static int _net_timedwait(sem_t *sem, bool interruptable, + FAR const struct timespec *abstime) +{ + unsigned int count; + irqstate_t flags; + int blresult; + int ret; + + flags = enter_critical_section(); /* No interrupts */ + sched_lock(); /* No context switches */ + + /* Release the network lock, remembering my count. net_breaklock will + * return a negated value if the caller does not hold the network lock. + */ + + blresult = net_breaklock(&count); + + /* Now take the semaphore, waiting if so requested. */ + + if (abstime != NULL) { - /* Take the semaphore (perhaps waiting) */ + /* Wait until we get the lock or until the timeout expires */ - ret = nxsem_wait(&g_netlock); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR || ret == -ECANCELED); + if (interruptable) + { + ret = nxsem_timedwait(sem, abstime); + } + else + { + ret = nxsem_timedwait_uninterruptible(sem, abstime); + } } - while (ret == -EINTR); + else + { + /* Wait as long as necessary to get the lock */ + if (interruptable) + { + ret = nxsem_wait(sem); + } + else + { + ret = nxsem_wait_uninterruptible(sem); + } + } + + /* Recover the network lock at the proper count (if we held it before) */ + + if (blresult >= 0) + { + net_restorelock(count); + } + + sched_unlock(); + leave_critical_section(flags); return ret; } @@ -241,7 +287,7 @@ int net_breaklock(FAR unsigned int *count) g_holder = NO_HOLDER; g_count = 0; - (void)nxsem_post(&g_netlock); + nxsem_post(&g_netlock); ret = OK; } @@ -304,45 +350,7 @@ int net_restorelock(unsigned int count) int net_timedwait(sem_t *sem, FAR const struct timespec *abstime) { - unsigned int count; - irqstate_t flags; - int blresult; - int ret; - - flags = enter_critical_section(); /* No interrupts */ - sched_lock(); /* No context switches */ - - /* Release the network lock, remembering my count. net_breaklock will - * return a negated value if the caller does not hold the network lock. - */ - - blresult = net_breaklock(&count); - - /* Now take the semaphore, waiting if so requested. */ - - if (abstime != NULL) - { - /* Wait until we get the lock or until the timeout expires */ - - ret = nxsem_timedwait(sem, abstime); - } - else - { - /* Wait as long as necessary to get the lock */ - - ret = nxsem_wait(sem); - } - - /* Recover the network lock at the proper count (if we held it before) */ - - if (blresult >= 0) - { - net_restorelock(count); - } - - sched_unlock(); - leave_critical_section(flags); - return ret; + return _net_timedwait(sem, true, abstime); } /**************************************************************************** @@ -370,6 +378,50 @@ int net_lockedwait(sem_t *sem) return net_timedwait(sem, NULL); } +/**************************************************************************** + * Name: net_timedwait_uninterruptible + * + * Description: + * This function is wrapped version of net_timedwait(), which is + * uninterruptible and convenient for use. + * + * Input Parameters: + * sem - A reference to the semaphore to be taken. + * abstime - The absolute time to wait until a timeout is declared. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure. + * + ****************************************************************************/ + +int net_timedwait_uninterruptible(sem_t *sem, + FAR const struct timespec *abstime) +{ + return _net_timedwait(sem, false, abstime); +} + +/**************************************************************************** + * Name: net_lockedwait_uninterruptible + * + * Description: + * This function is wrapped version of net_lockedwait(), which is + * uninterruptible and convenient for use. + * + * Input Parameters: + * sem - A reference to the semaphore to be taken. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure. + * + ****************************************************************************/ + +int net_lockedwait_uninterruptible(sem_t *sem) +{ + return net_timedwait_uninterruptible(sem, NULL); +} + /**************************************************************************** * Name: net_ioballoc * diff --git a/sched/clock/clock_initialize.c b/sched/clock/clock_initialize.c index 3fba5d4392..011f514f47 100644 --- a/sched/clock/clock_initialize.c +++ b/sched/clock/clock_initialize.c @@ -185,7 +185,7 @@ static void clock_inittime(void) { struct timespec ts; - (void)clock_ticks2time((sclock_t)g_system_timer, &ts); + clock_ticks2time((sclock_t)g_system_timer, &ts); /* Adjust base time to hide initial timer ticks. */ @@ -336,7 +336,7 @@ void clock_resynchronize(FAR struct timespec *rtc_diff) * bias value that we need to use to correct the base time. */ - (void)clock_systimespec(&bias); + clock_systimespec(&bias); /* Add the base time to this. The base time is the time-of-day * setting. When added to the elapsed time since the time-of-day diff --git a/sched/clock/clock_settime.c b/sched/clock/clock_settime.c index 3c1c164c70..cc27b57342 100644 --- a/sched/clock/clock_settime.c +++ b/sched/clock/clock_settime.c @@ -91,7 +91,7 @@ int clock_settime(clockid_t clock_id, FAR const struct timespec *tp) * bias value that we need to use to correct the base time. */ - (void)clock_systimespec(&bias); + clock_systimespec(&bias); /* Save the new base time. */ diff --git a/sched/clock/clock_systimer.c b/sched/clock/clock_systimer.c index e61634cf02..f96d46fe46 100644 --- a/sched/clock/clock_systimer.c +++ b/sched/clock/clock_systimer.c @@ -97,7 +97,7 @@ clock_t clock_systimer(void) /* Get the time from the platform specific hardware */ - (void)clock_systimespec(&ts); + clock_systimespec(&ts); /* Convert to a 64-bit value in microseconds, then in clock tick units */ @@ -110,7 +110,7 @@ clock_t clock_systimer(void) /* Get the time from the platform specific hardware */ - (void)clock_systimespec(&ts); + clock_systimespec(&ts); /* Convert to a 64- then a 32-bit value */ diff --git a/sched/environ/env_setenv.c b/sched/environ/env_setenv.c index 9fbb558227..38b7a4eb46 100644 --- a/sched/environ/env_setenv.c +++ b/sched/environ/env_setenv.c @@ -143,7 +143,7 @@ int setenv(FAR const char *name, FAR const char *value, int overwrite) * the environment buffer; this will happen below. */ - (void)env_removevar(group, pvar); + env_removevar(group, pvar); } /* Get the size of the new name=value string. The +2 is for the '=' and for diff --git a/sched/environ/env_unsetenv.c b/sched/environ/env_unsetenv.c index d6fb818bcb..d0e004be96 100644 --- a/sched/environ/env_unsetenv.c +++ b/sched/environ/env_unsetenv.c @@ -90,7 +90,7 @@ int unsetenv(FAR const char *name) { /* It does! Remove the name=value pair from the environment. */ - (void)env_removevar(group, pvar); + env_removevar(group, pvar); /* Reallocate the new environment buffer */ diff --git a/sched/group/group_create.c b/sched/group/group_create.c index 82e7814681..6f6afaacc1 100644 --- a/sched/group/group_create.c +++ b/sched/group/group_create.c @@ -288,7 +288,7 @@ int group_allocate(FAR struct task_tcb_s *tcb, uint8_t ttype) #ifndef CONFIG_DISABLE_PTHREAD /* Initialize the pthread join semaphore */ - (void)nxsem_init(&group->tg_joinsem, 0, 1); + nxsem_init(&group->tg_joinsem, 0, 1); #endif #if defined(CONFIG_SCHED_WAITPID) && !defined(CONFIG_SCHED_HAVE_PARENT) @@ -298,8 +298,8 @@ int group_allocate(FAR struct task_tcb_s *tcb, uint8_t ttype) * priority inheritance enabled. */ - (void)nxsem_init(&group->tg_exitsem, 0, 0); - (void)nxsem_setprotocol(&group->tg_exitsem, SEM_PRIO_NONE); + nxsem_init(&group->tg_exitsem, 0, 0); + nxsem_setprotocol(&group->tg_exitsem, SEM_PRIO_NONE); #endif return OK; diff --git a/sched/group/group_leave.c b/sched/group/group_leave.c index 57bf957226..084e4a886d 100644 --- a/sched/group/group_leave.c +++ b/sched/group/group_leave.c @@ -193,13 +193,13 @@ static inline void group_release(FAR struct task_group_s *group) #if defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_MM_SHM) /* Release any resource held by shared memory virtual page allocator */ - (void)shm_group_release(group); + shm_group_release(group); #endif #ifdef CONFIG_ARCH_ADDRENV /* Destroy the group address environment */ - (void)up_addrenv_destroy(&group->tg_addrenv); + up_addrenv_destroy(&group->tg_addrenv); /* Mark no address environment */ diff --git a/sched/group/group_setupidlefiles.c b/sched/group/group_setupidlefiles.c index 943de93a42..310eed2496 100644 --- a/sched/group/group_setupidlefiles.c +++ b/sched/group/group_setupidlefiles.c @@ -102,8 +102,8 @@ int group_setupidlefiles(FAR struct task_tcb_s *tcb) { /* Successfully opened /dev/console as stdin (fd == 0) */ - (void)fs_dupfd2(0, 1); - (void)fs_dupfd2(0, 2); + fs_dupfd2(0, 1); + fs_dupfd2(0, 2); } else { @@ -114,7 +114,7 @@ int group_setupidlefiles(FAR struct task_tcb_s *tcb) if (fd > 0) { sinfo("Open /dev/console fd: %d\n", fd); - (void)close(fd); + close(fd); } else { diff --git a/sched/group/group_setupstreams.c b/sched/group/group_setupstreams.c index 87201355bc..dd91a39588 100644 --- a/sched/group/group_setupstreams.c +++ b/sched/group/group_setupstreams.c @@ -83,9 +83,9 @@ int group_setupstreams(FAR struct task_tcb_s *tcb) * fd = 2 is stderr (write-only, append) */ - (void)fs_fdopen(0, O_RDONLY, (FAR struct tcb_s *)tcb); - (void)fs_fdopen(1, O_WROK | O_CREAT, (FAR struct tcb_s *)tcb); - (void)fs_fdopen(2, O_WROK | O_CREAT, (FAR struct tcb_s *)tcb); + fs_fdopen(0, O_RDONLY, (FAR struct tcb_s *)tcb); + fs_fdopen(1, O_WROK | O_CREAT, (FAR struct tcb_s *)tcb); + fs_fdopen(2, O_WROK | O_CREAT, (FAR struct tcb_s *)tcb); return OK; } diff --git a/sched/group/group_setuptaskfiles.c b/sched/group/group_setuptaskfiles.c index 6f5079ebc7..e7d0481dd8 100644 --- a/sched/group/group_setuptaskfiles.c +++ b/sched/group/group_setuptaskfiles.c @@ -118,7 +118,7 @@ static inline void sched_dupfiles(FAR struct task_tcb_s *tcb) { /* Yes... duplicate it for the child */ - (void)file_dup2(&parent[i], &child[i]); + file_dup2(&parent[i], &child[i]); } } } @@ -174,7 +174,7 @@ static inline void sched_dupsockets(FAR struct task_tcb_s *tcb) { /* Yes... duplicate it for the child */ - (void)net_clone(&parent[i], &child[i]); + net_clone(&parent[i], &child[i]); } } } diff --git a/sched/init/nx_bringup.c b/sched/init/nx_bringup.c index bd9ba6f6b0..11f08ef111 100644 --- a/sched/init/nx_bringup.c +++ b/sched/init/nx_bringup.c @@ -197,7 +197,7 @@ static inline void nx_workqueues(void) * halves. */ - (void)work_hpstart(); + work_hpstart(); #endif /* CONFIG_SCHED_HPWORK */ @@ -206,7 +206,7 @@ static inline void nx_workqueues(void) * tasks */ - (void)work_lpstart(); + work_lpstart(); #endif /* CONFIG_SCHED_LPWORK */ @@ -433,11 +433,11 @@ int nx_bringup(void) */ #ifdef CONFIG_PATH_INITIAL - (void)setenv("PATH", CONFIG_PATH_INITIAL, 1); + setenv("PATH", CONFIG_PATH_INITIAL, 1); #endif #ifdef CONFIG_LDPATH_INITIAL - (void)setenv("LD_LIBRARY_PATH", CONFIG_LDPATH_INITIAL, 1); + setenv("LD_LIBRARY_PATH", CONFIG_LDPATH_INITIAL, 1); #endif #endif @@ -465,7 +465,7 @@ int nx_bringup(void) defined(CONFIG_LDPATH_INITIAL)) /* We an save a few bytes by discarding the IDLE thread's environment. */ - (void)clearenv(); + clearenv(); #endif return OK; diff --git a/sched/init/nx_smpstart.c b/sched/init/nx_smpstart.c index d5bcab128e..3ff923dd3c 100644 --- a/sched/init/nx_smpstart.c +++ b/sched/init/nx_smpstart.c @@ -107,7 +107,7 @@ void nx_idle_trampoline(void) /* Then transfer control to the IDLE task */ - (void)nx_idle_task(0, NULL); + nx_idle_task(0, NULL); /* The IDLE task should never return */ diff --git a/sched/irq/irq_procfs.c b/sched/irq/irq_procfs.c index 015809bb44..eacc53e96a 100644 --- a/sched/irq/irq_procfs.c +++ b/sched/irq/irq_procfs.c @@ -380,7 +380,7 @@ static ssize_t irq_read(FAR struct file *filep, FAR char *buffer, * each. */ - (void)irq_foreach(irq_callback, (FAR void *)irqfile); + irq_foreach(irq_callback, (FAR void *)irqfile); /* Update the file position */ diff --git a/sched/irq/irq_unexpectedisr.c b/sched/irq/irq_unexpectedisr.c index ae3097786f..70d79c693f 100644 --- a/sched/irq/irq_unexpectedisr.c +++ b/sched/irq/irq_unexpectedisr.c @@ -60,7 +60,7 @@ int irq_unexpected_isr(int irq, FAR void *context, FAR void *arg) { - (void)up_irq_save(); + up_irq_save(); _err("ERROR irq: %d\n", irq); PANIC(); return OK; /* Won't get here */ diff --git a/sched/module/mod_insmod.c b/sched/module/mod_insmod.c index d4e8826e24..0cc2a8c24e 100644 --- a/sched/module/mod_insmod.c +++ b/sched/module/mod_insmod.c @@ -270,7 +270,7 @@ FAR void *insmod(FAR const char *filename, FAR const char *modname) errout_with_load: modlib_unload(&loadinfo); - (void)modlib_undepend(modp); + modlib_undepend(modp); errout_with_registry_entry: kmm_free(modp); errout_with_loadinfo: diff --git a/sched/module/mod_rmmod.c b/sched/module/mod_rmmod.c index 810d5ba094..885eeef006 100644 --- a/sched/module/mod_rmmod.c +++ b/sched/module/mod_rmmod.c @@ -155,7 +155,7 @@ int rmmod(FAR void *handle) #if CONFIG_MODLIB_MAXDEPEND > 0 /* Eliminate any dependencies that this module has on other modules */ - (void)modlib_undepend(modp); + modlib_undepend(modp); #endif modlib_registry_unlock(); diff --git a/sched/mqueue/mq_receive.c b/sched/mqueue/mq_receive.c index afc8a12e09..ec5cce6b39 100644 --- a/sched/mqueue/mq_receive.c +++ b/sched/mqueue/mq_receive.c @@ -185,7 +185,7 @@ ssize_t mq_receive(mqd_t mqdes, FAR char *msg, size_t msglen, /* mq_receive() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Let nxmq_receive do all of the work */ diff --git a/sched/mqueue/mq_release.c b/sched/mqueue/mq_release.c index 2e253b915b..bbd7378d49 100644 --- a/sched/mqueue/mq_release.c +++ b/sched/mqueue/mq_release.c @@ -67,6 +67,6 @@ void nxmq_release(FAR struct task_group_s *group) { while (group->tg_msgdesq.head) { - (void)nxmq_close_group((mqd_t)group->tg_msgdesq.head, group); + nxmq_close_group((mqd_t)group->tg_msgdesq.head, group); } } diff --git a/sched/mqueue/mq_send.c b/sched/mqueue/mq_send.c index 79b6c10d78..b881b793fe 100644 --- a/sched/mqueue/mq_send.c +++ b/sched/mqueue/mq_send.c @@ -214,7 +214,7 @@ int mq_send(mqd_t mqdes, FAR const char *msg, size_t msglen, unsigned int prio) /* mq_send() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Let nxmq_send() do all of the work */ diff --git a/sched/mqueue/mq_setattr.c b/sched/mqueue/mq_setattr.c index 5f5caa5995..d9e09dc2ac 100644 --- a/sched/mqueue/mq_setattr.c +++ b/sched/mqueue/mq_setattr.c @@ -84,7 +84,7 @@ int mq_setattr(mqd_t mqdes, const struct mq_attr *mq_stat, if (oldstat) { - (void)mq_getattr(mqdes, oldstat); + mq_getattr(mqdes, oldstat); } /* Set the new value of the O_NONBLOCK flag. */ diff --git a/sched/mqueue/mq_timedreceive.c b/sched/mqueue/mq_timedreceive.c index e0e43d6b66..74db2e2a00 100644 --- a/sched/mqueue/mq_timedreceive.c +++ b/sched/mqueue/mq_timedreceive.c @@ -240,8 +240,8 @@ ssize_t nxmq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen, /* Start the watchdog */ - (void)wd_start(rtcb->waitdog, ticks, (wdentry_t)nxmq_rcvtimeout, - 1, getpid()); + wd_start(rtcb->waitdog, ticks, (wdentry_t)nxmq_rcvtimeout, + 1, getpid()); } /* Get the message from the message queue */ @@ -334,7 +334,7 @@ ssize_t mq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen, /* mq_timedreceive() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Let nxmq_timedreceive do all of the work */ diff --git a/sched/mqueue/mq_timedsend.c b/sched/mqueue/mq_timedsend.c index 2c5d036b50..3bc9a1d324 100644 --- a/sched/mqueue/mq_timedsend.c +++ b/sched/mqueue/mq_timedsend.c @@ -271,8 +271,8 @@ int nxmq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, /* Start the watchdog and begin the wait for MQ not full */ - (void)wd_start(rtcb->waitdog, ticks, (wdentry_t)nxmq_sndtimeout, - 1, getpid()); + wd_start(rtcb->waitdog, ticks, (wdentry_t)nxmq_sndtimeout, + 1, getpid()); /* And wait for the message queue to be non-empty */ @@ -389,7 +389,7 @@ int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, /* mq_timedsend() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Let nxmq_send() do all of the work */ diff --git a/sched/paging/pg_miss.c b/sched/paging/pg_miss.c index f8841d4681..2713fe987c 100644 --- a/sched/paging/pg_miss.c +++ b/sched/paging/pg_miss.c @@ -166,7 +166,7 @@ void pg_miss(void) pginfo("New worker priority. %d->%d\n", wtcb->sched_priority, ftcb->sched_priority); - (void)nxsched_setpriority(wtcb, ftcb->sched_priority); + nxsched_setpriority(wtcb, ftcb->sched_priority); } /* Signal the page fill worker thread. @@ -177,7 +177,7 @@ void pg_miss(void) if (!g_pftcb) { pginfo("Signaling worker. PID: %d\n", g_pgworker); - (void)nxsig_kill(g_pgworker, SIGWORK); + nxsig_kill(g_pgworker, SIGWORK); } } diff --git a/sched/paging/pg_worker.c b/sched/paging/pg_worker.c index b846e3d54d..bdcb33722b 100644 --- a/sched/paging/pg_worker.c +++ b/sched/paging/pg_worker.c @@ -176,7 +176,7 @@ static void pg_callback(FAR struct tcb_s *tcb, int result) { pginfo("New worker priority. %d->%d\n", wtcb->sched_priority, priority); - (void)nxsched_setpriority(wtcb, priority); + nxsched_setpriority(wtcb, priority); } /* Save the page fill result (don't permit the value -EBUSY) */ @@ -192,7 +192,7 @@ static void pg_callback(FAR struct tcb_s *tcb, int result) /* Signal the page fill worker thread (in any event) */ pginfo("Signaling worker. PID: %d\n", g_pgworker); - (void)nxsig_kill(g_pgworker, SIGWORK); + nxsig_kill(g_pgworker, SIGWORK); } #endif @@ -287,7 +287,7 @@ static inline bool pg_dequeue(void) pginfo("New worker priority. %d->%d\n", wtcb->sched_priority, priority); - (void)nxsched_setpriority(wtcb, priority); + nxsched_setpriority(wtcb, priority); } /* Return with g_pftcb holding the pointer to @@ -451,7 +451,7 @@ static inline void pg_alldone(void) g_pftcb = NULL; pginfo("New worker priority. %d->%d\n", wtcb->sched_priority, CONFIG_PAGING_DEFPRIO); - (void)nxsched_setpriority(wtcb, CONFIG_PAGING_DEFPRIO); + nxsched_setpriority(wtcb, CONFIG_PAGING_DEFPRIO); } /**************************************************************************** @@ -529,7 +529,7 @@ int pg_worker(int argc, char *argv[]) */ pginfo("Started\n"); - (void)up_irq_save(); + up_irq_save(); for (; ; ) { /* Wait awhile. We will wait here until either the configurable timeout @@ -625,7 +625,7 @@ int pg_worker(int argc, char *argv[]) */ pginfo("Calling pg_startfill\n"); - (void)pg_startfill(); + pg_startfill(); } #else /* Are there tasks blocked and waiting for a fill? Loop until all diff --git a/sched/pthread/pthread_cancel.c b/sched/pthread/pthread_cancel.c index d583e96bef..c9774c9c56 100644 --- a/sched/pthread/pthread_cancel.c +++ b/sched/pthread/pthread_cancel.c @@ -160,7 +160,7 @@ int pthread_cancel(pthread_t thread) /* Complete pending join operations */ - (void)pthread_completejoin((pid_t)thread, PTHREAD_CANCELED); + pthread_completejoin((pid_t)thread, PTHREAD_CANCELED); #ifndef CONFIG_PTHREAD_MUTEX_UNSAFE /* Recover any mutexes still held by the canceled thread */ diff --git a/sched/pthread/pthread_completejoin.c b/sched/pthread/pthread_completejoin.c index 92fa5b7603..e395cd4708 100644 --- a/sched/pthread/pthread_completejoin.c +++ b/sched/pthread/pthread_completejoin.c @@ -79,7 +79,7 @@ static bool pthread_notifywaiters(FAR struct join_s *pjoin) * awakened when all waiting tasks receive the data */ - (void)nxsem_init(&pjoin->data_sem, 0, (ntasks_waiting + 1)); + nxsem_init(&pjoin->data_sem, 0, (ntasks_waiting + 1)); /* Post the semaphore to restart each thread that is waiting * on the semaphore @@ -99,7 +99,7 @@ static bool pthread_notifywaiters(FAR struct join_s *pjoin) * value. */ - (void)pthread_sem_take(&pjoin->data_sem, NULL, false); + pthread_sem_take(&pjoin->data_sem, NULL, false); return true; } @@ -210,12 +210,12 @@ int pthread_completejoin(pid_t pid, FAR void *exit_value) /* First, find thread's structure in the private data set. */ - (void)pthread_sem_take(&group->tg_joinsem, NULL, false); + pthread_sem_take(&group->tg_joinsem, NULL, false); pjoin = pthread_findjoininfo(group, pid); if (!pjoin) { serr("ERROR: Could not find join info, pid=%d\n", pid); - (void)pthread_sem_give(&group->tg_joinsem); + pthread_sem_give(&group->tg_joinsem); return ERROR; } else @@ -246,7 +246,7 @@ int pthread_completejoin(pid_t pid, FAR void *exit_value) * to call pthread_destroyjoin. */ - (void)pthread_sem_give(&group->tg_joinsem); + pthread_sem_give(&group->tg_joinsem); } return OK; @@ -279,8 +279,8 @@ void pthread_destroyjoin(FAR struct task_group_s *group, /* Destroy its semaphores */ - (void)nxsem_destroy(&pjoin->data_sem); - (void)nxsem_destroy(&pjoin->exit_sem); + nxsem_destroy(&pjoin->data_sem); + nxsem_destroy(&pjoin->exit_sem); /* And deallocate the pjoin structure */ diff --git a/sched/pthread/pthread_condtimedwait.c b/sched/pthread/pthread_condtimedwait.c index 3f7db6b624..f130f83efe 100644 --- a/sched/pthread/pthread_condtimedwait.c +++ b/sched/pthread/pthread_condtimedwait.c @@ -118,7 +118,7 @@ static void pthread_condtimedout(int argc, uint32_t pid, uint32_t signo) * a watchdog timer interrupt handler. */ - (void)nxsig_tcbdispatch(tcb, &info); + nxsig_tcbdispatch(tcb, &info); } #else /* HAVE_GROUP_MEMBERS */ @@ -133,9 +133,9 @@ static void pthread_condtimedout(int argc, uint32_t pid, uint32_t signo) /* Send the specified signal to the specified task. */ value.sival_ptr = NULL; - (void)nxsig_queue((int)pid, (int)signo, value); + nxsig_queue((int)pid, (int)signo, value); #else - (void)nxsig_queue((int)pid, (int)signo, NULL); + nxsig_queue((int)pid, (int)signo, NULL); #endif #endif /* HAVE_GROUP_MEMBERS */ @@ -180,7 +180,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, /* pthread_cond_timedwait() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Make sure that non-NULL references were provided. */ @@ -274,10 +274,10 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, { /* Start the watchdog */ - (void)wd_start(rtcb->waitdog, ticks, - (wdentry_t)pthread_condtimedout, - 2, (uint32_t)mypid, - (uint32_t)SIGCONDTIMEDOUT); + wd_start(rtcb->waitdog, ticks, + (wdentry_t)pthread_condtimedout, + 2, (uint32_t)mypid, + (uint32_t)SIGCONDTIMEDOUT); /* Take the condition semaphore. Do not restore interrupts * until we return from the wait. This is necessary to diff --git a/sched/pthread/pthread_condwait.c b/sched/pthread/pthread_condwait.c index 6807879f58..1884ba40b3 100644 --- a/sched/pthread/pthread_condwait.c +++ b/sched/pthread/pthread_condwait.c @@ -78,7 +78,7 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex) /* pthread_cond_wait() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Make sure that non-NULL references were provided. */ diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c index 884b389b75..657e791a7c 100644 --- a/sched/pthread/pthread_create.c +++ b/sched/pthread/pthread_create.c @@ -179,14 +179,14 @@ static void pthread_start(void) /* Successfully spawned, add the pjoin to our data set. */ - (void)pthread_sem_take(&group->tg_joinsem, NULL, false); + pthread_sem_take(&group->tg_joinsem, NULL, false); pthread_addjoininfo(group, pjoin); - (void)pthread_sem_give(&group->tg_joinsem); + pthread_sem_give(&group->tg_joinsem); /* Report to the spawner that we successfully started. */ pjoin->started = true; - (void)pthread_sem_give(&pjoin->data_sem); + pthread_sem_give(&pjoin->data_sem); /* The priority of this thread may have been boosted to avoid priority * inversion problems. If that is the case, then drop to the correct @@ -372,8 +372,8 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, /* Convert timespec values to system clock ticks */ - (void)clock_time2ticks(¶m.sched_ss_repl_period, &repl_ticks); - (void)clock_time2ticks(¶m.sched_ss_init_budget, &budget_ticks); + clock_time2ticks(¶m.sched_ss_repl_period, &repl_ticks); + clock_time2ticks(¶m.sched_ss_init_budget, &budget_ticks); /* The replenishment period must be greater than or equal to the * budget period. @@ -580,7 +580,7 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, * its join structure. */ - (void)pthread_sem_take(&pjoin->data_sem, NULL, false); + pthread_sem_take(&pjoin->data_sem, NULL, false); /* Return the thread information to the caller */ @@ -595,14 +595,14 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, } sched_unlock(); - (void)nxsem_destroy(&pjoin->data_sem); + nxsem_destroy(&pjoin->data_sem); } else { sched_unlock(); dq_rem((FAR dq_entry_t *)ptcb, (FAR dq_queue_t *)&g_inactivetasks); - (void)nxsem_destroy(&pjoin->data_sem); - (void)nxsem_destroy(&pjoin->exit_sem); + nxsem_destroy(&pjoin->data_sem); + nxsem_destroy(&pjoin->exit_sem); errcode = EIO; goto errout_with_join; diff --git a/sched/pthread/pthread_detach.c b/sched/pthread/pthread_detach.c index c6a1192651..953cb1d64d 100644 --- a/sched/pthread/pthread_detach.c +++ b/sched/pthread/pthread_detach.c @@ -87,7 +87,7 @@ int pthread_detach(pthread_t thread) /* Find the entry associated with this pthread. */ - (void)pthread_sem_take(&group->tg_joinsem, NULL, false); + pthread_sem_take(&group->tg_joinsem, NULL, false); pjoin = pthread_findjoininfo(group, (pid_t)thread); if (!pjoin) { @@ -119,7 +119,7 @@ int pthread_detach(pthread_t thread) ret = OK; } - (void)pthread_sem_give(&group->tg_joinsem); + pthread_sem_give(&group->tg_joinsem); sinfo("Returning %d\n", ret); return ret; diff --git a/sched/pthread/pthread_exit.c b/sched/pthread/pthread_exit.c index 56ce6418a2..0f79b9513b 100644 --- a/sched/pthread/pthread_exit.c +++ b/sched/pthread/pthread_exit.c @@ -89,7 +89,7 @@ void pthread_exit(FAR void *exit_value) * are performing the JOIN handshake. */ - (void)nxsig_procmask(SIG_SETMASK, &set, NULL); + nxsig_procmask(SIG_SETMASK, &set, NULL); #ifdef CONFIG_CANCELLATION_POINTS /* Mark the pthread as non-cancelable to avoid additional calls to diff --git a/sched/pthread/pthread_initialize.c b/sched/pthread/pthread_initialize.c index 2c8f267c94..83bf7cb2b9 100644 --- a/sched/pthread/pthread_initialize.c +++ b/sched/pthread/pthread_initialize.c @@ -102,55 +102,30 @@ int pthread_sem_take(FAR sem_t *sem, FAR const struct timespec *abs_timeout, { int ret; - /* Verify input parameters */ - - DEBUGASSERT(sem != NULL); - if (sem != NULL) + if (intr) { - do + if (abs_timeout == NULL) { - /* Take the semaphore (perhaps waiting) */ - - if (abs_timeout == NULL) - { - ret = nxsem_wait(sem); - } - else - { - ret = nxsem_timedwait(sem, abs_timeout); - } - - if (ret < 0) - { - /* The only cases that an error should occur here is if the wait - * was awakened by a signal or if the thread was canceled during - * the wait. - */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED || - ret == -ETIMEDOUT); - - /* When the error occurs in this case, should we errout? Or - * should we just continue waiting until we have the - * semaphore? - */ - - if (intr) - { - return -ret; - } - } + ret = nxsem_wait(sem); + } + else + { + ret = nxsem_timedwait(sem, abs_timeout); + } + } + else + { + if (abs_timeout == NULL) + { + ret = nxsem_wait_uninterruptible(sem); + } + else + { + ret = nxsem_timedwait_uninterruptible(sem, abs_timeout); } - while (ret == -EINTR); - - /* We have the semaphore (or some awful, unexpected error has - * occurred). - */ - - return OK; } - return EINVAL; + return -ret; } #ifdef CONFIG_PTHREAD_MUTEX_UNSAFE diff --git a/sched/pthread/pthread_join.c b/sched/pthread/pthread_join.c index 27876565a8..a7ad480087 100644 --- a/sched/pthread/pthread_join.c +++ b/sched/pthread/pthread_join.c @@ -96,7 +96,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) /* pthread_join() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* First make sure that this is not an attempt to join to * ourself. @@ -114,7 +114,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) * because it will also attempt to get this semaphore. */ - (void)pthread_sem_take(&group->tg_joinsem, NULL, false); + pthread_sem_take(&group->tg_joinsem, NULL, false); /* Find the join information associated with this thread. * This can fail for one of three reasons: (1) There is no @@ -148,7 +148,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) ret = EINVAL; } - (void)pthread_sem_give(&group->tg_joinsem); + pthread_sem_give(&group->tg_joinsem); } else { @@ -189,7 +189,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) * semaphore. */ - (void)pthread_sem_give(&group->tg_joinsem); + pthread_sem_give(&group->tg_joinsem); /* Take the thread's thread exit semaphore. We will sleep here * until the thread exits. We need to exercise caution because @@ -197,7 +197,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) * pthread to exit. */ - (void)pthread_sem_take(&pjoin->exit_sem, NULL, false); + pthread_sem_take(&pjoin->exit_sem, NULL, false); /* The thread has exited! Get the thread exit value */ @@ -211,13 +211,13 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) * will know that we have received the data. */ - (void)pthread_sem_give(&pjoin->data_sem); + pthread_sem_give(&pjoin->data_sem); /* Retake the join semaphore, we need to hold this when * pthread_destroyjoin is called. */ - (void)pthread_sem_take(&group->tg_joinsem, NULL, false); + pthread_sem_take(&group->tg_joinsem, NULL, false); } /* Pre-emption is okay now. The logic still cannot be re-entered @@ -232,10 +232,10 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) if (--pjoin->crefs <= 0) { - (void)pthread_destroyjoin(group, pjoin); + pthread_destroyjoin(group, pjoin); } - (void)pthread_sem_give(&group->tg_joinsem); + pthread_sem_give(&group->tg_joinsem); ret = OK; } diff --git a/sched/pthread/pthread_mutexinconsistent.c b/sched/pthread/pthread_mutexinconsistent.c index 5f8d5f9cc8..eb50056d54 100644 --- a/sched/pthread/pthread_mutexinconsistent.c +++ b/sched/pthread/pthread_mutexinconsistent.c @@ -95,7 +95,7 @@ void pthread_mutex_inconsistent(FAR struct pthread_tcb_s *tcb) /* Mark the mutex as INCONSISTENT and wake up any waiting thread */ mutex->flags |= _PTHREAD_MFLAGS_INCONSISTENT; - (void)pthread_sem_give(&mutex->sem); + pthread_sem_give(&mutex->sem); } sched_unlock(); diff --git a/sched/pthread/pthread_release.c b/sched/pthread/pthread_release.c index cca18edd3a..d51b95e574 100644 --- a/sched/pthread/pthread_release.c +++ b/sched/pthread/pthread_release.c @@ -89,8 +89,8 @@ void pthread_release(FAR struct task_group_s *group) /* Destroy the join semaphores */ - (void)nxsem_destroy(&join->data_sem); - (void)nxsem_destroy(&join->exit_sem); + nxsem_destroy(&join->data_sem); + nxsem_destroy(&join->exit_sem); /* And deallocate the join structure */ @@ -99,5 +99,5 @@ void pthread_release(FAR struct task_group_s *group) /* Destroy the join list semaphore */ - (void)nxsem_destroy(&group->tg_joinsem); + nxsem_destroy(&group->tg_joinsem); } diff --git a/sched/sched/sched_addreadytorun.c b/sched/sched/sched_addreadytorun.c index 6110c2da14..af29b96090 100644 --- a/sched/sched/sched_addreadytorun.c +++ b/sched/sched/sched_addreadytorun.c @@ -262,7 +262,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) * Add the task to the ready-to-run (but not running) task list */ - (void)sched_addprioritized(btcb, (FAR dq_queue_t *)&g_readytorun); + sched_addprioritized(btcb, (FAR dq_queue_t *)&g_readytorun); btcb->task_state = TSTATE_TASK_READYTORUN; doswitch = false; @@ -401,7 +401,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) tasklist = (FAR dq_queue_t *)&g_readytorun; } - (void)sched_addprioritized(next, tasklist); + sched_addprioritized(next, tasklist); } doswitch = true; diff --git a/sched/sched/sched_lock.c b/sched/sched/sched_lock.c index db314a7a37..1f7f03142a 100644 --- a/sched/sched/sched_lock.c +++ b/sched/sched/sched_lock.c @@ -178,7 +178,7 @@ int sched_lock(void) */ DEBUGASSERT((uint16_t)g_global_lockcount < INT16_MAX); /* Not atomic! */ - (void)up_fetchadd16(&g_global_lockcount, 1); + up_fetchadd16(&g_global_lockcount, 1); #endif /* This operation is safe if CONFIG_ARCH_HAVE_FETCHADD is defined. NOTE @@ -199,7 +199,7 @@ int sched_lock(void) up_irq_restore(flags); #elif defined(CONFIG_ARCH_HAVE_FETCHADD) DEBUGASSERT(g_global_lockcount > 0); - (void)up_fetchsub16(&g_global_lockcount, 1); + up_fetchsub16(&g_global_lockcount, 1); #endif } else @@ -247,7 +247,7 @@ int sched_lock(void) up_irq_restore(flags); #elif defined(CONFIG_ARCH_HAVE_FETCHADD) DEBUGASSERT(g_global_lockcount > 0); - (void)up_fetchsub16(&g_global_lockcount, 1); + up_fetchsub16(&g_global_lockcount, 1); #endif #if defined(CONFIG_SCHED_INSTRUMENTATION_PREEMPTION) || \ diff --git a/sched/sched/sched_processtimer.c b/sched/sched/sched_processtimer.c index e7cd954424..19c906addf 100644 --- a/sched/sched/sched_processtimer.c +++ b/sched/sched/sched_processtimer.c @@ -100,7 +100,7 @@ static inline void nxsched_cpu_scheduler(int cpu) * budget. */ - (void)sched_sporadic_process(rtcb, 1, false); + sched_sporadic_process(rtcb, 1, false); } #endif } diff --git a/sched/sched/sched_releasetcb.c b/sched/sched/sched_releasetcb.c index 4c7ccceba3..307721fa3c 100644 --- a/sched/sched/sched_releasetcb.c +++ b/sched/sched/sched_releasetcb.c @@ -184,7 +184,7 @@ int sched_releasetcb(FAR struct tcb_s *tcb, uint8_t ttype) #if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_ARCH_KERNEL_STACK) /* Release the kernel stack */ - (void)up_addrenv_kstackfree(tcb); + up_addrenv_kstackfree(tcb); #endif #ifdef CONFIG_ARCH_ADDRENV diff --git a/sched/sched/sched_setparam.c b/sched/sched/sched_setparam.c index 4b1fbbef60..17eb36d0d9 100644 --- a/sched/sched/sched_setparam.c +++ b/sched/sched/sched_setparam.c @@ -150,8 +150,8 @@ int nxsched_setparam(pid_t pid, FAR const struct sched_param *param) /* Convert timespec values to system clock ticks */ - (void)clock_time2ticks(¶m->sched_ss_repl_period, &repl_ticks); - (void)clock_time2ticks(¶m->sched_ss_init_budget, &budget_ticks); + clock_time2ticks(¶m->sched_ss_repl_period, &repl_ticks); + clock_time2ticks(¶m->sched_ss_init_budget, &budget_ticks); /* Avoid zero/negative times */ diff --git a/sched/sched/sched_setscheduler.c b/sched/sched/sched_setscheduler.c index 3a86128ef9..c199627706 100644 --- a/sched/sched/sched_setscheduler.c +++ b/sched/sched/sched_setscheduler.c @@ -199,8 +199,8 @@ int nxsched_setscheduler(pid_t pid, int policy, /* Convert timespec values to system clock ticks */ - (void)clock_time2ticks(¶m->sched_ss_repl_period, &repl_ticks); - (void)clock_time2ticks(¶m->sched_ss_init_budget, &budget_ticks); + clock_time2ticks(¶m->sched_ss_repl_period, &repl_ticks); + clock_time2ticks(¶m->sched_ss_init_budget, &budget_ticks); /* Avoid zero/negative times */ diff --git a/sched/sched/sched_sporadic.c b/sched/sched/sched_sporadic.c index 5a475e2e3e..ef65c7db38 100644 --- a/sched/sched/sched_sporadic.c +++ b/sched/sched/sched_sporadic.c @@ -895,7 +895,7 @@ int sched_sporadic_stop(FAR struct tcb_s *tcb) /* Stop all timers, reset scheduling */ - (void)sched_sporadic_reset(tcb); + sched_sporadic_reset(tcb); /* The free the container holder the sporadic scheduling parameters */ diff --git a/sched/sched/sched_timerexpiration.c b/sched/sched/sched_timerexpiration.c index bd8fc9191d..c94f7aed5f 100644 --- a/sched/sched/sched_timerexpiration.c +++ b/sched/sched/sched_timerexpiration.c @@ -562,7 +562,7 @@ void nxsched_timer_expiration(void) #ifdef CONFIG_SCHED_SPORADIC /* Save the last time that the scheduler ran */ - (void)up_timer_gettime(&g_sched_time); + up_timer_gettime(&g_sched_time); #endif /* Process the timer ticks and set up the next interval (or not) */ @@ -610,7 +610,7 @@ unsigned int sched_timer_cancel(void) ts.tv_sec = g_stop_time.tv_sec; ts.tv_nsec = g_stop_time.tv_nsec; - (void)up_alarm_cancel(&g_stop_time); + up_alarm_cancel(&g_stop_time); #ifdef CONFIG_SCHED_SPORADIC /* Save the last time that the scheduler ran */ @@ -654,7 +654,7 @@ unsigned int sched_timer_cancel(void) /* Get the time remaining on the interval timer and cancel the timer. */ - (void)up_timer_cancel(&ts); + up_timer_cancel(&ts); #ifdef CONFIG_SCHED_SPORADIC /* Save the last time that the scheduler ran */ @@ -716,7 +716,7 @@ void sched_timer_resume(void) #ifdef CONFIG_SCHED_SPORADIC /* Save the last time that the scheduler ran */ - (void)up_timer_gettime(&g_sched_time); + up_timer_gettime(&g_sched_time); #endif /* Reassess the next deadline (by simply processing a zero ticks expired) diff --git a/sched/sched/sched_waitid.c b/sched/sched/sched_waitid.c index fa6676684f..575673117f 100644 --- a/sched/sched/sched_waitid.c +++ b/sched/sched/sched_waitid.c @@ -82,7 +82,7 @@ static void exited_child(FAR struct tcb_s *rtcb, FAR struct child_status_s *chil /* Discard the child entry */ - (void)group_removechild(rtcb->group, child->ch_pid); + group_removechild(rtcb->group, child->ch_pid); group_freechild(child); } #endif @@ -195,12 +195,12 @@ int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options) /* waitid() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Create a signal set that contains only SIGCHLD */ - (void)sigemptyset(&set); - (void)sigaddset(&set, SIGCHLD); + sigemptyset(&set); + sigaddset(&set, SIGCHLD); /* Disable pre-emption so that nothing changes while the loop executes */ diff --git a/sched/sched/sched_waitpid.c b/sched/sched/sched_waitpid.c index c23b51ea62..13dcfc24f1 100644 --- a/sched/sched/sched_waitpid.c +++ b/sched/sched/sched_waitpid.c @@ -191,7 +191,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) /* waitpid() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Disable pre-emption so that nothing changes in the following tests */ @@ -322,12 +322,12 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) /* waitpid() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Create a signal set that contains only SIGCHLD */ - (void)sigemptyset(&set); - (void)sigaddset(&set, SIGCHLD); + sigemptyset(&set); + sigaddset(&set, SIGCHLD); /* Disable pre-emption so that nothing changes while the loop executes */ @@ -445,7 +445,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) /* Discard the child entry and break out of the loop */ - (void)group_removechild(rtcb->group, child->ch_pid); + group_removechild(rtcb->group, child->ch_pid); group_freechild(child); break; } @@ -470,7 +470,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) /* Discard the child entry and break out of the loop */ - (void)group_removechild(rtcb->group, pid); + group_removechild(rtcb->group, pid); group_freechild(child); break; } @@ -551,7 +551,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) if (child != NULL) { - (void)group_removechild(rtcb->group, child->ch_pid); + group_removechild(rtcb->group, child->ch_pid); group_freechild(child); } } diff --git a/sched/semaphore/sem_holder.c b/sched/semaphore/sem_holder.c index 36679b91ac..49ef51804e 100644 --- a/sched/semaphore/sem_holder.c +++ b/sched/semaphore/sem_holder.c @@ -390,7 +390,7 @@ static int nxsem_boostholderprio(FAR struct semholder_s *pholder, * switch may occur during up_block_task() processing. */ - (void)nxsched_setpriority(htcb, rtcb->sched_priority); + nxsched_setpriority(htcb, rtcb->sched_priority); } else { @@ -428,7 +428,7 @@ static int nxsem_boostholderprio(FAR struct semholder_s *pholder, * will occur during up_block_task() processing. */ - (void)nxsched_setpriority(htcb, rtcb->sched_priority); + nxsched_setpriority(htcb, rtcb->sched_priority); } #endif @@ -538,7 +538,7 @@ static int nxsem_restoreholderprio(FAR struct tcb_s *htcb, /* Reset the holder's priority back to the base priority. */ - (void)nxsched_reprioritize(htcb, htcb->base_priority); + nxsched_reprioritize(htcb, htcb->base_priority); } /* There are multiple pending priority levels. The holder thread's @@ -620,7 +620,7 @@ static int nxsem_restoreholderprio(FAR struct tcb_s *htcb, * priority. */ - (void)nxsched_reprioritize(htcb, htcb->base_priority); + nxsched_reprioritize(htcb, htcb->base_priority); #endif } @@ -687,7 +687,7 @@ static int nxsem_restoreholderprioB(FAR struct semholder_s *pholder, nxsem_findandfreeholder(sem, rtcb); #endif - (void)nxsem_restoreholderprio(rtcb, sem, arg); + nxsem_restoreholderprio(rtcb, sem, arg); return 1; } @@ -740,7 +740,7 @@ static inline void nxsem_restorebaseprio_irq(FAR struct tcb_s *stcb, { /* Drop the priority of all holder threads */ - (void)nxsem_foreachholder(sem, nxsem_restoreholderprioall, stcb); + nxsem_foreachholder(sem, nxsem_restoreholderprioall, stcb); } /* If there are no tasks waiting for available counts, then all holders @@ -750,7 +750,7 @@ static inline void nxsem_restorebaseprio_irq(FAR struct tcb_s *stcb, #ifdef CONFIG_DEBUG_ASSERTIONS else { - (void)nxsem_foreachholder(sem, nxsem_verifyholder, NULL); + nxsem_foreachholder(sem, nxsem_verifyholder, NULL); } #endif } @@ -810,11 +810,11 @@ static inline void nxsem_restorebaseprio_task(FAR struct tcb_s *stcb, * except for the running thread. */ - (void)nxsem_foreachholder(sem, nxsem_restoreholderprioA, stcb); + nxsem_foreachholder(sem, nxsem_restoreholderprioA, stcb); /* Now, find an reprioritize only the ready to run task */ - (void)nxsem_foreachholder(sem, nxsem_restoreholderprioB, stcb); + nxsem_foreachholder(sem, nxsem_restoreholderprioB, stcb); } /* If there are no tasks waiting for available counts, then all holders @@ -824,7 +824,7 @@ static inline void nxsem_restorebaseprio_task(FAR struct tcb_s *stcb, #ifdef CONFIG_DEBUG_ASSERTIONS else { - (void)nxsem_foreachholder(sem, nxsem_verifyholder, NULL); + nxsem_foreachholder(sem, nxsem_verifyholder, NULL); } #endif @@ -916,7 +916,7 @@ void nxsem_destroyholder(FAR sem_t *sem) */ DEBUGASSERT(sem->hhead->flink == NULL); - (void)nxsem_foreachholder(sem, nxsem_recoverholders, NULL); + nxsem_foreachholder(sem, nxsem_recoverholders, NULL); } #else @@ -1021,7 +1021,7 @@ void nxsem_boostpriority(FAR sem_t *sem) * count. */ - (void)nxsem_foreachholder(sem, nxsem_boostholderprio, rtcb); + nxsem_foreachholder(sem, nxsem_boostholderprio, rtcb); } /**************************************************************************** @@ -1146,7 +1146,7 @@ void nxsem_canceled(FAR struct tcb_s *stcb, FAR sem_t *sem) /* Adjust the priority of every holder as necessary */ - (void)nxsem_foreachholder(sem, nxsem_restoreholderprioall, stcb); + nxsem_foreachholder(sem, nxsem_restoreholderprioall, stcb); } /**************************************************************************** @@ -1169,7 +1169,7 @@ void nxsem_canceled(FAR struct tcb_s *stcb, FAR sem_t *sem) void sem_enumholders(FAR sem_t *sem) { #ifdef CONFIG_DEBUG_INFO - (void)nxsem_foreachholder(sem, nxsem_dumpholder, NULL); + nxsem_foreachholder(sem, nxsem_dumpholder, NULL); #endif } #endif diff --git a/sched/semaphore/sem_tickwait.c b/sched/semaphore/sem_tickwait.c index d69680396d..f134424d38 100644 --- a/sched/semaphore/sem_tickwait.c +++ b/sched/semaphore/sem_tickwait.c @@ -149,8 +149,8 @@ int nxsem_tickwait(FAR sem_t *sem, clock_t start, uint32_t delay) /* Start the watchdog with interrupts still disabled */ - (void)wd_start(rtcb->waitdog, delay, (wdentry_t)nxsem_timeout, - 1, getpid()); + wd_start(rtcb->waitdog, delay, (wdentry_t)nxsem_timeout, + 1, getpid()); /* Now perform the blocking wait */ diff --git a/sched/semaphore/sem_timedwait.c b/sched/semaphore/sem_timedwait.c index bcd28c6f58..5455a208da 100644 --- a/sched/semaphore/sem_timedwait.c +++ b/sched/semaphore/sem_timedwait.c @@ -192,8 +192,8 @@ int nxsem_timedwait(FAR sem_t *sem, FAR const struct timespec *abstime) /* Start the watchdog */ - (void)wd_start(rtcb->waitdog, ticks, (wdentry_t)nxsem_timeout, - 1, getpid()); + wd_start(rtcb->waitdog, ticks, (wdentry_t)nxsem_timeout, + 1, getpid()); /* Now perform the blocking wait. If nxsem_wait() fails, the * negated errno value will be returned below. @@ -256,7 +256,7 @@ int sem_timedwait(FAR sem_t *sem, FAR const struct timespec *abstime) /* sem_timedwait() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Let nxsem_timedout() do the work */ diff --git a/sched/signal/sig_action.c b/sched/signal/sig_action.c index d904525531..e9eaa577ce 100644 --- a/sched/signal/sig_action.c +++ b/sched/signal/sig_action.c @@ -287,7 +287,7 @@ int nxsig_action(int signo, FAR const struct sigaction *act, { /* We will be replacing the default action (or ignoring it) */ - (void)nxsig_default(rtcb, signo, false); + nxsig_default(rtcb, signo, false); } #endif diff --git a/sched/signal/sig_default.c b/sched/signal/sig_default.c index 806aa9b49f..1cd861b106 100644 --- a/sched/signal/sig_default.c +++ b/sched/signal/sig_default.c @@ -454,11 +454,11 @@ static void nxsig_setup_default_action(FAR struct task_group_s *group, memset(&sa, 0, sizeof(sa)); sa.sa_handler = info->action; sa.sa_flags = SA_SIGINFO; - (void)nxsig_action(info->signo, &sa, NULL, true); + nxsig_action(info->signo, &sa, NULL, true); /* Indicate that the default signal handler has been attached */ - (void)sigaddset(&group->tg_sigdefault, (int)info->signo); + sigaddset(&group->tg_sigdefault, (int)info->signo); } } @@ -581,7 +581,7 @@ _sa_handler_t nxsig_default(FAR struct tcb_s *tcb, int signo, bool defaction) /* sigaddset() is not atomic (but neither is sigaction()) */ flags = spin_lock_irqsave(); - (void)sigaddset(&group->tg_sigdefault, signo); + sigaddset(&group->tg_sigdefault, signo); spin_unlock_irqrestore(flags); } } @@ -593,7 +593,7 @@ _sa_handler_t nxsig_default(FAR struct tcb_s *tcb, int signo, bool defaction) */ flags = spin_lock_irqsave(); - (void)sigdelset(&group->tg_sigdefault, signo); + sigdelset(&group->tg_sigdefault, signo); spin_unlock_irqrestore(flags); } @@ -626,7 +626,7 @@ int nxsig_default_initialize(FAR struct tcb_s *tcb) /* Initialize the set of default signal handlers */ - (void)sigemptyset(&group->tg_sigdefault); + sigemptyset(&group->tg_sigdefault); /* Setup the default action for each signal in g_defactions[] */ diff --git a/sched/signal/sig_nanosleep.c b/sched/signal/sig_nanosleep.c index f68d2bd0d6..ca1490a2ef 100644 --- a/sched/signal/sig_nanosleep.c +++ b/sched/signal/sig_nanosleep.c @@ -131,7 +131,7 @@ int nxsig_nanosleep(FAR const struct timespec *rqtp, * still awaken nxsig_timedwait(). */ - (void)sigemptyset(&set); + sigemptyset(&set); /* nxsig_nanosleep is a simple application of nxsig_timedwait. */ @@ -142,8 +142,6 @@ int nxsig_nanosleep(FAR const struct timespec *rqtp, * meaning that some other unblocked signal was caught. */ - DEBUGASSERT(ret < 0 && (ret == -EAGAIN || ret == -EINTR)); - if (ret == -EAGAIN) { /* The timeout "error" is the normal, successful result */ @@ -171,7 +169,7 @@ int nxsig_nanosleep(FAR const struct timespec *rqtp, * wait. */ - (void)clock_time2ticks(rqtp, &ticks); + clock_time2ticks(rqtp, &ticks); /* Get the number of ticks that we actually waited */ @@ -191,7 +189,7 @@ int nxsig_nanosleep(FAR const struct timespec *rqtp, remaining = (clock_t)ticks - elapsed; } - (void)clock_ticks2time((sclock_t)remaining, rmtp); + clock_ticks2time((sclock_t)remaining, rmtp); } leave_critical_section(flags); @@ -279,7 +277,7 @@ int clock_nanosleep(clockid_t clockid, int flags, /* clock_nanosleep() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Check if absolute time is selected */ diff --git a/sched/signal/sig_pause.c b/sched/signal/sig_pause.c index 305dc40be9..85ebd097b0 100644 --- a/sched/signal/sig_pause.c +++ b/sched/signal/sig_pause.c @@ -81,14 +81,14 @@ int pause(void) /* pause() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Set up for the sleep. Using the empty set means that we are not * waiting for any particular signal. However, any unmasked signal * can still awaken sigtimedwait(). */ - (void)sigemptyset(&set); + sigemptyset(&set); /* sigtwaitinfo() cannot succeed. It should always return error EINTR * meaning that some unblocked signal was caught. diff --git a/sched/signal/sig_suspend.c b/sched/signal/sig_suspend.c index ade7da33b2..92781b00d9 100644 --- a/sched/signal/sig_suspend.c +++ b/sched/signal/sig_suspend.c @@ -98,7 +98,7 @@ int sigsuspend(FAR const sigset_t *set) /* sigsuspend() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Several operations must be performed below: We must determine if any * signal is pending and, if not, wait for the signal. Since signals can diff --git a/sched/signal/sig_timedwait.c b/sched/signal/sig_timedwait.c index c01b6dad63..727e1a4b24 100644 --- a/sched/signal/sig_timedwait.c +++ b/sched/signal/sig_timedwait.c @@ -355,8 +355,8 @@ int nxsig_timedwait(FAR const sigset_t *set, FAR struct siginfo *info, /* Start the watchdog */ - (void)wd_start(rtcb->waitdog, waitticks, - (wdentry_t)nxsig_timeout, 1, wdparm.pvarg); + wd_start(rtcb->waitdog, waitticks, + (wdentry_t)nxsig_timeout, 1, wdparm.pvarg); /* Now wait for either the signal or the watchdog, but * first, make sure this is not the idle task, @@ -506,7 +506,7 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info, /* sigtimedwait() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Let nxsig_timedwait() do the work. */ diff --git a/sched/signal/sig_waitinfo.c b/sched/signal/sig_waitinfo.c index 7927d92f94..93d42503eb 100644 --- a/sched/signal/sig_waitinfo.c +++ b/sched/signal/sig_waitinfo.c @@ -71,7 +71,7 @@ int sigwaitinfo(FAR const sigset_t *set, FAR struct siginfo *info) /* sigwaitinfo() is a cancellation point */ - (void)enter_cancellation_point(); + enter_cancellation_point(); /* Just a wrapper around nxsig_timedwait() */ diff --git a/sched/task/task_create.c b/sched/task/task_create.c index 8a2a687698..cab62410fb 100644 --- a/sched/task/task_create.c +++ b/sched/task/task_create.c @@ -144,7 +144,7 @@ static int nxthread_create(FAR const char *name, uint8_t ttype, /* Setup to pass parameters to the new task */ - (void)nxtask_argsetup(tcb, name, argv); + nxtask_argsetup(tcb, name, argv); /* Now we have enough in place that we can join the group */ diff --git a/sched/task/task_exit.c b/sched/task/task_exit.c index ac3329b957..4ac4d54cd9 100644 --- a/sched/task/task_exit.c +++ b/sched/task/task_exit.c @@ -108,7 +108,7 @@ int nxtask_exit(void) * with state == TSTATE_TASK_RUNNING */ - (void)sched_removereadytorun(dtcb); + sched_removereadytorun(dtcb); /* Get the new task at the head of the ready to run list */ @@ -176,7 +176,7 @@ int nxtask_exit(void) if (g_pendingtasks.head != NULL) { - (void)sched_mergepending(); + sched_mergepending(); } return ret; diff --git a/sched/task/task_exithook.c b/sched/task/task_exithook.c index 5803109f41..de5882ba89 100644 --- a/sched/task/task_exithook.c +++ b/sched/task/task_exithook.c @@ -363,7 +363,7 @@ static inline void nxtask_sigchild(grpid_t pgrpid, FAR struct tcb_s *ctcb, /* Send the signal to one thread in the group */ - (void)group_signal(pgrp, &info); + group_signal(pgrp, &info); } } @@ -418,7 +418,7 @@ static inline void nxtask_sigchild(FAR struct tcb_s *ptcb, * can provide the correct si_code value with the signal. */ - (void)nxsig_tcbdispatch(ptcb, &info); + nxsig_tcbdispatch(ptcb, &info); } } @@ -572,9 +572,9 @@ static inline void nxtask_flushstreams(FAR struct tcb_s *tcb) { #if (defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_KERNEL)) && \ defined(CONFIG_MM_KERNEL_HEAP) - (void)lib_flushall(tcb->group->tg_streamlist); + lib_flushall(tcb->group->tg_streamlist); #else - (void)lib_flushall(&tcb->group->tg_streamlist); + lib_flushall(&tcb->group->tg_streamlist); #endif } } diff --git a/sched/task/task_init.c b/sched/task/task_init.c index d5c1880724..48e8b4f936 100644 --- a/sched/task/task_init.c +++ b/sched/task/task_init.c @@ -135,7 +135,7 @@ int task_init(FAR struct tcb_s *tcb, const char *name, int priority, /* Setup to pass parameters to the new task */ - (void)nxtask_argsetup(ttcb, name, argv); + nxtask_argsetup(ttcb, name, argv); /* Now we have enough in place that we can join the group */ diff --git a/sched/task/task_posixspawn.c b/sched/task/task_posixspawn.c index 3cf2ceb0c1..88cac9f91d 100644 --- a/sched/task/task_posixspawn.c +++ b/sched/task/task_posixspawn.c @@ -142,7 +142,7 @@ static int nxposix_spawn_exec(FAR pid_t *pidp, FAR const char *path, if (attr) { - (void)spawn_execattrs(pid, attr); + spawn_execattrs(pid, attr); } /* Re-enable pre-emption and return */ diff --git a/sched/task/task_restart.c b/sched/task/task_restart.c index d9a7b69a50..ef43af03a0 100644 --- a/sched/task/task_restart.c +++ b/sched/task/task_restart.c @@ -142,7 +142,7 @@ int task_restart(pid_t pid) /* Kill any children of this thread */ #ifdef HAVE_GROUP_MEMBERS - (void)group_killchildren(tcb); + group_killchildren(tcb); #endif /* Remove the TCB from whatever list it is in. After this point, the TCB @@ -217,7 +217,7 @@ int task_restart(pid_t pid) ret = task_activate((FAR struct tcb_s *)tcb); if (ret != OK) { - (void)nxtask_terminate(pid, true); + nxtask_terminate(pid, true); errcode = -ret; goto errout_with_lock; } diff --git a/sched/task/task_setup.c b/sched/task/task_setup.c index ff1e1cab28..e8f85e3d3c 100644 --- a/sched/task/task_setup.c +++ b/sched/task/task_setup.c @@ -101,7 +101,7 @@ static int nxtask_assignpid(FAR struct tcb_s *tcb) * for the following operation. */ - (void)sched_lock(); + sched_lock(); /* We'll try every allowable pid */ @@ -136,7 +136,7 @@ static int nxtask_assignpid(FAR struct tcb_s *tcb) #endif tcb->pid = next_pid; - (void)sched_unlock(); + sched_unlock(); return OK; } } @@ -145,7 +145,7 @@ static int nxtask_assignpid(FAR struct tcb_s *tcb) * We cannot allow another task to be started. */ - (void)sched_unlock(); + sched_unlock(); return ERROR; } @@ -410,7 +410,7 @@ static int nxthread_schedsetup(FAR struct tcb_s *tcb, int priority, * inherit the signal mask of the parent thread. */ - (void)nxsig_procmask(SIG_SETMASK, NULL, &tcb->sigprocmask); + nxsig_procmask(SIG_SETMASK, NULL, &tcb->sigprocmask); /* Initialize the task state. It does not get a valid state * until it is activated. diff --git a/sched/task/task_spawn.c b/sched/task/task_spawn.c index 48ce61866e..ba4c27dfa1 100644 --- a/sched/task/task_spawn.c +++ b/sched/task/task_spawn.c @@ -162,7 +162,7 @@ static int nxtask_spawn_exec(FAR pid_t *pidp, FAR const char *name, if (attr) { - (void)spawn_execattrs(pid, attr); + spawn_execattrs(pid, attr); } /* Re-enable pre-emption and return */ diff --git a/sched/task/task_spawnparms.c b/sched/task/task_spawnparms.c index 732b6d57c2..aa3ab13644 100644 --- a/sched/task/task_spawnparms.c +++ b/sched/task/task_spawnparms.c @@ -87,7 +87,7 @@ static inline int nxspawn_close(FAR struct spawn_close_file_action_s *action) sinfo("Closing fd=%d\n", action->fd); - (void)close(action->fd); + close(action->fd); return OK; } @@ -173,14 +173,7 @@ static inline int nxspawn_open(FAR struct spawn_open_file_action_s *action) void spawn_semtake(FAR sem_t *sem) { - int ret; - - do - { - ret = nxsem_wait(sem); - DEBUGASSERT(ret == 0 || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(sem); } /**************************************************************************** @@ -290,7 +283,7 @@ int spawn_execattrs(pid_t pid, FAR const posix_spawnattr_t *attr) param.sched_ss_init_budget.tv_sec = attr->budget.tv_sec; param.sched_ss_init_budget.tv_nsec = attr->budget.tv_nsec; #endif - (void)nxsched_setscheduler(pid, attr->policy, ¶m); + nxsched_setscheduler(pid, attr->policy, ¶m); } return OK; @@ -324,7 +317,7 @@ int spawn_proxyattrs(FAR const posix_spawnattr_t *attr, if (attr != NULL && (attr->flags & POSIX_SPAWN_SETSIGMASK) != 0) { - (void)nxsig_procmask(SIG_SETMASK, &attr->sigmask, NULL); + nxsig_procmask(SIG_SETMASK, &attr->sigmask, NULL); } /* Were we also requested to perform file actions? */ diff --git a/sched/task/task_testcancel.c b/sched/task/task_testcancel.c index b0407173e3..056f92fdbc 100644 --- a/sched/task/task_testcancel.c +++ b/sched/task/task_testcancel.c @@ -62,6 +62,6 @@ void task_testcancel(void) { - (void)enter_cancellation_point(); + enter_cancellation_point(); leave_cancellation_point(); } diff --git a/sched/task/task_vfork.c b/sched/task/task_vfork.c index 9424751a0f..7c2594318f 100644 --- a/sched/task/task_vfork.c +++ b/sched/task/task_vfork.c @@ -481,7 +481,7 @@ pid_t nxtask_vforkstart(FAR struct task_tcb_s *child) serr("ERROR: waitpid failed: %d\n", errno); } #else - (void)waitpid(pid, &rc, 0); + waitpid(pid, &rc, 0); #endif sched_unlock(); diff --git a/sched/timer/timer_gettime.c b/sched/timer/timer_gettime.c index 14133a5f16..04764e9977 100644 --- a/sched/timer/timer_gettime.c +++ b/sched/timer/timer_gettime.c @@ -100,8 +100,8 @@ int timer_gettime(timer_t timerid, FAR struct itimerspec *value) /* Convert that to a struct timespec and return it */ - (void)clock_ticks2time(ticks, &value->it_value); - (void)clock_ticks2time(timer->pt_last, &value->it_interval); + clock_ticks2time(ticks, &value->it_value); + clock_ticks2time(timer->pt_last, &value->it_interval); return OK; } diff --git a/sched/timer/timer_release.c b/sched/timer/timer_release.c index b172a4ff7b..49115dd687 100644 --- a/sched/timer/timer_release.c +++ b/sched/timer/timer_release.c @@ -138,7 +138,7 @@ int timer_release(FAR struct posix_timer_s *timer) * watchdog logic before it is actually deleted) */ - (void)wd_delete(timer->pt_wdog); + wd_delete(timer->pt_wdog); /* Cancel any pending notification */ diff --git a/sched/timer/timer_settime.c b/sched/timer/timer_settime.c index 3fe15077c5..5c92605f22 100644 --- a/sched/timer/timer_settime.c +++ b/sched/timer/timer_settime.c @@ -114,8 +114,8 @@ static inline void timer_restart(FAR struct posix_timer_s *timer, if (timer->pt_delay) { timer->pt_last = timer->pt_delay; - (void)wd_start(timer->pt_wdog, timer->pt_delay, - (wdentry_t)timer_timeout, 1, itimer); + wd_start(timer->pt_wdog, timer->pt_delay, + (wdentry_t)timer_timeout, 1, itimer); } } @@ -298,7 +298,7 @@ int timer_settime(timer_t timerid, int flags, * is called). */ - (void)wd_cancel(timer->pt_wdog); + wd_cancel(timer->pt_wdog); /* Cancel any pending notification */ @@ -315,7 +315,7 @@ int timer_settime(timer_t timerid, int flags, if (value->it_interval.tv_sec > 0 || value->it_interval.tv_nsec > 0) { - (void)clock_time2ticks(&value->it_interval, &delay); + clock_time2ticks(&value->it_interval, &delay); /* REVISIT: Should pt_delay be sclock_t? */ @@ -341,7 +341,7 @@ int timer_settime(timer_t timerid, int flags, * returns an error if clockid != CLOCK_REALTIME. */ - (void)clock_abstime2ticks(CLOCK_REALTIME, &value->it_value, &delay); + clock_abstime2ticks(CLOCK_REALTIME, &value->it_value, &delay); } else { @@ -350,7 +350,7 @@ int timer_settime(timer_t timerid, int flags, * returns success. */ - (void)clock_time2ticks(&value->it_value, &delay); + clock_time2ticks(&value->it_value, &delay); } /* If the time is in the past or now, then set up the next interval diff --git a/sched/wdog/wd_cancel.c b/sched/wdog/wd_cancel.c index 0ae79eccde..01ea2efca9 100644 --- a/sched/wdog/wd_cancel.c +++ b/sched/wdog/wd_cancel.c @@ -125,13 +125,13 @@ int wd_cancel(WDOG_ID wdog) { /* Remove the watchdog from mid- or end-of-queue */ - (void)sq_remafter((FAR sq_entry_t *)prev, &g_wdactivelist); + sq_remafter((FAR sq_entry_t *)prev, &g_wdactivelist); } else { /* Remove the watchdog at the head of the queue */ - (void)sq_remfirst(&g_wdactivelist); + sq_remfirst(&g_wdactivelist); /* Reassess the interval timer that will generate the next * interval event. diff --git a/sched/wdog/wd_recover.c b/sched/wdog/wd_recover.c index 8fc0c2f4b0..097542df12 100644 --- a/sched/wdog/wd_recover.c +++ b/sched/wdog/wd_recover.c @@ -83,8 +83,8 @@ void wd_recover(FAR struct tcb_s *tcb) flags = enter_critical_section(); if (tcb->waitdog) { - (void)wd_cancel(tcb->waitdog); - (void)wd_delete(tcb->waitdog); + wd_cancel(tcb->waitdog); + wd_delete(tcb->waitdog); tcb->waitdog = NULL; } diff --git a/sched/wdog/wd_start.c b/sched/wdog/wd_start.c index f4235e9492..b8d8af50fd 100644 --- a/sched/wdog/wd_start.c +++ b/sched/wdog/wd_start.c @@ -250,7 +250,7 @@ int wd_start(WDOG_ID wdog, int32_t delay, wdentry_t wdentry, int argc, ...) * remove it). */ - (void)sched_timer_cancel(); + sched_timer_cancel(); #endif /* Do the easy case first -- when the watchdog timer queue is empty. */ diff --git a/sched/wqueue/kwork_inherit.c b/sched/wqueue/kwork_inherit.c index 78b3f0c570..83049610f9 100644 --- a/sched/wqueue/kwork_inherit.c +++ b/sched/wqueue/kwork_inherit.c @@ -123,7 +123,7 @@ static void lpwork_boostworker(pid_t wpid, uint8_t reqprio) * sched_unblock() processing. */ - (void)nxsched_setpriority(wtcb, reqprio); + nxsched_setpriority(wtcb, reqprio); } else { @@ -160,7 +160,7 @@ static void lpwork_boostworker(pid_t wpid, uint8_t reqprio) * sched_unlock() processing. */ - (void)nxsched_setpriority(wtcb, reqprio); + nxsched_setpriority(wtcb, reqprio); } #endif } @@ -223,7 +223,7 @@ static void lpwork_restoreworker(pid_t wpid, uint8_t reqprio) /* Reset the worker's priority back to the base priority. */ - (void)nxsched_reprioritize(wtcb, wtcb->base_priority); + nxsched_reprioritize(wtcb, wtcb->base_priority); } /* There are multiple pending priority levels. The worker thread's @@ -304,7 +304,7 @@ static void lpwork_restoreworker(pid_t wpid, uint8_t reqprio) * priority. */ - (void)nxsched_reprioritize(wtcb, wtcb->base_priority); + nxsched_reprioritize(wtcb, wtcb->base_priority); #endif } } diff --git a/sched/wqueue/kwork_notifier.c b/sched/wqueue/kwork_notifier.c index 66bc5731a6..0950dd4886 100644 --- a/sched/wqueue/kwork_notifier.c +++ b/sched/wqueue/kwork_notifier.c @@ -277,7 +277,7 @@ int work_notifier_setup(FAR struct work_notifier_s *info) ret = notifier->key; } - (void)nxsem_post(&g_notifier_sem); + nxsem_post(&g_notifier_sem); return ret; } @@ -338,7 +338,7 @@ int work_notifier_teardown(int key) ret = OK; } - (void)nxsem_post(&g_notifier_sem); + nxsem_post(&g_notifier_sem); return ret; } @@ -369,16 +369,10 @@ void work_notifier_signal(enum work_evtype_e evtype, FAR struct work_notifier_entry_s *notifier; FAR dq_entry_t *entry; FAR dq_entry_t *next; - int ret; /* Get exclusive access to the notifier data structure */ - do - { - ret = nxsem_wait(&g_notifier_sem); - DEBUGASSERT(ret >= 0 || ret == -EINTR || ret == -ECANCELED); - } - while (ret < 0); + nxsem_wait_uninterruptible(&g_notifier_sem); /* Don't let any newly started threads block this thread until all of * the notifications and been sent. @@ -422,13 +416,13 @@ void work_notifier_signal(enum work_evtype_e evtype, * responsible for freeing the allocated memory. */ - (void)work_queue(info->qid, ¬ifier->work, - work_notifier_worker, entry, 0); + work_queue(info->qid, ¬ifier->work, + work_notifier_worker, entry, 0); } } sched_unlock(); - (void)nxsem_post(&g_notifier_sem); + nxsem_post(&g_notifier_sem); } #endif /* CONFIG_WQUEUE_NOTIFIER */ diff --git a/sched/wqueue/kwork_process.c b/sched/wqueue/kwork_process.c index 650bbda272..bcaba329a8 100644 --- a/sched/wqueue/kwork_process.c +++ b/sched/wqueue/kwork_process.c @@ -142,7 +142,7 @@ void work_process(FAR struct kwork_wqueue_s *wqueue, int wndx) { /* Remove the ready-to-execute work from the list */ - (void)dq_rem((struct dq_entry_s *)work, &wqueue->q); + dq_rem((struct dq_entry_s *)work, &wqueue->q); /* Extract the work description from the entry (in case the work * instance by the re-used after it has been de-queued). diff --git a/tools/configure.c b/tools/configure.c index a1566d231c..58ebc4e25f 100644 --- a/tools/configure.c +++ b/tools/configure.c @@ -312,7 +312,7 @@ static void debug(const char *fmt, ...) if (g_debug) { va_start(ap, fmt); - (void)vprintf(fmt, ap); + vprintf(fmt, ap); va_end(ap); } } diff --git a/tools/convert-comments.c b/tools/convert-comments.c index 32540ec68f..5785e6eae7 100644 --- a/tools/convert-comments.c +++ b/tools/convert-comments.c @@ -313,7 +313,7 @@ int main(int argc, char **argv) /* Write the modified line to the output */ - (void)fputs(g_line0, outstream); + fputs(g_line0, outstream); } else { @@ -346,7 +346,7 @@ int main(int argc, char **argv) /* Write the modified line to the output */ - (void)fputs(g_line0, outstream); + fputs(g_line0, outstream); /* Closing comment must be followed by a blank line */ @@ -361,7 +361,7 @@ int main(int argc, char **argv) { /* Write the modified line to the output */ - (void)fputs(g_line0, outstream); + fputs(g_line0, outstream); } } } @@ -380,7 +380,7 @@ int main(int argc, char **argv) /* Write the closing line to the output */ - (void)fputs(g_iobuffer, outstream); + fputs(g_iobuffer, outstream); /* Closing comment must be followed by a blank line */ @@ -393,13 +393,13 @@ int main(int argc, char **argv) /* Write the noncomment line to the output */ - (void)fputs(g_line0, outstream); + fputs(g_line0, outstream); } else { /* Write the noncomment line to the output */ - (void)fputs(g_line0, outstream); + fputs(g_line0, outstream); } wascomment = iscomment; diff --git a/tools/gencromfs.c b/tools/gencromfs.c index 9b4056a569..1e0f4592bd 100644 --- a/tools/gencromfs.c +++ b/tools/gencromfs.c @@ -490,7 +490,7 @@ static void unlink_tmpfiles(void) for (i = 0; i < g_ntmps; i++) { snprintf(tmpname, TMP_NAMLEN, TMP_NAME, i); - (void)unlink(tmpname); + unlink(tmpname); } } #endif @@ -513,7 +513,7 @@ static void append_tmpfile(FILE *dest, FILE *src) nread = fread(iobuffer, 1, 1024, src); if (nread > 0) { - (void)fwrite(iobuffer, 1, nread, dest); + fwrite(iobuffer, 1, nread, dest); } } while (nread > 0); @@ -974,7 +974,7 @@ static void gen_directory(const char *path, const char *name, mode_t mode, { /* Then recurse to generate all of the nodes for the subtree */ - (void)traverse_directory(path, process_direntry, NULL); + traverse_directory(path, process_direntry, NULL); } /* When traverse_directory() returns, all of the nodes in the sub-tree under @@ -1326,7 +1326,7 @@ int main(int argc, char **argv, char **envp) * each directory entry encountered. */ - (void)traverse_directory(g_dirname, process_direntry, NULL); + traverse_directory(g_dirname, process_direntry, NULL); } /* Now append the volume header to output file */ diff --git a/tools/initialconfig.c b/tools/initialconfig.c index b1745a9783..410d8814e1 100644 --- a/tools/initialconfig.c +++ b/tools/initialconfig.c @@ -647,8 +647,8 @@ static int enum_boards(const char *dirpath, struct dirent *entry, void *arg) { /* Enumerate the board configurations */ - (void)foreach_dirent(boardpath, enum_board_configurations, - entry->d_name); + foreach_dirent(boardpath, enum_board_configurations, + entry->d_name); } } } diff --git a/tools/kconfig2html.c b/tools/kconfig2html.c index d6afe9ba2c..7b7f5ba114 100644 --- a/tools/kconfig2html.c +++ b/tools/kconfig2html.c @@ -266,7 +266,7 @@ static void debug(const char *fmt, ...) if (g_debug) { va_start(ap, fmt); - (void)vfprintf(stderr, fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); } } @@ -284,7 +284,7 @@ static void error(const char *fmt, ...) va_list ap; va_start(ap, fmt); - (void)vfprintf(stderr, fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); } @@ -301,7 +301,7 @@ static void output(const char *fmt, ...) va_list ap; va_start(ap, fmt); - (void)vfprintf(g_outfile, fmt, ap); + vfprintf(g_outfile, fmt, ap); va_end(ap); } @@ -318,7 +318,7 @@ static void body(const char *fmt, ...) va_list ap; va_start(ap, fmt); - (void)vfprintf(g_bodyfile, fmt, ap); + vfprintf(g_bodyfile, fmt, ap); va_end(ap); } @@ -335,7 +335,7 @@ static void appendix(const char *fmt, ...) va_list ap; va_start(ap, fmt); - (void)vfprintf(g_apndxfile, fmt, ap); + vfprintf(g_apndxfile, fmt, ap); va_end(ap); } @@ -365,7 +365,7 @@ static void append_file(const char *filename) while ((ch = getc(stream)) != EOF) { - (void)putc(ch, g_outfile); + putc(ch, g_outfile); } /* Close and remove the file */ @@ -2574,7 +2574,7 @@ int main(int argc, char **argv, char **envp) now = time(NULL); ptm = localtime(&now); - (void)strftime(g_scratch, SCRATCH_SIZE, "%B %d, %Y", ptm); + strftime(g_scratch, SCRATCH_SIZE, "%B %d, %Y", ptm); /* Output header boilerplater */ diff --git a/tools/lowhex.c b/tools/lowhex.c index 093e2dd0d7..ed18fb2ad2 100644 --- a/tools/lowhex.c +++ b/tools/lowhex.c @@ -148,7 +148,7 @@ int main(int argc, char **argv) } } - (void)fputs(g_line, outstream); + fputs(g_line, outstream); } ret = 0; diff --git a/tools/mksyscall.c b/tools/mksyscall.c index f7c87fc8e0..0265496ae5 100644 --- a/tools/mksyscall.c +++ b/tools/mksyscall.c @@ -120,7 +120,7 @@ static void print_formalparm(FILE *stream, const char *argtype, int parmno) (part2 = check_array(argtype)) != NULL) { len = part2 - argtype; - (void)fwrite(argtype, 1, len, stream); + fwrite(argtype, 1, len, stream); fprintf(stream, "parm%d%s", parmno, part2); } else diff --git a/tools/rmcr.c b/tools/rmcr.c index b020b11579..10e5048c41 100644 --- a/tools/rmcr.c +++ b/tools/rmcr.c @@ -107,7 +107,7 @@ int main(int argc, char **argv) g_line[len + 1] = '\n'; g_line[len + 2] = '\0'; - (void)fputs(g_line, outstream); + fputs(g_line, outstream); } ret = 0; diff --git a/wireless/bluetooth/bt_conn.c b/wireless/bluetooth/bt_conn.c index f3d65ef3fe..4b4232f068 100644 --- a/wireless/bluetooth/bt_conn.c +++ b/wireless/bluetooth/bt_conn.c @@ -149,13 +149,7 @@ static int conn_tx_kthread(int argc, FAR char *argv[]) wlinfo("calling nxsem_wait\n"); - do - { - ret = nxsem_wait(&g_btdev.le_pkts_sem); - } - while (ret == -EINTR); - - DEBUGASSERT(ret == OK); + nxsem_wait_uninterruptible(&g_btdev.le_pkts_sem); /* Check for disconnection */ @@ -574,13 +568,7 @@ void bt_conn_set_state(FAR struct bt_conn_s *conn, * zero when we complete this. */ - do - { - ret = nxsem_wait(&g_conn_handoff.sync_sem); - } - while (ret == -EINTR); - - DEBUGASSERT(ret == OK); + nxsem_wait_uninterruptible(&g_conn_handoff.sync_sem); /* Start the Tx connection kernel thread */ @@ -595,13 +583,7 @@ void bt_conn_set_state(FAR struct bt_conn_s *conn, * sem_count at -1. It will be zero again when we continue. */ - do - { - ret = nxsem_wait(&g_conn_handoff.sync_sem); - } - while (ret == -EINTR); - - DEBUGASSERT(ret == OK); + nxsem_wait_uninterruptible(&g_conn_handoff.sync_sem); nxsem_post(&g_conn_handoff.sync_sem); } break; diff --git a/wireless/bluetooth/bt_hcicore.c b/wireless/bluetooth/bt_hcicore.c index 3a633d9108..6e29366a87 100644 --- a/wireless/bluetooth/bt_hcicore.c +++ b/wireless/bluetooth/bt_hcicore.c @@ -439,7 +439,7 @@ static void hci_num_completed_packets(FAR struct bt_buf_s *buf) while (count--) { - sem_post(&g_btdev.le_pkts_sem); + nxsem_post(&g_btdev.le_pkts_sem); } } } @@ -978,13 +978,7 @@ static int hci_tx_kthread(int argc, FAR char *argv[]) /* Wait until ncmd > 0 */ - do - { - ret = nxsem_wait(&g_btdev.ncmd_sem); - } - while (ret == -EINTR); - - DEBUGASSERT(ret >= 0); + nxsem_wait_uninterruptible(&g_btdev.ncmd_sem); /* Get next command - wait if necessary */ @@ -1765,13 +1759,7 @@ int bt_hci_cmd_send_sync(uint16_t opcode, FAR struct bt_buf_s *buf, * released while we are waiting. */ - do - { - /* The timed wait could also be awakened by a signal */ - - ret = nxsem_timedwait(&sync_sem, &abstime); - } - while (ret == -EINTR); + nxsem_timedwait_uninterruptible(&sync_sem, &abstime); } sched_unlock(); diff --git a/wireless/bluetooth/bt_ioctl.c b/wireless/bluetooth/bt_ioctl.c index 7c14e01bd8..a1d105346b 100644 --- a/wireless/bluetooth/bt_ioctl.c +++ b/wireless/bluetooth/bt_ioctl.c @@ -157,7 +157,6 @@ static void btnet_scan_callback(FAR const bt_addr_le_t *addr, int8_t rssi, uint8_t nexttail; uint8_t head; uint8_t tail; - int ret; if (!g_scanstate.bs_scanning) { @@ -173,14 +172,7 @@ static void btnet_scan_callback(FAR const bt_addr_le_t *addr, int8_t rssi, /* Get exclusive access to the scan data */ - while ((ret = nxsem_wait(&g_scanstate.bs_exclsem)) < 0) - { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - if (ret != -EINTR) - { - return; - } - } + nxsem_wait_uninterruptible(&g_scanstate.bs_exclsem); /* Add the scan data to the cache */ @@ -260,7 +252,6 @@ static int btnet_scan_result(FAR struct bt_scanresponse_s *result, ret = nxsem_wait(&g_scanstate.bs_exclsem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); return ret; } } diff --git a/wireless/bluetooth/bt_netdev.c b/wireless/bluetooth/bt_netdev.c index 0d1660b132..336b9b0685 100644 --- a/wireless/bluetooth/bt_netdev.c +++ b/wireless/bluetooth/bt_netdev.c @@ -543,12 +543,12 @@ static void btnet_txpoll_work(FAR void *arg) /* Then perform the poll */ - (void)devif_timer(&priv->bd_dev.r_dev, TXPOLL_WDDELAY, btnet_txpoll_callback); + devif_timer(&priv->bd_dev.r_dev, TXPOLL_WDDELAY, btnet_txpoll_callback); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->bd_txpoll, TXPOLL_WDDELAY, btnet_txpoll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->bd_txpoll, TXPOLL_WDDELAY, btnet_txpoll_expiry, 1, + (wdparm_t)priv); net_unlock(); } @@ -627,8 +627,8 @@ static int btnet_ifup(FAR struct net_driver_s *netdev) /* Set and activate a timer process */ - (void)wd_start(priv->bd_txpoll, TXPOLL_WDDELAY, btnet_txpoll_expiry, - 1, (wdparm_t)priv); + wd_start(priv->bd_txpoll, TXPOLL_WDDELAY, btnet_txpoll_expiry, + 1, (wdparm_t)priv); /* The interface is now up */ @@ -724,7 +724,7 @@ static void btnet_txavail_work(FAR void *arg) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->bd_dev.r_dev, btnet_txpoll_callback); + devif_poll(&priv->bd_dev.r_dev, btnet_txpoll_callback); } net_unlock(); diff --git a/wireless/ieee802154/mac802154.c b/wireless/ieee802154/mac802154.c index dbfb79654a..9e42343153 100644 --- a/wireless/ieee802154/mac802154.c +++ b/wireless/ieee802154/mac802154.c @@ -195,7 +195,7 @@ int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, /* MAC is already released */ wlwarn("WARNING: mac802154_takesem failed: %d\n", ret); - return -EINTR; + return ret; } /* If we've taken a count from the semaphore, we have "reserved" the @@ -209,7 +209,7 @@ int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, wlwarn("WARNING: mac802154_lock failed: %d\n", ret); mac802154_givesem(&priv->txdesc_sem); - return -EINTR; + return ret; } /* We can now safely unlink the next free structure from the free list */ diff --git a/wireless/ieee802154/mac802154.h b/wireless/ieee802154/mac802154.h index 049a69803e..8c9d8e475d 100644 --- a/wireless/ieee802154/mac802154.h +++ b/wireless/ieee802154/mac802154.h @@ -151,7 +151,7 @@ int mac802154_get_mhrlen(MACHANDLE mac, int mac802154_req_data(MACHANDLE mac, FAR const struct ieee802154_frame_meta_s *meta, - FAR struct iob_s *frame); + FAR struct iob_s *frame, bool allowinterrupt); /**************************************************************************** * Name: mac802154_req_purge diff --git a/wireless/ieee802154/mac802154_data.c b/wireless/ieee802154/mac802154_data.c index d6ec56492b..666302a0d3 100644 --- a/wireless/ieee802154/mac802154_data.c +++ b/wireless/ieee802154/mac802154_data.c @@ -73,7 +73,7 @@ int mac802154_req_data(MACHANDLE mac, FAR const struct ieee802154_frame_meta_s *meta, - FAR struct iob_s *frame) + FAR struct iob_s *frame, bool allowinterrupt) { FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac; @@ -156,7 +156,7 @@ int mac802154_req_data(MACHANDLE mac, /* From this point on, we need exclusive access to the privmac struct */ - ret = mac802154_lock(priv, true); + ret = mac802154_lock(priv, allowinterrupt); if (ret < 0) { /* Should only fail if interrupted by a signal */ diff --git a/wireless/ieee802154/mac802154_device.c b/wireless/ieee802154/mac802154_device.c index 861b751dbb..b34a0ab5e3 100644 --- a/wireless/ieee802154/mac802154_device.c +++ b/wireless/ieee802154/mac802154_device.c @@ -179,18 +179,7 @@ static const struct file_operations mac802154dev_fops = static inline int mac802154dev_takesem(sem_t *sem) { - int ret; - - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(sem); - - /* The only case that an error should occur here is if the wait were - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - return ret; + return nxsem_wait(sem); } /**************************************************************************** @@ -440,7 +429,6 @@ static ssize_t mac802154dev_read(FAR struct file *filep, FAR char *buffer, ret = nxsem_wait(&dev->readsem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); dev->readpending = false; return ret; } @@ -568,7 +556,7 @@ static ssize_t mac802154dev_write(FAR struct file *filep, /* Pass the request to the MAC layer */ - ret = mac802154_req_data(dev->md_mac, &tx->meta, iob); + ret = mac802154_req_data(dev->md_mac, &tx->meta, iob, true); if (ret < 0) { iob_free(iob, IOBUSER_WIRELESS_MAC802154_CHARDEV); @@ -681,7 +669,6 @@ static int mac802154dev_ioctl(FAR struct file *filep, int cmd, ret = nxsem_wait(&dev->geteventsem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); dev->geteventpending = false; return ret; } diff --git a/wireless/ieee802154/mac802154_internal.h b/wireless/ieee802154/mac802154_internal.h index 11929a2751..bfd57116c8 100644 --- a/wireless/ieee802154/mac802154_internal.h +++ b/wireless/ieee802154/mac802154_internal.h @@ -540,27 +540,14 @@ void mac802154_notify(FAR struct ieee802154_privmac_s *priv, static inline int mac802154_takesem(sem_t *sem, bool allowinterrupt) { - int ret; - do + if (allowinterrupt) { - /* Take a count from the semaphore, possibly waiting */ - - ret = nxsem_wait(sem); - if (ret < 0) - { - /* EINTR and ECANCELED are the only errors that we expect */ - - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); - - if (allowinterrupt) - { - return ret; - } - } + return nxsem_wait(sem); + } + else + { + return nxsem_wait_uninterruptible(sem); } - while (ret == -EINTR); - - return ret; } #ifdef CONFIG_MAC802154_LOCK_VERBOSE diff --git a/wireless/ieee802154/mac802154_loopback.c b/wireless/ieee802154/mac802154_loopback.c index b50db1bf7a..74dcda5975 100644 --- a/wireless/ieee802154/mac802154_loopback.c +++ b/wireless/ieee802154/mac802154_loopback.c @@ -439,7 +439,7 @@ static void lo_loopback_work(FAR void *arg) /* Perform the loopback */ net_lock(); - (void)lo_loopback(&priv->lo_radio.r_dev); + lo_loopback(&priv->lo_radio.r_dev); net_unlock(); } @@ -476,11 +476,11 @@ static void lo_poll_work(FAR void *arg) /* Then perform the poll */ - (void)devif_timer(&priv->lo_radio.r_dev, LO_WDDELAY, lo_loopback); + devif_timer(&priv->lo_radio.r_dev, LO_WDDELAY, lo_loopback); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->lo_polldog, LO_WDDELAY, lo_poll_expiry, 1, priv); + wd_start(priv->lo_polldog, LO_WDDELAY, lo_poll_expiry, 1, priv); net_unlock(); } @@ -582,8 +582,8 @@ static int lo_ifup(FAR struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->lo_polldog, LO_WDDELAY, lo_poll_expiry, - 1, (wdparm_t)priv); + wd_start(priv->lo_polldog, LO_WDDELAY, lo_poll_expiry, + 1, (wdparm_t)priv); priv->lo_bifup = true; return OK; @@ -657,7 +657,7 @@ static void lo_txavail_work(FAR void *arg) priv->lo_radio.r_dev.d_buf = g_iobuffer.rb_buf; #endif - (void)devif_poll(&priv->lo_radio.r_dev, lo_loopback); + devif_poll(&priv->lo_radio.r_dev, lo_loopback); } net_unlock(); @@ -1118,7 +1118,7 @@ int ieee8021514_loopback(void) * performed. */ - (void)netdev_register(&priv->lo_radio.r_dev, NET_LL_IEEE802154); + netdev_register(&priv->lo_radio.r_dev, NET_LL_IEEE802154); /* Put the network in the UP state */ diff --git a/wireless/ieee802154/mac802154_netdev.c b/wireless/ieee802154/mac802154_netdev.c index 97b12b2d46..aaa02ab1f3 100644 --- a/wireless/ieee802154/mac802154_netdev.c +++ b/wireless/ieee802154/mac802154_netdev.c @@ -580,12 +580,12 @@ static void macnet_txpoll_work(FAR void *arg) /* Then perform the poll */ - (void)devif_timer(&priv->md_dev.r_dev, TXPOLL_WDDELAY, macnet_txpoll_callback); + devif_timer(&priv->md_dev.r_dev, TXPOLL_WDDELAY, macnet_txpoll_callback); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->md_txpoll, TXPOLL_WDDELAY, macnet_txpoll_expiry, 1, - (wdparm_t)priv); + wd_start(priv->md_txpoll, TXPOLL_WDDELAY, macnet_txpoll_expiry, 1, + (wdparm_t)priv); net_unlock(); } @@ -765,8 +765,8 @@ static int macnet_ifup(FAR struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->md_txpoll, TXPOLL_WDDELAY, macnet_txpoll_expiry, - 1, (wdparm_t)priv); + wd_start(priv->md_txpoll, TXPOLL_WDDELAY, macnet_txpoll_expiry, + 1, (wdparm_t)priv); ret = OK; } @@ -861,7 +861,7 @@ static void macnet_txavail_work(FAR void *arg) /* Then poll the network for new XMIT data */ - (void)devif_poll(&priv->md_dev.r_dev, macnet_txpoll_callback); + devif_poll(&priv->md_dev.r_dev, macnet_txpoll_callback); } net_unlock(); @@ -1077,7 +1077,6 @@ static int macnet_ioctl(FAR struct net_driver_s *dev, int cmd, ret = nxsem_wait(&priv->md_eventsem); if (ret < 0) { - DEBUGASSERT(ret == -EINTR || ret == -ECANCELED); priv->md_eventpending = false; return ret; } @@ -1200,17 +1199,9 @@ static int macnet_req_data(FAR struct radio_driver_s *netdev, framelist = iob->io_flink; iob->io_flink = NULL; - /* Transfer the frame to the MAC. mac802154_req_data will return - * -EINTR if a signal is received during certain phases of processing. - * In this context we just need to ignore -EINTR errors and try again. - */ - - do - { - ret = mac802154_req_data(priv->md_mac, pktmeta, iob); - } - while (ret == -EINTR); + /* Transfer the frame to the MAC. */ + ret = mac802154_req_data(priv->md_mac, pktmeta, iob, false); if (ret < 0) { wlerr("ERROR: mac802154_req_data failed: %d\n", ret); @@ -1295,10 +1286,10 @@ static int macnet_properties(FAR struct radio_driver_s *netdev, */ #ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR - (void)macnet_coord_eaddr(netdev, properties->sp_hubnode.nv_addr); + macnet_coord_eaddr(netdev, properties->sp_hubnode.nv_addr); properties->sp_hubnode.nv_addrlen = IEEE802154_EADDRSIZE; #else - (void)macnet_coord_saddr(netdev, properties->sp_hubnode.nv_addr); + macnet_coord_saddr(netdev, properties->sp_hubnode.nv_addr); properties->sp_hubnode.nv_addrlen = IEEE802154_SADDRSIZE; #endif #endif @@ -1431,7 +1422,7 @@ int mac802154netdev_register(MACHANDLE mac) /* Register the device with the OS so that socket IOCTLs can be performed */ - (void)netdev_register(&priv->md_dev.r_dev, NET_LL_IEEE802154); + netdev_register(&priv->md_dev.r_dev, NET_LL_IEEE802154); /* Put the network in the DOWN state, let the user decide when to bring it up */ diff --git a/wireless/ieee802154/mac802154_scan.c b/wireless/ieee802154/mac802154_scan.c index 0b7f5766ff..a860012650 100644 --- a/wireless/ieee802154/mac802154_scan.c +++ b/wireless/ieee802154/mac802154_scan.c @@ -102,7 +102,6 @@ int mac802154_req_scan(MACHANDLE mac, FAR struct ieee802154_scan_req_s *req) ret = mac802154_takesem(&priv->opsem, true); if (ret < 0) { - ret = -EINTR; goto errout; } @@ -114,7 +113,6 @@ int mac802154_req_scan(MACHANDLE mac, FAR struct ieee802154_scan_req_s *req) if (ret < 0) { mac802154_givesem(&priv->opsem); - ret = -EINTR; goto errout; } diff --git a/wireless/pktradio/pktradio_loopback.c b/wireless/pktradio/pktradio_loopback.c index 96e043d83d..be9aa6b06b 100644 --- a/wireless/pktradio/pktradio_loopback.c +++ b/wireless/pktradio/pktradio_loopback.c @@ -397,7 +397,7 @@ static void lo_loopback_work(FAR void *arg) /* Perform the loopback */ net_lock(); - (void)lo_loopback(&priv->lo_radio.r_dev); + lo_loopback(&priv->lo_radio.r_dev); net_unlock(); } @@ -434,11 +434,11 @@ static void lo_poll_work(FAR void *arg) /* And perform the poll */ - (void)devif_timer(&priv->lo_radio.r_dev, LO_WDDELAY, lo_loopback); + devif_timer(&priv->lo_radio.r_dev, LO_WDDELAY, lo_loopback); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->lo_polldog, LO_WDDELAY, lo_poll_expiry, 1, priv); + wd_start(priv->lo_polldog, LO_WDDELAY, lo_poll_expiry, 1, priv); net_unlock(); } @@ -522,8 +522,8 @@ static int lo_ifup(FAR struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->lo_polldog, LO_WDDELAY, lo_poll_expiry, - 1, (wdparm_t)priv); + wd_start(priv->lo_polldog, LO_WDDELAY, lo_poll_expiry, + 1, (wdparm_t)priv); priv->lo_bifup = true; return OK; @@ -599,7 +599,7 @@ static void lo_txavail_work(FAR void *arg) /* Then perform the poll */ - (void)devif_poll(&priv->lo_radio.r_dev, lo_loopback); + devif_poll(&priv->lo_radio.r_dev, lo_loopback); } net_unlock(); @@ -1061,7 +1061,7 @@ int pktradio_loopback(void) * performed. */ - (void)netdev_register(&priv->lo_radio.r_dev, NET_LL_PKTRADIO); + netdev_register(&priv->lo_radio.r_dev, NET_LL_PKTRADIO); /* Put the network in the UP state */ diff --git a/wireless/pktradio/pktradio_metadata.c b/wireless/pktradio/pktradio_metadata.c index 4dce2ec756..38cb53efe7 100644 --- a/wireless/pktradio/pktradio_metadata.c +++ b/wireless/pktradio/pktradio_metadata.c @@ -150,23 +150,10 @@ FAR struct pktradio_metadata_s *pktradio_metadata_allocate(void) { FAR struct pktradio_metadata_s *metadata; uint8_t pool; - int ret; /* Get exclusive access to the free list */ - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_metadata_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_metadata_sem); /* Try the free list first */ @@ -226,23 +213,9 @@ FAR struct pktradio_metadata_s *pktradio_metadata_allocate(void) void pktradio_metadata_free(FAR struct pktradio_metadata_s *metadata) { - int ret; - /* Get exclusive access to the free list */ - do - { - /* Take the semaphore (perhaps waiting) */ - - ret = nxsem_wait(&g_metadata_sem); - - /* The only case that an error should occur here is if the wait was - * awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } - while (ret == -EINTR); + nxsem_wait_uninterruptible(&g_metadata_sem); /* If this is a pre-allocated meta-data structure, then just put it back * in the free list.