- After the the volume has been mounted in the NuttX
+ After the volume has been mounted in the NuttX
pseudo filesystem,
it may be access in the same way as other objects in thefile system.
@@ -2108,7 +2108,7 @@ nsh>
diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html
index fdde2880ec..27873d291c 100644
--- a/Documentation/NuttX.html
+++ b/Documentation/NuttX.html
@@ -1214,7 +1214,7 @@ m68k, m68hc11, m68hc12, and SuperH ports.
This is a tougher environment.
- In this case, the Windows native toolchain is unaware of the the
+ In this case, the Windows native toolchain is unaware of the
Cygwin sandbox and, instead, operates in the native Windows environment.
The primary difficulties with this are:
diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html
index 6a8ee1847c..3fc63d6ad6 100644
--- a/Documentation/NuttxUserGuide.html
+++ b/Documentation/NuttxUserGuide.html
@@ -170,7 +170,7 @@ paragraphs.
If CONFIG_DEV_CONSOLE is defined, the first three file descriptors (corresponding
- to stdin, stdout, stderr) will be duplicated for the the new task.
+ to stdin, stdout, stderr) will be duplicated for the new task.
Since these file descriptors are duplicated, the child task can free close
them or manipulate them in any way without effecting the parent task.
File-related operations (open, close, etc.) within a task will have no effect
@@ -2430,7 +2430,7 @@ VxWorks provides the following comparable interface:
Description:
- This function returns the time remaining before the the specified watchdog expires.
+ This function returns the time remaining before the specified watchdog expires.
Input Parameters:
@@ -4490,7 +4490,7 @@ per-thread basis and persist for the life of the calling
thread.
Upon key creation, the value NULL will be associated with
-the the new key in all active threads. Upon thread
+the new key in all active threads. Upon thread
creation, the value NULL will be associated with all
defined keys in the new thread.
diff --git a/ReleaseNotes b/ReleaseNotes
index 9a5892024c..f421c5365e 100644
--- a/ReleaseNotes
+++ b/ReleaseNotes
@@ -801,7 +801,7 @@ support for two new architectures:
been integrated due to toolchain issues.
* Renesas M16C/20. Support for the Renesas SKP16C20 board has been included in
- the NuttX source tree. However, as the the eZ80Acclaim!, testing and integration
+ the NuttX source tree. However, as the eZ80Acclaim!, testing and integration
of that port is stalled due to toolchain issues.
These changes were verified only on the ZiLOG eZ80910200zcog-d board. Please report any errors
diff --git a/arch/arm/include/cortexm3/irq.h b/arch/arm/include/cortexm3/irq.h
index b439ec42fa..91be3e8b3c 100644
--- a/arch/arm/include/cortexm3/irq.h
+++ b/arch/arm/include/cortexm3/irq.h
@@ -160,7 +160,7 @@ static inline irqstate_t irqsave(void)
{
unsigned short primask;
- /* Return the the current value of primask register and set
+ /* Return the current value of primask register and set
* bit 0 of the primask register to disable interrupts
*/
diff --git a/arch/arm/src/arm/up_sigdeliver.c b/arch/arm/src/arm/up_sigdeliver.c
index 8d1601aeae..469f274e6c 100644
--- a/arch/arm/src/arm/up_sigdeliver.c
+++ b/arch/arm/src/arm/up_sigdeliver.c
@@ -86,7 +86,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the
- * signal handling so that the the user code final gets
+ * signal handling so that the user code final gets
* the correct errno value (probably EINTR).
*/
diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c
index 76a565fcd8..322882fd40 100644
--- a/arch/arm/src/c5471/c5471_ethernet.c
+++ b/arch/arm/src/c5471/c5471_ethernet.c
@@ -415,53 +415,16 @@ static void c5471_macassign(struct c5471_driver_s *c5471);
****************************************************************************/
#ifdef CONFIG_C5471_NET_DUMPBUFFER
-static void c5471_dumpbuffer(const char *buffer, ssize_t nbytes)
+static inline void c5471_dumpbuffer(const char *msg, const ubyte *buffer, unsigned int nbytes)
{
-#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_NET)
- char line[128];
- int ch;
- int i;
- int j;
-
- for (i = 0; i < nbytes; i += 16)
- {
- sprintf(line, "%04x: ", i);
- for (j = 0; j < 16; j++)
- {
- if (i + j < nbytes)
- {
- sprintf(&line[strlen(line)], "%02x", buffer[i+j] );
- }
- else
- {
- strcpy(&line[strlen(line)], " ");
- }
-
- if (j == 7 || j == 15)
- {
- strcpy(&line[strlen(line)], " ");
- }
- }
-
- for ( j = 0; j < 16; j++)
- {
- if (i + j < nbytes)
- {
- ch = buffer[i+j];
- sprintf(&line[strlen(line)], "%c", ch >= 0x20 && ch <= 0x7e ? ch : '.');
- }
-
- if (j == 7 || j == 15)
- {
- strcpy(&line[strlen(line)], " ");
- }
- }
- ndbg("%s\n", line);
- }
-#endif
+ /* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_NET have to be
+ * defined or the following does nothing.
+ */
+
+ nvdbgdumpbuffer(msg, buffer, nbytes);
}
#else
-# define c5471_dumpbuffer(buffer,nbytes)
+# define c5471_dumpbuffer(msg, buffer,nbytes)
#endif
/****************************************************************************
@@ -494,7 +457,7 @@ static void c5471_mdtxbit (int bit_state)
putreg32((getreg32(GPIO_CIO) & ~GPIO_CIO_MDIO), GPIO_CIO);
- /* Select the the bit output state */
+ /* Select the bit output state */
if (bit_state)
{
@@ -907,7 +870,7 @@ static int c5471_transmit(struct c5471_driver_s *c5471)
c5471->c_lastdescstart = c5471->c_rxcpudesc;
nvdbg("Packet size: %d RX CPU desc: %08x\n", nbytes, c5471->c_rxcpudesc);
- c5471_dumpbuffer(dev->d_buf, dev->d_len);
+ c5471_dumpbuffer("Transmit packet", dev->d_buf, dev->d_len);
while (nbytes)
{
@@ -1276,7 +1239,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
dev->d_len = packetlen;
nvdbg("Received packet, packetlen: %d type: %02x\n", packetlen, ntohs(BUF->type));
- c5471_dumpbuffer(dev->d_buf, dev->d_len);
+ c5471_dumpbuffer("Received packet", dev->d_buf, dev->d_len);
/* We only accept IP packets of the configured type and ARP packets */
@@ -2006,7 +1969,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471)
putreg32(ENET_ADR_BROADCAST|ENET_ADR_PROMISCUOUS, ENET0_ADRMODE_EN);
#else
/* The CPU port is not PROMISCUOUS, it wants a no-promiscuous address
- * match yet the the SWITCH receives packets from the PROMISCUOUS ENET0
+ * match yet the SWITCH receives packets from the PROMISCUOUS ENET0
* which routes all packets for filter matching at the CPU port which
* then allows the s/w to see the new incoming packetes that passed
* the filter. Here we are setting the main SWITCH closest the ether
diff --git a/arch/arm/src/c5471/c5471_watchdog.c b/arch/arm/src/c5471/c5471_watchdog.c
index 8983b75496..96ddb65297 100644
--- a/arch/arm/src/c5471/c5471_watchdog.c
+++ b/arch/arm/src/c5471/c5471_watchdog.c
@@ -287,7 +287,7 @@ static int wdt_ioctl(struct file *filep, int cmd, uint32 arg)
{
dbg("ioctl Call: cmd=0x%x arg=0x%x", cmd, arg);
- /* Process the the IOCTL command (see arch/watchdog.h) */
+ /* Process the IOCTL command (see arch/watchdog.h) */
switch(cmd)
{
diff --git a/arch/arm/src/common/up_blocktask.c b/arch/arm/src/common/up_blocktask.c
index 2590597f8b..f4e31526be 100644
--- a/arch/arm/src/common/up_blocktask.c
+++ b/arch/arm/src/common/up_blocktask.c
@@ -74,7 +74,7 @@
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
- * the task at the the head of the list). It most be
+ * the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new
diff --git a/arch/arm/src/common/up_exit.c b/arch/arm/src/common/up_exit.c
index 0d62a3d284..8416a99a35 100644
--- a/arch/arm/src/common/up_exit.c
+++ b/arch/arm/src/common/up_exit.c
@@ -136,7 +136,7 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
- * a context switch must be perform to the the next ready to run task.
+ * a context switch must be perform to the next ready to run task.
*
****************************************************************************/
diff --git a/arch/arm/src/common/up_internal.h b/arch/arm/src/common/up_internal.h
index 2fd44bb93e..5442f59149 100644
--- a/arch/arm/src/common/up_internal.h
+++ b/arch/arm/src/common/up_internal.h
@@ -74,7 +74,7 @@
/* Macros to handle saving and restore interrupt state. In the current ARM
* model, the state is always copied to and from the stack and TCB. In the
* Cortex-M3 model, the state is copied from the stack to the TCB, but only
- * a referenced is passed to get the the state from the TCB.
+ * a referenced is passed to get the state from the TCB.
*/
#ifdef CONFIG_ARCH_CORTEXM3
diff --git a/arch/arm/src/cortexm3/up_sigdeliver.c b/arch/arm/src/cortexm3/up_sigdeliver.c
index d0241dfa18..98dd94e99e 100644
--- a/arch/arm/src/cortexm3/up_sigdeliver.c
+++ b/arch/arm/src/cortexm3/up_sigdeliver.c
@@ -86,7 +86,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the
- * signal handling so that the the user code final gets
+ * signal handling so that the user code final gets
* the correct errno value (probably EINTR).
*/
diff --git a/arch/arm/src/dm320/dm320_restart.S b/arch/arm/src/dm320/dm320_restart.S
index 5990605c70..ccbdfc2d9d 100644
--- a/arch/arm/src/dm320/dm320_restart.S
+++ b/arch/arm/src/dm320/dm320_restart.S
@@ -110,7 +110,7 @@ up_phyrestart:
bic r0, r0, #(CR_S|CR_I|CR_V|CR_RR)
mcr p15, 0, r0, c1, c0, 0 /* Write control reg */
- /* We know that the the bootloader entry point is at the
+ /* We know that the bootloader entry point is at the
* beginning of flash.
*/
#if 1
diff --git a/arch/arm/src/dm320/dm320_serial.c b/arch/arm/src/dm320/dm320_serial.c
index 93da27525f..35d0db17d9 100644
--- a/arch/arm/src/dm320/dm320_serial.c
+++ b/arch/arm/src/dm320/dm320_serial.c
@@ -587,7 +587,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
* Description:
* Called (usually) from the interrupt level to receive one
* character from the UART. Error bits associated with the
- * receipt are provided in the the return 'status'.
+ * receipt are provided in the return 'status'.
*
****************************************************************************/
diff --git a/arch/arm/src/imx/imx_serial.c b/arch/arm/src/imx/imx_serial.c
index 4682a2938b..70dcb5f1ca 100644
--- a/arch/arm/src/imx/imx_serial.c
+++ b/arch/arm/src/imx/imx_serial.c
@@ -911,7 +911,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
* Description:
* Called (usually) from the interrupt level to receive one
* character from the UART. Error bits associated with the
- * receipt are provided in the the return 'status'.
+ * receipt are provided in the return 'status'.
*
****************************************************************************/
diff --git a/arch/arm/src/lm3s/lm3s_serial.c b/arch/arm/src/lm3s/lm3s_serial.c
index 04a9bdbf04..3c4247da5b 100644
--- a/arch/arm/src/lm3s/lm3s_serial.c
+++ b/arch/arm/src/lm3s/lm3s_serial.c
@@ -674,7 +674,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
* Description:
* Called (usually) from the interrupt level to receive one
* character from the UART. Error bits associated with the
- * receipt are provided in the the return 'status'.
+ * receipt are provided in the return 'status'.
*
****************************************************************************/
diff --git a/arch/arm/src/lpc214x/lpc214x_serial.c b/arch/arm/src/lpc214x/lpc214x_serial.c
index 360a252f58..74f8538300 100644
--- a/arch/arm/src/lpc214x/lpc214x_serial.c
+++ b/arch/arm/src/lpc214x/lpc214x_serial.c
@@ -612,7 +612,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
* Description:
* Called (usually) from the interrupt level to receive one
* character from the UART. Error bits associated with the
- * receipt are provided in the the return 'status'.
+ * receipt are provided in the return 'status'.
*
****************************************************************************/
diff --git a/arch/arm/src/str71x/str71x_serial.c b/arch/arm/src/str71x/str71x_serial.c
index 1c949a9d03..481603875f 100644
--- a/arch/arm/src/str71x/str71x_serial.c
+++ b/arch/arm/src/str71x/str71x_serial.c
@@ -783,7 +783,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
* Description:
* Called (usually) from the interrupt level to receive one
* character from the UART. Error bits associated with the
- * receipt are provided in the the return 'status'.
+ * receipt are provided in the return 'status'.
*
****************************************************************************/
diff --git a/arch/pjrc-8051/include/types.h b/arch/pjrc-8051/include/types.h
index 9656c02310..fad90f25d3 100644
--- a/arch/pjrc-8051/include/types.h
+++ b/arch/pjrc-8051/include/types.h
@@ -59,7 +59,7 @@
* For SDCC, sizeof(int) is 16 and sizeof(long) is 32.
* long long and double are not supported.
*
- * Generic pointers are 3 bytes in length with the the
+ * Generic pointers are 3 bytes in length with the
* first byte holding data space intformation.
*/
diff --git a/arch/pjrc-8051/src/up_blocktask.c b/arch/pjrc-8051/src/up_blocktask.c
index 9d9094a775..5760e9302b 100644
--- a/arch/pjrc-8051/src/up_blocktask.c
+++ b/arch/pjrc-8051/src/up_blocktask.c
@@ -71,7 +71,7 @@
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
- * the task at the the head of the list). It most be
+ * the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new
diff --git a/arch/pjrc-8051/src/up_exit.c b/arch/pjrc-8051/src/up_exit.c
index 227225596c..6b9529050c 100644
--- a/arch/pjrc-8051/src/up_exit.c
+++ b/arch/pjrc-8051/src/up_exit.c
@@ -69,7 +69,7 @@
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
- * a context switch must be perform to the the next ready to run task.
+ * a context switch must be perform to the next ready to run task.
*
****************************************************************************/
diff --git a/arch/sh/src/common/up_blocktask.c b/arch/sh/src/common/up_blocktask.c
index 154f3912fc..547fd368fb 100644
--- a/arch/sh/src/common/up_blocktask.c
+++ b/arch/sh/src/common/up_blocktask.c
@@ -71,7 +71,7 @@
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
- * the task at the the head of the list). It most be
+ * the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new
diff --git a/arch/sh/src/common/up_exit.c b/arch/sh/src/common/up_exit.c
index b362880ec4..ede0483705 100644
--- a/arch/sh/src/common/up_exit.c
+++ b/arch/sh/src/common/up_exit.c
@@ -134,7 +134,7 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
- * a context switch must be perform to the the next ready to run task.
+ * a context switch must be perform to the next ready to run task.
*
****************************************************************************/
diff --git a/arch/sh/src/m16c/m16c_serial.c b/arch/sh/src/m16c/m16c_serial.c
index 1db4b3ea1a..cefbbbf9bd 100644
--- a/arch/sh/src/m16c/m16c_serial.c
+++ b/arch/sh/src/m16c/m16c_serial.c
@@ -906,7 +906,7 @@ static boolean up_rxavailable(struct uart_dev_s *dev)
{
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
- /* Return true if the there is data available in the read buffer */
+ /* Return true if there is data available in the read buffer */
return ((up_serialin(priv, M16C_UART_C1) & UART_C1_RI) != 0);
}
diff --git a/arch/sh/src/m16c/m16c_sigdeliver.c b/arch/sh/src/m16c/m16c_sigdeliver.c
index 2d4cf2069d..5505e2e485 100644
--- a/arch/sh/src/m16c/m16c_sigdeliver.c
+++ b/arch/sh/src/m16c/m16c_sigdeliver.c
@@ -87,7 +87,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the
- * signal handling so that the the user code final gets
+ * signal handling so that the user code final gets
* the correct errno value (probably EINTR).
*/
diff --git a/arch/sh/src/sh1/sh1_serial.c b/arch/sh/src/sh1/sh1_serial.c
index 6991e0f329..0be2bc280f 100644
--- a/arch/sh/src/sh1/sh1_serial.c
+++ b/arch/sh/src/sh1/sh1_serial.c
@@ -644,7 +644,7 @@ static int up_interrupt(int irq, void *context)
* Description:
* Called (usually) from the interrupt level to receive one
* character from the SCI. Error bits associated with the
- * receipt are provided in the the return 'status'.
+ * receipt are provided in the return 'status'.
*
****************************************************************************/
diff --git a/arch/sh/src/sh1/sh1_sigdeliver.c b/arch/sh/src/sh1/sh1_sigdeliver.c
index 2b5442812e..91e9163fff 100644
--- a/arch/sh/src/sh1/sh1_sigdeliver.c
+++ b/arch/sh/src/sh1/sh1_sigdeliver.c
@@ -87,7 +87,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the
- * signal handling so that the the user code final gets
+ * signal handling so that the user code final gets
* the correct errno value (probably EINTR).
*/
diff --git a/arch/sim/src/up_blocktask.c b/arch/sim/src/up_blocktask.c
index 33056018f0..b297f1a8df 100644
--- a/arch/sim/src/up_blocktask.c
+++ b/arch/sim/src/up_blocktask.c
@@ -71,7 +71,7 @@
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
- * the task at the the head of the list). It most be
+ * the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new
diff --git a/arch/sim/src/up_exit.c b/arch/sim/src/up_exit.c
index 5c2cd3dc42..4a829e3cc3 100644
--- a/arch/sim/src/up_exit.c
+++ b/arch/sim/src/up_exit.c
@@ -68,7 +68,7 @@
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
- * a context switch must be perform to the the next ready to run task.
+ * a context switch must be perform to the next ready to run task.
*
****************************************************************************/
diff --git a/arch/z16/include/z16f/irq.h b/arch/z16/include/z16f/irq.h
index 3e4ae472cf..025a38b9bc 100644
--- a/arch/z16/include/z16f/irq.h
+++ b/arch/z16/include/z16f/irq.h
@@ -163,7 +163,7 @@
#ifndef __ASSEMBLY__
-/* This is the the type of the register save array */
+/* This is the type of the register save array */
typedef uint16 chipreg_t;
diff --git a/arch/z16/src/common/up_blocktask.c b/arch/z16/src/common/up_blocktask.c
index 218afe0804..806c91d41c 100644
--- a/arch/z16/src/common/up_blocktask.c
+++ b/arch/z16/src/common/up_blocktask.c
@@ -74,7 +74,7 @@
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
- * the task at the the head of the list). It most be
+ * the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new
diff --git a/arch/z16/src/common/up_exit.c b/arch/z16/src/common/up_exit.c
index 589f9ca6ad..e86137ab2e 100644
--- a/arch/z16/src/common/up_exit.c
+++ b/arch/z16/src/common/up_exit.c
@@ -138,7 +138,7 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
- * a context switch must be perform to the the next ready to run task.
+ * a context switch must be perform to the next ready to run task.
*
****************************************************************************/
diff --git a/arch/z16/src/common/up_sigdeliver.c b/arch/z16/src/common/up_sigdeliver.c
index e6aa6325da..a8eecdda22 100644
--- a/arch/z16/src/common/up_sigdeliver.c
+++ b/arch/z16/src/common/up_sigdeliver.c
@@ -87,7 +87,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the signal handling
- * so that the the user code final gets the correct errno value (probably
+ * so that the user code final gets the correct errno value (probably
* EINTR).
*/
diff --git a/arch/z16/src/z16f/z16f_sysexec.c b/arch/z16/src/z16f/z16f_sysexec.c
index e492bab6eb..d736c109bd 100644
--- a/arch/z16/src/z16f/z16f_sysexec.c
+++ b/arch/z16/src/z16f/z16f_sysexec.c
@@ -89,7 +89,7 @@ void z16f_sysexec(FAR chipreg_t *regs)
current_regs = regs;
- /* The cause of the the system exception is indicated in the SYSEXCPH&L
+ /* The cause of the system exception is indicated in the SYSEXCPH&L
* registers
*/
diff --git a/arch/z80/include/z8/irq.h b/arch/z80/include/z8/irq.h
index 79fe8e83b3..25c80e009e 100644
--- a/arch/z80/include/z8/irq.h
+++ b/arch/z80/include/z8/irq.h
@@ -304,7 +304,7 @@
#ifndef __ASSEMBLY__
-/* This is the the type of the register save array */
+/* This is the type of the register save array */
typedef uint16 chipreg_t;
diff --git a/arch/z80/include/z80/irq.h b/arch/z80/include/z80/irq.h
index 25d43e3637..042e44e17e 100644
--- a/arch/z80/include/z80/irq.h
+++ b/arch/z80/include/z80/irq.h
@@ -88,7 +88,7 @@
#ifndef __ASSEMBLY__
-/* This is the the type of the register save array */
+/* This is the type of the register save array */
typedef uint16 chipreg_t;
diff --git a/arch/z80/src/common/up_blocktask.c b/arch/z80/src/common/up_blocktask.c
index d0e7922031..3d3ce99ad3 100644
--- a/arch/z80/src/common/up_blocktask.c
+++ b/arch/z80/src/common/up_blocktask.c
@@ -75,7 +75,7 @@
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
- * the task at the the head of the list). It most be
+ * the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new
diff --git a/arch/z80/src/common/up_exit.c b/arch/z80/src/common/up_exit.c
index b56f286cd4..c9ae45bb99 100644
--- a/arch/z80/src/common/up_exit.c
+++ b/arch/z80/src/common/up_exit.c
@@ -138,7 +138,7 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
- * a context switch must be perform to the the next ready to run task.
+ * a context switch must be perform to the next ready to run task.
*
****************************************************************************/
diff --git a/arch/z80/src/ez80/ez80_emac.c b/arch/z80/src/ez80/ez80_emac.c
index 0e557564d3..bbfe74675f 100644
--- a/arch/z80/src/ez80/ez80_emac.c
+++ b/arch/z80/src/ez80/ez80_emac.c
@@ -2119,7 +2119,7 @@ int up_multicastfilter(FAR struct uip_driver_s *dev, FAR ubyte *mac, boolean ena
* is '0', the multicast packet is rejected.
*/
- /* Apply the hash algorithm to the the hash table index and bit number
+ /* Apply the hash algorithm to the hash table index and bit number
* corresponding to this MAC
*/
diff --git a/arch/z80/src/ez80/ez80_sigdeliver.c b/arch/z80/src/ez80/ez80_sigdeliver.c
index b7084ab6d2..3f6b6ed1ac 100644
--- a/arch/z80/src/ez80/ez80_sigdeliver.c
+++ b/arch/z80/src/ez80/ez80_sigdeliver.c
@@ -88,7 +88,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the signal handling
- * so that the the user code final gets the correct errno value (probably
+ * so that the user code final gets the correct errno value (probably
* EINTR).
*/
diff --git a/arch/z80/src/z8/z8_sigdeliver.c b/arch/z80/src/z8/z8_sigdeliver.c
index 8ba3c552eb..7e7700ed19 100644
--- a/arch/z80/src/z8/z8_sigdeliver.c
+++ b/arch/z80/src/z8/z8_sigdeliver.c
@@ -102,7 +102,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the signal handling
- * so that the the user code final gets the correct errno value (probably
+ * so that the user code final gets the correct errno value (probably
* EINTR).
*/
diff --git a/arch/z80/src/z80/z80_sigdeliver.c b/arch/z80/src/z80/z80_sigdeliver.c
index cfdc32e558..06b43d1dfc 100644
--- a/arch/z80/src/z80/z80_sigdeliver.c
+++ b/arch/z80/src/z80/z80_sigdeliver.c
@@ -87,7 +87,7 @@ void up_sigdeliver(void)
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the signal handling
- * so that the the user code final gets the correct errno value (probably
+ * so that the user code final gets the correct errno value (probably
* EINTR).
*/
diff --git a/binfmt/libnxflat/libnxflat_bind.c b/binfmt/libnxflat/libnxflat_bind.c
index 4489ebfcd8..84ef3a9a32 100644
--- a/binfmt/libnxflat/libnxflat_bind.c
+++ b/binfmt/libnxflat/libnxflat_bind.c
@@ -51,9 +51,25 @@
#include
/****************************************************************************
- * Definitions
+ * Pre-processor Definitions
****************************************************************************/
+#undef NXFLAT_DUMPBUFFER /* Define to enable very verbose buffer dumping */
+
+/* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_BINFMT have to be
+ * defined or NXFLAT_DUMPBUFFER does nothing.
+ */
+
+#if !defined(CONFIG_DEBUG_VERBOSE) || !defined (CONFIG_DEBUG_BINFMT)
+# undef NXFLAT_DUMPBUFFER
+#endif
+
+#ifdef NXFLAT_DUMPBUFFER
+# define nxflat_dumpbuffer(m,b,n) bvdbgdumpbuffer(m,b,n)
+#else
+# define nxflat_dumpbuffer(m,b,n)
+#endif
+
/****************************************************************************
* Private Types
****************************************************************************/
@@ -72,7 +88,7 @@
* Description:
* Perform the NXFLAT_RELOC_TYPE_REL32I binding:
*
- * Meaning: Object file contains a 32-bit offset into I-Space at the the offset.
+ * Meaning: Object file contains a 32-bit offset into I-Space at the offset.
* Fixup: Add mapped I-Space address to the offset.
*
* Returned Value:
@@ -111,7 +127,7 @@ static inline int nxflat_bindrel32i(FAR struct nxflat_loadinfo_s *loadinfo,
* Description:
* Perform the NXFLAT_RELOC_TYPE_REL32D binding:
*
- * Meaning: Object file contains a 32-bit offset into D-Space at the the offset.
+ * Meaning: Object file contains a 32-bit offset into D-Space at the offset.
* Fixup: Add allocated D-Space address to the offset.
*
* Returned Value:
@@ -246,7 +262,7 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo)
{
/* NXFLAT_RELOC_TYPE_REL32I Meaning: Object file contains a 32-bit offset
- * into I-Space at the the offset.
+ * into I-Space at the offset.
* Fixup: Add mapped I-Space address to the offset.
*/
@@ -257,7 +273,7 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo)
break;
/* NXFLAT_RELOC_TYPE_REL32D Meaning: Object file contains a 32-bit offset
- * into D-Space at the the offset.
+ * into D-Space at the offset.
* Fixup: Add allocated D-Space address to the
* offset.
*/
@@ -301,6 +317,15 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo)
}
}
+ /* Dump the relocation got */
+
+#ifdef NXFLAT_DUMPBUFFER
+ if (ret == OK && nrelocs > 0)
+ {
+ relocs = (FAR struct nxflat_reloc_s*)(offset - loadinfo->isize + loadinfo->dspace->region);
+ nxflat_dumpbuffer("GOT", (FAR const ubyte*)relocs, nrelocs * sizeof(struct nxflat_reloc_s));
+ }
+#endif
return ret;
}
@@ -396,11 +421,19 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo,
imports[i].i_funcaddress = (uint32)symbol->sym_value;
- bvdbg("Bound imported function '%s' to address %08x\n",
- symname, imports[i].i_funcaddress);
+ bvdbg("Bound import %d (%08p) to export 's' (%08x)\n",
+ i, &imports[i], symname, imports[i].i_funcaddress);
}
}
+ /* Dump the relocation import table */
+
+#ifdef NXFLAT_DUMPBUFFER
+ if (nimports > 0)
+ {
+ nxflat_dumpbuffer("Imports", (FAR const ubyte*)imports, nimports * sizeof(struct nxflat_import_s));
+ }
+#endif
return OK;
}
diff --git a/binfmt/libnxflat/libnxflat_verify.c b/binfmt/libnxflat/libnxflat_verify.c
index 96947dbc83..bf52212786 100644
--- a/binfmt/libnxflat/libnxflat_verify.c
+++ b/binfmt/libnxflat/libnxflat_verify.c
@@ -84,7 +84,7 @@ int nxflat_verifyheader(const struct nxflat_hdr_s *header)
/* Check the FLT header -- magic number and revision.
*
- * If the the magic number does not match. Just return
+ * If the magic number does not match. Just return
* silently. This is not our binary.
*/
diff --git a/binfmt/nxflat.c b/binfmt/nxflat.c
index 6e9d54c84f..8b3677df5e 100644
--- a/binfmt/nxflat.c
+++ b/binfmt/nxflat.c
@@ -55,13 +55,32 @@
* Pre-processor Definitions
****************************************************************************/
+#undef NXFLAT_DUMPBUFFER /* Define to enable very verbose buffer dumping */
+
+/* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_BINFMT have to be
+ * defined or NXFLAT_DUMPBUFFER does nothing.
+ */
+
+#if !defined(CONFIG_DEBUG_VERBOSE) || !defined (CONFIG_DEBUG_BINFMT)
+# undef NXFLAT_DUMPBUFFER
+#endif
+
+#ifdef NXFLAT_DUMPBUFFER
+# define nxflat_dumpbuffer(m,b,n) bvdbgdumpbuffer(m,b,n)
+#else
+# define nxflat_dumpbuffer(m,b,n)
+#endif
+
+#ifndef MIN
+# define MIN(a,b) (a < b ? a : b)
+#endif
+
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
static int nxflat_loadbinary(struct binary_s *binp);
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_BINFMT)
-static void nxflat_dumpmemory(void *addr, int nbytes);
static void nxflat_dumploadinfo(struct nxflat_loadinfo_s *loadinfo);
#endif
@@ -79,25 +98,6 @@ static struct binfmt_s g_nxflatbinfmt =
* Private Functions
****************************************************************************/
-/****************************************************************************
- * Name: nnxflat_dumpmemory
- ****************************************************************************/
-
-#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_BINFMT)
-static void nxflat_dumpmemory(void *addr, int nbytes)
-{
- ubyte *ptr;
-
- bdbg(" ADDRESS VALUE\n");
- for (ptr = (ubyte*)addr; nbytes > 0; ptr += 4, nbytes -= 4)
- {
- bdbg(" %p: %02x %02x %02x %02x\n", ptr, ptr[0], ptr[1], ptr[2], ptr[3]);
- }
-}
-#else
-# define nxflat_dumpmemory(a,n)
-#endif
-
/****************************************************************************
* Name: nxflat_dumploadinfo
****************************************************************************/
@@ -115,7 +115,7 @@ static void nxflat_dumploadinfo(struct nxflat_loadinfo_s *loadinfo)
bdbg(" DSPACE:\n");
bdbg(" dspace: %08lx\n", loadinfo->dspace);
- if (oadinfo->dspace != NULL)
+ if (loadinfo->dspace != NULL)
{
bdbg(" crefs: %d\n", loadinfo->dspace->crefs);
bdbg(" region: %08lx\n", loadinfo->dspace->region);
@@ -196,8 +196,7 @@ static int nxflat_loadbinary(struct binary_s *binp)
binp->isize = loadinfo.isize;
binp->stacksize = loadinfo.stacksize;
- bvdbg("ENTRY CODE:\n");
- nxflat_dumpmemory(binp->entrypt, 16*sizeof(uint32));
+ nxflat_dumpbuffer("Entry code", (FAR const ubyte*)binp->entrypt, MIN(binp->isize,512));
nxflat_uninit(&loadinfo);
return OK;
}
diff --git a/configs/eagle100/httpd/ld.script b/configs/eagle100/httpd/ld.script
index 0063eb39fd..434cffbdec 100644
--- a/configs/eagle100/httpd/ld.script
+++ b/configs/eagle100/httpd/ld.script
@@ -34,7 +34,7 @@
****************************************************************************/
/* The LM3S6918 has 256Kb of FLASH beginning at address 0x0000:0000. However,
- * if the the Eagle100 Ethernet bootloader is used, then the entry point must
+ * if the Eagle100 Ethernet bootloader is used, then the entry point must
* be at the following offset in FLASH (and the size of the FLASH must be
* reduced to 248Kb):
*/
diff --git a/configs/eagle100/nettest/ld.script b/configs/eagle100/nettest/ld.script
index 91ac6f57e6..b8af71dddd 100644
--- a/configs/eagle100/nettest/ld.script
+++ b/configs/eagle100/nettest/ld.script
@@ -34,7 +34,7 @@
****************************************************************************/
/* The LM3S6918 has 256Kb of FLASH beginning at address 0x0000:0000. However,
- * if the the Eagle100 Ethernet bootloader is used, then the entry point must
+ * if the Eagle100 Ethernet bootloader is used, then the entry point must
* be at the following offset in FLASH (and the size of the FLASH must be
* reduced to 248Kb):
*/
diff --git a/configs/eagle100/nsh/ld.script b/configs/eagle100/nsh/ld.script
index 5a8fdc472a..e77b6778dc 100644
--- a/configs/eagle100/nsh/ld.script
+++ b/configs/eagle100/nsh/ld.script
@@ -34,7 +34,7 @@
****************************************************************************/
/* The LM3S6918 has 256Kb of FLASH beginning at address 0x0000:0000. However,
- * if the the Eagle100 Ethernet bootloader is used, then the entry point must
+ * if the Eagle100 Ethernet bootloader is used, then the entry point must
* be at the following offset in FLASH (and the size of the FLASH must be
* reduced to 248Kb):
*/
diff --git a/configs/eagle100/nxflat/ld.script b/configs/eagle100/nxflat/ld.script
index 68969391ee..ffd8dec486 100644
--- a/configs/eagle100/nxflat/ld.script
+++ b/configs/eagle100/nxflat/ld.script
@@ -34,7 +34,7 @@
****************************************************************************/
/* The LM3S6918 has 256Kb of FLASH beginning at address 0x0000:0000. However,
- * if the the Eagle100 Ethernet bootloader is used, then the entry point must
+ * if the Eagle100 Ethernet bootloader is used, then the entry point must
* be at the following offset in FLASH (and the size of the FLASH must be
* reduced to 248Kb):
*/
diff --git a/configs/eagle100/ostest/ld.script b/configs/eagle100/ostest/ld.script
index 7c1d8f1bfb..0d7032fcf2 100644
--- a/configs/eagle100/ostest/ld.script
+++ b/configs/eagle100/ostest/ld.script
@@ -34,7 +34,7 @@
****************************************************************************/
/* The LM3S6918 has 256Kb of FLASH beginning at address 0x0000:0000. However,
- * if the the Eagle100 Ethernet bootloader is used, then the entry point must
+ * if the Eagle100 Ethernet bootloader is used, then the entry point must
* be at the following offset in FLASH (and the size of the FLASH must be
* reduced to 248Kb):
*/
diff --git a/configs/xtrs/src/xtr_irq.c b/configs/xtrs/src/xtr_irq.c
index 44df0fe4d9..91d0cf42a1 100644
--- a/configs/xtrs/src/xtr_irq.c
+++ b/configs/xtrs/src/xtr_irq.c
@@ -78,7 +78,7 @@ void up_irqinitialize(void)
*
* NOTE: Normally, there are seperate enables for "global" interrupts
* and specific device interrupts. In such a "normal" case, the timer
- * interrupt should be attached and enabled in the the function up_timerinit()
+ * interrupt should be attached and enabled in the function up_timerinit()
*/
irq_attach(Z80_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
diff --git a/configs/z80sim/src/z80_irq.c b/configs/z80sim/src/z80_irq.c
index c2b64a1d59..334ea672c2 100644
--- a/configs/z80sim/src/z80_irq.c
+++ b/configs/z80sim/src/z80_irq.c
@@ -78,7 +78,7 @@ void up_irqinitialize(void)
*
* NOTE: Normally, there are seperate enables for "global" interrupts
* and specific device interrupts. In such a "normal" case, the timer
- * interrupt should be attached and enabled in the the function up_timerinit()
+ * interrupt should be attached and enabled in the function up_timerinit()
*/
irq_attach(Z80_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
diff --git a/drivers/mmcsd/mmcsd_debug.c b/drivers/mmcsd/mmcsd_debug.c
index 85e2d7d444..2b05f3df65 100644
--- a/drivers/mmcsd/mmcsd_debug.c
+++ b/drivers/mmcsd/mmcsd_debug.c
@@ -81,68 +81,6 @@
* Public Functions
****************************************************************************/
-/****************************************************************************
- * Name: mmcsd_dmpcsd
- *
- * Description:
- * Dump the contents a buffer
- *
- ****************************************************************************/
-
-#ifdef CONFIG_MMCSD_DUMPALL
-void mmcsd_dumpbuffer(FAR const ubyte *buffer, unsigned int buflen)
-{
- int i, j, k;
-
- for (i = 0; i < buflen; i += 32)
- {
- message("%04x: ", i);
- for (j = 0; j < 32; j++)
- {
- k = i + j;
-
- if (j == 16)
- {
- message(" ");
- }
-
- if (k < buflen)
- {
- message("%02x", buffer[k]);
- }
- else
- {
- message(" ");
- }
- }
-
- message(" ");
- for (j = 0; j < 32; j++)
- {
- k = i + j;
-
- if (j == 16)
- {
- message(" ");
- }
-
- if (k < buflen)
- {
- if (buffer[k] >= 0x20 && buffer[k] < 0x7f)
- {
- message("%c", buffer[k]);
- }
- else
- {
- message(".");
- }
- }
- }
- message("\n");
- }
-}
-#endif
-
/****************************************************************************
* Name: mmcsd_dmpcsd
*
diff --git a/drivers/mmcsd/mmcsd_internal.h b/drivers/mmcsd/mmcsd_internal.h
index 1a81b59b5d..9d25a372a4 100644
--- a/drivers/mmcsd/mmcsd_internal.h
+++ b/drivers/mmcsd/mmcsd_internal.h
@@ -1,7 +1,7 @@
/****************************************************************************
* drivers/mmcsd/mmcsd_internal.h
*
- * Copyright (C) 20082009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -42,6 +42,7 @@
#include
#include
+#include
/****************************************************************************
* Pre-Processor Definitions
@@ -85,9 +86,9 @@ extern "C" {
#endif
#ifdef CONFIG_MMCSD_DUMPALL
-EXTERN void mmcsd_dumpbuffer(FAR const ubyte *buffer, unsigned int buflen);
+# define mmcsd_dumpbuffer(m,b,l) fvdbgdumpbuffer(m,b,l)
#else
-# define mmcsd_dumpbuffer(b,l)
+# define mmcsd_dumpbuffer(m,b,l)
#endif
#if defined(CONFIG_DEBUG_VERBOSE) && defined(CONFIG_DEBUG_FS)
diff --git a/drivers/mmcsd/mmcsd_spi.c b/drivers/mmcsd/mmcsd_spi.c
index cd08706164..4129699225 100644
--- a/drivers/mmcsd/mmcsd_spi.c
+++ b/drivers/mmcsd/mmcsd_spi.c
@@ -347,7 +347,7 @@ static void mmcsd_semtake(sem_t *sem)
* Name: mmcsd_waitready
*
* Description:
- * Wait until the the card is no longer busy
+ * Wait until the card is no longer busy
*
* Assumptions:
* MMC/SD card already selected
@@ -1170,7 +1170,7 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer,
mmcsd_semgive(&slot->sem);
fvdbg("Read %d bytes:\n", nbytes);
- mmcsd_dumpbuffer(buffer, nbytes);
+ mmcsd_dumpbuffer("Read buffer", buffer, nbytes);
return nsectors;
errout_with_eio:
@@ -1264,7 +1264,7 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer,
offset = start_sector * SECTORSIZE(slot);
fvdbg("nbytes=%d byte offset=%d\n", nbytes, offset);
}
- mmcsd_dumpbuffer(buffer, nbytes);
+ mmcsd_dumpbuffer("Write buffer", buffer, nbytes);
/* Select the slave */
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index bfabe6e93f..d7ceef2339 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -823,7 +823,7 @@ static int cs89x0_txavail(struct uip_driver_s *dev)
* Initialize the Ethernet driver
*
* Parameters:
- * impl - decribes the the implementation of the cs89x00 implementation.
+ * impl - decribes the implementation of the cs89x00 implementation.
* This reference is retained so so must remain stable throughout the
* life of the driver instance.
* devno - Identifies the device number. This must be a number between
diff --git a/drivers/usbdev/usbdev_scsi.c b/drivers/usbdev/usbdev_scsi.c
index e17999b201..700bb64fb2 100644
--- a/drivers/usbdev/usbdev_scsi.c
+++ b/drivers/usbdev/usbdev_scsi.c
@@ -1900,7 +1900,7 @@ static int usbstrg_cmdparsestate(FAR struct usbstrg_dev_s *priv)
if (priv->cbwdir == USBSTRG_FLAGS_DIRDEVICE2HOST)
{
- /* The number of bytes in the response cannot exceed the the host
+ /* The number of bytes in the response cannot exceed the host
* 'allocation length' in the command.
*/
diff --git a/examples/README.txt b/examples/README.txt
index 08c425b14f..b31c374908 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -349,7 +349,7 @@ examples/usbserial
dmesg
- At the end of the dmesg output, you should see the the seria
+ At the end of the dmesg output, you should see the serial
device was successfully idenfied and assigned to a tty device,
probably /dev/ttyUSB0.
diff --git a/examples/nsh/README.txt b/examples/nsh/README.txt
index 17a541eef0..e663071fca 100644
--- a/examples/nsh/README.txt
+++ b/examples/nsh/README.txt
@@ -551,7 +551,7 @@ o mount -t
create whatever psuedo directories that may be needed to complete
the full path but the full path must not already exist.
- After the the volume has been mounted in the NuttX psuedo file
+ After the volume has been mounted in the NuttX psuedo file
system, it may be access in the same way as other objects in the
file system.
@@ -898,7 +898,7 @@ NSH-Specific Configuration Settings
receiving TELNET commands/reponses
* CONFIG_EXAMPLES_NSH_DHCPC
- Obtain the the IP address via DHCP.
+ Obtain the IP address via DHCP.
* CONFIG_EXAMPLES_NSH_IPADDR
If CONFIG_EXAMPLES_NSH_DHCPC is NOT set, then the static IP
diff --git a/examples/nsh/nsh_netcmds.c b/examples/nsh/nsh_netcmds.c
index 3d64e662f0..27ab064219 100644
--- a/examples/nsh/nsh_netcmds.c
+++ b/examples/nsh/nsh_netcmds.c
@@ -719,7 +719,7 @@ int cmd_wget(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
fullpath = nsh_getfullpath(vtbl, localfile);
- /* Open the the local file for writing */
+ /* Open the local file for writing */
fd = open(fullpath, O_WRONLY|O_CREAT|O_TRUNC, 0644);
if (fd < 0)
diff --git a/examples/nxflat/nxflat_main.c b/examples/nxflat/nxflat_main.c
index f8f6084885..78146b9139 100644
--- a/examples/nxflat/nxflat_main.c
+++ b/examples/nxflat/nxflat_main.c
@@ -93,7 +93,7 @@
#define ROMFSDEV "/dev/ram0"
#define MOUNTPT "/mnt/romfs"
-/* If CONFIG_DEBUG is enabled, use dbg instead of printf so that the the
+/* If CONFIG_DEBUG is enabled, use dbg instead of printf so that the
* output will be synchronous with the debug output.
*/
diff --git a/examples/nxflat/tests/hello++/Makefile b/examples/nxflat/tests/hello++/Makefile
index e282816197..113520da5d 100644
--- a/examples/nxflat/tests/hello++/Makefile
+++ b/examples/nxflat/tests/hello++/Makefile
@@ -123,7 +123,7 @@ $(BIN2): $(BIN2).r2
@$(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^
# BIN3 and BIN4 require that we include --cxx in the xflat-ld command.
-# This will instruct xflat-ld that we want it to put togethe the correct
+# This will instruct xflat-ld that we want it to put together the correct
# startup files to handle the C++ static initializers.
#
# BIN3 is equivalent to BIN2 except that is uses static initializers
diff --git a/examples/pashello/device.c b/examples/pashello/device.c
index b4401531a4..def8f60ecd 100644
--- a/examples/pashello/device.c
+++ b/examples/pashello/device.c
@@ -85,7 +85,7 @@ static ssize_t hello_read(struct file *filep, char *buffer, size_t len)
if (offset < hello_pex_len)
{
- /* Make sure the the read does not extend beyond the .pex file */
+ /* Make sure the read does not extend beyond the .pex file */
nread = len;
if (nread + offset > hello_pex_len)
diff --git a/fs/fat/fs_fat32util.c b/fs/fat/fs_fat32util.c
index 7353dee883..b7ce20ec14 100644
--- a/fs/fat/fs_fat32util.c
+++ b/fs/fat/fs_fat32util.c
@@ -2492,7 +2492,7 @@ int fat_currentsector(struct fat_mountpt_s *fs, struct fat_file_s *ff,
sectoroffset = SEC_NSECTORS(fs, position) & CLUS_NDXMASK(fs);
- /* The current cluster is the the first sector of the cluster plus
+ /* The current cluster is the first sector of the cluster plus
* the sector offset
*/
diff --git a/fs/fs_poll.c b/fs/fs_poll.c
index dd71bfa48e..5e377de941 100644
--- a/fs/fs_poll.c
+++ b/fs/fs_poll.c
@@ -304,7 +304,7 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
poll_semtake(&sem);
}
- /* Teardown the the poll operation and get the count of events */
+ /* Teardown the poll operation and get the count of events */
ret = poll_teardown(fds, nfds, &count);
}
diff --git a/fs/fs_seekdir.c b/fs/fs_seekdir.c
index ab1e7b6212..bdbada7b68 100644
--- a/fs/fs_seekdir.c
+++ b/fs/fs_seekdir.c
@@ -166,7 +166,7 @@ static inline void seekmountptdir(struct internal_dir_s *idir, off_t offset)
pos++;
}
- /* If we get here the the directory position has been successfully set */
+ /* If we get here the directory position has been successfully set */
idir->fd_position = pos;
}
diff --git a/graphics/nxfonts/nxfonts_convert.c b/graphics/nxfonts/nxfonts_convert.c
index 7e80565f91..2176052933 100644
--- a/graphics/nxfonts/nxfonts_convert.c
+++ b/graphics/nxfonts/nxfonts_convert.c
@@ -50,7 +50,7 @@
* Pre-Processor Definitions
****************************************************************************/
-/* Make sure the the bits-per-pixel value has been set */
+/* Make sure the bits-per-pixel value has been set */
#ifndef NXFONTS_BITSPERPIXEL
# error "NXFONTS_BITSPERPIXEL must be defined on the command line"
diff --git a/graphics/nxglib/nxglib_bitblit.h b/graphics/nxglib/nxglib_bitblit.h
index 02baba13ae..b3deb66dda 100644
--- a/graphics/nxglib/nxglib_bitblit.h
+++ b/graphics/nxglib/nxglib_bitblit.h
@@ -49,7 +49,7 @@
* Pre-Processor Definitions
****************************************************************************/
-/* Make sure the the bits-per-pixel value has been set by the includer of
+/* Make sure the bits-per-pixel value has been set by the includer of
* this header file.
*/
diff --git a/graphics/nxmu/nxfe.h b/graphics/nxmu/nxfe.h
index 47a804c497..b808e5bf3e 100644
--- a/graphics/nxmu/nxfe.h
+++ b/graphics/nxmu/nxfe.h
@@ -118,7 +118,7 @@ struct nxfe_conn_s
/* Server state structure ***************************************************/
-/* This the the server 'front-end' state structure */
+/* This the server 'front-end' state structure */
struct nxfe_state_s
{
@@ -443,7 +443,7 @@ extern "C" {
* NOTE: wnd must have been allocated using malloc() (or related allocators)
* Once provided to nxfe_constructwindow() that memory is owned and managed
* by NX. On certain error conditions or when the window is closed, NX will
- * free() the the window.
+ * free() the window.
*
* Input Parameters:
* handle - The handle returned by nx_connect
diff --git a/graphics/nxmu/nxmu_constructwindow.c b/graphics/nxmu/nxmu_constructwindow.c
index 0923696df4..f7e62f7115 100644
--- a/graphics/nxmu/nxmu_constructwindow.c
+++ b/graphics/nxmu/nxmu_constructwindow.c
@@ -85,7 +85,7 @@
* NOTE: wnd must have been allocated using malloc() (or related allocators)
* Once provided to nxfe_constructwindow() that memory is owned and managed
* by NX. On certain error conditions or when the window is closed, NX will
- * free() the the window.
+ * free() the window.
*
* Input Parameters:
* handle - The handle returned by nx_connect
diff --git a/graphics/nxsu/nxfe.h b/graphics/nxsu/nxfe.h
index a95ae9c60b..9cecef7ed0 100644
--- a/graphics/nxsu/nxfe.h
+++ b/graphics/nxsu/nxfe.h
@@ -61,7 +61,7 @@
/* Server state structure ***************************************************/
-/* This the the server 'front-end' state structure. It is really the same
+/* This the server 'front-end' state structure. It is really the same
* as the back-end state, but we wrap the back-end state so that we can add
* things to the structure in the future
*/
@@ -108,7 +108,7 @@ EXTERN const struct nx_callback_s g_bkgdcb;
* NOTE: wnd must have been allocated using malloc() (or related allocators)
* Once provided to nxfe_constructwindow() that memory is owned and managed
* by NX. On certain error conditions or when the window is closed, NX will
- * free() the the window.
+ * free() the window.
*
* Input Parameters:
* handle - The handle returned by nx_connect
diff --git a/graphics/nxsu/nxsu_constructwindow.c b/graphics/nxsu/nxsu_constructwindow.c
index e41071b269..d7a6df0a6e 100644
--- a/graphics/nxsu/nxsu_constructwindow.c
+++ b/graphics/nxsu/nxsu_constructwindow.c
@@ -85,7 +85,7 @@
* NOTE: wnd must have been allocated using malloc() (or related allocators)
* Once provided to nxfe_constructwindow() that memory is owned and managed
* by NX. On certain error conditions or when the window is closed, NX will
- * free() the the window.
+ * free() the window.
*
* Input Parameters:
* handle - The handle returned by nx_connect
diff --git a/include/debug.h b/include/debug.h
index 7253d93e49..485bf8a206 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -71,21 +71,21 @@
# ifdef CONFIG_ARCH_LOWPUTC
# define lldbg(format, arg...) \
- lib_lowprintf(EXTRA_FMT format EXTRA_ARG, ##arg)
+ lib_lowprintf(EXTRA_FMT format EXTRA_ARG, ##arg)
# else
# define lldbg(x...)
# endif
# ifdef CONFIG_DEBUG_VERBOSE
# define vdbg(format, arg...) \
- lib_rawprintf(EXTRA_FMT format EXTRA_ARG, ##arg)
+ lib_rawprintf(EXTRA_FMT format EXTRA_ARG, ##arg)
-# ifdef CONFIG_ARCH_LOWPUTC
-# define llvdbg(format, arg...) \
- lib_lowprintf(EXTRA_FMT format EXTRA_ARG, ##arg)
-# else
-# define llvdbg(x...)
-# endif
+# ifdef CONFIG_ARCH_LOWPUTC
+# define llvdbg(format, arg...) \
+ lib_lowprintf(EXTRA_FMT format EXTRA_ARG, ##arg)
+# else
+# define llvdbg(x...)
+# endif
# else
# define vdbg(x...)
@@ -322,6 +322,86 @@
#endif /* CONFIG_CPP_HAVE_VARARGS */
+/* Buffer dumping macros do not depend on varargs */
+
+#ifdef CONFIG_DEBUG
+# define dbgdumpbuffer(m,b,n) lib_dumpbuffer(m,b,n)
+# ifdef CONFIG_DEBUG_VERBOSE
+# define vdbgdumpbuffer(m,b,n) lib_dumpbuffer(m,b,n)
+# else
+# define vdbgdumpbuffer(m,b,n)
+# endif
+#else
+# define dbgdumpbuffer(m,b,n)
+# define vdbgdumpbuffer(m,b,n)
+# endif
+
+/* Subsystem specific debug */
+
+#ifdef CONFIG_DEBUG_MM
+# define mdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
+# define mvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
+#else
+# define mdbgdumpbuffer(m,b,n)
+# define mvdbgdumpbuffer(m,b,n)
+#endif
+
+#ifdef CONFIG_DEBUG_SCHED
+# define sdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
+# define svdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
+#else
+# define sdbgdumpbuffer(m,b,n)
+# define svdbgdumpbuffer(m,b,n)
+#endif
+
+#ifdef CONFIG_DEBUG_NET
+# define ndbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
+# define nvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
+#else
+# define ndbgdumpbuffer(m,b,n)
+# define nvdbgdumpbuffer(m,b,n)
+#endif
+
+#ifdef CONFIG_DEBUG_USB
+# define udbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
+# define uvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
+#else
+# define udbgdumpbuffer(m,b,n)
+# define uvdbgdumpbuffer(m,b,n)
+#endif
+
+#ifdef CONFIG_DEBUG_FS
+# define fdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
+# define fvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
+#else
+# define fdbgdumpbuffer(m,b,n)
+# define fvdbgdumpbuffer(m,b,n)
+#endif
+
+#ifdef CONFIG_DEBUG_GRAPHICS
+# define gdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
+# define gvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
+#else
+# define gdbgdumpbuffer(m,b,n)
+# define gvdbgdumpbuffer(m,b,n)
+#endif
+
+#ifdef CONFIG_DEBUG_BINFMT
+# define bdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
+# define bvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
+#else
+# define bdbgdumpbuffer(m,b,n)
+# define bvdbgdumpbuffer(m,b,n)
+#endif
+
+#ifdef CONFIG_DEBUG_LIB
+# define ldbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n)
+# define lvdbgdumpbuffer(m,b,n) vdbgdumpbuffer(m,b,n)
+#else
+# define ldbgdumpbuffer(m,b,n)
+# define lvdbgdumpbuffer(m,b,n)
+#endif
+
/****************************************************************************
* Public Type Declarations
****************************************************************************/
@@ -354,6 +434,10 @@ EXTERN int lib_rawprintf(const char *format, ...);
EXTERN int lib_lowprintf(const char *format, ...);
#endif
+/* Dump a buffer of data */
+
+EXTERN int lib_dumpbuffer(FAR const char *msg, FAR const ubyte *buffer, unsigned int buflen);
+
/* If the cross-compiler's pre-processor does not support variable
* length arguments, then these additional APIs will be built.
*/
diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h
index f3cb5c184f..a1182b1984 100644
--- a/include/nuttx/arch.h
+++ b/include/nuttx/arch.h
@@ -229,7 +229,7 @@ EXTERN void up_unblock_task(FAR _TCB *tcb);
*
* Inputs:
* tcb: Refers to a task in the ready-to-run list (normally
- * the task at the the head of the list). It most be
+ * the task at the head of the list). It most be
* stopped, its context saved and moved into one of the
* waiting task lists. It it was the task at the head
* of the ready-to-run list, then a context to the new
@@ -293,7 +293,7 @@ EXTERN void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority);
* This function causes the currently executing task to cease
* to exist. This is a special case of task_delete() where the task to
* be deleted is the currently executing task. It is more complex because
- * a context switch must be perform to the the next ready to run task.
+ * a context switch must be perform to the next ready to run task.
*
* Unlike other UP APIs, this function may be called directly from user
* programs in various states. The implementation of this function should
diff --git a/include/nuttx/can.h b/include/nuttx/can.h
index 7a9562b053..370297615f 100644
--- a/include/nuttx/can.h
+++ b/include/nuttx/can.h
@@ -195,7 +195,7 @@ struct can_ops_s
CODE int (*co_send)(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg);
/* Return TRUE if all message have been sent. If for example, the CAN
- * hardware implements FIFOs, then this would mean the the transmit FIFO is
+ * hardware implements FIFOs, then this would mean the transmit FIFO is
* empty. This method is called when the driver needs to make sure that
* all characters are "drained" from the TX hardware before calling co_shutdown().
*/
diff --git a/include/nuttx/cs89x0.h b/include/nuttx/cs89x0.h
index 6e2f5bc343..fc990d850e 100755
--- a/include/nuttx/cs89x0.h
+++ b/include/nuttx/cs89x0.h
@@ -140,7 +140,7 @@ extern "C" {
* Initialize the Ethernet driver
*
* Parameters:
- * impl - decribes the the implementation of the cs89x00 implementation.
+ * impl - decribes the implementation of the cs89x00 implementation.
* This reference is retained so so must remain stable throughout the
* life of the driver instance.
* devno - Identifies the device number. This must be a number between
diff --git a/include/nuttx/serial.h b/include/nuttx/serial.h
index ed5c6a1c01..fad9ecd892 100644
--- a/include/nuttx/serial.h
+++ b/include/nuttx/serial.h
@@ -167,7 +167,7 @@ struct uart_ops_s
CODE boolean (*txready)(FAR struct uart_dev_s *dev);
/* Return TRUE if all characters have been sent. If for example, the UART
- * hardware implements FIFOs, then this would mean the the transmit FIFO is
+ * hardware implements FIFOs, then this would mean the transmit FIFO is
* empty. This method is called when the driver needs to make sure that
* all characters are "drained" from the TX hardware.
*/
diff --git a/include/nxflat.h b/include/nxflat.h
index 8e551b2526..14f0718063 100644
--- a/include/nxflat.h
+++ b/include/nxflat.h
@@ -73,7 +73,7 @@ struct nxflat_hdr_s
/* The following fields provide the memory map for the nxflat binary.
*
- * h_entry - Offset to the the first executable insruction from
+ * h_entry - Offset to the first executable insruction from
* the beginning of the file.
* h_datastart - Offset to the beginning of the data segment from
* the beginning of the file. This field can also
diff --git a/lib/Makefile b/lib/Makefile
index 6774868f9e..14af7fe33f 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -53,7 +53,7 @@ STRING_SRCS = lib_checkbase.c lib_isbasedigit.c lib_memset.c lib_memcpy.c \
CTYPE_SRCS =
-STDIO_SRCS = lib_printf.c lib_rawprintf.c lib_lowprintf.c lib_dbg.c \
+STDIO_SRCS = lib_printf.c lib_rawprintf.c lib_lowprintf.c \
lib_sprintf.c lib_snprintf.c lib_libsprintf.c lib_vsprintf.c \
lib_vsnprintf.c lib_libvsprintf.c lib_meminstream.c \
lib_memoutstream.c lib_lowinstream.c lib_lowoutstream.c \
@@ -93,8 +93,11 @@ SQ_SRCS = sq_addlast.c sq_addfirst.c sq_addafter.c \
DQ_SRCS = dq_addlast.c dq_addfirst.c dq_addafter.c dq_addbefore.c \
dq_rem.c dq_remlast.c dq_remfirst.c
+DBG_SRCS = lib_dbg.c lib_dumpbuffer.c
+
CSRCS = $(MISC_SRCS) $(STRING_SRCS) $(CTYPE_SRCS) $(STDIO_SRCS) $(STDLIB_SRCS) \
- $(MATH_SRCS) $(UNISTD_SRCS) $(NET_SRCS) $(LIBGEN_SRCS) $(SQ_SRCS) $(DQ_SRCS)
+ $(MATH_SRCS) $(UNISTD_SRCS) $(NET_SRCS) $(LIBGEN_SRCS) $(SQ_SRCS) \
+ $(DQ_SRCS) $(DBG_SRCS)
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
diff --git a/mm/mm_shrinkchunk.c b/mm/mm_shrinkchunk.c
index 4612c426d0..4e81f5b3aa 100644
--- a/mm/mm_shrinkchunk.c
+++ b/mm/mm_shrinkchunk.c
@@ -55,7 +55,7 @@
* Reduce the size of the chunk specified by the node
* structure to the specified size. this internal logic
* is used both from memalign to dispose of any trailing
- * memory in the the aligned allocation and also by realloc
+ * memory in the aligned allocation and also by realloc
* when there is a request to reduce the size of an allocation.
*
* NOTES:
diff --git a/net/netdev_register.c b/net/netdev_register.c
index 86d8bf83f4..b173bf2319 100644
--- a/net/netdev_register.c
+++ b/net/netdev_register.c
@@ -132,7 +132,7 @@ int netdev_register(FAR struct uip_driver_s *dev)
int devnum;
netdev_semtake();
- /* Assign a device name to the the interface */
+ /* Assign a device name to the interface */
devnum = g_next_devnum++;
snprintf( dev->d_ifname, IFNAMSIZ, "eth%d", devnum );
diff --git a/net/uip/uip_icmpping.c b/net/uip/uip_icmpping.c
index 9a68ca5432..00c6a79051 100644
--- a/net/uip/uip_icmpping.c
+++ b/net/uip/uip_icmpping.c
@@ -171,7 +171,7 @@ static uint16 ping_interrupt(struct uip_driver_s *dev, void *conn,
else
{
/* Check if this is a ICMP ECHO reply. If so, return the sequence
- * number to the the caller. NOTE: We may not even have sent the
+ * number to the caller. NOTE: We may not even have sent the
* requested ECHO request; this could have been the delayed ECHO
* response from a previous ping.
*/
diff --git a/net/uip/uip_tcpbacklog.c b/net/uip/uip_tcpbacklog.c
index e27c70a510..8e6d1fb904 100644
--- a/net/uip/uip_tcpbacklog.c
+++ b/net/uip/uip_tcpbacklog.c
@@ -120,7 +120,7 @@ int uip_backlogcreate(FAR struct uip_conn *conn, int nblg)
return -ENOMEM;
}
- /* Then add all of the pre-allocated containers to the the free list */
+ /* Then add all of the pre-allocated containers to the free list */
blc = (FAR struct uip_blcontainer_s*)(((FAR ubyte*)bls) + offset);
for (i = 0; i < nblg; i++)
diff --git a/netutils/dhcpc/dhcpc.c b/netutils/dhcpc/dhcpc.c
index 96d945aa6f..670b2256c9 100644
--- a/netutils/dhcpc/dhcpc.c
+++ b/netutils/dhcpc/dhcpc.c
@@ -512,7 +512,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
state = STATE_HAVE_LEASE;
}
- /* NAK means the the server has refused our request. Break out of
+ /* NAK means the server has refused our request. Break out of
* this loop with state == STATE_HAVE_OFFER and send DISCOVER again
*/
diff --git a/netutils/telnetd/telnetd.c b/netutils/telnetd/telnetd.c
index 61f3dcda62..fb5c2c8e2a 100644
--- a/netutils/telnetd/telnetd.c
+++ b/netutils/telnetd/telnetd.c
@@ -127,42 +127,13 @@ struct telnetd_s
****************************************************************************/
#ifdef CONFIG_NETUTILS_TELNETD_DUMPBUFFER
-static void telnetd_dumpbuffer(const char *msg, const char *buffer, ssize_t nbytes)
+static inline void telnetd_dumpbuffer(FAR const char *msg, FAR const char *buffer, unsigned int nbytes)
{
-#ifdef CONFIG_DEBUG
- char line[128];
- int ch;
- int i;
- int j;
-
- dbg("%s:\n", msg);
- for (i = 0; i < nbytes; i += 16)
- {
- sprintf(line, "%04x: ", i);
-
- for ( j = 0; j < 16; j++)
- {
- if (i + j < nbytes)
- {
- sprintf(&line[strlen(line)], "%02x ", buffer[i+j] );
- }
- else
- {
- strcpy(&line[strlen(line)], " ");
- }
- }
-
- for ( j = 0; j < 16; j++)
- {
- if (i + j < nbytes)
- {
- ch = buffer[i+j];
- sprintf(&line[strlen(line)], "%c", ch >= 0x20 && ch <= 0x7e ? ch : '.');
- }
- }
- dbg("%s\n", line);
- }
-#endif
+ /* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_NET have to be
+ * defined or the following does nothing.
+ */
+
+ nvdbgdumpbuffer(msg, (FAR const ubyte*)buffer, nbytes);
}
#else
# define telnetd_dumpbuffer(msg,buffer,nbytes)
diff --git a/netutils/tftpc/tftpc_internal.h b/netutils/tftpc/tftpc_internal.h
index 9e853efba5..214f7306d3 100644
--- a/netutils/tftpc/tftpc_internal.h
+++ b/netutils/tftpc/tftpc_internal.h
@@ -161,7 +161,7 @@ extern ssize_t tftp_recvfrom(int sd, void *buf, size_t len, struct sockaddr_in *
extern ssize_t tftp_sendto(int sd, const void *buf, size_t len, struct sockaddr_in *to);
#ifdef CONFIG_NETUTILS_TFTP_DUMPBUFFERS
-extern void tftp_dumpbuffer(const char *msg, ubyte *buffer, int nbytes);
+# define tftp_dumpbuffer(msg, buffer, nbytes) nvdbgdumpbuffer(msg, buffer, nbytes)
#else
# define tftp_dumpbuffer(msg, buffer, nbytes)
#endif
diff --git a/netutils/tftpc/tftpc_packets.c b/netutils/tftpc/tftpc_packets.c
index 73e4bd1109..d190c4f1ab 100644
--- a/netutils/tftpc/tftpc_packets.c
+++ b/netutils/tftpc/tftpc_packets.c
@@ -1,7 +1,7 @@
/****************************************************************************
* netuils/tftp/tftpc_packets.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -326,52 +326,4 @@ ssize_t tftp_sendto(int sd, const void *buf, size_t len, struct sockaddr_in *to)
}
}
-/****************************************************************************
- * Name: tftp_sendto
- *
- * Description:
- * Dump a buffer of data
- *
- ****************************************************************************/
-
-#ifdef CONFIG_NETUTILS_TFTP_DUMPBUFFERS
-void tftp_dumpbuffer(const char *msg, ubyte *buffer, int nbytes)
-{
-#ifdef CONFIG_DEBUG
- char line[128];
- int ch;
- int i;
- int j;
-
- dbg("%s:\n", msg);
- for (i = 0; i < nbytes; i += 16)
- {
- sprintf(line, "%04x: ", i);
-
- for ( j = 0; j < 16; j++)
- {
- if (i + j < nbytes)
- {
- sprintf(&line[strlen(line)], "%02x ", buffer[i+j] );
- }
- else
- {
- strcpy(&line[strlen(line)], " ");
- }
- }
-
- for ( j = 0; j < 16; j++)
- {
- if (i + j < nbytes)
- {
- ch = buffer[i+j];
- sprintf(&line[strlen(line)], "%c", ch >= 0x20 && ch <= 0x7e ? ch : '.');
- }
- }
- dbg("%s\n", line);
- }
-#endif
-}
-#endif
-
#endif /* CONFIG_NET && CONFIG_NET_UDP && CONFIG_NFILE_DESCRIPTORS */
diff --git a/netutils/webserver/httpd.c b/netutils/webserver/httpd.c
index 900cc3bea8..c37958c3d7 100644
--- a/netutils/webserver/httpd.c
+++ b/netutils/webserver/httpd.c
@@ -115,42 +115,16 @@ static const char g_httpheader404[] =
****************************************************************************/
#ifdef CONFIG_NETUTILS_HTTPD_DUMPBUFFER
-static void httpd_dumpbuffer(const char *buffer, ssize_t nbytes)
+static void httpd_dumpbuffer(FAR const char *msg, FAR const char *buffer, unsigned int nbytes)
{
-#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_VERBOSE) && defined(CONFIG_DEBUG_NET)
- char line[128];
- int ch;
- int i;
- int j;
-
- for (i = 0; i < nbytes; i += 16)
- {
- sprintf(line, "%04x: ", i);
- for ( j = 0; j < 16; j++)
- {
- if (i + j < nbytes)
- {
- sprintf(&line[strlen(line)], "%02x ", buffer[i+j] );
- }
- else
- {
- strcpy(&line[strlen(line)], " ");
- }
- }
- for ( j = 0; j < 16; j++)
- {
- if (i + j < nbytes)
- {
- ch = buffer[i+j];
- sprintf(&line[strlen(line)], "%c", ch >= 0x20 && ch <= 0x7e ? ch : '.');
- }
- }
- nvdbg("%s\n", line);
- }
-#endif
+ /* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_NET have to be
+ * defined or the following does nothing.
+ */
+
+ nvdbgdumpbuffer(msg, (FAR const ubyte*)buffer, nbytes);
}
#else
-# define httpd_dumpbuffer(buffer,nbytes)
+# define httpd_dumpbuffer(msg,buffer,nbytes)
#endif
#ifdef CONFIG_NETUTILS_HTTPD_DUMPPSTATE
@@ -280,7 +254,7 @@ static int httpd_addchunk(struct httpd_state *pstate, const char *buffer, int le
{
/* The buffer is full.. Send what we have and reset to send again */
- httpd_dumpbuffer(pstate->ht_buffer, newlen);
+ httpd_dumpbuffer("Outgoing buffer", pstate->ht_buffer, newlen);
ret = send(pstate->ht_sockfd, pstate->ht_buffer, newlen, 0);
if (ret < 0)
{
@@ -382,7 +356,7 @@ static int httpd_sendfile(struct httpd_state *pstate)
if (ret == OK && pstate->ht_sndlen > 0)
{
- httpd_dumpbuffer(pstate->ht_buffer, pstate->ht_sndlen);
+ httpd_dumpbuffer("Outgoing buffer", pstate->ht_buffer, pstate->ht_sndlen);
if (send(pstate->ht_sockfd, pstate->ht_buffer, pstate->ht_sndlen, 0) < 0)
{
ret = ERROR;
@@ -405,7 +379,7 @@ static inline int httpd_cmd(struct httpd_state *pstate)
ndbg("[%d] recv failed: %d\n", pstate->ht_sockfd, errno);
return ERROR;
}
- httpd_dumpbuffer(pstate->ht_buffer, recvlen);
+ httpd_dumpbuffer("Incoming buffer", pstate->ht_buffer, recvlen);
/* We will handle only GET */
diff --git a/sched/mq_timedreceive.c b/sched/mq_timedreceive.c
index a6cf003389..fd8f0edd80 100644
--- a/sched/mq_timedreceive.c
+++ b/sched/mq_timedreceive.c
@@ -114,7 +114,7 @@ static void mq_rcvtimeout(int argc, uint32 pid)
wtcb->pterrno = ETIMEDOUT;
- /* Restart the the task. */
+ /* Restart the task. */
up_unblock_task(wtcb);
}
diff --git a/sched/mq_timedsend.c b/sched/mq_timedsend.c
index 4cd508d3b6..b50cdcef3d 100644
--- a/sched/mq_timedsend.c
+++ b/sched/mq_timedsend.c
@@ -115,7 +115,7 @@ static void mq_sndtimeout(int argc, uint32 pid)
wtcb->pterrno = ETIMEDOUT;
- /* Restart the the task. */
+ /* Restart the task. */
up_unblock_task(wtcb);
}
diff --git a/sched/mq_waitirq.c b/sched/mq_waitirq.c
index 75ecbb08f3..417aa84bf5 100644
--- a/sched/mq_waitirq.c
+++ b/sched/mq_waitirq.c
@@ -113,7 +113,7 @@ void mq_waitirq(FAR _TCB *wtcb)
wtcb->pterrno = EINTR;
- /* Restart the the task. */
+ /* Restart the task. */
up_unblock_task(wtcb);
}
diff --git a/sched/pthread_keycreate.c b/sched/pthread_keycreate.c
index c11ccafe11..402d0e6900 100644
--- a/sched/pthread_keycreate.c
+++ b/sched/pthread_keycreate.c
@@ -81,7 +81,7 @@
* thread.
*
* Upon key creation, the value NULL will be associated with
- * the the new key in all active threads. Upon thread
+ * the new key in all active threads. Upon thread
* creation, the value NULL will be associated with all
* defined keys in the new thread.
*
diff --git a/sched/sem_holder.c b/sched/sem_holder.c
index 825f04b02c..66ee2592af 100644
--- a/sched/sem_holder.c
+++ b/sched/sem_holder.c
@@ -114,7 +114,7 @@ static inline FAR struct semholder_s *sem_allocholder(sem_t *sem)
pholder->flink = sem->hlist.flink;
sem->hlist.flink = pholder;
- /* Make sure the the initial count is zero */
+ /* Make sure the initial count is zero */
pholder->counts = 0;
}
diff --git a/sched/sem_waitirq.c b/sched/sem_waitirq.c
index 3aded997d3..e5572acb17 100644
--- a/sched/sem_waitirq.c
+++ b/sched/sem_waitirq.c
@@ -117,7 +117,7 @@ void sem_waitirq(FAR _TCB *wtcb)
wtcb->pterrno = EINTR;
- /* Restart the the task. */
+ /* Restart the task. */
up_unblock_task(wtcb);
}
diff --git a/sched/wd_gettime.c b/sched/wd_gettime.c
index 77d71eb5ce..40322e00a4 100644
--- a/sched/wd_gettime.c
+++ b/sched/wd_gettime.c
@@ -70,7 +70,7 @@
* Function: wd_gettime
*
* Description:
- * This function returns the time remaining before the the specified watchdog
+ * This function returns the time remaining before the specified watchdog
* expires.
*
* Parameters:
|