Eliminate obsolete coding convention comments
Gets rid of single-line comments required by a previous set of
coding conventions. These comments provide no value to readers
and just clutter things up.
Change-Id: I2a08b12cf5026253de56979efdfc510e7e68defe
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
diff --git a/arch/arc/bsp/fatal_error.c b/arch/arc/bsp/fatal_error.c
index 44ccc17..f88d9cf 100644
--- a/arch/arc/bsp/fatal_error.c
+++ b/arch/arc/bsp/fatal_error.c
@@ -35,8 +35,6 @@
This module provides the _SysFatalErrorHandler() routine for ARCv2 BSPs.
*/
-/* includes */
-
#include <cputype.h>
#include <nanokernel.h>
#include <arch/cpu.h>
diff --git a/arch/arm/bsp/sysFatalErrorHandler.c b/arch/arm/bsp/sysFatalErrorHandler.c
index 8a6b3da..4a255dd 100644
--- a/arch/arm/bsp/sysFatalErrorHandler.c
+++ b/arch/arm/bsp/sysFatalErrorHandler.c
@@ -35,8 +35,6 @@
This module provides the _SysFatalErrorHandler() routine for Cortex-M BSPs.
*/
-/* includes */
-
#include <cputype.h>
#include <nanokernel.h>
#include <arch/cpu.h>
diff --git a/arch/arm/core/nanofatal.c b/arch/arm/core/nanofatal.c
index d254302..d6b7781 100644
--- a/arch/arm/core/nanofatal.c
+++ b/arch/arm/core/nanofatal.c
@@ -35,8 +35,6 @@
This module provides the _NanoFatalErrorHandler() routine for ARM Cortex-M.
*/
-/* includes */
-
#include <toolchain.h>
#include <sections.h>
@@ -52,8 +50,6 @@
#define PR_EXC(...)
#endif /* CONFIG_PRINTK */
-/* globals */
-
/*
* Define a default ESF for use with _NanoFatalErrorHandler() in the event
* the caller does not have a NANO_ESF to pass
diff --git a/arch/arm/timer/systick.c b/arch/arm/timer/systick.c
index 83f18d4..d4b6a10 100644
--- a/arch/arm/timer/systick.c
+++ b/arch/arm/timer/systick.c
@@ -82,8 +82,6 @@
#include <board.h>
-/* defines */
-
/*
* When GDB_INFO is enabled, the handler installed in the vector table
* (__systick), can be found in systick_gdb.s. In this case, the handler
@@ -103,8 +101,6 @@
#define IDLE_TICKLESS 1 /* tickless idle mode */
#endif /* CONFIG_TICKLESS_IDLE */
-/* globals */
-
#ifdef CONFIG_INT_LATENCY_BENCHMARK
extern uint32_t _hw_irq_to_c_handler_latency;
#endif
@@ -119,8 +115,6 @@
extern int32_t _sys_idle_elapsed_ticks;
#endif /* CONFIG_TICKLESS_IDLE */
-/* locals */
-
#ifdef CONFIG_TICKLESS_IDLE
static uint32_t __noinit default_load_value; /* default count */
static uint32_t idle_original_count = 0;
diff --git a/arch/x86/bsp/sysFatalErrorHandler.c b/arch/x86/bsp/sysFatalErrorHandler.c
index 6f0a344..f8f1cad 100644
--- a/arch/x86/bsp/sysFatalErrorHandler.c
+++ b/arch/x86/bsp/sysFatalErrorHandler.c
@@ -36,8 +36,6 @@
supported BSPs.
*/
-/* includes */
-
#include <cputype.h>
#include <nanokernel.h>
#include <arch/cpu.h>
diff --git a/arch/x86/core/excconnect.c b/arch/x86/core/excconnect.c
index b416a95..1b8410c 100644
--- a/arch/x86/core/excconnect.c
+++ b/arch/x86/core/excconnect.c
@@ -81,8 +81,6 @@
#include <nanok.h>
-/* forward declarations */
-
void _NanoCpuExcConnectAtDpl(unsigned int vector,
void (*routine)(NANO_ESF * pEsf),
NANO_EXC_STUB pExcStubMem,
diff --git a/arch/x86/core/gdt.c b/arch/x86/core/gdt.c
index 4d2d8f6..68ba174 100644
--- a/arch/x86/core/gdt.c
+++ b/arch/x86/core/gdt.c
@@ -36,8 +36,6 @@
for the IA-32 architecture.
*/
-/* includes */
-
#include <linker-defs.h>
#include <toolchain.h>
#include <sections.h>
@@ -46,8 +44,6 @@
#include <arch/cpu.h>
#include <gdt.h>
-/* defines */
-
#if (CONFIG_NUM_GDT_SPARE_ENTRIES < 0)
#error "**** CONFIG_NUM_GDT_SPARE_ENTRIES must be at least 0\n\n"
#endif
@@ -57,8 +53,6 @@
#define MAX_GDT_ENTRIES \
(NUM_BASE_GDT_ENTRIES + CONFIG_NUM_GDT_SPARE_ENTRIES)
-/* locals */
-
/*
* The RAM based global descriptor table. It is aligned on an 8 byte boundary
* as the Intel manuals recommend this for best performance.
@@ -91,8 +85,6 @@
},
};
-/* globals */
-
tGdtHeader _gdt = {
sizeof(tGdtDesc[MAX_GDT_ENTRIES - CONFIG_NUM_GDT_SPARE_ENTRIES]) -
1,
diff --git a/arch/x86/core/nanoatomic_nolock.c b/arch/x86/core/nanoatomic_nolock.c
index 32b50ba..8b3b3b0 100644
--- a/arch/x86/core/nanoatomic_nolock.c
+++ b/arch/x86/core/nanoatomic_nolock.c
@@ -45,8 +45,6 @@
as there is no requirement for this capability.
*/
-/* includes */
-
#if defined(CONFIG_LOCK_INSTRUCTION_UNSUPPORTED)
#include <nanokernel.h>
diff --git a/arch/x86/core/nanocontext.c b/arch/x86/core/nanocontext.c
index 01c61a4..7859acf 100644
--- a/arch/x86/core/nanocontext.c
+++ b/arch/x86/core/nanocontext.c
@@ -36,8 +36,6 @@
processor architecture.
*/
-/* includes */
-
#ifdef CONFIG_MICROKERNEL
#include <microkernel.h>
#include <kernel_struct.h>
diff --git a/arch/x86/core/nanofatal.c b/arch/x86/core/nanofatal.c
index 2ec372c..26c1f16 100644
--- a/arch/x86/core/nanofatal.c
+++ b/arch/x86/core/nanofatal.c
@@ -35,7 +35,6 @@
This module provides the _NanoFatalErrorHandler() routine.
*/
-/* includes */
#include <toolchain.h>
#include <sections.h>
@@ -46,8 +45,6 @@
#include <misc/printk.h>
-/* globals */
-
/*
* Define a default ESF for use with _NanoFatalErrorHandler() in the event
* the caller does not have a NANO_ESF to pass
diff --git a/arch/x86/include/gdt.h b/arch/x86/include/gdt.h
index abf2e76..c8081b4 100644
--- a/arch/x86/include/gdt.h
+++ b/arch/x86/include/gdt.h
@@ -39,8 +39,6 @@
#ifndef _GDT_H
#define _GDT_H
-/* includes */
-
#include <arch/x86/arch.h>
#ifndef _ASMLANGUAGE
@@ -48,8 +46,6 @@
#include <stdint.h>
#include <toolchain.h>
-/* typedefs */
-
/* a generic GDT entry structure definition */
typedef struct s_gdtDesc {
diff --git a/arch/x86/include/nanok.h b/arch/x86/include/nanok.h
index 20cdbe2..978f012 100644
--- a/arch/x86/include/nanok.h
+++ b/arch/x86/include/nanok.h
@@ -47,8 +47,6 @@
#ifndef _NANOK_H
#define _NANOK_H
-/* includes */
-
#include <toolchain.h>
#include <sections.h>
#include <asm_inline.h>
diff --git a/arch/x86/interrupt_controller/ioApicIntr.c b/arch/x86/interrupt_controller/ioApicIntr.c
index 1c2052c..035ac97 100644
--- a/arch/x86/interrupt_controller/ioApicIntr.c
+++ b/arch/x86/interrupt_controller/ioApicIntr.c
@@ -75,8 +75,6 @@
SEE ALSO: loApicIntr.c
*/
-/* includes */
-
#include <nanokernel.h>
#include <arch/cpu.h>
@@ -88,8 +86,6 @@
#include <drivers/ioapic.h> /* public API declarations */
#include <drivers/loapic.h> /* public API declarations and registers */
-/* defines */
-
/* IO APIC direct register offsets */
#define IOAPIC_IND 0x00 /* Index Register */
@@ -196,8 +192,6 @@
#endif /* IOAPIC_MSI_REDIRECT */
-/* forward declarations */
-
#ifndef XIOAPIC_DIRECT_ADDRESSING
static uint32_t __IoApicGet(int32_t offset);
static void __IoApicSet(int32_t offset, uint32_t value);
diff --git a/arch/x86/interrupt_controller/loApicIntr.c b/arch/x86/interrupt_controller/loApicIntr.c
index c80d60a..a6fc4e9 100644
--- a/arch/x86/interrupt_controller/loApicIntr.c
+++ b/arch/x86/interrupt_controller/loApicIntr.c
@@ -103,8 +103,6 @@
INCLUDE FILES: loapic.h
*/
-/* includes */
-
#include <nanokernel.h>
#include <arch/cpu.h>
#include <stdint.h>
@@ -114,8 +112,6 @@
#include <sections.h>
#include <drivers/loapic.h> /* public API declarations */
-/* defines */
-
/* IA32_APIC_BASE MSR Bits */
#define LOAPIC_BASE_MASK 0xfffff000 /* LO APIC Base Addr mask */
diff --git a/arch/x86/timer/hpet.c b/arch/x86/timer/hpet.c
index 99756f3..1dbab85 100644
--- a/arch/x86/timer/hpet.c
+++ b/arch/x86/timer/hpet.c
@@ -96,8 +96,6 @@
#include <board.h>
-/* defines */
-
/* HPET register offsets */
#define GENERAL_CAPS_REG 0 /* 64-bit register */
@@ -196,7 +194,6 @@
#define HPET_COMP_DELAY 192
-/* locals */
#ifdef CONFIG_DYNAMIC_INT_STUBS
static NANO_CPU_INT_STUB_DECL(_hpetIntStub); /* interrupt stub memory */
#else /* !CONFIG_DYNAMIC_INT_STUBS */
diff --git a/arch/x86/timer/loApicTimer.c b/arch/x86/timer/loApicTimer.c
index 5d18d7e..6a10415 100644
--- a/arch/x86/timer/loApicTimer.c
+++ b/arch/x86/timer/loApicTimer.c
@@ -43,8 +43,6 @@
After reset, the timer is initialized to zero.
*/
-/* includes */
-
#include <nanokernel.h>
#include <arch/cpu.h>
#include <toolchain.h>
@@ -72,8 +70,6 @@
#include <board.h>
-/* defines */
-
/* Local APIC Timer Bits */
#define LOAPIC_TIMER_DIVBY_2 0x0 /* Divide by 2 */
@@ -112,13 +108,10 @@
do {/* nothing */ \
} while (0)
#endif /* !TIMER_SUPPORTS_TICKLESS */
-/* globals */
-
#if defined(TIMER_SUPPORTS_TICKLESS)
extern int32_t _sys_idle_elapsed_ticks;
#endif /* TIMER_SUPPORTS_TICKLESS */
-/* locals */
#ifdef CONFIG_DYNAMIC_INT_STUBS
static NANO_CPU_INT_STUB_DECL(
_loapic_timer_irq_stub); /* interrupt stub memory for */
diff --git a/doc/doxygen/irq_test_common_commented.h b/doc/doxygen/irq_test_common_commented.h
index 6ce853d..031ed45 100644
--- a/doc/doxygen/irq_test_common_commented.h
+++ b/doc/doxygen/irq_test_common_commented.h
@@ -39,7 +39,6 @@
#ifndef _IRQ_TEST_COMMON__H_
#define _IRQ_TEST_COMMON__H_
-/* defines */
#if defined(VXMICRO_ARCH_x86)
#define IRQ_PRIORITY 3
diff --git a/doc/doxygen/phil_fiber_commented.c b/doc/doxygen/phil_fiber_commented.c
index 841fc01..3cbe0af 100644
--- a/doc/doxygen/phil_fiber_commented.c
+++ b/doc/doxygen/phil_fiber_commented.c
@@ -32,8 +32,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* includes */
-
#ifdef CONFIG_NANOKERNEL
/* For the nanokernel. */
#include <nanokernel.h>
@@ -46,8 +44,6 @@
#include <nanokernel/cpu.h> //!< Used to be know as: irq_lock/irq_unlock
-/* defines */
-
#ifdef CONFIG_NANOKERNEL
/* For the nanokernel. */
#define FORK(x) &forks[x]
diff --git a/doc/doxygen/phil_task_commented.c b/doc/doxygen/phil_task_commented.c
index ed0562b..574b0d7 100644
--- a/doc/doxygen/phil_task_commented.c
+++ b/doc/doxygen/phil_task_commented.c
@@ -38,8 +38,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* includes */
-
#ifdef CONFIG_NANOKERNEL
#include <nanokernel.h>
#include "phil.h"
@@ -48,8 +46,6 @@
#include "phil.h"
#endif
-/* defines */
-
#define DEMO_DESCRIPTION \
"\x1b[2J\x1b[15;1H" \
"Demo Description\n" \
diff --git a/drivers/interrupt_controller/i8259.c b/drivers/interrupt_controller/i8259.c
index 2f9857a..d5f64bc 100644
--- a/drivers/interrupt_controller/i8259.c
+++ b/drivers/interrupt_controller/i8259.c
@@ -83,8 +83,6 @@
* specific and implemented in assembler
*/
-/* includes */
-
#include <nanokernel.h>
#include <arch/cpu.h>
#include <toolchain.h>
@@ -93,15 +91,11 @@
#include <drivers/pic.h>
#include <board.h>
-/* defines */
-
#define OCW3_DEF 0x08 /* 3rd default control word */
#define OCW3_PCB 0x04 /* Polling Control Bit */
#define OCW3_ISR 0x03 /* Read in-service reg */
#define OCW3_IRR 0x02 /* Read inter request reg */
-/* globals */
-
#ifndef CONFIG_SHUTOFF_PIC
unsigned int _i8259_spurious_interrupt_count =
0; /* track # of spurious interrupts */
diff --git a/drivers/pci/pci_config.c b/drivers/pci/pci_config.c
index 35b6a23..0f59bf18 100644
--- a/drivers/pci/pci_config.c
+++ b/drivers/pci/pci_config.c
@@ -37,8 +37,6 @@
*/
-/* includes */
-
#include <nanokernel.h>
#include <arch/cpu.h>
diff --git a/drivers/pci/pci_interface.c b/drivers/pci/pci_interface.c
index 3641bbd..0b2ee1f 100644
--- a/drivers/pci/pci_interface.c
+++ b/drivers/pci/pci_interface.c
@@ -37,8 +37,6 @@
*/
-/* includes */
-
#include <nanokernel.h>
#include <arch/cpu.h>
diff --git a/drivers/serial/k20UartDrv.c b/drivers/serial/k20UartDrv.c
index 47fb2dd..fddad46 100644
--- a/drivers/serial/k20UartDrv.c
+++ b/drivers/serial/k20UartDrv.c
@@ -40,8 +40,6 @@
INCLUDE FILES: drivers/serial/k20_uart.h
*/
-/* includes */
-
#include <nanokernel.h>
#include <arch/cpu.h>
#include <stdint.h>
@@ -53,16 +51,12 @@
#include <toolchain.h>
#include <sections.h>
-/* typedefs */
-
typedef struct {
uint8_t *base; /* base address of registers */
uint8_t irq; /* interrupt request level */
uint8_t intPri; /* interrupt priority */
} _k20Uart_t;
-/* locals */
-
UART_PORTS_CONFIGURE(_k20Uart_t, uart);
/*******************************************************************************
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 21da327..f772806 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -56,8 +56,6 @@
INCLUDE FILES: drivers/uart.h
*/
-/* includes */
-
#include <nanokernel.h>
#include <arch/cpu.h>
#include <stdint.h>
@@ -71,8 +69,6 @@
#include <pci/pci_mgr.h>
#endif /* CONFIG_PCI */
-/* defines */
-
/* register definitions */
#define REG_THR 0x00 /* Transmitter holding reg. */
@@ -228,8 +224,6 @@
} while (0)
#endif /* VXMICRO_ARCH_Intel */
-/* typedefs */
-
struct ns16550 {
uint32_t port; /* base port number or MM base address */
uint8_t irq; /* interrupt request level */
@@ -237,8 +231,6 @@
uint8_t iirCache; /* cache of IIR since it clears when read */
};
-/* locals */
-
#if !(defined(UART_PORTS_CONFIGURE)) && !(defined(CONFIG_PCI))
#error "CONFIG_PCI or UART_PORTS_CONFIGURE is needed"
diff --git a/drivers/timer/i8253.c b/drivers/timer/i8253.c
index b148b89..5f551b3 100644
--- a/drivers/timer/i8253.c
+++ b/drivers/timer/i8253.c
@@ -49,8 +49,6 @@
directly invoke the VIOAPIC APIs to configure/unmask the IRQ.
*/
-/* includes */
-
#include <nanokernel.h>
#include <arch/cpu.h>
#include <toolchain.h>
@@ -84,8 +82,6 @@
#include <board.h>
-/* defines */
-
#if defined(CONFIG_TICKLESS_IDLE)
#define TIMER_SUPPORTS_TICKLESS
#endif
@@ -115,14 +111,10 @@
#define PIT_CNT2(base) PIT_ADRS(base, 0x02) /* counter/channel 2 */
#define PIT_CMD(base) PIT_ADRS(base, 0x03) /* control word */
-/* globals */
-
#if defined(TIMER_SUPPORTS_TICKLESS)
extern int32_t _sys_idle_elapsed_ticks;
#endif
-/* locals */
-
/* interrupt stub memory for irq_connect() */
#ifndef CONFIG_DYNAMIC_INT_STUBS
diff --git a/include/microkernel/cmdPkt.h b/include/microkernel/cmdPkt.h
index 227067e..4b39077 100644
--- a/include/microkernel/cmdPkt.h
+++ b/include/microkernel/cmdPkt.h
@@ -37,8 +37,6 @@
extern "C" {
#endif
-/* includes */
-
#include <microkernel/k_types.h>
/* define size of command packet (without exposing its internal structure) */
@@ -72,8 +70,6 @@
#define CMD_PKT_SET(name) (*(struct cmd_pkt_set *)(name))
-/* typedefs */
-
typedef uint32_t cmdPkt_t[CMD_PKT_SIZE_IN_WORDS];
struct cmd_pkt_set {
diff --git a/include/microkernel/ticks.h b/include/microkernel/ticks.h
index 00409ba..a264103 100644
--- a/include/microkernel/ticks.h
+++ b/include/microkernel/ticks.h
@@ -33,8 +33,6 @@
#ifndef TICKS_H
#define TICKS_H
-/* includes */
-
#include <nanokernel.h>
#include <clock_vars.h>
diff --git a/include/misc/dlist.h b/include/misc/dlist.h
index 804f939..ecd2ff0 100644
--- a/include/misc/dlist.h
+++ b/include/misc/dlist.h
@@ -39,8 +39,6 @@
#ifndef _DLIST_H
#define _DLIST_H
-/* typedefs */
-
typedef struct dnode_s {
union {
struct dnode_s *head; /* ptr to head of list (dlist_t) */
diff --git a/kernel/microkernel/cmdPkt.c b/kernel/microkernel/cmdPkt.c
index 8a60e7f..247afc0 100644
--- a/kernel/microkernel/cmdPkt.c
+++ b/kernel/microkernel/cmdPkt.c
@@ -52,8 +52,6 @@
that have an ISR component should use their own command packet set.
*/
-/* includes */
-
#include <nanokernel.h>
#include <arch/cpu.h>
#include <microkernel/cmdPkt.h>
diff --git a/kernel/microkernel/k_mbox.c b/kernel/microkernel/k_mbox.c
index e3909de..aaec51c 100644
--- a/kernel/microkernel/k_mbox.c
+++ b/kernel/microkernel/k_mbox.c
@@ -30,8 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* includes */
-
#include <microkernel.h>
#include <string.h>
#include <toolchain.h>
diff --git a/kernel/microkernel/k_mutex.c b/kernel/microkernel/k_mutex.c
index 5710135..2c7c595 100644
--- a/kernel/microkernel/k_mutex.c
+++ b/kernel/microkernel/k_mutex.c
@@ -55,8 +55,6 @@
NOMANUAL
*/
-/* includes */
-
#include <microkernel.h>
#include <minik.h>
#include <nanok.h>
diff --git a/kernel/microkernel/k_sema.c b/kernel/microkernel/k_sema.c
index 0a230cf..dc92800 100644
--- a/kernel/microkernel/k_sema.c
+++ b/kernel/microkernel/k_sema.c
@@ -30,8 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* includes */
-
#include <microkernel.h>
#include <toolchain.h>
#include <sections.h>
diff --git a/kernel/microkernel/movedata.c b/kernel/microkernel/movedata.c
index a0af9e0..40b0c86 100644
--- a/kernel/microkernel/movedata.c
+++ b/kernel/microkernel/movedata.c
@@ -30,8 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* includes */
-
#include <minik.h>
#include <string.h>
#include <toolchain.h>
diff --git a/kernel/nanokernel/compiler_stack_protect.c b/kernel/nanokernel/compiler_stack_protect.c
index c747637..56cc1ef 100644
--- a/kernel/nanokernel/compiler_stack_protect.c
+++ b/kernel/nanokernel/compiler_stack_protect.c
@@ -40,7 +40,6 @@
function __stack_chk_fail and global variable __stack_chk_guard.
*/
-/* includes */
#include <toolchain.h> /* compiler specific configurations */
#if defined(CONFIG_STACK_CANARIES)
diff --git a/kernel/nanokernel/int_latency_bench.c b/kernel/nanokernel/int_latency_bench.c
index 8f2693c..0023e47 100644
--- a/kernel/nanokernel/int_latency_bench.c
+++ b/kernel/nanokernel/int_latency_bench.c
@@ -30,8 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* includes */
-
#ifdef CONFIG_INT_LATENCY_BENCHMARK
#include "toolchain.h"
@@ -42,12 +40,8 @@
#include <clock_vars.h>
#include <drivers/system_timer.h>
-/* defines */
-
#define NB_CACHE_WARMING_DRY_RUN 7
-/* locals */
-
/*
* Timestamp corresponding to when interrupt were turned off.
* A value of zero indicated interrupt are not currently locked.
@@ -69,8 +63,6 @@
/* indicate if the interrupt latency benchamrk is ready to be used */
static uint32_t int_latency_bench_ready = 0;
-/* globals */
-
/* min amount of time it takes from HW interrupt generation to 'C' handler */
uint32_t _hw_irq_to_c_handler_latency = ULONG_MAX;
diff --git a/kernel/nanokernel/nanometrics.c b/kernel/nanokernel/nanometrics.c
index a80c3c7..112ec48 100644
--- a/kernel/nanokernel/nanometrics.c
+++ b/kernel/nanokernel/nanometrics.c
@@ -30,8 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* includes */
-
#include <nanok.h>
#include <toolchain.h>
#include <sections.h>
diff --git a/kernel/nanokernel/version.c b/kernel/nanokernel/version.c
index 92b5ba6..bdf9e4c 100644
--- a/kernel/nanokernel/version.c
+++ b/kernel/nanokernel/version.c
@@ -30,13 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* includes */
-
#include <cputype.h>
#include "version.h" /* generated by MAKE, at compile time */
-/* locals */
-
static uint32_t kernel_version = KERNELVERSION;
/*******************************************************************************
diff --git a/misc/dlist.c b/misc/dlist.c
index a0c0008..650f977 100644
--- a/misc/dlist.c
+++ b/misc/dlist.c
@@ -40,8 +40,6 @@
\NOMANUAL
*/
-/* includes */
-
#include <stddef.h>
#include <misc/dlist.h>
diff --git a/samples/include/irq_test_common.h b/samples/include/irq_test_common.h
index a2805c0..a642f05 100644
--- a/samples/include/irq_test_common.h
+++ b/samples/include/irq_test_common.h
@@ -39,8 +39,6 @@
#ifndef _IRQ_TEST_COMMON__H_
#define _IRQ_TEST_COMMON__H_
-/* defines */
-
#if defined(VXMICRO_ARCH_x86)
#define IRQ_PRIORITY 3
#elif defined(VXMICRO_ARCH_arm)
diff --git a/samples/include/tc_util.h b/samples/include/tc_util.h
index 4153708..6b92cf5 100644
--- a/samples/include/tc_util.h
+++ b/samples/include/tc_util.h
@@ -33,8 +33,6 @@
#ifndef __TC_UTIL_H__
#define __TC_UTIL_H__
-/* includes */
-
#if defined(CONFIG_NANOKERNEL)
#include <nanokernel.h>
#else
@@ -44,8 +42,6 @@
#include <misc/printk.h>
#include <string.h>
-/* defines */
-
#define PRINT_DATA(fmt, ...) printk(fmt, ##__VA_ARGS__)
#define PRINT_LINE \
diff --git a/samples/microkernel/apps/philosophers/src/phil.h b/samples/microkernel/apps/philosophers/src/phil.h
index f5d6497..143457c 100644
--- a/samples/microkernel/apps/philosophers/src/phil.h
+++ b/samples/microkernel/apps/philosophers/src/phil.h
@@ -29,16 +29,12 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* includes */
-
#if defined(CONFIG_STDOUT_CONSOLE)
#include <stdio.h>
#else
#include <misc/printk.h>
#endif
-/* defines */
-
#define N_PHILOSOPHERS 6
/*
* There are multiple tasks doing printfs and they may conflict.
diff --git a/samples/microkernel/apps/philosophers/src/phil_fiber.c b/samples/microkernel/apps/philosophers/src/phil_fiber.c
index 895cd53..5c4c72d 100644
--- a/samples/microkernel/apps/philosophers/src/phil_fiber.c
+++ b/samples/microkernel/apps/philosophers/src/phil_fiber.c
@@ -29,8 +29,6 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* includes */
-
#ifdef CONFIG_NANOKERNEL
#include <nanokernel.h>
#include "phil.h"
@@ -41,8 +39,6 @@
#include <arch/cpu.h> /* irq_lock/irq_unlock */
-/* defines */
-
#ifdef CONFIG_NANOKERNEL
#define FORK(x) &forks[x]
#define TAKE(x) nano_fiber_sem_take_wait(x)
@@ -62,8 +58,6 @@
extern struct nano_sem forks[N_PHILOSOPHERS];
#else /* ! CONFIG_NANOKERNEL */
-/* globals */
-
kmutex_t forks[] = {forkMutex0, forkMutex1, forkMutex2, forkMutex3, forkMutex4, forkMutex5};
#endif /* CONFIG_NANOKERNEL */
diff --git a/samples/microkernel/apps/philosophers/src/phil_task.c b/samples/microkernel/apps/philosophers/src/phil_task.c
index cb9a069..fb0992c 100644
--- a/samples/microkernel/apps/philosophers/src/phil_task.c
+++ b/samples/microkernel/apps/philosophers/src/phil_task.c
@@ -30,8 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* includes */
-
#ifdef CONFIG_NANOKERNEL
#include <nanokernel.h>
#include <arch/cpu.h>
@@ -41,8 +39,6 @@
#include "phil.h"
#endif
-/* defines */
-
#define DEMO_DESCRIPTION \
"\x1b[2J\x1b[15;1H" \
"Demo Description\n" \
@@ -60,8 +56,6 @@
extern void philEntry(void);
-/* globals */
-
char __stack philStack[N_PHILOSOPHERS][STSIZE];
struct nano_sem forks[N_PHILOSOPHERS];
#endif /* CONFIG_NANOKERNEL */
diff --git a/samples/microkernel/benchmark/boot_time/src/boot_time.c b/samples/microkernel/benchmark/boot_time/src/boot_time.c
index 1bab4bf..a3d2d1a 100644
--- a/samples/microkernel/benchmark/boot_time/src/boot_time.c
+++ b/samples/microkernel/benchmark/boot_time/src/boot_time.c
@@ -39,8 +39,6 @@
- from _start to idle (for microkernel)
*/
-/* includes */
-
#ifdef CONFIG_NANOKERNEL
#include <nanokernel.h>
#else
diff --git a/samples/microkernel/benchmark/footprint/src/microkernel_footprint.c b/samples/microkernel/benchmark/footprint/src/microkernel_footprint.c
index 46a3650..1b65510 100644
--- a/samples/microkernel/benchmark/footprint/src/microkernel_footprint.c
+++ b/samples/microkernel/benchmark/footprint/src/microkernel_footprint.c
@@ -30,8 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* includes */
-
#include <microkernel.h>
#include <toolchain.h>
@@ -41,8 +39,6 @@
#else
-/* includes */
-
#include <arch/cpu.h>
#include <misc/printk.h>
#include <stdio.h>
@@ -55,8 +51,6 @@
#endif /* __GNUC__ */
#endif /* TEST_reg */
-/* defines */
-
#define IRQ_PRIORITY 3
#define TEST_SOFT_INT 64
@@ -66,8 +60,6 @@
#define MESSAGE "Running regular microkernel configuration\n"
#endif /* TEST_max */
-/* typedefs */
-
typedef void* (*pfunc) (void*);
/* variables */
diff --git a/samples/microkernel/test/test_critical/src/critical.c b/samples/microkernel/test/test_critical/src/critical.c
index 967da78..0d99e9a 100644
--- a/samples/microkernel/test/test_critical/src/critical.c
+++ b/samples/microkernel/test/test_critical/src/critical.c
@@ -35,19 +35,13 @@
This module tests the task_offload_to_fiber() API.
*/
-/* includes */
-
#include <vxmicro.h>
#include <tc_util.h>
#include <sections.h>
-/* defines */
-
#define NUM_TICKS 500
#define TEST_TIMEOUT 2000
-/* locals */
-
static uint32_t criticalVar = 0;
static uint32_t altTaskIterations = 0;
diff --git a/samples/microkernel/test/test_events/src/events.c b/samples/microkernel/test/test_events/src/events.c
index 040f203..29802c4 100644
--- a/samples/microkernel/test/test_events/src/events.c
+++ b/samples/microkernel/test/test_events/src/events.c
@@ -38,8 +38,6 @@
*/
-/* includes */
-
#include <tc_util.h>
#include <vxmicro.h>
#include <arch/cpu.h>
@@ -51,14 +49,10 @@
#include <irq_test_common.h>
#include <util_test_common.h>
-/* typedefs */
-
typedef struct {
kevent_t event;
} ISR_INFO;
-/* locals */
-
static int evidence = 0;
static ISR_INFO isrInfo;
diff --git a/samples/microkernel/test/test_events/src/test_fiber.c b/samples/microkernel/test/test_events/src/test_fiber.c
index 49b3ac9..10df2b4 100644
--- a/samples/microkernel/test/test_events/src/test_fiber.c
+++ b/samples/microkernel/test/test_events/src/test_fiber.c
@@ -36,12 +36,10 @@
event signaling
*/
-/* includes */
#include <nanokernel.h>
#include <arch/cpu.h>
#include <vxmicro.h>
-/* defines */
#define N_TESTS 10 /* number of tests to run */
#define FIBER_PRIORITY 6
#define FIBER_STACK_SIZE 1024
@@ -49,8 +47,6 @@
/* exports */
struct nano_sem fiberSem; /* semaphore that allows test control the fiber */
-/* locals */
-
static char __stack fiberStack[FIBER_STACK_SIZE]; /* test fiber stack size */
/*******************************************************************************
diff --git a/samples/microkernel/test/test_fifo/src/fifo.c b/samples/microkernel/test/test_fifo/src/fifo.c
index 8c5d42b..6e952fb 100644
--- a/samples/microkernel/test/test_fifo/src/fifo.c
+++ b/samples/microkernel/test/test_fifo/src/fifo.c
@@ -45,14 +45,10 @@
- Verify the return codes are correct for the APIs
*/
-/* includes */
-
#include <tc_util.h>
#include <stdbool.h>
#include <vxmicro.h>
-/* defines */
-
#define MULTIPLIER 100 /* Used to initialize myData */
#define NUM_OF_ELEMENT 5 /* Number of elements in myData array */
#define DEPTH_OF_FIFO_QUEUE 2 /*
@@ -63,8 +59,6 @@
#define SPECIAL_DATA 999 /* Special number to put in queue */
-/* locals */
-
static int myData[NUM_OF_ELEMENT];
static int tcRC = TC_PASS; /* test case return code */
diff --git a/samples/microkernel/test/test_libs/src/libraries.c b/samples/microkernel/test/test_libs/src/libraries.c
index f83a341..6edb996 100644
--- a/samples/microkernel/test/test_libs/src/libraries.c
+++ b/samples/microkernel/test/test_libs/src/libraries.c
@@ -41,8 +41,6 @@
it guarantee that ALL functionality provided is working correctly.
*/
-/* includes */
-
#include <microkernel.h>
#include <tc_util.h>
diff --git a/samples/microkernel/test/test_libs/src/main.c b/samples/microkernel/test/test_libs/src/main.c
index 5b32fdf..3a977b5 100644
--- a/samples/microkernel/test/test_libs/src/main.c
+++ b/samples/microkernel/test/test_libs/src/main.c
@@ -44,22 +44,16 @@
in the future to enhance test coverage.
*/
-/* includes */
-
#include <tc_util.h>
#include <vxmicro.h>
#include <util_test_common.h>
-/* defines */
-
#define NUM_TEST_TASKS 1 /* # of test tasks to monitor */
/* # ticks to wait for test completion */
#define TIMEOUT (60 * sys_clock_ticks_per_sec)
-/* locals */
-
/*
* Note that semaphore group entries are arranged so that resultSems[TC_PASS]
* refers to SEM_TASKDONE and resultSems[TC_FAIL] refers to SEM_TASKFAIL.
@@ -67,9 +61,6 @@
static ksem_t resultSems[] = { SEM_TASKDONE, SEM_TASKFAIL, ENDLIST };
-/* globals */
-
-
/*******************************************************************************
*
* RegressionTaskEntry - entry point for RegressionTask
diff --git a/samples/microkernel/test/test_mail/src/mail.c b/samples/microkernel/test/test_mail/src/mail.c
index 3de36a6..b7700c0 100644
--- a/samples/microkernel/test/test_mail/src/mail.c
+++ b/samples/microkernel/test/test_mail/src/mail.c
@@ -58,28 +58,20 @@
to ensure higher priority tasks get preference.
*/
-/* includes */
-
#include <microkernel.h>
#include <tc_util.h>
-/* defines */
-
#define MSGSIZE 16 /* Standard message data size */
#define XFER_PRIO 5 /* standard message transfer priority */
#define MSG_INFO1 1234 /* Message info test value */
#define MSG_INFO2 666 /* Message info test value */
-/* locals */
-
static char myData1[MSGSIZE] = "This is myData1";
static char myData2[MSGSIZE] = "This is myData2";
static char myData3[MSGSIZE] = "This is myData3";
static char myData4[MSGSIZE] = "This is myData4";
-/* globals */
-
extern ktask_t msgSenderTask;
extern ktask_t msgRcvrTask;
diff --git a/samples/microkernel/test/test_mail/src/main.c b/samples/microkernel/test/test_mail/src/main.c
index b3e1ce9..034b8d5 100644
--- a/samples/microkernel/test/test_mail/src/main.c
+++ b/samples/microkernel/test/test_mail/src/main.c
@@ -42,20 +42,14 @@
then announces the result of the test.
*/
-/* includes */
-
#include <tc_util.h>
#include <vxmicro.h>
-/* defines */
-
#define NUM_TEST_TASKS 2 /* # of test tasks to monitor */
/* # ticks to wait for test completion */
#define TIMEOUT (60 * sys_clock_ticks_per_sec)
-/* locals */
-
/*
* Note that semaphore group entries are arranged so that resultSems[TC_PASS]
* refers to SEM_TASKDONE and resultSems[TC_FAIL] refers to SEM_TASKFAIL.
@@ -63,8 +57,6 @@
static ksem_t resultSems[] = { SEM_TASKDONE, SEM_TASKFAIL, ENDLIST };
-/* globals */
-
ktask_t msgSenderTask = MSGSENDERTASK;
ktask_t msgRcvrTask = MSGRCVRTASK;
diff --git a/samples/microkernel/test/test_map/src/map.c b/samples/microkernel/test/test_map/src/map.c
index d0692d8..7a06342 100644
--- a/samples/microkernel/test/test_map/src/map.c
+++ b/samples/microkernel/test/test_map/src/map.c
@@ -44,14 +44,10 @@
unpredictable side effects.
*/
-/* includes */
-
#include <tc_util.h>
#include <stdbool.h>
#include <vxmicro.h>
-/* defines */
-
#define NUMBLOCKS 2 /*
* Number of memory blocks. This number
* has to be aligned with the number in VPF file
@@ -59,12 +55,8 @@
* test is 2
*/
-/* locals */
-
static int tcRC = TC_PASS; /* test case return code */
-/* forward declarations */
-
int testMapGetAllBlocks(void **P);
int testMapFreeAllBlocks(void **P);
diff --git a/samples/microkernel/test/test_mutex/src/mutex.c b/samples/microkernel/test/test_mutex/src/mutex.c
index dea0ca3..1122096 100644
--- a/samples/microkernel/test/test_mutex/src/mutex.c
+++ b/samples/microkernel/test/test_mutex/src/mutex.c
@@ -65,20 +65,14 @@
: RegressionTask (@ priority 40) sleeps
*/
-/* includes */
-
#include <tc_util.h>
#include <vxmicro.h>
-/* defines */
-
#define ONE_SECOND (sys_clock_ticks_per_sec)
#define HALF_SECOND (sys_clock_ticks_per_sec / 2)
#define THIRD_SECOND (sys_clock_ticks_per_sec / 3)
#define FOURTH_SECOND (sys_clock_ticks_per_sec / 4)
-/* locals */
-
static int tcRC = TC_PASS; /* test case return code */
/*******************************************************************************
diff --git a/samples/microkernel/test/test_pipe/src/main.c b/samples/microkernel/test/test_pipe/src/main.c
index ce37a2c..4d2e6e9 100644
--- a/samples/microkernel/test/test_pipe/src/main.c
+++ b/samples/microkernel/test/test_pipe/src/main.c
@@ -42,20 +42,14 @@
then announces the result of the test.
*/
-/* includes */
-
#include <vxmicro.h>
#include <tc_util.h>
-/* defines */
-
#define NUM_TEST_TASKS 2 /* # of test tasks to monitor */
/* # ticks to wait for test completion */
#define TIMEOUT (60 * sys_clock_ticks_per_sec)
-/* locals */
-
/*
* Note that semaphore group entries are arranged so that resultSems[TC_PASS]
* refers to SEM_TASKDONE and resultSems[TC_FAIL] refers to SEM_TASKFAIL.
@@ -63,8 +57,6 @@
static ksem_t resultSems[] = { SEM_TASKDONE, SEM_TASKFAIL, ENDLIST };
-/* globals */
-
ksem_t regSem = REGRESSION_SEM;
ksem_t altSem = ALTERNATE_SEM;
ksem_t counterSem = COUNTER_SEM;
diff --git a/samples/microkernel/test/test_pipe/src/pipe.c b/samples/microkernel/test/test_pipe/src/pipe.c
index ec239b3..7c72d83 100644
--- a/samples/microkernel/test/test_pipe/src/pipe.c
+++ b/samples/microkernel/test/test_pipe/src/pipe.c
@@ -41,24 +41,18 @@
task_pipe_put_async()
*/
-/* includes */
-
#include <nanokernel.h>
#include <arch/cpu.h>
#include <tc_util.h>
#include <vxmicro.h>
#include <misc/util.h>
-/* defines */
-
#define ONE_SECOND (sys_clock_ticks_per_sec)
#define IRQ_PRIORITY 3
#define PIPE_SIZE 256 /* This must match the value in the VPF file */
-/* typedefs */
-
typedef struct {
int size; /* number of bytes to send/receive */
K_PIPE_OPTION options; /* options for task_pipe_XXX() APIs */
@@ -66,9 +60,6 @@
int rcode; /* expected return code */
} SIZE_EXPECT;
-/* locals */
-
-
static char txBuffer[PIPE_SIZE + 32];
static char rxBuffer[PIPE_SIZE + 32];
@@ -159,8 +150,6 @@
{PIPE_SIZE + 1, _0_TO_N, 0, RC_FAIL}
};
-/* globals */
-
extern ksem_t regSem;
extern ksem_t altSem;
extern ksem_t counterSem;
diff --git a/samples/microkernel/test/test_pool/src/pool.c b/samples/microkernel/test/test_pool/src/pool.c
index 220a1d0..06bdabd 100644
--- a/samples/microkernel/test/test_pool/src/pool.c
+++ b/samples/microkernel/test/test_pool/src/pool.c
@@ -38,16 +38,12 @@
task_mem_pool_free()
*/
-/* includes */
-
#include <tc_util.h>
#include <nanokernel.h>
#include <arch/cpu.h>
#include <vxmicro.h>
#include <misc/util.h>
-/* defines */
-
#define ONE_SECOND (sys_clock_ticks_per_sec)
#define TENTH_SECOND (sys_clock_ticks_per_sec / 10)
@@ -55,8 +51,6 @@
#define DEFRAG_BLK_TEST 2222
-/* typedefs */
-
typedef struct {
struct k_block *block; /* pointer to block data */
kmemory_pool_t poolId; /* pool ID */
@@ -68,8 +62,6 @@
typedef int (*poolBlockGetFunc_t)(struct k_block *, kmemory_pool_t, int, int32_t);
typedef int (*poolMoveBlockFunc_t)(struct k_block *, kmemory_pool_t);
-/* locals */
-
static volatile int evidence = 0;
static struct k_block blockList[NUM_BLOCKS];
diff --git a/samples/microkernel/test/test_sema/src/main.c b/samples/microkernel/test/test_sema/src/main.c
index 215c4c2..8478294 100644
--- a/samples/microkernel/test/test_sema/src/main.c
+++ b/samples/microkernel/test/test_sema/src/main.c
@@ -42,8 +42,6 @@
then announces the result of the test.
*/
-/* includes */
-
#include <nanokernel.h>
#include <arch/cpu.h>
#include <vxmicro.h>
@@ -58,12 +56,8 @@
extern void testFiberInit(void);
extern struct nano_sem fiberSem; /* semaphore that allows test control the fiber */
-/* defines */
-
#define NUM_TEST_TASKS 4 /* # of test tasks to monitor */
-/* locals */
-
static ksem_t testIsrInfo;
static CMD_PKT_SET_INSTANCE(cmdPktSet, 2)
@@ -75,8 +69,6 @@
static ksem_t resultSems[] = { SEM_TASKDONE, SEM_TASKFAIL, ENDLIST };
-/* globals */
-
ksem_t simpleSem = SIMPLE_SEM;
ksem_t altSem = ALTTASK_SEM;
ksem_t hpSem = HIGH_PRI_SEM;
diff --git a/samples/microkernel/test/test_sema/src/sema.c b/samples/microkernel/test/test_sema/src/sema.c
index 4cf1433b..c597c47 100644
--- a/samples/microkernel/test/test_sema/src/sema.c
+++ b/samples/microkernel/test/test_sema/src/sema.c
@@ -41,8 +41,6 @@
isr_sem_give(), fiber_sem_give()
*/
-/* includes */
-
#include <nanokernel.h>
#include <arch/cpu.h>
#include <vxmicro.h>
@@ -53,7 +51,6 @@
extern void trigger_isrSemaSignal(ksem_t semaphore);
extern void releaseTestFiber(void);
-/* defines */
#define N_TESTS 10 /* number of tests to run */
#define OBJ_TIMEOUT SECONDS(1)
diff --git a/samples/microkernel/test/test_sema/src/test_fiber.c b/samples/microkernel/test/test_sema/src/test_fiber.c
index 7f45970..612408a 100644
--- a/samples/microkernel/test/test_sema/src/test_fiber.c
+++ b/samples/microkernel/test/test_sema/src/test_fiber.c
@@ -36,12 +36,10 @@
semaphore signaling
*/
-/* includes */
#include <nanokernel.h>
#include <arch/cpu.h>
#include <vxmicro.h>
-/* defines */
#define N_TESTS 10 /* number of tests to run */
#define FIBER_PRIORITY 6
#define FIBER_STACK_SIZE 1024
@@ -49,7 +47,6 @@
/* exports */
struct nano_sem fiberSem; /* semaphore that allows test control the fiber */
-/* locals */
extern ksem_t simpleSem;
extern ksem_t semList[];
diff --git a/samples/microkernel/test/test_sprintf/src/test_sprintf.c b/samples/microkernel/test/test_sprintf/src/test_sprintf.c
index 02805f3..42a19db 100644
--- a/samples/microkernel/test/test_sprintf/src/test_sprintf.c
+++ b/samples/microkernel/test/test_sprintf/src/test_sprintf.c
@@ -35,13 +35,9 @@
This module contains the code for testing sprintf() functionality.
*/
-/* includes */
-
#include <tc_util.h>
#include <stdio.h>
-/* defines */
-
#define DEADBEEF 0xdeadbeef
#define DEADBEEF_LHEX_ALT_STR "0xdeadbeef"
@@ -68,8 +64,6 @@
#define PRINTF_MAX_STRING_LENGTH 200
-/* typedefs */
-
typedef union {
double d;
struct {
diff --git a/samples/microkernel/test/test_stackprot/src/stackprot.c b/samples/microkernel/test/test_stackprot/src/stackprot.c
index cc49df0..d1c6bac 100644
--- a/samples/microkernel/test/test_stackprot/src/stackprot.c
+++ b/samples/microkernel/test/test_stackprot/src/stackprot.c
@@ -46,20 +46,15 @@
prints out a short string couple times.
*/
-/* includes */
#include <tc_util.h>
#ifdef CONFIG_MICROKERNEL
#include <vxmicro.h>
-/* locals */
-
#else
#include <arch/cpu.h>
-/* defines */
#define STACKSIZE 1024
-/* locals */
char __stack fiberStack[STACKSIZE];
#endif /* CONFIG_MICROKERNEL */
@@ -67,7 +62,6 @@
static int count = 0;
static int tcRC = TC_PASS;
-/* forward declarations */
void check_input(const char *name, const char *input);
/*******************************************************************************
diff --git a/samples/microkernel/test/test_static_idt/src/static_idt.c b/samples/microkernel/test/test_static_idt/src/static_idt.c
index 897c81f..8480e97 100644
--- a/samples/microkernel/test/test_static_idt/src/static_idt.c
+++ b/samples/microkernel/test/test_static_idt/src/static_idt.c
@@ -35,8 +35,6 @@
Ensures interrupt and exception stubs are installed correctly.
*/
-/* includes */
-
#include <tc_util.h>
#include <nanokernel.h>
@@ -52,8 +50,6 @@
#include <vxmicro.h>
#endif
-/* defines */
-
/* These vectors are somewhat arbitrary. We try and use unused vectors */
#define TEST_SOFT_INT 62
#define TEST_SPUR_INT 63
@@ -69,8 +65,6 @@
NANO_CPU_INT_REGISTER(nanoIntStub, TEST_SOFT_INT, 0);
-/* locals */
-
static volatile int excHandlerExecuted;
static volatile int intHandlerExecuted;
/* Assume the spurious interrupt handler will execute and abort the task/fiber */
diff --git a/samples/microkernel/test/test_task/src/task.c b/samples/microkernel/test/test_task/src/task.c
index 55a67cb..64032dd 100644
--- a/samples/microkernel/test/test_task/src/task.c
+++ b/samples/microkernel/test/test_task/src/task.c
@@ -38,8 +38,6 @@
task_sleep(), task_yield()
*/
-/* includes */
-
#include <tc_util.h>
#include <vxmicro.h>
#include <arch/cpu.h>
@@ -50,8 +48,6 @@
#include <irq_test_common.h>
#include <util_test_common.h>
-/* defines */
-
#define RT_PRIO 10 /* RegressionTask prio - must match prj.vpf */
#define HT_PRIO 20 /* HelperTask prio - must match prj.vpf */
@@ -60,15 +56,11 @@
#define CMD_TASKID 0
#define CMD_PRIORITY 1
-/* typedefs */
-
typedef struct {
int cmd;
int data;
} ISR_INFO;
-/* locals */
-
static vvfn _trigger_isrTaskCommand = (vvfn)sw_isr_trigger_0;
static ISR_INFO isrInfo;
diff --git a/samples/microkernel/test/test_task_irq/src/main.c b/samples/microkernel/test/test_task_irq/src/main.c
index 963ed1a..c871485 100644
--- a/samples/microkernel/test/test_task_irq/src/main.c
+++ b/samples/microkernel/test/test_task_irq/src/main.c
@@ -48,8 +48,6 @@
/* # ticks to wait for test completion */
#define TIMEOUT (60 * sys_clock_ticks_per_sec)
-/* locals */
-
static ksem_t resultSems[] = { SEM_TASKDONE, SEM_TASKFAIL, ENDLIST };
static ksem_t rdySem = SEM_RDY;
diff --git a/samples/microkernel/test/test_timer/src/timer.c b/samples/microkernel/test/test_timer/src/timer.c
index b633b77..99300b3 100644
--- a/samples/microkernel/test/test_timer/src/timer.c
+++ b/samples/microkernel/test/test_timer/src/timer.c
@@ -39,8 +39,6 @@
task_tick_delta(), task_tick_get_32()
*/
-/* includes */
-
#include <tc_util.h>
#include <vxmicro.h>
@@ -51,8 +49,6 @@
#define WITHIN_ERROR(var, target, epsilon) \
(((var) >= (target)) && ((var) <= (target) + (epsilon)))
-/* locals */
-
static ktimer_t pTimer[NTIMERS + 1];
/*******************************************************************************
diff --git a/samples/microkernel/test/test_xip/src/test_xip.c b/samples/microkernel/test/test_xip/src/test_xip.c
index f90dd38..a4f0814 100644
--- a/samples/microkernel/test/test_xip/src/test_xip.c
+++ b/samples/microkernel/test/test_xip/src/test_xip.c
@@ -38,8 +38,6 @@
global variables for completeness sake.
*/
-/* includes */
-
#include <tc_util.h>
#include <nanokernel.h>
#include "test.h"
diff --git a/samples/microkernel/test/test_xip/src/test_xip_helper.c b/samples/microkernel/test/test_xip/src/test_xip_helper.c
index 5502935..83c8b15 100644
--- a/samples/microkernel/test/test_xip/src/test_xip_helper.c
+++ b/samples/microkernel/test/test_xip/src/test_xip_helper.c
@@ -36,8 +36,6 @@
test.
*/
-/* includes */
-
#include <nanokernel.h>
#include "test.h"
diff --git a/samples/nanokernel/benchmark/footprint/src/nanokernel_footprint.c b/samples/nanokernel/benchmark/footprint/src/nanokernel_footprint.c
index 2f57cde..53556db 100644
--- a/samples/nanokernel/benchmark/footprint/src/nanokernel_footprint.c
+++ b/samples/nanokernel/benchmark/footprint/src/nanokernel_footprint.c
@@ -37,8 +37,6 @@
#ifndef TEST_min
-/* includes */
-
#include <misc/printk.h>
#include <arch/cpu.h>
#include <stdio.h>
@@ -51,8 +49,6 @@
#endif /* __GNUC__ */
#endif /* TEST_reg */
-/* defines */
-
#define IRQ_PRIORITY 3
#define TEST_SOFT_INT 64
@@ -68,8 +64,6 @@
#define MESSAGE "Running regular nanokernel configuration\n"
#endif /* TEST_max */
-/* typedefs */
-
typedef void* (*pfunc) (void*);
/* variables */
diff --git a/samples/nanokernel/test/test_arm_m3_irq_vector_table/src/main.c b/samples/nanokernel/test/test_arm_m3_irq_vector_table/src/main.c
index 138bce9..5f4b7f2 100644
--- a/samples/nanokernel/test/test_arm_m3_irq_vector_table/src/main.c
+++ b/samples/nanokernel/test/test_arm_m3_irq_vector_table/src/main.c
@@ -39,8 +39,6 @@
The ISRs are installed at build time, directly in the vector table.
*/
-/* includes */
-
#if !defined(CONFIG_CPU_CORTEXM3)
#error project can only run on Cortex-M3
#endif
diff --git a/samples/nanokernel/test/test_context/src/context.c b/samples/nanokernel/test/test_context/src/context.c
index d453ff1..0357996 100644
--- a/samples/nanokernel/test/test_context/src/context.c
+++ b/samples/nanokernel/test/test_context/src/context.c
@@ -41,8 +41,6 @@
irq_enable(), irq_disable(),
*/
-/* includes */
-
#include <tc_util.h>
#include <nanok.h>
#include <arch/cpu.h>
@@ -61,8 +59,6 @@
#include <board.h>
#endif
-/* defines */
-
#define FIBER_STACKSIZE 2000
#define FIBER_PRIORITY 4
@@ -88,8 +84,6 @@
#error Timer type is not defined for this BSP
#endif
-/* typedefs */
-
typedef struct {
int command; /* command to process */
int error; /* error value (if any) */
@@ -102,8 +96,6 @@
typedef int (* disable_interrupt_func)(int);
typedef void (* enable_interrupt_func)(int);
-/* locals */
-
/* Cortex-M3 does not implement connecting non-IRQ exception handlers */
#if !defined(CONFIG_CPU_CORTEXM3)
static NANO_CPU_EXC_STUB_DECL(nanoExcStub);
diff --git a/samples/nanokernel/test/test_fifo/src/fifo.c b/samples/nanokernel/test/test_fifo/src/fifo.c
index 87e0dc7..c3998ce 100644
--- a/samples/nanokernel/test/test_fifo/src/fifo.c
+++ b/samples/nanokernel/test/test_fifo/src/fifo.c
@@ -61,8 +61,6 @@
in ISR context.
*/
-/* includes */
-
#include <tc_util.h>
#include <arch/cpu.h>
@@ -72,8 +70,6 @@
#include <irq_test_common.h>
#include <util_test_common.h>
-/* defines */
-
#define STACKSIZE 2048
#define NUM_FIFO_ELEMENT 4
#define INVALID_DATA NULL
@@ -82,15 +78,11 @@
#define TCERR2 TC_ERROR("Didn't get back correct FIFO\n")
#define TCERR3 TC_ERROR("The queue should be empty!\n")
-/* typedefs */
-
typedef struct {
struct nano_fifo *channel; /* FIFO channel */
void *data; /* pointer to data to add */
} ISR_FIFO_INFO;
-/* globals */
-
char __stack fiberStack1[STACKSIZE];
char __stack fiberStack2[STACKSIZE];
char __stack fiberStack3[STACKSIZE];
@@ -132,15 +124,11 @@
int retCode = TC_PASS;
-/* locals */
-
static ISR_FIFO_INFO isrFifoInfo = {&nanoFifoObj, NULL};
static void (*_trigger_nano_isr_fifo_put)(void) = (vvfn)sw_isr_trigger_0;
static void (*_trigger_nano_isr_fifo_get)(void) = (vvfn)sw_isr_trigger_1;
-/* forward declarations */
-
void fiber1(void);
void fiber2(void);
void fiber3(void);
diff --git a/samples/nanokernel/test/test_lifo/src/lifo.c b/samples/nanokernel/test/test_lifo/src/lifo.c
index 241a53e..19161b0 100644
--- a/samples/nanokernel/test/test_lifo/src/lifo.c
+++ b/samples/nanokernel/test/test_lifo/src/lifo.c
@@ -52,8 +52,6 @@
These scenarios will be tested using a combinations of tasks, fibers and ISRs.
*/
-/* includes */
-
#include <tc_util.h>
#include <arch/cpu.h>
@@ -63,13 +61,9 @@
#include <irq_test_common.h>
#include <util_test_common.h>
-/* defines */
-
#define FIBER_STACKSIZE 2000
#define FIBER_PRIORITY 4
-/* typedefs */
-
typedef struct {
struct nano_lifo *channel; /* LIFO channel */
void *data; /* pointer to data to add */
@@ -80,8 +74,6 @@
uint32_t data; /* miscellaneous data put on LIFO (not important) */
} LIFO_ITEM;
-/* locals */
-
/* Items to be added/removed from LIFO during the test */
static LIFO_ITEM lifoItem[4] = {
{0, 1},
diff --git a/samples/nanokernel/test/test_sema/src/sema.c b/samples/nanokernel/test/test_sema/src/sema.c
index c0c7b70..9a68bd3 100644
--- a/samples/nanokernel/test/test_sema/src/sema.c
+++ b/samples/nanokernel/test/test_sema/src/sema.c
@@ -50,8 +50,6 @@
Multiple fibers pend on the same semaphore.
*/
-/* includes */
-
#include <tc_util.h>
#include <arch/cpu.h>
@@ -61,13 +59,9 @@
#include <irq_test_common.h>
#include <util_test_common.h>
-/* defines */
-
#define FIBER_STACKSIZE 2000
#define FIBER_PRIORITY 4
-/* typedefs */
-
typedef struct {
struct nano_sem *sem; /* ptr to semaphore */
int data; /* data */
@@ -80,8 +74,6 @@
STS_ISR_WOKE_TASK
} SEM_TEST_STATE;
-/* locals */
-
static SEM_TEST_STATE semTestState;
static ISR_SEM_INFO isrSemInfo;
static struct nano_sem testSem;
diff --git a/samples/nanokernel/test/test_stack/src/stack.c b/samples/nanokernel/test/test_stack/src/stack.c
index d608c92..8875d27 100644
--- a/samples/nanokernel/test/test_stack/src/stack.c
+++ b/samples/nanokernel/test/test_stack/src/stack.c
@@ -60,8 +60,6 @@
these are run in ISR context.
*/
-/* includes */
-
#include <tc_util.h>
#include <arch/cpu.h>
@@ -71,7 +69,6 @@
#include <irq_test_common.h>
#include <util_test_common.h>
-/* defines */
#define STACKSIZE 2048
#define NUM_STACK_ELEMENT 4
#define STARTNUM 1 /* Used to compute data to put in the stack */
@@ -83,16 +80,12 @@
#define TCERR2 TC_ERROR("Didn't get back correct data\n")
#define TCERR3 TC_ERROR("The stack should be empty!\n")
-/* typedefs */
-
typedef struct {
struct nano_stack *channel; /* STACK channel */
uint32_t data; /* data to add */
} ISR_STACK_INFO;
-/* globals */
-
char fiberStack1[STACKSIZE];
char fiberStack2[STACKSIZE];
char fiberStack3[STACKSIZE];
@@ -115,15 +108,11 @@
void *timerData[1];
int retCode = TC_PASS;
-/* locals */
-
static ISR_STACK_INFO isrStackInfo = {&nanoStackObj, 0};
static void (*_trigger_nano_isr_stack_push)(void) = (vvfn)sw_isr_trigger_0;
static void (*_trigger_nano_isr_stack_pop)(void) = (vvfn)sw_isr_trigger_1;
-/* forward declarations */
-
void initData(void);
void fiber1(void);
void fiber2(void);
diff --git a/samples/nanokernel/test/test_timer/src/timer.c b/samples/nanokernel/test/test_timer/src/timer.c
index b7f56fd..6f9e959 100644
--- a/samples/nanokernel/test/test_timer/src/timer.c
+++ b/samples/nanokernel/test/test_timer/src/timer.c
@@ -39,13 +39,9 @@
nano_time_init(), nano_tick_get_32(), nano_cycle_get_32(), nano_tick_delta()
*/
-/* includes */
-
#include <tc_util.h>
#include <arch/cpu.h>
-/* defines */
-
#define TWO_SECONDS (2 * sys_clock_ticks_per_sec)
#define SIX_SECONDS (6 * sys_clock_ticks_per_sec)
@@ -59,15 +55,11 @@
#define FIBER2_STACKSIZE 2000
#define FIBER2_PRIORITY 10
-/* typedefs */
-
typedef void (* timer_start_func)(struct nano_timer *, int);
typedef void (* timer_stop_func)(struct nano_timer *);
typedef void* (* timer_getw_func)(struct nano_timer *);
typedef void* (* timer_get_func)(struct nano_timer *);
-/* locals */
-
static struct nano_timer timer;
static struct nano_timer shortTimer;
static struct nano_timer longTimer;