From 2991836ee840191b55ece8683d86d0a6347ad450 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 25 Mar 2020 11:04:24 +0900 Subject: [PATCH] sim: Appease nxstyle errors --- arch/sim/src/sim/up_blocktask.c | 6 +++--- arch/sim/src/sim/up_createstack.c | 4 ++-- arch/sim/src/sim/up_devconsole.c | 18 ++++++++++-------- arch/sim/src/sim/up_hostfs.c | 4 ++-- arch/sim/src/sim/up_interruptcontext.c | 1 + arch/sim/src/sim/up_netdriver.c | 11 ++++++----- arch/sim/src/sim/up_releasepending.c | 5 +++-- arch/sim/src/sim/up_reprioritizertr.c | 7 ++++--- arch/sim/src/sim/up_romgetc.c | 4 ++-- arch/sim/src/sim/up_simuart.c | 3 ++- arch/sim/src/sim/up_stackframe.c | 4 ++-- arch/sim/src/sim/up_unblocktask.c | 10 ++++++---- arch/sim/src/sim/up_usestack.c | 4 ++-- 13 files changed, 45 insertions(+), 36 deletions(-) diff --git a/arch/sim/src/sim/up_blocktask.c b/arch/sim/src/sim/up_blocktask.c index bb447b4669..c527dda0cb 100644 --- a/arch/sim/src/sim/up_blocktask.c +++ b/arch/sim/src/sim/up_blocktask.c @@ -82,7 +82,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) DEBUGASSERT((tcb->task_state >= FIRST_READY_TO_RUN_STATE) && (tcb->task_state <= LAST_READY_TO_RUN_STATE)); - //sinfo("Blocking TCB=%p\n", tcb); + /* sinfo("Blocking TCB=%p\n", tcb); */ /* Remove the tcb task from the ready-to-run list. If we are blocking the * task at the head of the task list (the most likely case), then a @@ -128,8 +128,8 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) sinfo("New Active Task TCB=%p\n", rtcb); /* The way that we handle signals in the simulation is kind of - * a kludge. This would be unsafe in a truly multi-threaded, interrupt - * driven environment. + * a kludge. This would be unsafe in a truly multi-threaded, + * interrupt driven environment. */ if (rtcb->xcp.sigdeliver) diff --git a/arch/sim/src/sim/up_createstack.c b/arch/sim/src/sim/up_createstack.c index 3d490aea5a..1c047017d2 100644 --- a/arch/sim/src/sim/up_createstack.c +++ b/arch/sim/src/sim/up_createstack.c @@ -53,8 +53,8 @@ * Pre-processor Macros ****************************************************************************/ -/* Use a stack alignment of 16 bytes. If necessary frame_size must be rounded - * up to the next boundary +/* Use a stack alignment of 16 bytes. If necessary frame_size must be + * rounded up to the next boundary */ #define STACK_ALIGNMENT 16 diff --git a/arch/sim/src/sim/up_devconsole.c b/arch/sim/src/sim/up_devconsole.c index 6b11413981..74fff98610 100644 --- a/arch/sim/src/sim/up_devconsole.c +++ b/arch/sim/src/sim/up_devconsole.c @@ -56,7 +56,8 @@ static int devconsole_setup(FAR struct uart_dev_s *dev); static void devconsole_shutdown(FAR struct uart_dev_s *dev); static int devconsole_attach(FAR struct uart_dev_s *dev); static void devconsole_detach(FAR struct uart_dev_s *dev); -static int devconsole_ioctl(FAR struct file *filep, int cmd, unsigned long arg); +static int devconsole_ioctl(FAR struct file *filep, int cmd, + unsigned long arg); static int devconsole_receive(FAR struct uart_dev_s *dev, uint32_t *status); static void devconsole_rxint(FAR struct uart_dev_s *dev, bool enable); static bool devconsole_rxavailable(FAR struct uart_dev_s *dev); @@ -140,14 +141,15 @@ static void devconsole_shutdown(struct uart_dev_s *dev) * Name: devconsole_attach * * Description: - * Configure the UART to operation in interrupt driven mode. This method is - * called when the serial port is opened. Normally, this is just after the + * Configure the UART to operation in interrupt driven mode. This method + * is called when the serial port is opened. Normally, this is just after * the setup() method is called, however, the serial console may operate in * a non-interrupt driven mode during the boot phase. * - * RX and TX interrupts are not enabled when by the attach method (unless the - * hardware supports multiple levels of interrupt enabling). The RX and TX - * interrupts are not enabled until the txint() and rxint() methods are called. + * RX and TX interrupts are not enabled when by the attach method (unless + * the hardware supports multiple levels of interrupt enabling). The RX + * and TX interrupts are not enabled until the txint() and rxint() methods + * are called. * ****************************************************************************/ @@ -161,8 +163,8 @@ static int devconsole_attach(struct uart_dev_s *dev) * * Description: * Detach UART interrupts. This method is called when the serial port is - * closed normally just before the shutdown method is called. The exception is - * the serial console which is never shutdown. + * closed normally just before the shutdown method is called. The + * exception is the serial console which is never shutdown. * ****************************************************************************/ diff --git a/arch/sim/src/sim/up_hostfs.c b/arch/sim/src/sim/up_hostfs.c index 6958eb9bac..32b8726dfc 100644 --- a/arch/sim/src/sim/up_hostfs.c +++ b/arch/sim/src/sim/up_hostfs.c @@ -193,7 +193,7 @@ int host_close(int fd) * Name: host_read ****************************************************************************/ -ssize_t host_read(int fd, void* buf, size_t count) +ssize_t host_read(int fd, void *buf, size_t count) { /* Just call the read routine */ @@ -296,7 +296,7 @@ void *host_opendir(const char *name) * Name: host_readdir ****************************************************************************/ -int host_readdir(void* dirp, struct nuttx_dirent_s* entry) +int host_readdir(void *dirp, struct nuttx_dirent_s *entry) { struct dirent *ent; diff --git a/arch/sim/src/sim/up_interruptcontext.c b/arch/sim/src/sim/up_interruptcontext.c index 45a9275dd7..91661acb72 100644 --- a/arch/sim/src/sim/up_interruptcontext.c +++ b/arch/sim/src/sim/up_interruptcontext.c @@ -59,5 +59,6 @@ bool up_interrupt_context(void) { /* The simulation is never in the interrupt state */ + return false; } diff --git a/arch/sim/src/sim/up_netdriver.c b/arch/sim/src/sim/up_netdriver.c index 5ada2771be..e5df8f6de2 100644 --- a/arch/sim/src/sim/up_netdriver.c +++ b/arch/sim/src/sim/up_netdriver.c @@ -1,7 +1,8 @@ /**************************************************************************** * arch/sim/src/sim/up_netdriver.c * - * Copyright (C) 2007, 2009-2012, 2015-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009-2012, 2015-2016 Gregory Nutt. + * All rights reserved. * Author: Gregory Nutt * * Based on code from uIP which also has a BSD-like license: @@ -82,8 +83,8 @@ static struct net_driver_s g_sim_dev; static void netdriver_reply(FAR struct net_driver_s *dev) { - /* If the receiving resulted in data that should be sent out on the network, - * the field d_len is set to a value > 0. + /* If the receiving resulted in data that should be sent out on + * the network, the field d_len is set to a value > 0. */ if (dev->d_len > 0) @@ -259,8 +260,8 @@ static int netdriver_txpoll(FAR struct net_driver_s *dev) } } - /* If zero is returned, the polling will continue until all connections have - * been examined. + /* If zero is returned, the polling will continue until all connections + * have been examined. */ return 0; diff --git a/arch/sim/src/sim/up_releasepending.c b/arch/sim/src/sim/up_releasepending.c index 33555a1886..72f7bc1f48 100644 --- a/arch/sim/src/sim/up_releasepending.c +++ b/arch/sim/src/sim/up_releasepending.c @@ -71,6 +71,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ /* sched_lock(); */ + if (sched_mergepending()) { /* The currently active task has changed! We will need to switch @@ -96,8 +97,8 @@ void up_release_pending(void) sinfo("New Active Task TCB=%p\n", rtcb); /* The way that we handle signals in the simulation is kind of - * a kludge. This would be unsafe in a truly multi-threaded, interrupt - * driven environment. + * a kludge. This would be unsafe in a truly multi-threaded, + * interrupt driven environment. */ if (rtcb->xcp.sigdeliver) diff --git a/arch/sim/src/sim/up_reprioritizertr.c b/arch/sim/src/sim/up_reprioritizertr.c index 251b94155a..4dddc35d69 100644 --- a/arch/sim/src/sim/up_reprioritizertr.c +++ b/arch/sim/src/sim/up_reprioritizertr.c @@ -138,7 +138,8 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) /* Copy the exception context into the TCB at the (old) head of the * ready-to-run Task list. if up_setjmp returns a non-zero - * value, then this is really the previously running task restarting! + * value, then this is really the previously running task + * restarting! */ if (!up_setjmp(rtcb->xcp.regs)) @@ -151,8 +152,8 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("New Active Task TCB=%p\n", rtcb); /* The way that we handle signals in the simulation is kind of - * a kludge. This would be unsafe in a truly multi-threaded, interrupt - * driven environment. + * a kludge. This would be unsafe in a truly multi-threaded, + * interrupt driven environment. */ if (rtcb->xcp.sigdeliver) diff --git a/arch/sim/src/sim/up_romgetc.c b/arch/sim/src/sim/up_romgetc.c index 6b6b016f7b..92cd96e6f3 100644 --- a/arch/sim/src/sim/up_romgetc.c +++ b/arch/sim/src/sim/up_romgetc.c @@ -73,8 +73,8 @@ * lie in FLASH (string arguments for %s are still assumed to reside in * SRAM). And (2), the string argument to puts and fputs is assumed to * reside in FLASH. Clearly, these assumptions may have to modified for - * the particular needs of your environment. There is no "one-size-fits-all" - * solution for this problem. + * the particular needs of your environment. There is no + * "one-size-fits-all" solution for this problem. * ****************************************************************************/ diff --git a/arch/sim/src/sim/up_simuart.c b/arch/sim/src/sim/up_simuart.c index d1c97a2e80..cdb7551618 100644 --- a/arch/sim/src/sim/up_simuart.c +++ b/arch/sim/src/sim/up_simuart.c @@ -70,7 +70,8 @@ static void setrawmode(void) memcpy(&raw, &g_cooked, sizeof(struct termios)); - raw.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); + raw.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | + ICRNL | IXON); raw.c_oflag &= ~OPOST; raw.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); raw.c_cflag &= ~(CSIZE | PARENB); diff --git a/arch/sim/src/sim/up_stackframe.c b/arch/sim/src/sim/up_stackframe.c index 3f3d84f7f6..7458ed21ec 100644 --- a/arch/sim/src/sim/up_stackframe.c +++ b/arch/sim/src/sim/up_stackframe.c @@ -53,8 +53,8 @@ * Pre-processor Macros ****************************************************************************/ -/* Use a stack alignment of 16 bytes. If necessary frame_size must be rounded - * up to the next boundary +/* Use a stack alignment of 16 bytes. If necessary frame_size must be + * rounded up to the next boundary */ #define STACK_ALIGNMENT 16 diff --git a/arch/sim/src/sim/up_unblocktask.c b/arch/sim/src/sim/up_unblocktask.c index 1553fcfc82..bf9ca4f136 100644 --- a/arch/sim/src/sim/up_unblocktask.c +++ b/arch/sim/src/sim/up_unblocktask.c @@ -1,7 +1,8 @@ /**************************************************************************** * arch/sim/src/sim/up_unblocktask.c * - * Copyright (C) 2007-2009, 2013, 2015-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2013, 2015-2016 Gregory Nutt. + * All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -90,6 +91,7 @@ void up_unblock_task(FAR struct tcb_s *tcb) if (sched_addreadytorun(tcb)) { /* The currently active task has changed! */ + /* Update scheduler parameters */ sched_suspend_scheduler(rtcb); @@ -110,8 +112,8 @@ void up_unblock_task(FAR struct tcb_s *tcb) sinfo("New Active Task TCB=%p\n", rtcb); /* The way that we handle signals in the simulation is kind of - * a kludge. This would be unsafe in a truly multi-threaded, interrupt - * driven environment. + * a kludge. This would be unsafe in a truly multi-threaded, + * interrupt driven environment. */ if (rtcb->xcp.sigdeliver) @@ -128,6 +130,6 @@ void up_unblock_task(FAR struct tcb_s *tcb) /* Then switch contexts */ up_longjmp(rtcb->xcp.regs, 1); - } + } } } diff --git a/arch/sim/src/sim/up_usestack.c b/arch/sim/src/sim/up_usestack.c index 5016b692c0..8703f2333a 100644 --- a/arch/sim/src/sim/up_usestack.c +++ b/arch/sim/src/sim/up_usestack.c @@ -52,8 +52,8 @@ * Pre-processor Macros ****************************************************************************/ -/* Use a stack alignment of 16 bytes. If necessary frame_size must be rounded - * up to the next boundary +/* Use a stack alignment of 16 bytes. If necessary frame_size must be + * rounded up to the next boundary */ #define STACK_ALIGNMENT 16