From cf9a4ec79b1cd0ad9b227b5f642d0f8a321bc7be Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Tue, 14 Aug 2012 16:29:05 +0000 Subject: [PATCH] Kernel: clean up include statements a bit Coverity was flagging a recursive include between kernel.h and cpulocals.h. As cpulocals.h also included proc.h, we can move that include statement into kernel.h, and clean up the source files' include statements accordingly. --- kernel/arch/i386/apic.c | 2 -- kernel/arch/i386/arch_clock.c | 1 - kernel/arch/i386/arch_reset.c | 2 -- kernel/arch/i386/arch_smp.c | 2 -- kernel/arch/i386/arch_system.c | 2 -- kernel/arch/i386/exception.c | 2 -- kernel/arch/i386/head.S | 2 -- kernel/arch/i386/i8259.c | 1 - kernel/arch/i386/memory.c | 3 --- kernel/arch/i386/procoffsets.cf | 1 - kernel/arch/i386/protect.c | 1 - kernel/clock.c | 1 - kernel/cpulocals.h | 3 --- kernel/debug.c | 2 -- kernel/interrupt.c | 1 - kernel/kernel.h | 3 ++- kernel/main.c | 2 -- kernel/proc.c | 4 ---- kernel/profile.c | 2 -- kernel/system.c | 2 -- kernel/system.h | 4 ---- kernel/table.c | 2 -- kernel/utility.c | 1 - 23 files changed, 2 insertions(+), 44 deletions(-) diff --git a/kernel/arch/i386/apic.c b/kernel/arch/i386/apic.c index 5c652c0a9..ffbbdb98c 100644 --- a/kernel/arch/i386/apic.c +++ b/kernel/arch/i386/apic.c @@ -10,8 +10,6 @@ #include #include -#include "kernel/proc.h" -#include "kernel/glo.h" #include "arch_proto.h" #include diff --git a/kernel/arch/i386/arch_clock.c b/kernel/arch/i386/arch_clock.c index 692a95d92..b7b7c1ec3 100644 --- a/kernel/arch/i386/arch_clock.c +++ b/kernel/arch/i386/arch_clock.c @@ -7,7 +7,6 @@ #include "kernel/kernel.h" #include "kernel/clock.h" -#include "kernel/proc.h" #include "kernel/interrupt.h" #include #include "glo.h" diff --git a/kernel/arch/i386/arch_reset.c b/kernel/arch/i386/arch_reset.c index 7891abe42..26e579a60 100644 --- a/kernel/arch/i386/arch_reset.c +++ b/kernel/arch/i386/arch_reset.c @@ -19,8 +19,6 @@ #include "arch_proto.h" #include "serial.h" #include "oxpcie.h" -#include "kernel/proc.h" -#include "kernel/debug.h" #include "direct_utils.h" #include diff --git a/kernel/arch/i386/arch_smp.c b/kernel/arch/i386/arch_smp.c index 25c536883..09f42ff04 100644 --- a/kernel/arch/i386/arch_smp.c +++ b/kernel/arch/i386/arch_smp.c @@ -7,9 +7,7 @@ #define _SMP #include "kernel/kernel.h" -#include "kernel/proc.h" #include "arch_proto.h" -#include "kernel/glo.h" #include #include #include diff --git a/kernel/arch/i386/arch_system.c b/kernel/arch/i386/arch_system.c index 6dd62d2e9..7cc9f4157 100644 --- a/kernel/arch/i386/arch_system.c +++ b/kernel/arch/i386/arch_system.c @@ -19,8 +19,6 @@ #include "arch_proto.h" #include "serial.h" #include "oxpcie.h" -#include "kernel/proc.h" -#include "kernel/debug.h" #include "direct_utils.h" #include diff --git a/kernel/arch/i386/exception.c b/kernel/arch/i386/exception.c index 8611c81ce..e10d6dd73 100644 --- a/kernel/arch/i386/exception.c +++ b/kernel/arch/i386/exception.c @@ -8,8 +8,6 @@ #include #include #include -#include "kernel/proc.h" -#include "kernel/proto.h" #include struct ex_s { diff --git a/kernel/arch/i386/head.S b/kernel/arch/i386/head.S index c019ab11d..b73befcfb 100644 --- a/kernel/arch/i386/head.S +++ b/kernel/arch/i386/head.S @@ -10,8 +10,6 @@ #include #include #include "archconst.h" -#include "kernel/const.h" -#include "kernel/proc.h" #include "sconst.h" #include diff --git a/kernel/arch/i386/i8259.c b/kernel/arch/i386/i8259.c index 65e0021bd..76cf10dac 100644 --- a/kernel/arch/i386/i8259.c +++ b/kernel/arch/i386/i8259.c @@ -6,7 +6,6 @@ */ #include "kernel/kernel.h" -#include "kernel/proc.h" #include "arch_proto.h" #include "hw_intr.h" #include diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index 78bdb26a7..3e4b74347 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -1,6 +1,5 @@ #include "kernel/kernel.h" -#include "kernel/proc.h" #include "kernel/vm.h" #include @@ -17,8 +16,6 @@ #include "oxpcie.h" #include "arch_proto.h" -#include "kernel/proto.h" -#include "kernel/debug.h" #ifdef USE_APIC #include "apic.h" diff --git a/kernel/arch/i386/procoffsets.cf b/kernel/arch/i386/procoffsets.cf index a0264d03a..d39772157 100644 --- a/kernel/arch/i386/procoffsets.cf +++ b/kernel/arch/i386/procoffsets.cf @@ -1,6 +1,5 @@ include "kernel.h" -include "proc.h" struct proc member DIREG p_reg.di diff --git a/kernel/arch/i386/protect.c b/kernel/arch/i386/protect.c index 9fcfb4c26..cd3c6bbec 100644 --- a/kernel/arch/i386/protect.c +++ b/kernel/arch/i386/protect.c @@ -8,7 +8,6 @@ #include #include "kernel/kernel.h" -#include "kernel/proc.h" #include "archconst.h" #include "arch_proto.h" diff --git a/kernel/clock.c b/kernel/clock.c index 1049d6b55..7d478eec7 100644 --- a/kernel/clock.c +++ b/kernel/clock.c @@ -30,7 +30,6 @@ */ #include "kernel.h" -#include "proc.h" #include #include diff --git a/kernel/cpulocals.h b/kernel/cpulocals.h index 2f844f1b9..a13e58a61 100644 --- a/kernel/cpulocals.h +++ b/kernel/cpulocals.h @@ -4,9 +4,6 @@ #ifndef __ASSEMBLY__ -#include "kernel.h" -#include "proc.h" - #ifdef CONFIG_SMP /* SMP */ diff --git a/kernel/debug.c b/kernel/debug.c index f0ac507b0..260b334aa 100644 --- a/kernel/debug.c +++ b/kernel/debug.c @@ -4,8 +4,6 @@ */ #include "kernel.h" -#include "proc.h" -#include "debug.h" #include #include diff --git a/kernel/interrupt.c b/kernel/interrupt.c index 9293a4c09..cdab6d1f1 100644 --- a/kernel/interrupt.c +++ b/kernel/interrupt.c @@ -16,7 +16,6 @@ #include #include "kernel.h" -#include "proc.h" #include "archconst.h" #include "hw_intr.h" diff --git a/kernel/kernel.h b/kernel/kernel.h index 48aa3106c..77e5b0642 100644 --- a/kernel/kernel.h +++ b/kernel/kernel.h @@ -45,8 +45,9 @@ #include "ipc.h" /* IPC constants */ #include "profile.h" /* system profiling */ #include "perf.h" /* performance-related definitions */ +#include "proc.h" /* process table */ +#include "cpulocals.h" /* CPU-local variables */ #include "debug.h" /* debugging, MUST be last kernel header */ -#include "cpulocals.h" #ifndef CONFIG_SMP /* We only support 1 cpu now */ diff --git a/kernel/main.c b/kernel/main.c index c5e7ab29f..9dff7251c 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -20,8 +20,6 @@ #include #include #include -#include "proc.h" -#include "debug.h" #include "clock.h" #include "hw_intr.h" #include "arch_proto.h" diff --git a/kernel/proc.c b/kernel/proc.c index e89c6ffa8..72a3d052c 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -35,14 +35,10 @@ #include #include -#include "debug.h" #include "kernel.h" -#include "proc.h" #include "vm.h" #include "clock.h" #include "spinlock.h" -#include "profile.h" - #include "arch_proto.h" #include diff --git a/kernel/profile.c b/kernel/profile.c index 55a2808cf..c4547f51c 100644 --- a/kernel/profile.c +++ b/kernel/profile.c @@ -18,8 +18,6 @@ #include #include "kernel.h" -#include "profile.h" -#include "proc.h" #include #include diff --git a/kernel/system.c b/kernel/system.c index 8cd81c94b..e19d8f525 100644 --- a/kernel/system.c +++ b/kernel/system.c @@ -31,10 +31,8 @@ * Sep 30, 2004 source code documentation updated (Jorrit N. Herder) */ -#include "debug.h" #include "kernel.h" #include "system.h" -#include "proc.h" #include "vm.h" #include "kernel/clock.h" #include diff --git a/kernel/system.h b/kernel/system.h index 755ebae4e..19285a176 100644 --- a/kernel/system.h +++ b/kernel/system.h @@ -30,11 +30,7 @@ #ifndef SYSTEM_H #define SYSTEM_H -/* Common includes for the system library. */ -#include "debug.h" #include "kernel.h" -#include "proto.h" -#include "proc.h" int do_exec(struct proc * caller, message *m_ptr); #if ! USE_EXEC diff --git a/kernel/table.c b/kernel/table.c index 6a4a3f3d1..18cd1f485 100644 --- a/kernel/table.c +++ b/kernel/table.c @@ -30,8 +30,6 @@ #define _TABLE #include "kernel.h" -#include "proc.h" -#include "ipc.h" #include /* The system image table lists all programs that are part of the boot image. diff --git a/kernel/utility.c b/kernel/utility.c index 1751573f5..af2425e77 100644 --- a/kernel/utility.c +++ b/kernel/utility.c @@ -4,7 +4,6 @@ */ #include "kernel.h" -#include "proc.h" #include "arch_proto.h" #include -- 2.44.0