Skip to contentSkip to conversation

x86: include inverse Xmas tree patches

git-pull -tip Jaswinder Singh Rajput 10 participants 28 messages Mar 28, 2009 – Mar 29, 2009

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
Ingo Molnar (1):

        Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Jaswinder Singh Rajput (49):
x86: process_32.c include inverse Xmas tree effect
x86: signal.c include inverse Xmas tree effect
x86: entry_32.S include inverse Xmas tree effect
x86: traps.c include inverse Xmas tree effect
x86: irq.c include inverse Xmas tree effect
x86: irq_32.c include inverse Xmas tree effect
x86: dumpstack.c include inverse Xmas tree effect
x86: time_32.c include inverse Xmas tree effect
x86: ioport.c include inverse Xmas tree effect
x86: ldt.c include inverse Xmas tree effect
x86: dumpstack_32.c include inverse Xmas tree effect
x86: setup.c include inverse Xmas tree effect
x86: i8259.c include inverse Xmas tree effect
x86: irqinit_32.c include inverse Xmas tree effect
x86: probe_roms_32.c include inverse Xmas tree effect
x86: sys_i386_32.c include inverse Xmas tree effect
x86: i386_ksyms_32.c include inverse Xmas tree effect
x86: bootflag.c include inverse Xmas tree effect
x86: e820.c include inverse Xmas tree effect
x86: pci-dma.c include inverse Xmas tree effect
x86: quirks.c include inverse Xmas tree effect
x86: i8237.c include inverse Xmas tree effect
x86: alternative.c include inverse Xmas tree effect
x86: tsc.c include inverse Xmas tree effect
x86: process.c include inverse Xmas tree effect
x86: xsave.c include inverse Xmas tree effect
x86: ptrace.c include inverse Xmas tree effect
x86: ds.c include inverse Xmas tree effect
x86: tls.c include inverse Xmas tree effect
x86: step.c include inverse Xmas tree effect
x86: stacktrace.c include inverse Xmas tree effect
x86: reboot.c include inverse Xmas tree effect
x86: msr.c include inverse Xmas tree effect
x86: cpuid.c include inverse Xmas tree effect
x86: early-quirks.c include inverse Xmas tree effect
x86: smp.c include inverse Xmas tree effect
x86: smpboot.c include inverse Xmas tree effect
x86: tsc_sync.c include inverse Xmas tree effect
x86: setup_percpu.c include inverse Xmas tree effect
x86: trampoline_32.S include inverse Xmas tree effect
x86: mpparse.c include inverse Xmas tree effect
x86: module_32.c include inverse Xmas tree effect
x86: doublefault_32.c include inverse Xmas tree effect
x86: vm86_32.c include inverse Xmas tree effect
ix86: early_printk.c include inverse Xmas tree effect
x86: pcspeaker.c include inverse Xmas tree effect
x86: head_32.c include inverse Xmas tree effect
x86: head.c include inverse Xmas tree effect
x86: init_task.c include inverse Xmas tree effect

 arch/x86/include/asm/proto.h         |    2 +
 arch/x86/include/asm/sigcontext32.h  |    3 +-
 arch/x86/include/asm/smpboot_hooks.h |    2 +
 arch/x86/include/asm/topology.h      |    2 +
 arch/x86/kernel/alternative.c        |   11 ++--
 arch/x86/kernel/bootflag.c           |   12 ++--
 arch/x86/kernel/cpuid.c              |   17 ++---
 arch/x86/kernel/doublefault_32.c     |    8 +-
 arch/x86/kernel/ds.c                 |   11 +--
 arch/x86/kernel/dumpstack.c          |    5 +-
 arch/x86/kernel/dumpstack_32.c       |    5 +-
 arch/x86/kernel/e820.c               |   21 +++---
 arch/x86/kernel/early-quirks.c       |    9 ++-
 arch/x86/kernel/early_printk.c       |   26 ++++---
 arch/x86/kernel/entry_32.S           |   17 +++--
 arch/x86/kernel/head.c               |    2 +-
 arch/x86/kernel/head_32.S            |   17 +++--
 arch/x86/kernel/i386_ksyms_32.c      |    3 +-
 arch/x86/kernel/i8237.c              |    3 +-
 arch/x86/kernel/i8259.c              |   28 ++++----
 arch/x86/kernel/init_task.c          |    8 +-
 arch/x86/kernel/ioport.c             |   15 ++--
 arch/x86/kernel/irq.c                |   11 ++--
 arch/x86/kernel/irq_32.c             |   10 ++--
 arch/x86/kernel/irqinit_32.c         |   29 ++++----
 arch/x86/kernel/ldt.c                |   14 ++--
 arch/x86/kernel/module_32.c          |    7 +-
 arch/x86/kernel/mpparse.c            |   24 +++---
 arch/x86/kernel/msr.c                |   17 ++---
 arch/x86/kernel/pci-dma.c            |   10 ++--
 arch/x86/kernel/pcspeaker.c          |    2 +-
 arch/x86/kernel/probe_roms_32.c      |   23 +++---
 arch/x86/kernel/process.c            |   19 +++---
 arch/x86/kernel/process_32.c         |   70 +++++++++----------
 arch/x86/kernel/ptrace.c             |   30 ++++----
 arch/x86/kernel/quirks.c             |    4 +-
 arch/x86/kernel/reboot.c             |   30 ++++----
 arch/x86/kernel/setup.c              |  126 ++++++++++++++++------------------
 arch/x86/kernel/setup_percpu.c       |   21 +++---
 arch/x86/kernel/signal.c             |   33 ++++-----
 arch/x86/kernel/smp.c                |   16 ++--
 arch/x86/kernel/smpboot.c            |   33 ++++-----
 arch/x86/kernel/stacktrace.c         |    6 +-
 arch/x86/kernel/step.c               |    3 +-
 arch/x86/kernel/sys_i386_32.c        |   25 +++----
 arch/x86/kernel/time_32.c            |    7 +-
 arch/x86/kernel/tls.c                |   10 ++--
 arch/x86/kernel/trampoline_32.S      |    3 +-
 arch/x86/kernel/traps.c              |   34 +++------
 arch/x86/kernel/tsc.c                |   20 +++---
 arch/x86/kernel/tsc_sync.c           |    2 +-
 arch/x86/kernel/vm86_32.c            |   20 +++---
 arch/x86/kernel/xsave.c              |    5 +-
 53 files changed, 437 insertions(+), 454 deletions(-)

Complete diff:

arch/x86/include/asm/proto.h +2 -0
index 49fb3ec..a8d63be 100644
@@ -7,7 +7,9 @@
 
 extern void early_idt_handler(void);
 
+#ifdef CONFIG_X86_64
 extern void system_call(void);
+#endif
 extern void syscall_init(void);
 
 extern void ia32_syscall(void);
arch/x86/include/asm/sigcontext32.h +2 -1
index ad1478c..f80df2e 100644
@@ -1,6 +1,7 @@
 #ifndef _ASM_X86_SIGCONTEXT32_H
 #define _ASM_X86_SIGCONTEXT32_H
 
+#ifdef CONFIG_IA32_EMULATION
 #include <linux/types.h>
 
 /* signal context for 32bit programs. */
@@ -73,5 +74,5 @@ struct sigcontext_ia32 {
        unsigned int oldmask;
        unsigned int cr2;
 };
-
+#endif
 #endif /* _ASM_X86_SIGCONTEXT32_H */
arch/x86/include/asm/smpboot_hooks.h +2 -0
index 1def601..dff6e11 100644
@@ -1,6 +1,8 @@
 /* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
  * which needs to alter them. */
 
+#include <asm/tlbflush.h>
+
 static inline void smpboot_clear_io_apic_irqs(void)
 {
 #ifdef CONFIG_X86_IO_APIC
arch/x86/include/asm/topology.h +2 -0
index 77cfb2c..1f23e58 100644
@@ -194,10 +194,12 @@ extern int __node_distance(int, int);
 
 #else /* !CONFIG_NUMA */
 
+#if 0
 static inline int numa_node_id(void)
 {
 	return 0;
 }
+#endif
 
 static inline int cpu_to_node(int cpu)
 {
arch/x86/kernel/alternative.c +6 -5
index 4c80f15..51fb5c5 100644
@@ -1,17 +1,18 @@
+#include <linux/kprobes.h>
+#include <linux/vmalloc.h>
 #include <linux/module.h>
-#include <linux/sched.h>
 #include <linux/mutex.h>
+#include <linux/sched.h>
 #include <linux/list.h>
-#include <linux/kprobes.h>
 #include <linux/mm.h>
-#include <linux/vmalloc.h>
+
 #include <asm/alternative.h>
+#include <asm/cacheflush.h>
 #include <asm/sections.h>
+#include <asm/vsyscall.h>
 #include <asm/pgtable.h>
 #include <asm/mce.h>
 #include <asm/nmi.h>
-#include <asm/vsyscall.h>
-#include <asm/cacheflush.h>
 #include <asm/io.h>
 
 #define MAX_PATCH_LEN (255-1)
arch/x86/kernel/bootflag.c +6 -6
index 30f25a7..3cbb632 100644
@@ -1,17 +1,17 @@
 /*
  *	Implement 'Simple Boot Flag Specification 2.0'
  */
-#include <linux/types.h>
+
+#include <linux/mc146818rtc.h>
+#include <linux/spinlock.h>
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/string.h>
-#include <linux/slab.h>
-#include <linux/spinlock.h>
+#include <linux/types.h>
 #include <linux/acpi.h>
+#include <linux/init.h>
+#include <linux/slab.h>
 #include <asm/io.h>
 
-#include <linux/mc146818rtc.h>
-
 #define SBF_RESERVED (0x78)
 #define SBF_PNPOS    (1<<0)
 #define SBF_BOOTING  (1<<1)
arch/x86/kernel/cpuid.c +8 -9
index 2ac1f0c..7e5caa6 100644
@@ -25,25 +25,24 @@
  * an SMP box will direct the access to CPU %d.
  */
 
+#include <linux/notifier.h>
+#include <linux/smp_lock.h>
+#include <linux/uaccess.h>
+#include <linux/device.h>
 #include <linux/module.h>
-
-#include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/fcntl.h>
+#include <linux/major.h>
+#include <linux/types.h>
 #include <linux/init.h>
 #include <linux/poll.h>
+#include <linux/cpu.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
-#include <linux/major.h>
 #include <linux/fs.h>
-#include <linux/device.h>
-#include <linux/cpu.h>
-#include <linux/notifier.h>
-#include <linux/uaccess.h>
 
 #include <asm/processor.h>
-#include <asm/msr.h>
 #include <asm/system.h>
+#include <asm/msr.h>
 
 static struct class *cpuid_class;
 
arch/x86/kernel/doublefault_32.c +4 -4
index b4f14c6..2d1f7b7 100644
@@ -1,12 +1,12 @@
-#include <linux/mm.h>
+#include <linux/init_task.h>
 #include <linux/sched.h>
 #include <linux/init.h>
-#include <linux/init_task.h>
 #include <linux/fs.h>
+#include <linux/mm.h>
 
-#include <asm/uaccess.h>
-#include <asm/pgtable.h>
 #include <asm/processor.h>
+#include <asm/pgtable.h>
+#include <asm/uaccess.h>
 #include <asm/desc.h>
 
 #define DOUBLEFAULT_STACKSIZE (1024)
arch/x86/kernel/ds.c +4 -7
index 87b67e3..fa9b42c 100644
@@ -19,16 +19,13 @@
  * Markus Metzger <[email protected]>, 2007-2009
  */
 
-
-#include <asm/ds.h>
-
-#include <linux/errno.h>
+#include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/slab.h>
+#include <linux/errno.h>
 #include <linux/sched.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
-#include <linux/kernel.h>
-
+#include <asm/ds.h>
 
 /*
  * The configuration for a particular DS hardware implementation.
arch/x86/kernel/dumpstack.c +3 -2
index 87d103d..9c4da7e 100644
@@ -2,18 +2,19 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  *  Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs
  */
+
 #include <linux/kallsyms.h>
 #include <linux/kprobes.h>
+#include <linux/hardirq.h>
 #include <linux/uaccess.h>
 #include <linux/utsname.h>
-#include <linux/hardirq.h>
 #include <linux/kdebug.h>
 #include <linux/module.h>
 #include <linux/ptrace.h>
 #include <linux/kexec.h>
+#include <linux/sysfs.h>
 #include <linux/bug.h>
 #include <linux/nmi.h>
-#include <linux/sysfs.h>
 
 #include <asm/stacktrace.h>
 
arch/x86/kernel/dumpstack_32.c +3 -2
index d593cd1..f967111 100644
@@ -2,18 +2,19 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  *  Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs
  */
+
 #include <linux/kallsyms.h>
+#include <linux/hardirq.h>
 #include <linux/kprobes.h>
 #include <linux/uaccess.h>
 #include <linux/utsname.h>
-#include <linux/hardirq.h>
 #include <linux/kdebug.h>
 #include <linux/module.h>
 #include <linux/ptrace.h>
 #include <linux/kexec.h>
+#include <linux/sysfs.h>
 #include <linux/bug.h>
 #include <linux/nmi.h>
-#include <linux/sysfs.h>
 
 #include <asm/stacktrace.h>
 
arch/x86/kernel/e820.c +11 -10
index fb638d9..8232b2b 100644
@@ -8,25 +8,26 @@
  *  Venkatesh Pallipadi <[email protected]>
  *
  */
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/init.h>
+
+#include <linux/firmware-map.h>
 #include <linux/bootmem.h>
+#include <linux/suspend.h>
 #include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/string.h>
 #include <linux/kexec.h>
-#include <linux/module.h>
-#include <linux/mm.h>
+#include <linux/types.h>
+#include <linux/init.h>
 #include <linux/pfn.h>
-#include <linux/suspend.h>
-#include <linux/firmware-map.h>
+#include <linux/mm.h>
 
+#include <asm/trampoline.h>
 #include <asm/pgtable.h>
-#include <asm/page.h>
-#include <asm/e820.h>
 #include <asm/proto.h>
 #include <asm/setup.h>
-#include <asm/trampoline.h>
+#include <asm/e820.h>
+#include <asm/page.h>
 
 /*
  * The e820 map is the map that gets modified e.g. with command line parameters
arch/x86/kernel/early-quirks.c +5 -4
index 76b8cd9..c4acdfd 100644
@@ -9,15 +9,16 @@
    Mainboard specific bugs should be handled by DMI entries.
    CPU specific bugs in setup.c */
 
-#include <linux/pci.h>
-#include <linux/acpi.h>
 #include <linux/pci_ids.h>
+#include <linux/acpi.h>
+#include <linux/pci.h>
+
 #include <asm/pci-direct.h>
-#include <asm/dma.h>
 #include <asm/io_apic.h>
-#include <asm/apic.h>
 #include <asm/iommu.h>
+#include <asm/apic.h>
 #include <asm/gart.h>
+#include <asm/dma.h>
 
 static void __init fix_hypertransport_config(int num, int slot, int func)
 {
arch/x86/kernel/early_printk.c +15 -11
index 335f049..57a1ab3 100644
@@ -1,21 +1,25 @@
-#include <linux/console.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/string.h>
+#include <linux/spinlock_types.h>
 #include <linux/screen_info.h>
-#include <linux/usb/ch9.h>
 #include <linux/pci_regs.h>
+#include <linux/console.h>
 #include <linux/pci_ids.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
 #include <linux/errno.h>
-#include <asm/io.h>
-#include <asm/processor.h>
-#include <asm/fcntl.h>
-#include <asm/setup.h>
+#include <linux/init.h>
+
+#include <linux/usb/ehci_def.h>
+#include <linux/usb/ch9.h>
+
 #include <xen/hvc-console.h>
+
 #include <asm/pci-direct.h>
-#include <asm/fixmap.h>
+#include <asm/processor.h>
 #include <asm/pgtable.h>
-#include <linux/usb/ehci_def.h>
+#include <asm/fixmap.h>
+#include <asm/fcntl.h>
+#include <asm/setup.h>
+#include <asm/io.h>
 
 /* Simple VGA output */
 #define VGABASE		(__ISA_IO_base + 0xb8000)
arch/x86/kernel/entry_32.S +9 -8
index c929add..5f1c934 100644
@@ -42,21 +42,22 @@
  */
 
 #include <linux/linkage.h>
+#include <linux/elf-em.h>
+
+#include <asm/processor-flags.h>
+#include <asm/irq_vectors.h>
 #include <asm/thread_info.h>
+#include <asm/page_types.h>
 #include <asm/irqflags.h>
-#include <asm/errno.h>
 #include <asm/segment.h>
-#include <asm/smp.h>
-#include <asm/page_types.h>
-#include <asm/desc.h>
-#include <asm/percpu.h>
 #include <asm/dwarf2.h>
-#include <asm/processor-flags.h>
 #include <asm/ftrace.h>
-#include <asm/irq_vectors.h>
+#include <asm/percpu.h>
+#include <asm/errno.h>
+#include <asm/desc.h>
+#include <asm/smp.h>
 
 /* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this.  */
-#include <linux/elf-em.h>
 #define AUDIT_ARCH_I386		(EM_386|__AUDIT_ARCH_LE)
 #define __AUDIT_ARCH_LE	   0x40000000
 
arch/x86/kernel/head.c +1 -1
index 3e66bd3..685811a 100644
@@ -1,8 +1,8 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 
-#include <asm/setup.h>
 #include <asm/bios_ebda.h>
+#include <asm/setup.h>
 
 #define BIOS_LOWMEM_KILOBYTES 0x413
 
arch/x86/kernel/head_32.S +9 -8
index 3068388..3dd22b3 100644
@@ -7,19 +7,20 @@
  */
 
 .text
+#include <linux/linkage.h>
 #include <linux/threads.h>
 #include <linux/init.h>
-#include <linux/linkage.h>
-#include <asm/segment.h>
-#include <asm/page_types.h>
+
+#include <asm/processor-flags.h>
 #include <asm/pgtable_types.h>
-#include <asm/desc.h>
-#include <asm/cache.h>
-#include <asm/thread_info.h>
 #include <asm/asm-offsets.h>
-#include <asm/setup.h>
-#include <asm/processor-flags.h>
+#include <asm/thread_info.h>
+#include <asm/page_types.h>
+#include <asm/segment.h>
 #include <asm/percpu.h>
+#include <asm/cache.h>
+#include <asm/setup.h>
+#include <asm/desc.h>
 
 /* Physical address */
 #define pa(X) ((X) - __PAGE_OFFSET)
arch/x86/kernel/i386_ksyms_32.c +1 -2
index 43cec6b..87616ff 100644
@@ -1,9 +1,8 @@
 #include <linux/module.h>
-
 #include <asm/checksum.h>
 #include <asm/pgtable.h>
-#include <asm/desc.h>
 #include <asm/ftrace.h>
+#include <asm/desc.h>
 
 #ifdef CONFIG_FUNCTION_TRACER
 /* mcount is defined in assembly */
arch/x86/kernel/i8237.c +1 -2
index b42ca69..bc043f7 100644
@@ -9,9 +9,8 @@
  * your option) any later version.
  */
 
-#include <linux/init.h>
 #include <linux/sysdev.h>
-
+#include <linux/init.h>
 #include <asm/dma.h>
 
 /*
arch/x86/kernel/i8259.c +14 -14
index df89102..e9e6df1 100644
@@ -1,28 +1,28 @@
+#include <linux/kernel_stat.h>
+#include <linux/interrupt.h>
 #include <linux/linkage.h>
-#include <linux/errno.h>
-#include <linux/signal.h>
-#include <linux/sched.h>
+#include <linux/bitops.h>
 #include <linux/ioport.h>
-#include <linux/interrupt.h>
-#include <linux/timex.h>
-#include <linux/slab.h>
 #include <linux/random.h>
-#include <linux/init.h>
-#include <linux/kernel_stat.h>
+#include <linux/signal.h>
 #include <linux/sysdev.h>
-#include <linux/bitops.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/timex.h>
 #include <linux/acpi.h>
+#include <linux/init.h>
+#include <linux/slab.h>
 #include <linux/io.h>
-#include <linux/delay.h>
 
+#include <asm/pgtable.h>
 #include <asm/atomic.h>
+#include <asm/hw_irq.h>
 #include <asm/system.h>
+#include <asm/i8259.h>
 #include <asm/timer.h>
-#include <asm/hw_irq.h>
-#include <asm/pgtable.h>
-#include <asm/desc.h>
 #include <asm/apic.h>
-#include <asm/i8259.h>
+#include <asm/desc.h>
 
 /*
  * This is the 'legacy' 8259A Programmable Interrupt Controller,
arch/x86/kernel/init_task.c +4 -4
index df3bf26..c53d699 100644
@@ -1,13 +1,13 @@
-#include <linux/mm.h>
+#include <linux/init_task.h>
 #include <linux/module.h>
+#include <linux/mqueue.h>
 #include <linux/sched.h>
 #include <linux/init.h>
-#include <linux/init_task.h>
 #include <linux/fs.h>
-#include <linux/mqueue.h>
+#include <linux/mm.h>
 
-#include <asm/uaccess.h>
 #include <asm/pgtable.h>
+#include <asm/uaccess.h>
 #include <asm/desc.h>
 
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
arch/x86/kernel/ioport.c +8 -7
index 99c4d30..fb498da 100644
@@ -3,17 +3,18 @@
  * by Linus. 32/64 bits code unification by Miguel Botón.
  */
 
-#include <linux/sched.h>
-#include <linux/kernel.h>
+#include <linux/thread_info.h>
 #include <linux/capability.h>
-#include <linux/errno.h>
-#include <linux/types.h>
+#include <linux/syscalls.h>
 #include <linux/ioport.h>
-#include <linux/smp.h>
+#include <linux/kernel.h>
 #include <linux/stddef.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/types.h>
 #include <linux/slab.h>
-#include <linux/thread_info.h>
-#include <linux/syscalls.h>
+#include <linux/smp.h>
+
 #include <asm/syscalls.h>
 
 /* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */
arch/x86/kernel/irq.c +6 -5
index b8ac3b6..c1c484f 100644
@@ -1,17 +1,18 @@
 /*
  * Common interrupt code for 32 and 64 bit
  */
-#include <linux/cpu.h>
-#include <linux/interrupt.h>
+
 #include <linux/kernel_stat.h>
+#include <linux/interrupt.h>
 #include <linux/seq_file.h>
-#include <linux/smp.h>
 #include <linux/ftrace.h>
+#include <linux/cpu.h>
+#include <linux/smp.h>
 
-#include <asm/apic.h>
 #include <asm/io_apic.h>
-#include <asm/irq.h>
 #include <asm/idle.h>
+#include <asm/apic.h>
+#include <asm/irq.h>
 
 atomic_t irq_err_count;
 
arch/x86/kernel/irq_32.c +5 -5
index 3b09634..08bde3c 100644
@@ -8,15 +8,15 @@
  * io_apic.c.)
  */
 
-#include <linux/module.h>
-#include <linux/seq_file.h>
-#include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
+#include <linux/interrupt.h>
 #include <linux/notifier.h>
-#include <linux/cpu.h>
-#include <linux/delay.h>
+#include <linux/seq_file.h>
 #include <linux/uaccess.h>
+#include <linux/module.h>
 #include <linux/percpu.h>
+#include <linux/delay.h>
+#include <linux/cpu.h>
 
 #include <asm/apic.h>
 
arch/x86/kernel/irqinit_32.c +14 -15
index bc13261..fcb54ac 100644
@@ -1,27 +1,26 @@
-#include <linux/errno.h>
-#include <linux/signal.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
+#include <linux/kernel_stat.h>
 #include <linux/interrupt.h>
-#include <linux/slab.h>
+#include <linux/bitops.h>
+#include <linux/ioport.h>
 #include <linux/random.h>
-#include <linux/init.h>
-#include <linux/kernel_stat.h>
+#include <linux/signal.h>
 #include <linux/sysdev.h>
-#include <linux/bitops.h>
-#include <linux/io.h>
 #include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/io.h>
 
+#include <asm/pgtable.h>
 #include <asm/atomic.h>
 #include <asm/system.h>
-#include <asm/timer.h>
-#include <asm/pgtable.h>
-#include <asm/desc.h>
-#include <asm/apic.h>
-#include <asm/setup.h>
 #include <asm/i8259.h>
+#include <asm/setup.h>
+#include <asm/timer.h>
 #include <asm/traps.h>
-
+#include <asm/apic.h>
+#include <asm/desc.h>
 
 /*
  * Note that on a 486, we don't want to do a SIGFPE on an irq13
arch/x86/kernel/ldt.c +7 -7
index 71f1d99..08ad4c5 100644
@@ -6,19 +6,19 @@
  * This handles calls from both 32bit and 64bit mode.
  */
 
+#include <linux/uaccess.h>
+#include <linux/vmalloc.h>
+#include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
-#include <linux/string.h>
-#include <linux/mm.h>
 #include <linux/smp.h>
-#include <linux/vmalloc.h>
-#include <linux/uaccess.h>
+#include <linux/mm.h>
 
-#include <asm/system.h>
-#include <asm/ldt.h>
-#include <asm/desc.h>
 #include <asm/mmu_context.h>
 #include <asm/syscalls.h>
+#include <asm/system.h>
+#include <asm/desc.h>
+#include <asm/ldt.h>
 
 #ifdef CONFIG_SMP
 static void flush_ldt(void *current_mm)
arch/x86/kernel/module_32.c +4 -3
index 0edd819..0f8dede 100644
@@ -15,13 +15,14 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
+
 #include <linux/moduleloader.h>
-#include <linux/elf.h>
 #include <linux/vmalloc.h>
-#include <linux/fs.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
+#include <linux/string.h>
 #include <linux/bug.h>
+#include <linux/elf.h>
+#include <linux/fs.h>
 
 #if 0
 #define DEBUGP printk
arch/x86/kernel/mpparse.c +12 -12
index dce99dc..f604897 100644
@@ -7,29 +7,29 @@
  *      (c) 2008 Alexey Starikovskiy <[email protected]>
  */
 
-#include <linux/mm.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/bootmem.h>
 #include <linux/kernel_stat.h>
 #include <linux/mc146818rtc.h>
+#include <linux/bootmem.h>
 #include <linux/bitops.h>
-#include <linux/acpi.h>
 #include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/acpi.h>
+#include <linux/init.h>
 #include <linux/smp.h>
+#include <linux/mm.h>
 
-#include <asm/mtrr.h>
-#include <asm/mpspec.h>
-#include <asm/pgalloc.h>
+#include <asm/trampoline.h>
+#include <asm/bios_ebda.h>
 #include <asm/io_apic.h>
+#include <asm/pgalloc.h>
+#include <asm/mpspec.h>
 #include <asm/proto.h>
-#include <asm/bios_ebda.h>
-#include <asm/e820.h>
-#include <asm/trampoline.h>
 #include <asm/setup.h>
+#include <asm/apic.h>
+#include <asm/e820.h>
+#include <asm/mtrr.h>
 #include <asm/smp.h>
 
-#include <asm/apic.h>
 /*
  * Checksum an MP configuration block.
  */
arch/x86/kernel/msr.c +8 -9
index 3cf3413..1828fe0 100644
@@ -21,25 +21,24 @@
  * an SMP box will direct the access to CPU %d.
  */
 
+#include <linux/notifier.h>
+#include <linux/smp_lock.h>
+#include <linux/uaccess.h>
+#include <linux/device.h>
 #include <linux/module.h>
-
-#include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/fcntl.h>
+#include <linux/major.h>
+#include <linux/types.h>
 #include <linux/init.h>
 #include <linux/poll.h>
+#include <linux/cpu.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
-#include <linux/major.h>
 #include <linux/fs.h>
-#include <linux/device.h>
-#include <linux/cpu.h>
-#include <linux/notifier.h>
-#include <linux/uaccess.h>
 
 #include <asm/processor.h>
-#include <asm/msr.h>
 #include <asm/system.h>
+#include <asm/msr.h>
 
 static struct class *msr_class;
 
arch/x86/kernel/pci-dma.c +5 -5
index b254285..b4a3a61 100644
@@ -1,14 +1,14 @@
 #include <linux/dma-mapping.h>
-#include <linux/dmar.h>
 #include <linux/bootmem.h>
+#include <linux/dmar.h>
 #include <linux/pci.h>
 
-#include <asm/proto.h>
-#include <asm/dma.h>
+#include <asm/amd_iommu.h>
+#include <asm/calgary.h>
 #include <asm/iommu.h>
+#include <asm/proto.h>
 #include <asm/gart.h>
-#include <asm/calgary.h>
-#include <asm/amd_iommu.h>
+#include <asm/dma.h>
 
 static int forbid_dac __read_mostly;
 
arch/x86/kernel/pcspeaker.c +1 -1
index a311ffc..d5047ca 100644
@@ -1,6 +1,6 @@
 #include <linux/platform_device.h>
-#include <linux/err.h>
 #include <linux/init.h>
+#include <linux/err.h>
 
 static __init int add_pcspkr(void)
 {
arch/x86/kernel/probe_roms_32.c +11 -12
index 071e7fe..9ddad2a 100644
@@ -1,24 +1,23 @@
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/uaccess.h>
-#include <linux/mmzone.h>
-#include <linux/ioport.h>
 #include <linux/seq_file.h>
 #include <linux/console.h>
+#include <linux/uaccess.h>
+#include <linux/ioport.h>
+#include <linux/mmzone.h>
+#include <linux/sched.h>
 #include <linux/init.h>
-#include <linux/edd.h>
 #include <linux/dmi.h>
-#include <linux/pfn.h>
+#include <linux/edd.h>
 #include <linux/pci.h>
-#include <asm/pci-direct.h>
-
+#include <linux/pfn.h>
+#include <linux/mm.h>
 
-#include <asm/e820.h>
+#include <asm/pci-direct.h>
+#include <asm/setup_arch.h>
+#include <asm/sections.h>
 #include <asm/mmzone.h>
 #include <asm/setup.h>
-#include <asm/sections.h>
+#include <asm/e820.h>
 #include <asm/io.h>
-#include <asm/setup_arch.h>
 
 static struct resource system_rom_resource = {
 	.name	= "System ROM",
arch/x86/kernel/process.c +10 -9
index 156f875..e508d97 100644
@@ -1,19 +1,20 @@
-#include <linux/errno.h>
+#include <linux/clockchips.h>
+#include <linux/ftrace.h>
 #include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/smp.h>
+#include <linux/module.h>
+#include <linux/errno.h>
 #include <linux/prctl.h>
-#include <linux/slab.h>
 #include <linux/sched.h>
-#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/smp.h>
+#include <linux/mm.h>
 #include <linux/pm.h>
-#include <linux/clockchips.h>
-#include <linux/ftrace.h>
+
+#include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/apic.h>
-#include <asm/idle.h>
-#include <asm/uaccess.h>
 #include <asm/i387.h>
+#include <asm/idle.h>
 
 unsigned long idle_halt;
 EXPORT_SYMBOL(idle_halt);
arch/x86/kernel/process_32.c +33 -37

92 lines not on this page · raw message

arch/x86/kernel/ptrace.c +15 -15
index 1937871..8a33d61 100644
@@ -7,31 +7,31 @@
  *	Markus Metzger <[email protected]>, Dec 2007
  */
 
+#include <linux/tracehook.h>
+#include <linux/security.h>
+#include <linux/seccomp.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/smp.h>
-#include <linux/errno.h>
 #include <linux/ptrace.h>
 #include <linux/regset.h>
-#include <linux/tracehook.h>
+#include <linux/signal.h>
+#include <linux/audit.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
 #include <linux/user.h>
 #include <linux/elf.h>
-#include <linux/security.h>
-#include <linux/audit.h>
-#include <linux/seccomp.h>
-#include <linux/signal.h>
+#include <linux/smp.h>
+#include <linux/mm.h>
 
-#include <asm/uaccess.h>
-#include <asm/pgtable.h>
-#include <asm/system.h>
 #include <asm/processor.h>
-#include <asm/i387.h>
 #include <asm/debugreg.h>
-#include <asm/ldt.h>
-#include <asm/desc.h>
+#include <asm/pgtable.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
 #include <asm/prctl.h>
 #include <asm/proto.h>
+#include <asm/desc.h>
+#include <asm/i387.h>
+#include <asm/ldt.h>
 #include <asm/ds.h>
 
 #include "tls.h"
arch/x86/kernel/quirks.c +2 -2
index 6a5a297..303c6d3 100644
@@ -1,9 +1,9 @@
 /*
  * This file contains work-arounds for x86 and x86_64 platform bugs.
  */
-#include <linux/pci.h>
-#include <linux/irq.h>
 
+#include <linux/irq.h>
+#include <linux/pci.h>
 #include <asm/hpet.h>
 
 #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI)
arch/x86/kernel/reboot.c +14 -16
index 2aef36d..fbe594b 100644
@@ -1,28 +1,26 @@
+#include <linux/mc146818rtc.h>
 #include <linux/module.h>
 #include <linux/reboot.h>
+#include <linux/ctype.h>
 #include <linux/init.h>
-#include <linux/pm.h>
+#include <linux/dmi.h>
 #include <linux/efi.h>
+#include <linux/pm.h>
+
 #include <acpi/reboot.h>
-#include <asm/io.h>
-#include <asm/apic.h>
-#include <asm/desc.h>
-#include <asm/hpet.h>
-#include <asm/pgtable.h>
-#include <asm/proto.h>
+
 #include <asm/reboot_fixups.h>
-#include <asm/reboot.h>
 #include <asm/pci_x86.h>
+#include <asm/pgtable.h>
 #include <asm/virtext.h>
+#include <asm/reboot.h>
+#include <asm/iommu.h>
+#include <asm/proto.h>
+#include <asm/apic.h>
+#include <asm/desc.h>
+#include <asm/hpet.h>
 #include <asm/cpu.h>
-
-#ifdef CONFIG_X86_32
-# include <linux/dmi.h>
-# include <linux/ctype.h>
-# include <linux/mc146818rtc.h>
-#else
-# include <asm/iommu.h>
-#endif
+#include <asm/io.h>
 
 /*
  * Power off function, if any
arch/x86/kernel/setup.c +59 -67

151 lines not on this page · raw message

arch/x86/kernel/setup_percpu.c +11 -10
index 400331b..85e84b4 100644
@@ -1,23 +1,24 @@
+#include <linux/crash_dump.h>
+#include <linux/topology.h>
+#include <linux/bootmem.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/init.h>
-#include <linux/bootmem.h>
 #include <linux/percpu.h>
 #include <linux/kexec.h>
-#include <linux/crash_dump.h>
-#include <linux/smp.h>
-#include <linux/topology.h>
+#include <linux/init.h>
 #include <linux/pfn.h>
-#include <asm/sections.h>
+#include <linux/smp.h>
+
+#include <asm/stackprotector.h>
 #include <asm/processor.h>
-#include <asm/setup.h>
-#include <asm/mpspec.h>
+#include <asm/sections.h>
 #include <asm/apicdef.h>
+#include <asm/cpumask.h>
 #include <asm/highmem.h>
+#include <asm/mpspec.h>
 #include <asm/proto.h>
-#include <asm/cpumask.h>
+#include <asm/setup.h>
 #include <asm/cpu.h>
-#include <asm/stackprotector.h>
 
 #ifdef CONFIG_DEBUG_PER_CPU_MAPS
 # define DBG(x...) printk(KERN_DEBUG x)
arch/x86/kernel/signal.c +14 -19
index dfcc74a..e12975d 100644
@@ -7,35 +7,30 @@
  *  2000-2002   x86-64 support by Andi Kleen
  */
 
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/smp.h>
+#include <linux/personality.h>
+#include <linux/tracehook.h>
+#include <linux/uaccess.h>
 #include <linux/kernel.h>
+#include <linux/ptrace.h>
 #include <linux/signal.h>
+#include <linux/stddef.h>
+#include <linux/unistd.h>
 #include <linux/errno.h>
+#include <linux/sched.h>
 #include <linux/wait.h>
-#include <linux/ptrace.h>
-#include <linux/tracehook.h>
-#include <linux/unistd.h>
-#include <linux/stddef.h>
-#include <linux/personality.h>
-#include <linux/uaccess.h>
+#include <linux/smp.h>
+#include <linux/mm.h>
 
+#include <asm/ia32_unistd.h>
 #include <asm/processor.h>
+#include <asm/sigframe.h>
+#include <asm/syscalls.h>
 #include <asm/ucontext.h>
+#include <asm/syscall.h>
+#include <asm/proto.h>
 #include <asm/i387.h>
 #include <asm/vdso.h>
-
-#ifdef CONFIG_X86_64
-#include <asm/proto.h>
-#include <asm/ia32_unistd.h>
 #include <asm/mce.h>
-#endif /* CONFIG_X86_64 */
-
-#include <asm/syscall.h>
-#include <asm/syscalls.h>
-
-#include <asm/sigframe.h>
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
arch/x86/kernel/smp.c +8 -8
index 13f33ea..d881655 100644
@@ -11,22 +11,22 @@
  *	later.
  */
 
-#include <linux/init.h>
-
-#include <linux/mm.h>
-#include <linux/delay.h>
-#include <linux/spinlock.h>
 #include <linux/kernel_stat.h>
 #include <linux/mc146818rtc.h>
-#include <linux/cache.h>
 #include <linux/interrupt.h>
+#include <linux/spinlock.h>
+#include <linux/cache.h>
+#include <linux/delay.h>
+#include <linux/init.h>
 #include <linux/cpu.h>
+#include <linux/mm.h>
 
-#include <asm/mtrr.h>
-#include <asm/tlbflush.h>
 #include <asm/mmu_context.h>
+#include <asm/tlbflush.h>
 #include <asm/proto.h>
 #include <asm/apic.h>
+#include <asm/mtrr.h>
+
 /*
  *	Some notes on x86 processor bugs affecting SMP operation:
  *
arch/x86/kernel/smpboot.c +16 -17
index ef7d101..60f6dde 100644
@@ -39,33 +39,32 @@
  *	Glauber Costa		:	i386 and x86_64 integration
  */
 
-#include <linux/init.h>
-#include <linux/smp.h>
+#include <linux/mc146818rtc.h>
+#include <linux/bootmem.h>
 #include <linux/module.h>
-#include <linux/sched.h>
 #include <linux/percpu.h>
-#include <linux/bootmem.h>
+#include <linux/sched.h>
+#include <linux/init.h>
 #include <linux/err.h>
 #include <linux/nmi.h>
+#include <linux/smp.h>
 
+#include <asm/smpboot_hooks.h>
+#include <asm/trampoline.h>
+#include <asm/tlbflush.h>
+#include <asm/pgtable.h>
+#include <asm/setup.h>
+#include <asm/uv/uv.h>
 #include <asm/acpi.h>
+#include <asm/apic.h>
 #include <asm/desc.h>
-#include <asm/nmi.h>
-#include <asm/irq.h>
 #include <asm/idle.h>
-#include <asm/trampoline.h>
-#include <asm/cpu.h>
-#include <asm/numa.h>
-#include <asm/pgtable.h>
-#include <asm/tlbflush.h>
 #include <asm/mtrr.h>
+#include <asm/numa.h>
+#include <asm/cpu.h>
+#include <asm/irq.h>
+#include <asm/nmi.h>
 #include <asm/vmi.h>
-#include <asm/apic.h>
-#include <asm/setup.h>
-#include <asm/uv/uv.h>
-#include <linux/mc146818rtc.h>
-
-#include <asm/smpboot_hooks.h>
 
 #ifdef CONFIG_X86_32
 u8 apicid_2_node[MAX_APICID];
arch/x86/kernel/stacktrace.c +4 -2
index f7bddc2..397eb1f 100644
@@ -3,10 +3,12 @@
  *
  *  Copyright (C) 2006-2009 Red Hat, Inc., Ingo Molnar <[email protected]>
  */
-#include <linux/sched.h>
+
 #include <linux/stacktrace.h>
-#include <linux/module.h>
 #include <linux/uaccess.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+
 #include <asm/stacktrace.h>
 
 static void save_stack_warning(void *data, char *msg)
arch/x86/kernel/step.c +2 -1
index e8b9863..caa27d3 100644
@@ -1,9 +1,10 @@
 /*
  * x86 single-step support code, common to 32-bit and 64-bit.
  */
+
+#include <linux/ptrace.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
-#include <linux/ptrace.h>
 
 unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs)
 {
arch/x86/kernel/sys_i386_32.c +12 -13
index 1884a8d..287fa4b 100644
@@ -4,23 +4,22 @@
  * platform.
  */
 
+#include <linux/syscalls.h>
+#include <linux/uaccess.h>
+#include <linux/utsname.h>
+#include <linux/unistd.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/fs.h>
-#include <linux/smp.h>
-#include <linux/sem.h>
-#include <linux/msg.h>
-#include <linux/shm.h>
-#include <linux/stat.h>
-#include <linux/syscalls.h>
-#include <linux/mman.h>
 #include <linux/file.h>
-#include <linux/utsname.h>
+#include <linux/mman.h>
+#include <linux/stat.h>
 #include <linux/ipc.h>
-
-#include <linux/uaccess.h>
-#include <linux/unistd.h>
+#include <linux/msg.h>
+#include <linux/sem.h>
+#include <linux/shm.h>
+#include <linux/smp.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
 
 #include <asm/syscalls.h>
 
arch/x86/kernel/time_32.c +3 -4
index 5c5d87f..5ce14b9 100644
@@ -28,17 +28,16 @@
  *	serialize accesses to xtime/lost_ticks).
  */
 
-#include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/init.h>
 #include <linux/time.h>
 #include <linux/mca.h>
 
+#include <asm/do_timer.h>
 #include <asm/setup.h>
+#include <asm/timer.h>
 #include <asm/hpet.h>
 #include <asm/time.h>
-#include <asm/timer.h>
-
-#include <asm/do_timer.h>
 
 int timer_ack;
 
arch/x86/kernel/tls.c +5 -5
index 6bb7b85..944b8ed 100644
@@ -1,16 +1,16 @@
 #include <linux/kernel.h>
+#include <linux/regset.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/user.h>
-#include <linux/regset.h>
 
+#include <asm/processor.h>
+#include <asm/syscalls.h>
 #include <asm/uaccess.h>
-#include <asm/desc.h>
 #include <asm/system.h>
-#include <asm/ldt.h>
-#include <asm/processor.h>
 #include <asm/proto.h>
-#include <asm/syscalls.h>
+#include <asm/desc.h>
+#include <asm/ldt.h>
 
 #include "tls.h"
 
arch/x86/kernel/trampoline_32.S +2 -1
index 66d874e..9fa45df 100644
@@ -28,8 +28,9 @@
  */
 
 #include <linux/linkage.h>
-#include <asm/segment.h>
+
 #include <asm/page_types.h>
+#include <asm/segment.h>
 
 /* We can free up trampoline after bootup if cpu hotplug is not supported. */
 #ifndef CONFIG_HOTPLUG_CPU
arch/x86/kernel/traps.c +11 -23
index a1d2883..4f1e6cf 100644
@@ -15,6 +15,7 @@
 #include <linux/kprobes.h>
 #include <linux/uaccess.h>
 #include <linux/utsname.h>
+#include <linux/ioport.h>
 #include <linux/kdebug.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -25,47 +26,34 @@
 #include <linux/kexec.h>
 #include <linux/sched.h>
 #include <linux/timer.h>
+#include <linux/edac.h>
+#include <linux/eisa.h>
 #include <linux/init.h>
 #include <linux/bug.h>
+#include <linux/mca.h>
 #include <linux/nmi.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
 #include <linux/io.h>
 
-#ifdef CONFIG_EISA
-#include <linux/ioport.h>
-#include <linux/eisa.h>
-#endif
-
-#ifdef CONFIG_MCA
-#include <linux/mca.h>
-#endif
-
-#if defined(CONFIG_EDAC)
-#include <linux/edac.h>
-#endif
-
+#include <asm/processor-flags.h>
+#include <asm/mach_traps.h>
 #include <asm/stacktrace.h>
 #include <asm/processor.h>
 #include <asm/debugreg.h>
+#include <asm/pgalloc.h>
 #include <asm/atomic.h>
 #include <asm/system.h>
-#include <asm/traps.h>
-#include <asm/desc.h>
-#include <asm/i387.h>
-
-#include <asm/mach_traps.h>
-
-#ifdef CONFIG_X86_64
-#include <asm/pgalloc.h>
 #include <asm/proto.h>
-#else
-#include <asm/processor-flags.h>
 #include <asm/setup.h>
 #include <asm/traps.h>
+#include <asm/desc.h>
+#include <asm/i387.h>
 
 #include "cpu/mcheck/mce.h"
 
+#ifndef CONFIG_X86_64
+
 asmlinkage int system_call(void);
 
 /* Do we ignore FPU interrupts ? */
arch/x86/kernel/tsc.c +10 -10
index 462b9ba..6598ef0 100644
@@ -1,21 +1,21 @@
+#include <linux/clocksource.h>
+#include <linux/acpi_pmtmr.h>
+#include <linux/cpufreq.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/init.h>
 #include <linux/module.h>
+#include <linux/percpu.h>
+#include <linux/delay.h>
+#include <linux/sched.h>
 #include <linux/timer.h>
-#include <linux/acpi_pmtmr.h>
-#include <linux/cpufreq.h>
+#include <linux/init.h>
 #include <linux/dmi.h>
-#include <linux/delay.h>
-#include <linux/clocksource.h>
-#include <linux/percpu.h>
 
-#include <asm/hpet.h>
+#include <asm/hypervisor.h>
+#include <asm/delay.h>
 #include <asm/timer.h>
 #include <asm/vgtod.h>
+#include <asm/hpet.h>
 #include <asm/time.h>
-#include <asm/delay.h>
-#include <asm/hypervisor.h>
 
 unsigned int cpu_khz;           /* TSC clocks / usec, not used here */
 EXPORT_SYMBOL(cpu_khz);
arch/x86/kernel/tsc_sync.c +1 -1
index bf36328..0bac99f 100644
@@ -17,8 +17,8 @@
 #include <linux/spinlock.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/smp.h>
 #include <linux/nmi.h>
+#include <linux/smp.h>
 #include <asm/tsc.h>
 
 /*
arch/x86/kernel/vm86_32.c +10 -10
index d7ac84e..c05a2c1 100644
@@ -29,24 +29,24 @@
  */
 
 #include <linux/capability.h>
-#include <linux/errno.h>
 #include <linux/interrupt.h>
-#include <linux/sched.h>
+#include <linux/highmem.h>
 #include <linux/kernel.h>
+#include <linux/ptrace.h>
 #include <linux/signal.h>
+#include <linux/stddef.h>
 #include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/smp.h>
-#include <linux/highmem.h>
-#include <linux/ptrace.h>
 #include <linux/audit.h>
-#include <linux/stddef.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/smp.h>
+#include <linux/mm.h>
 
-#include <asm/uaccess.h>
-#include <asm/io.h>
+#include <asm/syscalls.h>
 #include <asm/tlbflush.h>
+#include <asm/uaccess.h>
 #include <asm/irq.h>
-#include <asm/syscalls.h>
+#include <asm/io.h>
 
 /*
  * Known problems:
arch/x86/kernel/xsave.c +2 -3
index 2b54fe0..778ed67 100644
@@ -3,12 +3,11 @@
  *
  * Author: Suresh Siddha <[email protected]>
  */
+
+#include <asm/sigcontext32.h>
 #include <linux/bootmem.h>
 #include <linux/compat.h>
 #include <asm/i387.h>
-#ifdef CONFIG_IA32_EMULATION
-#include <asm/sigcontext32.h>
-#endif
 #include <asm/xcr.h>
 
 /*
#1 lore raw
Quoted 10 lines · Jaswinder Singh Rajput

The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
Ingo Molnar (1):

        Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Jaswinder Singh Rajput (49):
x86: process_32.c include inverse Xmas tree effect

What the heck is this?

Quoted 177 lines

x86: signal.c include inverse Xmas tree effect
x86: entry_32.S include inverse Xmas tree effect
x86: traps.c include inverse Xmas tree effect
x86: irq.c include inverse Xmas tree effect
x86: irq_32.c include inverse Xmas tree effect
x86: dumpstack.c include inverse Xmas tree effect
x86: time_32.c include inverse Xmas tree effect
x86: ioport.c include inverse Xmas tree effect
x86: ldt.c include inverse Xmas tree effect
x86: dumpstack_32.c include inverse Xmas tree effect
x86: setup.c include inverse Xmas tree effect
x86: i8259.c include inverse Xmas tree effect
x86: irqinit_32.c include inverse Xmas tree effect
x86: probe_roms_32.c include inverse Xmas tree effect
x86: sys_i386_32.c include inverse Xmas tree effect
x86: i386_ksyms_32.c include inverse Xmas tree effect
x86: bootflag.c include inverse Xmas tree effect
x86: e820.c include inverse Xmas tree effect
x86: pci-dma.c include inverse Xmas tree effect
x86: quirks.c include inverse Xmas tree effect
x86: i8237.c include inverse Xmas tree effect
x86: alternative.c include inverse Xmas tree effect
x86: tsc.c include inverse Xmas tree effect
x86: process.c include inverse Xmas tree effect
x86: xsave.c include inverse Xmas tree effect
x86: ptrace.c include inverse Xmas tree effect
x86: ds.c include inverse Xmas tree effect
x86: tls.c include inverse Xmas tree effect
x86: step.c include inverse Xmas tree effect
x86: stacktrace.c include inverse Xmas tree effect
x86: reboot.c include inverse Xmas tree effect
x86: msr.c include inverse Xmas tree effect
x86: cpuid.c include inverse Xmas tree effect
x86: early-quirks.c include inverse Xmas tree effect
x86: smp.c include inverse Xmas tree effect
x86: smpboot.c include inverse Xmas tree effect
x86: tsc_sync.c include inverse Xmas tree effect
x86: setup_percpu.c include inverse Xmas tree effect
x86: trampoline_32.S include inverse Xmas tree effect
x86: mpparse.c include inverse Xmas tree effect
x86: module_32.c include inverse Xmas tree effect
x86: doublefault_32.c include inverse Xmas tree effect
x86: vm86_32.c include inverse Xmas tree effect
ix86: early_printk.c include inverse Xmas tree effect
x86: pcspeaker.c include inverse Xmas tree effect
x86: head_32.c include inverse Xmas tree effect
x86: head.c include inverse Xmas tree effect
x86: init_task.c include inverse Xmas tree effect

 arch/x86/include/asm/proto.h         |    2 +
 arch/x86/include/asm/sigcontext32.h  |    3 +-
 arch/x86/include/asm/smpboot_hooks.h |    2 +
 arch/x86/include/asm/topology.h      |    2 +
 arch/x86/kernel/alternative.c        |   11 ++--
 arch/x86/kernel/bootflag.c           |   12 ++--
 arch/x86/kernel/cpuid.c              |   17 ++---
 arch/x86/kernel/doublefault_32.c     |    8 +-
 arch/x86/kernel/ds.c                 |   11 +--
 arch/x86/kernel/dumpstack.c          |    5 +-
 arch/x86/kernel/dumpstack_32.c       |    5 +-
 arch/x86/kernel/e820.c               |   21 +++---
 arch/x86/kernel/early-quirks.c       |    9 ++-
 arch/x86/kernel/early_printk.c       |   26 ++++---
 arch/x86/kernel/entry_32.S           |   17 +++--
 arch/x86/kernel/head.c               |    2 +-
 arch/x86/kernel/head_32.S            |   17 +++--
 arch/x86/kernel/i386_ksyms_32.c      |    3 +-
 arch/x86/kernel/i8237.c              |    3 +-
 arch/x86/kernel/i8259.c              |   28 ++++----
 arch/x86/kernel/init_task.c          |    8 +-
 arch/x86/kernel/ioport.c             |   15 ++--
 arch/x86/kernel/irq.c                |   11 ++--
 arch/x86/kernel/irq_32.c             |   10 ++--
 arch/x86/kernel/irqinit_32.c         |   29 ++++----
 arch/x86/kernel/ldt.c                |   14 ++--
 arch/x86/kernel/module_32.c          |    7 +-
 arch/x86/kernel/mpparse.c            |   24 +++---
 arch/x86/kernel/msr.c                |   17 ++---
 arch/x86/kernel/pci-dma.c            |   10 ++--
 arch/x86/kernel/pcspeaker.c          |    2 +-
 arch/x86/kernel/probe_roms_32.c      |   23 +++---
 arch/x86/kernel/process.c            |   19 +++---
 arch/x86/kernel/process_32.c         |   70 +++++++++----------
 arch/x86/kernel/ptrace.c             |   30 ++++----
 arch/x86/kernel/quirks.c             |    4 +-
 arch/x86/kernel/reboot.c             |   30 ++++----
 arch/x86/kernel/setup.c              |  126 ++++++++++++++++------------------
 arch/x86/kernel/setup_percpu.c       |   21 +++---
 arch/x86/kernel/signal.c             |   33 ++++-----
 arch/x86/kernel/smp.c                |   16 ++--
 arch/x86/kernel/smpboot.c            |   33 ++++-----
 arch/x86/kernel/stacktrace.c         |    6 +-
 arch/x86/kernel/step.c               |    3 +-
 arch/x86/kernel/sys_i386_32.c        |   25 +++----
 arch/x86/kernel/time_32.c            |    7 +-
 arch/x86/kernel/tls.c                |   10 ++--
 arch/x86/kernel/trampoline_32.S      |    3 +-
 arch/x86/kernel/traps.c              |   34 +++------
 arch/x86/kernel/tsc.c                |   20 +++---
 arch/x86/kernel/tsc_sync.c           |    2 +-
 arch/x86/kernel/vm86_32.c            |   20 +++---
 arch/x86/kernel/xsave.c              |    5 +-
 53 files changed, 437 insertions(+), 454 deletions(-)

Complete diff:

arch/x86/include/asm/proto.h +2 -0
index 49fb3ec..a8d63be 100644
@@ -7,7 +7,9 @@
 
 extern void early_idt_handler(void);
 
+#ifdef CONFIG_X86_64
 extern void system_call(void);
+#endif
 extern void syscall_init(void);
 
 extern void ia32_syscall(void);
arch/x86/include/asm/sigcontext32.h +2 -1
index ad1478c..f80df2e 100644
@@ -1,6 +1,7 @@
 #ifndef _ASM_X86_SIGCONTEXT32_H
 #define _ASM_X86_SIGCONTEXT32_H
 
+#ifdef CONFIG_IA32_EMULATION
 #include <linux/types.h>
 
 /* signal context for 32bit programs. */
@@ -73,5 +74,5 @@ struct sigcontext_ia32 {
        unsigned int oldmask;
        unsigned int cr2;
 };
-
+#endif
 #endif /* _ASM_X86_SIGCONTEXT32_H */
arch/x86/include/asm/smpboot_hooks.h +2 -0
index 1def601..dff6e11 100644
@@ -1,6 +1,8 @@
 /* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
  * which needs to alter them. */
 
+#include <asm/tlbflush.h>
+
 static inline void smpboot_clear_io_apic_irqs(void)
 {
 #ifdef CONFIG_X86_IO_APIC
arch/x86/include/asm/topology.h +2 -0
index 77cfb2c..1f23e58 100644
@@ -194,10 +194,12 @@ extern int __node_distance(int, int);
 
 #else /* !CONFIG_NUMA */
 
+#if 0
 static inline int numa_node_id(void)
 {
 	return 0;
 }
+#endif
 
 static inline int cpu_to_node(int cpu)
 {
arch/x86/kernel/alternative.c +2 -1
index 4c80f15..51fb5c5 100644
@@ -1,17 +1,18 @@
+#include <linux/kprobes.h>
+#include <linux/vmalloc.h>
 #include <linux/module.h>
-#include <linux/sched.h>
#2 lore raw
Quoted 6 lines

kenel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Quoted 3 lines

Jaswinder Singh Rajput (49):
x86: process_32.c include inverse Xmas tree effect

What the heck is this?

Does inverse christmas tree effect not translate well. It could perhaps have been more clearly explained.

Getting the includes under control is a good thing and saves everyone time.

Alan

#3 lore raw
Quoted 5 lines · Alan Cox
Quoted 5 lines

kenel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Quoted 3 lines

Jaswinder Singh Rajput (49):
x86: process_32.c include inverse Xmas tree effect

Quoted 7 lines
Quoted 1 line

What the heck is this?

Does inverse christmas tree effect not translate well. It could perhaps have been more clearly explained.

Getting the includes under control is a good thing and saves everyone time.

Moving #includes up and down is not getting them under control.

#4 lore raw
Quoted 4 lines
Quoted 2 lines

Getting the includes under control is a good thing and saves everyone time.

Moving #includes up and down is not getting them under control.

Look a bit deeper and youĺl see what is going on (or tell your gcc to log the include calls and it will become very apparent)

#5 lore raw
In reply to Alexey Dobriyan
Quoted 8 lines · Alexey Dobriyan
Quoted 7 lines · Alan Cox
Quoted 6 lines

kenel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Quoted 3 lines

Jaswinder Singh Rajput (49):
x86: process_32.c include inverse Xmas tree effect

What the heck is this?

Quoted 7 lines
Quoted 5 lines

Does inverse christmas tree effect not translate well. It could perhaps have been more clearly explained.

Getting the includes under control is a good thing and saves everyone time.

Moving #includes up and down is not getting them under control.

Here is Ingo's response about this effect:

Quoted 68 lines · Ingo Molnar
Quoted 5 lines · Li Zefan
Quoted 5 lines

#include <linux/debugfs.h>
#include <linux/uaccess.h>

(quoted diff) +1 -1
-#include <linux/stat.h>
+#include <linux/module.h>
 #include <linux/init.h>
Quoted 8 lines

Review

Quoted 5 lines
(quoted diff) +1 -1
+#include <linux/stat.h>
 #include <linux/io.h>
 #include <linux/mm.h>
-#include <linux/module.h>

Just curious about the rule to sort those includes, and why they need to be rearranged.

Such includes (the 'reverse christmas tree'):

#include <linux/interrupt.h>
#include <linux/mmiotrace.h>
#include <linux/bootmem.h>
#include <linux/compiler.h>
#include <linux/highmem.h>
#include <linux/kprobes.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
#include <linux/vt_kern.h>
#include <linux/signal.h>
#include <linux/kernel.h>
#include <linux/ptrace.h>
#include <linux/string.h>
#include <linux/module.h>
#include <linux/kdebug.h>
#include <linux/errno.h>
#include <linux/magic.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/mman.h>
#include <linux/tty.h>
#include <linux/smp.h>
#include <linux/mm.h>

#include <asm/kmemcheck.h>
#include <asm/tlbflush.h>
#include <asm/pgalloc.h>
#include <asm/segment.h>
#include <asm/system.h>
#include <asm/proto.h>
#include <asm/traps.h>
#include <asm/desc.h>

are used by x86 architecture code (and some other subsystems) to reduce the likelyhood of patch conflicts in commonly modified kernel files.

Without such ordering developers typically append to the existing list of include files when introducing a new header - creating an almost certain patch conflict. Via the above ordering, new headers get distributed roughly evenly amongst the full range - and thus the chance of patch conflicts is much smaller.

This way it also looks a bit more structured and bit less messy. It looks unprofessional and sloppy if a .c file starts with a big block of thrown-together include files.

Ingo

#6 lore raw
In reply to Alexey Dobriyan
Quoted 5 lines · Alexey Dobriyan
Quoted 4 lines · Jaswinder Singh Rajput

The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
Ingo Molnar (1):

        Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core
Quoted 8 lines
Quoted 6 lines

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Jaswinder Singh Rajput (49):
x86: process_32.c include inverse Xmas tree effect

What the heck is this?

Ordering include based on length of line minimize the risk of merge conflicts.
If people just add new includes in the bottom of the list you are certain that a merge conflit happens.

This scheme is starting to be used in several places with the primary advocates being David Miller and Ingo.

It is getting used both for includes _and_ for local variables.

Sam

#7 lore raw
Quoted 11 lines · Sam Ravnborg

Ordering include based on length of line minimize the risk of merge conflicts.
If people just add new includes in the bottom of the list you are certain that a merge conflit happens.

This scheme is starting to be used in several places with the primary advocates being David Miller and Ingo.

It is getting used both for includes _and_ for local variables.

Personally I'd prefer alphabetic order, sorting based on length isn't a complete ordering. Nearly all editors can sort alphabetically at the push of a key.

-hpa

#8 lore raw
Quoted 10 lines · H. Peter Anvin
Quoted 9 lines · Sam Ravnborg

Ordering include based on length of line minimize the risk of merge conflicts.
If people just add new includes in the bottom of the list you are certain that a merge conflit happens.

This scheme is starting to be used in several places with the primary advocates being David Miller and Ingo.

Quoted 6 lines
Quoted 2 lines

It is getting used both for includes _and_ for local variables.

Personally I'd prefer alphabetic order, sorting based on length isn't a complete ordering. Nearly all editors can sort alphabetically at the push of a key.

*shrug*

FWIW, the real problem is that we have far too many includes in a typical file; the ordering wouldn't matter if there would be 4-5 #include in foo.c. Inventing elaborate policies to cope with that crap instead of addressing the root cause (namely, cut'n'paste approach to includes) is rather pointless...

#9 lore raw
In reply to H. Peter Anvin
Quoted 10 lines · H. Peter Anvin
Quoted 9 lines · Sam Ravnborg

Ordering include based on length of line minimize the risk of merge conflicts.
If people just add new includes in the bottom of the list you are certain that a merge conflit happens.

This scheme is starting to be used in several places with the primary advocates being David Miller and Ingo.

Quoted 6 lines
Quoted 2 lines

It is getting used both for includes _and_ for local variables.

Personally I'd prefer alphabetic order, sorting based on length isn't a complete ordering. Nearly all editors can sort alphabetically at the push of a key.

I'd prefer if somebody would sit down and write a tool to analyse the include hell instead of manually shuffling crap around to avoid trivial merge conflicts. I have cleaned up enough stuff in the x86 merger myself where I was able to cut the number of includes at least in half just by staring at the gcc intermediate files. We could do better and automate the analysis so we get down to a handful of includes instead of including the world and more.

Also there are lots of occasions where includes in header files can be avoided completely by a single line forward declaration of struct foo instead of adding the include, which drags in another five.

Thanks,

tglx

#10 lore raw
Quoted 11 lines · Thomas Gleixner
Quoted 3 lines

Personally I'd prefer alphabetic order, sorting based on length isn't a complete ordering. Nearly all editors can sort alphabetically at the push of a key.

I'd prefer if somebody would sit down and write a tool to analyse the include hell instead of manually shuffling crap around to avoid trivial merge conflicts. I have cleaned up enough stuff in the x86 merger myself where I was able to cut the number of includes at least in half just by staring at the gcc intermediate files. We could do better and automate the analysis so we get down to a handful of includes instead of including the world and more.

I do not disagree with include file cleanups (we've done many of them in this cycle and in previous cycles), but note that the reduction in include files at the top of .c files actually increases the chance of patch conflicts: when a new include file is added by two patches to the same .c file.

Ingo

#11 lore raw
Quoted 14 lines · Ingo Molnar
Quoted 11 lines · Thomas Gleixner
Quoted 3 lines

Personally I'd prefer alphabetic order, sorting based on length isn't a complete ordering. Nearly all editors can sort alphabetically at the push of a key.

I'd prefer if somebody would sit down and write a tool to analyse the include hell instead of manually shuffling crap around to avoid trivial merge conflicts. I have cleaned up enough stuff in the x86 merger myself where I was able to cut the number of includes at least in half just by staring at the gcc intermediate files. We could do better and automate the analysis so we get down to a handful of includes instead of including the world and more.

Quoted 5 lines

I do not disagree with include file cleanups (we've done many of them in this cycle and in previous cycles), but note that the reduction in include files at the top of .c files actually increases the chance of patch conflicts: when a new include file is added by two patches to the same .c file.

Those conflicts are trivial and if we have a mechanism to anlyse include dependencies then we can avoid such conflicts often at all.

Go through some of the include madness and watch the compiler reading the same header file ten times for a single source file compile.

Thanks,

tglx

#12 lore raw
Quoted 21 lines · Thomas Gleixner
Quoted 14 lines · Ingo Molnar
Quoted 11 lines · Thomas Gleixner
Quoted 3 lines

Personally I'd prefer alphabetic order, sorting based on length isn't a complete ordering. Nearly all editors can sort alphabetically at the push of a key.

I'd prefer if somebody would sit down and write a tool to analyse the include hell instead of manually shuffling crap around to avoid trivial merge conflicts. I have cleaned up enough stuff in the x86 merger myself where I was able to cut the number of includes at least in half just by staring at the gcc intermediate files. We could do better and automate the analysis so we get down to a handful of includes instead of including the world and more.

Quoted 5 lines

I do not disagree with include file cleanups (we've done many of them in this cycle and in previous cycles), but note that the reduction in include files at the top of .c files actually increases the chance of patch conflicts: when a new include file is added by two patches to the same .c file.

Quoted 3 lines

Those conflicts are trivial and if we have a mechanism to anlyse include dependencies then we can avoid such conflicts often at all.

Yeah, i agree that least 50% of the existing #include's are not needed.

That's not the point though. When two new files both append to the #include file section, they'll clash. Those _new_ includes tend to be justified - people dont add #includes needlessly - it's years long bitrot that causes #includes to bloat up slowly.

Quoted 3 lines

Go through some of the include madness and watch the compiler reading the same header file ten times for a single source file compile.

Yes, we need both efforts. That section needs to look professional (unordered lines look amateurishly random, arbitrary and confusing), and it needs to be minimalized as well.

And the xmas-tree helps the minimizing effort - as it trivially eliminates duplicate #includes (which do happen frequently as well), and they eliminate related includes as well because they get moved together and get noticed.

Most importantly, such code needs to look like as if someone actually cared about it. If code looks tidy, people assume that it's supposed to be perfect, and will notice and fix more subtle imperfections in it. If code looks totally messy on the other hand, _nobody_ will care because it's visibly broken. So these changes are a small step forward.

Ingo

#13 lore raw
Quoted 3 lines · Ingo Molnar

Yes, we need both efforts. That section needs to look professional (unordered lines look amateurishly random, arbitrary and confusing), and it needs to be minimalized as well.

You are _begging_ for basic training jokes, along the lines of "every blade of grass shall be painted regulation green"...

#14 lore raw
In reply to Ingo Molnar
Quoted 28 lines · Ingo Molnar
Quoted 21 lines · Thomas Gleixner
Quoted 14 lines · Ingo Molnar
Quoted 11 lines · Thomas Gleixner
Quoted 3 lines

Personally I'd prefer alphabetic order, sorting based on length isn't a complete ordering. Nearly all editors can sort alphabetically at the push of a key.

I'd prefer if somebody would sit down and write a tool to analyse the include hell instead of manually shuffling crap around to avoid trivial merge conflicts. I have cleaned up enough stuff in the x86 merger myself where I was able to cut the number of includes at least in half just by staring at the gcc intermediate files. We could do better and automate the analysis so we get down to a handful of includes instead of including the world and more.

Quoted 5 lines

I do not disagree with include file cleanups (we've done many of them in this cycle and in previous cycles), but note that the reduction in include files at the top of .c files actually increases the chance of patch conflicts: when a new include file is added by two patches to the same .c file.

Quoted 3 lines

Those conflicts are trivial and if we have a mechanism to anlyse include dependencies then we can avoid such conflicts often at all.

Quoted 11 lines

Yeah, i agree that least 50% of the existing #include's are not needed.

That's not the point though. When two new files both append to the #include file section, they'll clash. Those _new_ includes tend to be justified - people dont add #includes needlessly - it's years long bitrot that causes #includes to bloat up slowly.

Quoted 3 lines

Go through some of the include madness and watch the compiler reading the same header file ten times for a single source file compile.

Care to read strace(1) output? Include file is not even opened second time.

[reads strace(1) output himself]

Correction!

Except, e. g., <asm/atomic.h> because i386/x86_64 unification dropped ifndef guards in the right place and added them in the wrong one.

Quoted 3 lines

Yes, we need both efforts. That section needs to look professional (unordered lines look amateurishly random, arbitrary and confusing), and it needs to be minimalized as well.

These are #include directives, how else should they look like. As for confusing, as if you're looking for the first time at C code.

Quoted 2 lines

And the xmas-tree helps the minimizing effort - as it trivially eliminates duplicate #includes (which do happen frequently as well),

yes, 5-10-20 for the whole tree per release and people periodically removing them regardless of -tip, Xmas and so on.

Quoted 2 lines

and they eliminate related includes as well because they get moved together and get noticed.

I'll answer on this later.

Quoted 2 lines

Most importantly, such code needs to look like as if someone actually cared about it.

Reminder, this is include directives, not real code.

Quoted 5 lines

If code looks tidy, people assume that it's
supposed to be perfect, and will notice and fix more subtle imperfections in it. If code looks totally messy on the other hand, _nobody_ will care because it's visibly broken. So these changes are a small step forward.

People probably forgot the real problem with includes and start inventing new non-problems with all the consequences.

So here is my countersuggestion for small and useful improvements:

1. Plug ifndef guargs back on x86.
Check with strace(1) for past behaviour re non-opened includes. Remove current ifdef guards (need much more thinking for consequences)

2. Do #1 for other arches which exercised similar transformation (sparc/sparc64?)

3. For headers with small and let's say bounded area like <asm/unistd.h>, go check for every file including them and remove it if header genuinely unneeded.

In case of <asm/unistd.h> this would check for copy_from_user/copy_to_user, put_user/get_user, clear_user and not much more.

This will reduce compile time _and_ size of DEBUG_INFO=y kernels.

#15 lore raw
In reply to Thomas Gleixner
Quoted 21 lines · Thomas Gleixner
Quoted 14 lines · Ingo Molnar
Quoted 11 lines · Thomas Gleixner
Quoted 3 lines

Personally I'd prefer alphabetic order, sorting based on length isn't a complete ordering. Nearly all editors can sort alphabetically at the push of a key.

I'd prefer if somebody would sit down and write a tool to analyse the include hell instead of manually shuffling crap around to avoid trivial merge conflicts. I have cleaned up enough stuff in the x86 merger myself where I was able to cut the number of includes at least in half just by staring at the gcc intermediate files. We could do better and automate the analysis so we get down to a handful of includes instead of including the world and more.

Quoted 5 lines

I do not disagree with include file cleanups (we've done many of them in this cycle and in previous cycles), but note that the reduction in include files at the top of .c files actually increases the chance of patch conflicts: when a new include file is added by two patches to the same .c file.

Quoted 5 lines

Those conflicts are trivial and if we have a mechanism to anlyse include dependencies then we can avoid such conflicts often at all.

Go through some of the include madness and watch the compiler reading the same header file ten times for a single source file compile.

I'm not against sorting the headers at all. I personally have no preference whether it's alphabetical or length, but...

I just run the following on current git:

# FS=find -type f; for F in $FS; do grep -c "#include" $F; done | sort -n | uniq -c

The top 5 are:

lib/locking-selftest.c: 108 (justified as this includes all the test cases)
fs/compat_ioctl.c 88 (maybe ok as it is the all in one kitchen sink)
arch/x86/kernel/setup.c: 76 (completely nuts)
init/main.c: 62 (needs to be looked at)
security/selinux/hooks.c 61 (needs to be looked at, spotted at least 5 which can be removed)

1400 files have more than 20 includes. 5375 more than 10.

I think it's well justified to sit down and work on a tool which helps us analyse and distangle that mess.

Thanks,

tglx

#16 lore raw
Quoted 9 lines · Thomas Gleixner

I just run the following on current git:

# FS=find -type f; for F in $FS; do grep -c "#include" $F; done | sort -n | uniq -c

The top 5 are:

lib/locking-selftest.c: 108 (justified as this includes all the test cases)
fs/compat_ioctl.c 88 (maybe ok as it is the all in one kitchen sink)
arch/x86/kernel/setup.c: 76 (completely nuts)

[yep]

Quoted 7 lines

init/main.c: 62 (needs to be looked at)
security/selinux/hooks.c 61 (needs to be looked at, spotted at least 5 which can be removed)

1400 files have more than 20 includes. 5375 more than 10.

I think it's well justified to sit down and work on a tool which helps us analyse and distangle that mess.

yeah.

Ingo

#17 lore raw
In reply to H. Peter Anvin
Quoted 10 lines · H. Peter Anvin
Quoted 9 lines · Sam Ravnborg

Ordering include based on length of line minimize the risk of merge conflicts.
If people just add new includes in the bottom of the list you are certain that a merge conflit happens.

This scheme is starting to be used in several places with the primary advocates being David Miller and Ingo.

Quoted 7 lines
Quoted 2 lines

It is getting used both for includes _and_ for local variables.

Personally I'd prefer alphabetic order, sorting based on length isn't a complete ordering. Nearly all editors can sort alphabetically at the push of a key.

This sorting is based on Length + alphabetic.

--
JSR

#18 lore raw
In reply to Jaswinder Singh Rajput
Quoted 50 lines · Jaswinder Singh Rajput

The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
Ingo Molnar (1):

        Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Jaswinder Singh Rajput (49):
x86: process_32.c include inverse Xmas tree effect
x86: signal.c include inverse Xmas tree effect
x86: entry_32.S include inverse Xmas tree effect
x86: traps.c include inverse Xmas tree effect
x86: irq.c include inverse Xmas tree effect
x86: irq_32.c include inverse Xmas tree effect
x86: dumpstack.c include inverse Xmas tree effect
x86: time_32.c include inverse Xmas tree effect
x86: ioport.c include inverse Xmas tree effect
x86: ldt.c include inverse Xmas tree effect
x86: dumpstack_32.c include inverse Xmas tree effect
x86: setup.c include inverse Xmas tree effect
x86: i8259.c include inverse Xmas tree effect
x86: irqinit_32.c include inverse Xmas tree effect
x86: probe_roms_32.c include inverse Xmas tree effect
x86: sys_i386_32.c include inverse Xmas tree effect
x86: i386_ksyms_32.c include inverse Xmas tree effect
x86: bootflag.c include inverse Xmas tree effect
x86: e820.c include inverse Xmas tree effect
x86: pci-dma.c include inverse Xmas tree effect
x86: quirks.c include inverse Xmas tree effect
x86: i8237.c include inverse Xmas tree effect
x86: alternative.c include inverse Xmas tree effect
x86: tsc.c include inverse Xmas tree effect
x86: process.c include inverse Xmas tree effect
x86: xsave.c include inverse Xmas tree effect
x86: ptrace.c include inverse Xmas tree effect
x86: ds.c include inverse Xmas tree effect
x86: tls.c include inverse Xmas tree effect
x86: step.c include inverse Xmas tree effect
x86: stacktrace.c include inverse Xmas tree effect
x86: reboot.c include inverse Xmas tree effect
x86: msr.c include inverse Xmas tree effect
x86: cpuid.c include inverse Xmas tree effect
x86: early-quirks.c include inverse Xmas tree effect
x86: smp.c include inverse Xmas tree effect
x86: smpboot.c include inverse Xmas tree effect
x86: tsc_sync.c include inverse Xmas tree effect
x86: setup_percpu.c include inverse Xmas tree effect
x86: trampoline_32.S include inverse Xmas tree effect
x86: mpparse.c include inverse Xmas tree effect

Quoted 8 lines

x86: module_32.c include inverse Xmas tree effect
x86: doublefault_32.c include inverse Xmas tree effect
x86: vm86_32.c include inverse Xmas tree effect
ix86: early_printk.c include inverse Xmas tree effect
x86: pcspeaker.c include inverse Xmas tree effect
x86: head_32.c include inverse Xmas tree effect
x86: head.c include inverse Xmas tree effect
x86: init_task.c include inverse Xmas tree effect

Where have you sent these patches for review?

Quoted 1 line

Complete diff:

No. Complete diffs are not easy to review. At least not in this size.

Quoted 27 lines
arch/x86/include/asm/proto.h +2 -0
index 49fb3ec..a8d63be 100644
@@ -7,7 +7,9 @@
 
 extern void early_idt_handler(void);
 
+#ifdef CONFIG_X86_64
 extern void system_call(void);
+#endif
 extern void syscall_init(void);
 
 extern void ia32_syscall(void);
arch/x86/include/asm/sigcontext32.h +1 -0
index ad1478c..f80df2e 100644
@@ -1,6 +1,7 @@
 #ifndef _ASM_X86_SIGCONTEXT32_H
 #define _ASM_X86_SIGCONTEXT32_H
 
+#ifdef CONFIG_IA32_EMULATION
 #include <linux/types.h>
 
 /* signal context for 32bit programs. */

arch/x86/include/asm/sigcontext32.h struct sigcontext_ia32 { · line 78

Quoted 6 lines
arch/x86/include/asm/sigcontext32.h +1 -1
@@ -73,5 +74,5 @@ struct sigcontext_ia32 {
        unsigned int oldmask;
        unsigned int cr2;
 };
-
+#endif
 #endif /* _ASM_X86_SIGCONTEXT32_H */

This doesn't seem to be related to your header include rearangements.

Quoted 18 lines
arch/x86/include/asm/smpboot_hooks.h +2 -0
index 1def601..dff6e11 100644
@@ -1,6 +1,8 @@
 /* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
  * which needs to alter them. */
 
+#include <asm/tlbflush.h>
+
 static inline void smpboot_clear_io_apic_irqs(void)
 {
 #ifdef CONFIG_X86_IO_APIC
arch/x86/include/asm/topology.h +0 -0
index 77cfb2c..1f23e58 100644

arch/x86/include/asm/topology.h extern int __node_distance(int, int); · line 202

Quoted 9 lines
arch/x86/include/asm/topology.h +2 -0
@@ -194,10 +194,12 @@ extern int __node_distance(int, int);
 
 #else /* !CONFIG_NUMA */
 
+#if 0
 static inline int numa_node_id(void)
 {
 	return 0;
 }
+#endif

"#if 0" ???

#19 lore raw
Quoted 60 lines · Joerg Roedel
Quoted 50 lines · Jaswinder Singh Rajput

The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
Ingo Molnar (1):

        Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Jaswinder Singh Rajput (49):
x86: process_32.c include inverse Xmas tree effect
x86: signal.c include inverse Xmas tree effect
x86: entry_32.S include inverse Xmas tree effect
x86: traps.c include inverse Xmas tree effect
x86: irq.c include inverse Xmas tree effect
x86: irq_32.c include inverse Xmas tree effect
x86: dumpstack.c include inverse Xmas tree effect
x86: time_32.c include inverse Xmas tree effect
x86: ioport.c include inverse Xmas tree effect
x86: ldt.c include inverse Xmas tree effect
x86: dumpstack_32.c include inverse Xmas tree effect
x86: setup.c include inverse Xmas tree effect
x86: i8259.c include inverse Xmas tree effect
x86: irqinit_32.c include inverse Xmas tree effect
x86: probe_roms_32.c include inverse Xmas tree effect
x86: sys_i386_32.c include inverse Xmas tree effect
x86: i386_ksyms_32.c include inverse Xmas tree effect
x86: bootflag.c include inverse Xmas tree effect
x86: e820.c include inverse Xmas tree effect
x86: pci-dma.c include inverse Xmas tree effect
x86: quirks.c include inverse Xmas tree effect
x86: i8237.c include inverse Xmas tree effect
x86: alternative.c include inverse Xmas tree effect
x86: tsc.c include inverse Xmas tree effect
x86: process.c include inverse Xmas tree effect
x86: xsave.c include inverse Xmas tree effect
x86: ptrace.c include inverse Xmas tree effect
x86: ds.c include inverse Xmas tree effect
x86: tls.c include inverse Xmas tree effect
x86: step.c include inverse Xmas tree effect
x86: stacktrace.c include inverse Xmas tree effect
x86: reboot.c include inverse Xmas tree effect
x86: msr.c include inverse Xmas tree effect
x86: cpuid.c include inverse Xmas tree effect
x86: early-quirks.c include inverse Xmas tree effect
x86: smp.c include inverse Xmas tree effect
x86: smpboot.c include inverse Xmas tree effect
x86: tsc_sync.c include inverse Xmas tree effect
x86: setup_percpu.c include inverse Xmas tree effect
x86: trampoline_32.S include inverse Xmas tree effect
x86: mpparse.c include inverse Xmas tree effect

Quoted 8 lines

x86: module_32.c include inverse Xmas tree effect
x86: doublefault_32.c include inverse Xmas tree effect
x86: vm86_32.c include inverse Xmas tree effect
ix86: early_printk.c include inverse Xmas tree effect
x86: pcspeaker.c include inverse Xmas tree effect
x86: head_32.c include inverse Xmas tree effect
x86: head.c include inverse Xmas tree effect
x86: init_task.c include inverse Xmas tree effect

Quoted 2 lines

Where have you sent these patches for review?

-tip's master.

Quoted 3 lines
Quoted 1 line

Complete diff:

No. Complete diffs are not easy to review. At least not in this size.

46 of 49 are clean patches, and only 3 are doubtful which you pointed. I am attaching those patches for feedback.

Quoted 26 lines
Quoted 26 lines
arch/x86/include/asm/proto.h +2 -0
index 49fb3ec..a8d63be 100644
@@ -7,7 +7,9 @@
 
 extern void early_idt_handler(void);
 
+#ifdef CONFIG_X86_64
 extern void system_call(void);
+#endif
 extern void syscall_init(void);
 
 extern void ia32_syscall(void);
arch/x86/include/asm/sigcontext32.h +1 -0
index ad1478c..f80df2e 100644
@@ -1,6 +1,7 @@
 #ifndef _ASM_X86_SIGCONTEXT32_H
 #define _ASM_X86_SIGCONTEXT32_H
 
+#ifdef CONFIG_IA32_EMULATION
 #include <linux/types.h>
 
Quoted 11 lines

arch/x86/include/asm/sigcontext32.h struct sigcontext_ia32 { · line 78

Quoted 8 lines
arch/x86/include/asm/sigcontext32.h +1 -1
 /* signal context for 32bit programs. */
@@ -73,5 +74,5 @@ struct sigcontext_ia32 {
        unsigned int oldmask;
        unsigned int cr2;
 };
-
+#endif
 #endif /* _ASM_X86_SIGCONTEXT32_H */

This doesn't seem to be related to your header include rearangements.

Please check this patch then you will find the relation:

From: Jaswinder Singh Rajput <[email protected]>
Date: Sat, 28 Mar 2009 16:02:42 +0530
Subject: [PATCH] x86: xsave.c include inverse Xmas tree effect

Impact: Xmas tree effect

---
 arch/x86/include/asm/sigcontext32.h |    3 ++-
 arch/x86/kernel/xsave.c             |    5 ++---
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/include/asm/sigcontext32.h +2 -1
index ad1478c..f80df2e 100644
@@ -1,6 +1,7 @@
 #ifndef _ASM_X86_SIGCONTEXT32_H
 #define _ASM_X86_SIGCONTEXT32_H
 
+#ifdef CONFIG_IA32_EMULATION
 #include <linux/types.h>
 
 /* signal context for 32bit programs. */
@@ -73,5 +74,5 @@ struct sigcontext_ia32 {
        unsigned int oldmask;
        unsigned int cr2;
 };
-
+#endif
 #endif /* _ASM_X86_SIGCONTEXT32_H */
arch/x86/kernel/xsave.c +2 -3
index 2b54fe0..778ed67 100644
@@ -3,12 +3,11 @@
  *
  * Author: Suresh Siddha <[email protected]>
  */
+
+#include <asm/sigcontext32.h>
 #include <linux/bootmem.h>
 #include <linux/compat.h>
 #include <asm/i387.h>
-#ifdef CONFIG_IA32_EMULATION
-#include <asm/sigcontext32.h>
-#endif
 #include <asm/xcr.h>
 
 /*
Signature · 1 line
1.6.0.6
Quoted 8 lines
Quoted 8 lines
arch/x86/include/asm/smpboot_hooks.h +0 -0
index 1def601..dff6e11 100644
@@ -1,6 +1,8 @@
 /* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
  * which needs to alter them. */
 
Quoted 5 lines

arch/x86/include/asm/smpboot_hooks.h line 8

Quoted 5 lines
arch/x86/include/asm/smpboot_hooks.h +2 -0
+#include <asm/tlbflush.h>
+
 static inline void smpboot_clear_io_apic_irqs(void)
 {
 #ifdef CONFIG_X86_IO_APIC

From: Jaswinder Singh Rajput <[email protected]>
Date: Sat, 28 Mar 2009 16:46:42 +0530
Subject: [PATCH] x86: smpboot.c include inverse Xmas tree effect

Impact: Xmas tree effect

---
 arch/x86/include/asm/smpboot_hooks.h |    2 ++
 arch/x86/kernel/smpboot.c            |   33 ++++++++++++++++-----------------
 2 files changed, 18 insertions(+), 17 deletions(-)
arch/x86/include/asm/smpboot_hooks.h +2 -0
index 1def601..dff6e11 100644
@@ -1,6 +1,8 @@
 /* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
  * which needs to alter them. */
 
+#include <asm/tlbflush.h>
+
 static inline void smpboot_clear_io_apic_irqs(void)
 {
 #ifdef CONFIG_X86_IO_APIC
arch/x86/kernel/smpboot.c +16 -17
index ef7d101..60f6dde 100644
@@ -39,33 +39,32 @@
  *	Glauber Costa		:	i386 and x86_64 integration
  */
 
-#include <linux/init.h>
-#include <linux/smp.h>
+#include <linux/mc146818rtc.h>
+#include <linux/bootmem.h>
 #include <linux/module.h>
-#include <linux/sched.h>
 #include <linux/percpu.h>
-#include <linux/bootmem.h>
+#include <linux/sched.h>
+#include <linux/init.h>
 #include <linux/err.h>
 #include <linux/nmi.h>
+#include <linux/smp.h>
 
+#include <asm/smpboot_hooks.h>
+#include <asm/trampoline.h>
+#include <asm/tlbflush.h>
+#include <asm/pgtable.h>
+#include <asm/setup.h>
+#include <asm/uv/uv.h>
 #include <asm/acpi.h>
+#include <asm/apic.h>
 #include <asm/desc.h>
-#include <asm/nmi.h>
-#include <asm/irq.h>
 #include <asm/idle.h>
-#include <asm/trampoline.h>
-#include <asm/cpu.h>
-#include <asm/numa.h>
-#include <asm/pgtable.h>
-#include <asm/tlbflush.h>
 #include <asm/mtrr.h>
+#include <asm/numa.h>
+#include <asm/cpu.h>
+#include <asm/irq.h>
+#include <asm/nmi.h>
 #include <asm/vmi.h>
-#include <asm/apic.h>
-#include <asm/setup.h>
-#include <asm/uv/uv.h>
-#include <linux/mc146818rtc.h>
-
-#include <asm/smpboot_hooks.h>
 
 #ifdef CONFIG_X86_32
 u8 apicid_2_node[MAX_APICID];
Signature · 1 line
1.6.0.6
Quoted 8 lines
Quoted 8 lines
arch/x86/include/asm/topology.h +0 -0
index 77cfb2c..1f23e58 100644
@@ -194,10 +194,12 @@ extern int __node_distance(int, int);
 
 #else /* !CONFIG_NUMA */
 
Quoted 9 lines

arch/x86/include/asm/topology.h extern int __node_distance(int, int); · line 202

Quoted 6 lines
arch/x86/include/asm/topology.h +2 -0
+#if 0
 static inline int numa_node_id(void)
 {
 	return 0;
 }
+#endif

"#if 0" ???

Hmm, this is really funny and doubtful. numa_node_id is already defined. Rusty :-)

From: Jaswinder Singh Rajput <[email protected]>
Date: Sat, 28 Mar 2009 17:11:43 +0530
Subject: [PATCH] x86: setup_percpu.c include inverse Xmas tree effect

Impact: Xmas tree effect

---
 arch/x86/include/asm/topology.h |    2 ++
 arch/x86/kernel/setup_percpu.c  |   21 +++++++++++----------
 2 files changed, 13 insertions(+), 10 deletions(-)
arch/x86/include/asm/topology.h +2 -0
index 77cfb2c..1f23e58 100644
@@ -194,10 +194,12 @@ extern int __node_distance(int, int);
 
 #else /* !CONFIG_NUMA */
 
+#if 0
 static inline int numa_node_id(void)
 {
 	return 0;
 }
+#endif
 
 static inline int cpu_to_node(int cpu)
 {
arch/x86/kernel/setup_percpu.c +11 -10
index 400331b..85e84b4 100644
@@ -1,23 +1,24 @@
+#include <linux/crash_dump.h>
+#include <linux/topology.h>
+#include <linux/bootmem.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/init.h>
-#include <linux/bootmem.h>
 #include <linux/percpu.h>
 #include <linux/kexec.h>
-#include <linux/crash_dump.h>
-#include <linux/smp.h>
-#include <linux/topology.h>
+#include <linux/init.h>
 #include <linux/pfn.h>
-#include <asm/sections.h>
+#include <linux/smp.h>
+
+#include <asm/stackprotector.h>
 #include <asm/processor.h>
-#include <asm/setup.h>
-#include <asm/mpspec.h>
+#include <asm/sections.h>
 #include <asm/apicdef.h>
+#include <asm/cpumask.h>
 #include <asm/highmem.h>
+#include <asm/mpspec.h>
 #include <asm/proto.h>
-#include <asm/cpumask.h>
+#include <asm/setup.h>
 #include <asm/cpu.h>
-#include <asm/stackprotector.h>
 
 #ifdef CONFIG_DEBUG_PER_CPU_MAPS
 # define DBG(x...) printk(KERN_DEBUG x)
Signature · 4 lines
1.6.0.6

--
JSR
#20 lore raw
Quoted 64 lines · Jaswinder Singh Rajput
Quoted 60 lines · Joerg Roedel
Quoted 50 lines · Jaswinder Singh Rajput

The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
Ingo Molnar (1):

        Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Jaswinder Singh Rajput (49):
x86: process_32.c include inverse Xmas tree effect
x86: signal.c include inverse Xmas tree effect
x86: entry_32.S include inverse Xmas tree effect
x86: traps.c include inverse Xmas tree effect
x86: irq.c include inverse Xmas tree effect
x86: irq_32.c include inverse Xmas tree effect
x86: dumpstack.c include inverse Xmas tree effect
x86: time_32.c include inverse Xmas tree effect
x86: ioport.c include inverse Xmas tree effect
x86: ldt.c include inverse Xmas tree effect
x86: dumpstack_32.c include inverse Xmas tree effect
x86: setup.c include inverse Xmas tree effect
x86: i8259.c include inverse Xmas tree effect
x86: irqinit_32.c include inverse Xmas tree effect
x86: probe_roms_32.c include inverse Xmas tree effect
x86: sys_i386_32.c include inverse Xmas tree effect
x86: i386_ksyms_32.c include inverse Xmas tree effect
x86: bootflag.c include inverse Xmas tree effect
x86: e820.c include inverse Xmas tree effect
x86: pci-dma.c include inverse Xmas tree effect
x86: quirks.c include inverse Xmas tree effect
x86: i8237.c include inverse Xmas tree effect
x86: alternative.c include inverse Xmas tree effect
x86: tsc.c include inverse Xmas tree effect
x86: process.c include inverse Xmas tree effect
x86: xsave.c include inverse Xmas tree effect
x86: ptrace.c include inverse Xmas tree effect
x86: ds.c include inverse Xmas tree effect
x86: tls.c include inverse Xmas tree effect
x86: step.c include inverse Xmas tree effect
x86: stacktrace.c include inverse Xmas tree effect
x86: reboot.c include inverse Xmas tree effect
x86: msr.c include inverse Xmas tree effect
x86: cpuid.c include inverse Xmas tree effect
x86: early-quirks.c include inverse Xmas tree effect
x86: smp.c include inverse Xmas tree effect
x86: smpboot.c include inverse Xmas tree effect
x86: tsc_sync.c include inverse Xmas tree effect
x86: setup_percpu.c include inverse Xmas tree effect
x86: trampoline_32.S include inverse Xmas tree effect
x86: mpparse.c include inverse Xmas tree effect

Quoted 8 lines

x86: module_32.c include inverse Xmas tree effect
x86: doublefault_32.c include inverse Xmas tree effect
x86: vm86_32.c include inverse Xmas tree effect
ix86: early_printk.c include inverse Xmas tree effect
x86: pcspeaker.c include inverse Xmas tree effect
x86: head_32.c include inverse Xmas tree effect
x86: head.c include inverse Xmas tree effect
x86: init_task.c include inverse Xmas tree effect

Quoted 2 lines

Where have you sent these patches for review?

Quoted 9 lines

-tip's master.

Quoted 3 lines
Quoted 1 line

Complete diff:

No. Complete diffs are not easy to review. At least not in this size.

46 of 49 are clean patches, and only 3 are doubtful which you pointed. I am attaching those patches for feedback.

Ahh here is one more:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
arch/x86/include/asm/proto.h +0 -0
index 49fb3ec..a8d63be 100644
@@ -7,7 +7,9 @@
 
Quoted 8 lines
Quoted 8 lines

arch/x86/include/asm/proto.h line 15

Quoted 8 lines
arch/x86/include/asm/proto.h +2 -0
 extern void early_idt_handler(void);
 
+#ifdef CONFIG_X86_64
 extern void system_call(void);
+#endif
 extern void syscall_init(void);
 
 extern void ia32_syscall(void);

From: Jaswinder Singh Rajput <[email protected]>
Date: Sat, 28 Mar 2009 14:12:34 +0530
Subject: [PATCH] x86: traps.c include inverse Xmas tree effect

Impact: Xmas tree effect

---
 arch/x86/include/asm/proto.h |    2 ++
 arch/x86/kernel/traps.c      |   34 +++++++++++-----------------------
 2 files changed, 13 insertions(+), 23 deletions(-)
arch/x86/include/asm/proto.h +2 -0
index 49fb3ec..a8d63be 100644
@@ -7,7 +7,9 @@
 
 extern void early_idt_handler(void);
 
+#ifdef CONFIG_X86_64
 extern void system_call(void);
+#endif
 extern void syscall_init(void);
 
 extern void ia32_syscall(void);
arch/x86/kernel/traps.c +11 -23
index a1d2883..4f1e6cf 100644
@@ -15,6 +15,7 @@
 #include <linux/kprobes.h>
 #include <linux/uaccess.h>
 #include <linux/utsname.h>
+#include <linux/ioport.h>
 #include <linux/kdebug.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -25,47 +26,34 @@
 #include <linux/kexec.h>
 #include <linux/sched.h>
 #include <linux/timer.h>
+#include <linux/edac.h>
+#include <linux/eisa.h>
 #include <linux/init.h>
 #include <linux/bug.h>
+#include <linux/mca.h>
 #include <linux/nmi.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
 #include <linux/io.h>
 
-#ifdef CONFIG_EISA
-#include <linux/ioport.h>
-#include <linux/eisa.h>
-#endif
-
-#ifdef CONFIG_MCA
-#include <linux/mca.h>
-#endif
-
-#if defined(CONFIG_EDAC)
-#include <linux/edac.h>
-#endif
-
+#include <asm/processor-flags.h>
+#include <asm/mach_traps.h>
 #include <asm/stacktrace.h>
 #include <asm/processor.h>
 #include <asm/debugreg.h>
+#include <asm/pgalloc.h>
 #include <asm/atomic.h>
 #include <asm/system.h>
-#include <asm/traps.h>
-#include <asm/desc.h>
-#include <asm/i387.h>
-
-#include <asm/mach_traps.h>
-
-#ifdef CONFIG_X86_64
-#include <asm/pgalloc.h>
 #include <asm/proto.h>
-#else
-#include <asm/processor-flags.h>
 #include <asm/setup.h>
 #include <asm/traps.h>
+#include <asm/desc.h>
+#include <asm/i387.h>
 
 #include "cpu/mcheck/mce.h"
 
+#ifndef CONFIG_X86_64
+
 asmlinkage int system_call(void);
 
 /* Do we ignore FPU interrupts ? */
Signature · 1 line
1.6.0.6
Quoted 77 lines
Quoted 11 lines
Quoted 11 lines
arch/x86/include/asm/sigcontext32.h +1 -0
index ad1478c..f80df2e 100644
@@ -1,6 +1,7 @@
 #ifndef _ASM_X86_SIGCONTEXT32_H
 #define _ASM_X86_SIGCONTEXT32_H
 
+#ifdef CONFIG_IA32_EMULATION
 #include <linux/types.h>
 
Quoted 11 lines

arch/x86/include/asm/sigcontext32.h struct sigcontext_ia32 { · line 78

Quoted 8 lines
arch/x86/include/asm/sigcontext32.h +1 -1
 /* signal context for 32bit programs. */
@@ -73,5 +74,5 @@ struct sigcontext_ia32 {
        unsigned int oldmask;
        unsigned int cr2;
 };
-
+#endif
 #endif /* _ASM_X86_SIGCONTEXT32_H */

This doesn't seem to be related to your header include rearangements.

Please check this patch then you will find the relation:

From: Jaswinder Singh Rajput <[email protected]>
Date: Sat, 28 Mar 2009 16:02:42 +0530
Subject: [PATCH] x86: xsave.c include inverse Xmas tree effect

Impact: Xmas tree effect

---
 arch/x86/include/asm/sigcontext32.h |    3 ++-
 arch/x86/kernel/xsave.c             |    5 ++---
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/include/asm/sigcontext32.h +2 -1
index ad1478c..f80df2e 100644
@@ -1,6 +1,7 @@
 #ifndef _ASM_X86_SIGCONTEXT32_H
 #define _ASM_X86_SIGCONTEXT32_H
 
+#ifdef CONFIG_IA32_EMULATION
 #include <linux/types.h>
 
 /* signal context for 32bit programs. */
@@ -73,5 +74,5 @@ struct sigcontext_ia32 {
        unsigned int oldmask;
        unsigned int cr2;
 };
-
+#endif
 #endif /* _ASM_X86_SIGCONTEXT32_H */
arch/x86/kernel/xsave.c +2 -3
index 2b54fe0..778ed67 100644
@@ -3,12 +3,11 @@
  *
  * Author: Suresh Siddha <[email protected]>
  */
+
+#include <asm/sigcontext32.h>
 #include <linux/bootmem.h>
 #include <linux/compat.h>
 #include <asm/i387.h>
-#ifdef CONFIG_IA32_EMULATION
-#include <asm/sigcontext32.h>
-#endif
 #include <asm/xcr.h>
 
 /*
Signature · 1 line
1.6.0.6

this one looks much better:

From: Jaswinder Singh Rajput <[email protected]>
Date: Sat, 28 Mar 2009 16:02:42 +0530
Subject: [PATCH] x86: xsave.c include inverse Xmas tree effect

Impact: Xmas tree effect

---
 arch/x86/include/asm/sigcontext32.h |    3 ++-
 arch/x86/kernel/xsave.c             |    6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)
arch/x86/include/asm/sigcontext32.h +2 -1
index ad1478c..f80df2e 100644
@@ -1,6 +1,7 @@
 #ifndef _ASM_X86_SIGCONTEXT32_H
 #define _ASM_X86_SIGCONTEXT32_H
 
+#ifdef CONFIG_IA32_EMULATION
 #include <linux/types.h>
 
 /* signal context for 32bit programs. */
@@ -73,5 +74,5 @@ struct sigcontext_ia32 {
        unsigned int oldmask;
        unsigned int cr2;
 };
-
+#endif
 #endif /* _ASM_X86_SIGCONTEXT32_H */
arch/x86/kernel/xsave.c +3 -3
index 2b54fe0..f3ce183 100644
@@ -3,12 +3,12 @@
  *
  * Author: Suresh Siddha <[email protected]>
  */
+
 #include <linux/bootmem.h>
 #include <linux/compat.h>
-#include <asm/i387.h>
-#ifdef CONFIG_IA32_EMULATION
+
 #include <asm/sigcontext32.h>
-#endif
+#include <asm/i387.h>
 #include <asm/xcr.h>
 
 /*
Signature · 1 line
1.6.0.6
#21 lore raw
In reply to Jaswinder Singh Rajput
Quoted 50 lines · Jaswinder Singh Rajput

The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
Ingo Molnar (1):

        Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Jaswinder Singh Rajput (49):
x86: process_32.c include inverse Xmas tree effect
x86: signal.c include inverse Xmas tree effect
x86: entry_32.S include inverse Xmas tree effect
x86: traps.c include inverse Xmas tree effect
x86: irq.c include inverse Xmas tree effect
x86: irq_32.c include inverse Xmas tree effect
x86: dumpstack.c include inverse Xmas tree effect
x86: time_32.c include inverse Xmas tree effect
x86: ioport.c include inverse Xmas tree effect
x86: ldt.c include inverse Xmas tree effect
x86: dumpstack_32.c include inverse Xmas tree effect
x86: setup.c include inverse Xmas tree effect
x86: i8259.c include inverse Xmas tree effect
x86: irqinit_32.c include inverse Xmas tree effect
x86: probe_roms_32.c include inverse Xmas tree effect
x86: sys_i386_32.c include inverse Xmas tree effect
x86: i386_ksyms_32.c include inverse Xmas tree effect
x86: bootflag.c include inverse Xmas tree effect
x86: e820.c include inverse Xmas tree effect
x86: pci-dma.c include inverse Xmas tree effect
x86: quirks.c include inverse Xmas tree effect
x86: i8237.c include inverse Xmas tree effect
x86: alternative.c include inverse Xmas tree effect
x86: tsc.c include inverse Xmas tree effect
x86: process.c include inverse Xmas tree effect
x86: xsave.c include inverse Xmas tree effect
x86: ptrace.c include inverse Xmas tree effect
x86: ds.c include inverse Xmas tree effect
x86: tls.c include inverse Xmas tree effect
x86: step.c include inverse Xmas tree effect
x86: stacktrace.c include inverse Xmas tree effect
x86: reboot.c include inverse Xmas tree effect
x86: msr.c include inverse Xmas tree effect
x86: cpuid.c include inverse Xmas tree effect
x86: early-quirks.c include inverse Xmas tree effect
x86: smp.c include inverse Xmas tree effect
x86: smpboot.c include inverse Xmas tree effect
x86: tsc_sync.c include inverse Xmas tree effect
x86: setup_percpu.c include inverse Xmas tree effect
x86: trampoline_32.S include inverse Xmas tree effect
x86: mpparse.c include inverse Xmas tree effect

Quoted 8 lines

x86: module_32.c include inverse Xmas tree effect
x86: doublefault_32.c include inverse Xmas tree effect
x86: vm86_32.c include inverse Xmas tree effect
ix86: early_printk.c include inverse Xmas tree effect
x86: pcspeaker.c include inverse Xmas tree effect
x86: head_32.c include inverse Xmas tree effect
x86: head.c include inverse Xmas tree effect
x86: init_task.c include inverse Xmas tree effect

Gasp.

Please find a better use for your time.

Imagine, there might be developers out there with real work to do in these files: all you are doing is throwing silly little obstacles in their way.

IMHO
Hugh

[snip most of it to leave one example]

Quoted 26 lines
arch/x86/kernel/alternative.c +6 -5
@@ -1,17 +1,18 @@
+#include <linux/kprobes.h>
+#include <linux/vmalloc.h>
 #include <linux/module.h>
-#include <linux/sched.h>
 #include <linux/mutex.h>
+#include <linux/sched.h>
 #include <linux/list.h>
-#include <linux/kprobes.h>
 #include <linux/mm.h>
-#include <linux/vmalloc.h>
+
 #include <asm/alternative.h>
+#include <asm/cacheflush.h>
 #include <asm/sections.h>
+#include <asm/vsyscall.h>
 #include <asm/pgtable.h>
 #include <asm/mce.h>
 #include <asm/nmi.h>
-#include <asm/vsyscall.h>
-#include <asm/cacheflush.h>
 #include <asm/io.h>
 
 #define MAX_PATCH_LEN (255-1)
#22 lore raw
Quoted 60 lines · Hugh Dickins
Quoted 50 lines · Jaswinder Singh Rajput

The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
Ingo Molnar (1):

        Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Jaswinder Singh Rajput (49):
x86: process_32.c include inverse Xmas tree effect
x86: signal.c include inverse Xmas tree effect
x86: entry_32.S include inverse Xmas tree effect
x86: traps.c include inverse Xmas tree effect
x86: irq.c include inverse Xmas tree effect
x86: irq_32.c include inverse Xmas tree effect
x86: dumpstack.c include inverse Xmas tree effect
x86: time_32.c include inverse Xmas tree effect
x86: ioport.c include inverse Xmas tree effect
x86: ldt.c include inverse Xmas tree effect
x86: dumpstack_32.c include inverse Xmas tree effect
x86: setup.c include inverse Xmas tree effect
x86: i8259.c include inverse Xmas tree effect
x86: irqinit_32.c include inverse Xmas tree effect
x86: probe_roms_32.c include inverse Xmas tree effect
x86: sys_i386_32.c include inverse Xmas tree effect
x86: i386_ksyms_32.c include inverse Xmas tree effect
x86: bootflag.c include inverse Xmas tree effect
x86: e820.c include inverse Xmas tree effect
x86: pci-dma.c include inverse Xmas tree effect
x86: quirks.c include inverse Xmas tree effect
x86: i8237.c include inverse Xmas tree effect
x86: alternative.c include inverse Xmas tree effect
x86: tsc.c include inverse Xmas tree effect
x86: process.c include inverse Xmas tree effect
x86: xsave.c include inverse Xmas tree effect
x86: ptrace.c include inverse Xmas tree effect
x86: ds.c include inverse Xmas tree effect
x86: tls.c include inverse Xmas tree effect
x86: step.c include inverse Xmas tree effect
x86: stacktrace.c include inverse Xmas tree effect
x86: reboot.c include inverse Xmas tree effect
x86: msr.c include inverse Xmas tree effect
x86: cpuid.c include inverse Xmas tree effect
x86: early-quirks.c include inverse Xmas tree effect
x86: smp.c include inverse Xmas tree effect
x86: smpboot.c include inverse Xmas tree effect
x86: tsc_sync.c include inverse Xmas tree effect
x86: setup_percpu.c include inverse Xmas tree effect
x86: trampoline_32.S include inverse Xmas tree effect
x86: mpparse.c include inverse Xmas tree effect

Quoted 8 lines

x86: module_32.c include inverse Xmas tree effect
x86: doublefault_32.c include inverse Xmas tree effect
x86: vm86_32.c include inverse Xmas tree effect
ix86: early_printk.c include inverse Xmas tree effect
x86: pcspeaker.c include inverse Xmas tree effect
x86: head_32.c include inverse Xmas tree effect
x86: head.c include inverse Xmas tree effect
x86: init_task.c include inverse Xmas tree effect

Quoted 7 lines

Gasp.

Please find a better use for your time.

Imagine, there might be developers out there with real work to do in these files: all you are doing is throwing silly little obstacles in their way.

Actually, now is the right time to do such changes as we've just pushed all pending x86 changes upstream. And since these changes reduce the chance of future patch conflicts, they do help development. (in a small way)

Nevertheless i'd suggest to make this a single commit, to not clobber the shortlog with it.

Ingo

#23 lore raw
Quoted 8 lines · Ingo Molnar
Quoted 6 lines · Hugh Dickins

Please find a better use for your time.

Imagine, there might be developers out there with real work to do in these files: all you are doing is throwing silly little obstacles in their way.

Quoted 8 lines

Actually, now is the right time to do such changes as we've just pushed all pending x86 changes upstream. And since these changes reduce the chance of future patch conflicts, they do help development. (in a small way)

Nevertheless i'd suggest to make this a single commit, to not clobber the shortlog with it.

I think individual patches will be better option, in case of unavoidable situation we can simply revert that particular patch.

--
JSR

#24 lore raw
Quoted 14 lines · Jaswinder Singh Rajput
Quoted 13 lines · Ingo Molnar
Quoted 6 lines · Hugh Dickins

Please find a better use for your time.

Imagine, there might be developers out there with real work to do in these files: all you are doing is throwing silly little obstacles in their way.

Actually, now is the right time to do such changes as we've just pushed all pending x86 changes upstream. And since these changes reduce the chance of future patch conflicts, they do help development. (in a small way)

Quoted 6 lines
Quoted 3 lines

Nevertheless i'd suggest to make this a single commit, to not clobber the shortlog with it.

I think individual patches will be better option, in case of unavoidable situation we can simply revert that particular patch.

What unavoidable situation ? That you broke stuff with your changes ? If you are so unsure about the quality of your changes, then the best option is to not pull that stuff at all.

Thanks,

tglx

#25 lore raw
Quoted 19 lines · Thomas Gleixner
Quoted 18 lines · Jaswinder Singh Rajput
Quoted 16 lines · Ingo Molnar
Quoted 6 lines · Hugh Dickins

Please find a better use for your time.

Imagine, there might be developers out there with real work to do in these files: all you are doing is throwing silly little obstacles in their way.

Actually, now is the right time to do such changes as we've just pushed all pending x86 changes upstream. And since these changes reduce the chance of future patch conflicts, they do help development. (in a small way)

Nevertheless i'd suggest to make this a single commit, to not clobber the shortlog with it.

Quoted 7 lines
Quoted 2 lines

I think individual patches will be better option, in case of unavoidable situation we can simply revert that particular patch.

What unavoidable situation ? That you broke stuff with your changes ? If you are so unsure about the quality of your changes, then the best option is to not pull that stuff at all.

OK. Tree deleted, thanks for your advice.

--
JSR

#26 lore raw
In reply to Jaswinder Singh Rajput
Quoted 9 lines · Jaswinder Singh Rajput

The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
Ingo Molnar (1):

        Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Jaswinder Singh Rajput (49):

Looks nice.

Have you written a script for this? If yes, would you mind to share it with us? Thanks,

Ingo

#27 lore raw
Quoted 8 lines · Ingo Molnar
Quoted 6 lines · Jaswinder Singh Rajput

The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
Ingo Molnar (1):

        Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core

are available in the git repository at:

Quoted 8 lines
Quoted 3 lines

git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Jaswinder Singh Rajput (49):

Looks nice.

Have you written a script for this? If yes, would you mind to share it with us? Thanks,

I have done this manually.

Scripts can be helpful in ordering but will not be useful in many cases like:
1. Duplication of asm files (include/linux/xyz.h call asm/xyz.h file without any case or this case is always true in that file)
2. Remove unwanted files
3. Handle various ifdefs in include file
4. handling errors which can be generated by this ordering
5. do some more beautification where required
6. ordering of variables
7. and many more issues which I have not faced so far ..

So because of above cases even you made scripts with AI, they will fail in many cases.

--
JSR