You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/03/25 05:09:32 UTC
[incubator-nuttx] branch master updated: sim: Appease nxstyle errors
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 2991836 sim: Appease nxstyle errors
2991836 is described below
commit 2991836ee840191b55ece8683d86d0a6347ad450
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Wed Mar 25 11:04:24 2020 +0900
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 bb447b4..c527dda 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 3d490ae..1c04701 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 6b11413..74fff98 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 6958eb9..32b8726 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 45a9275..91661ac 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 5ada277..e5df8f6 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 <gn...@nuttx.org>
*
* 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 33555a1..72f7bc1 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 251b941..4dddc35 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 6b6b016..92cd96e 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 d1c97a2..cdb7551 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 3f3d84f..7458ed2 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 1553fcf..bf9ca4f 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 <gn...@nuttx.org>
*
* 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 5016b69..8703f23 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