[03/28] KVM: VMX: Alphabetize the includes in vmx.c
diff mbox series

Message ID 20181203215318.15545-4-sean.j.christopherson@intel.com
State New
Headers show
Series
  • KVM: VMX: Add "vmx" dir and shatter vmx.c
Related show

Commit Message

Sean Christopherson Dec. 3, 2018, 9:52 p.m. UTC
...to prepare for the creation of a "vmx" subdirectory that will contain
a variety of headers.  Clean things up now to avoid making a bigger mess
in the future.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kvm/vmx.c | 51 +++++++++++++++++++++++-----------------------
 1 file changed, 25 insertions(+), 26 deletions(-)

Comments

Jim Mattson Dec. 4, 2018, 6:14 p.m. UTC | #1
On Mon, Dec 3, 2018 at 1:54 PM Sean Christopherson
<sean.j.christopherson@intel.com> wrote:
>
> ...to prepare for the creation of a "vmx" subdirectory that will contain
> a variety of headers.  Clean things up now to avoid making a bigger mess
> in the future.
>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>

Are include directives one of the areas where the Linux community
prefers "reverse fir tree" formatting? Just curious.
Radim Krčmář Dec. 13, 2018, 9:24 p.m. UTC | #2
2018-12-04 10:14-0800, Jim Mattson:
> On Mon, Dec 3, 2018 at 1:54 PM Sean Christopherson
> <sean.j.christopherson@intel.com> wrote:
> >
> > ...to prepare for the creation of a "vmx" subdirectory that will contain
> > a variety of headers.  Clean things up now to avoid making a bigger mess
> > in the future.
> >
> > Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> 
> Are include directives one of the areas where the Linux community
> prefers "reverse fir tree" formatting? Just curious.

Not sure it it's the reverse fir tree, but I think the consensus is to
go from most generic <linux/...> includes; through more specific ones
<linux/sched/...>, <asm/...>, etc.;  and end with includes in the
current directory.

Patch
diff mbox series

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 49c5b155e07d..589230c923e2 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -16,49 +16,48 @@ 
  *
  */
 
-#include "irq.h"
-#include "mmu.h"
-#include "cpuid.h"
-#include "lapic.h"
-#include "hyperv.h"
-
+#include <linux/frame.h>
+#include <linux/highmem.h>
+#include <linux/hrtimer.h>
+#include <linux/kernel.h>
 #include <linux/kvm_host.h>
 #include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/highmem.h>
-#include <linux/sched.h>
 #include <linux/moduleparam.h>
 #include <linux/mod_devicetable.h>
-#include <linux/trace_events.h>
+#include <linux/mm.h>
+#include <linux/nospec.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/tboot.h>
-#include <linux/hrtimer.h>
-#include <linux/frame.h>
-#include <linux/nospec.h>
-#include "kvm_cache_regs.h"
-#include "x86.h"
+#include <linux/trace_events.h>
 
+#include <asm/apic.h>
 #include <asm/asm.h>
 #include <asm/cpu.h>
-#include <asm/io.h>
+#include <asm/debugreg.h>
 #include <asm/desc.h>
-#include <asm/vmx.h>
-#include <asm/virtext.h>
-#include <asm/mce.h>
 #include <asm/fpu/internal.h>
-#include <asm/perf_event.h>
-#include <asm/debugreg.h>
-#include <asm/kexec.h>
-#include <asm/apic.h>
+#include <asm/io.h>
 #include <asm/irq_remapping.h>
+#include <asm/kexec.h>
+#include <asm/perf_event.h>
+#include <asm/mce.h>
 #include <asm/mmu_context.h>
-#include <asm/spec-ctrl.h>
 #include <asm/mshyperv.h>
+#include <asm/spec-ctrl.h>
+#include <asm/virtext.h>
+#include <asm/vmx.h>
 
-#include "trace.h"
+#include "cpuid.h"
+#include "hyperv.h"
+#include "irq.h"
+#include "kvm_cache_regs.h"
+#include "lapic.h"
+#include "mmu.h"
 #include "pmu.h"
+#include "trace.h"
 #include "vmx_evmcs.h"
+#include "x86.h"
 
 #define __ex(x) __kvm_handle_fault_on_reboot(x)
 #define __ex_clear(x, reg) \