[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: mark certain items static


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Tue, 11 Dec 2012 04:33:24 +0000
  • Delivery-date: Tue, 11 Dec 2012 04:33:29 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1354884468 -3600
# Node ID b881901cca83f40935d77981341ff6f079c5b048
# Parent  18b25321cea6142391921dbad56765eb32cd4f90
x86: mark certain items static

..., and at once constify the data items among them.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Fri Dec 07 13:47:48 2012 +0100
@@ -4117,10 +4117,10 @@ long do_hvm_op(unsigned long op, XEN_GUE
         struct domain *d;
         
         /* Interface types to internal p2m types */
-        p2m_type_t memtype[] = {
-            p2m_ram_rw,        /* HVMMEM_ram_rw  */
-            p2m_ram_ro,        /* HVMMEM_ram_ro  */
-            p2m_mmio_dm        /* HVMMEM_mmio_dm */
+        static const p2m_type_t memtype[] = {
+            [HVMMEM_ram_rw]  = p2m_ram_rw,
+            [HVMMEM_ram_ro]  = p2m_ram_ro,
+            [HVMMEM_mmio_dm] = p2m_mmio_dm
         };
 
         if ( copy_from_guest(&a, arg, 1) )
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/hvm/svm/emulate.c
--- a/xen/arch/x86/hvm/svm/emulate.c    Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/hvm/svm/emulate.c    Fri Dec 07 13:47:48 2012 +0100
@@ -152,7 +152,7 @@ static int fetch(struct vcpu *v, u8 *buf
 }
 
 int __get_instruction_length_from_list(struct vcpu *v,
-        enum instruction_index *list, unsigned int list_count)
+        const enum instruction_index *list, unsigned int list_count)
 {
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     unsigned int i, j, inst_len = 0;
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c        Fri Dec 07 13:47:48 2012 +0100
@@ -1931,7 +1931,7 @@ static void svm_wbinvd_intercept(void)
 
 static void svm_vmexit_do_invalidate_cache(struct cpu_user_regs *regs)
 {
-    enum instruction_index list[] = { INSTR_INVD, INSTR_WBINVD };
+    static const enum instruction_index list[] = { INSTR_INVD, INSTR_WBINVD };
     int inst_len;
 
     inst_len = __get_instruction_length_from_list(
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Fri Dec 07 13:47:48 2012 +0100
@@ -2475,9 +2475,11 @@ void vmx_vmexit_handler(struct cpu_user_
         vmx_update_cpu_exec_control(v);
         break;
     case EXIT_REASON_TASK_SWITCH: {
-        const enum hvm_task_switch_reason reasons[] = {
-            TSW_call_or_int, TSW_iret, TSW_jmp, TSW_call_or_int };
+        static const enum hvm_task_switch_reason reasons[] = {
+            TSW_call_or_int, TSW_iret, TSW_jmp, TSW_call_or_int
+        };
         int32_t ecode = -1, source;
+
         exit_qualification = __vmread(EXIT_QUALIFICATION);
         source = (exit_qualification >> 30) & 3;
         /* Vectored event should fill in interrupt information. */
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/mm/guest_walk.c
--- a/xen/arch/x86/mm/guest_walk.c      Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/mm/guest_walk.c      Fri Dec 07 13:47:48 2012 +0100
@@ -34,7 +34,7 @@
 /* Flags that are needed in a pagetable entry, with the sense of NX inverted */
 static uint32_t mandatory_flags(struct vcpu *v, uint32_t pfec) 
 {
-    static uint32_t flags[] = {
+    static const uint32_t flags[] = {
         /* I/F -  Usr Wr */
         /* 0   0   0   0 */ _PAGE_PRESENT, 
         /* 0   0   0   1 */ _PAGE_PRESENT|_PAGE_RW,
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c    Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/smpboot.c    Fri Dec 07 13:47:48 2012 +0100
@@ -179,7 +179,7 @@ static void synchronize_tsc_slave(unsign
     }
 }
 
-void smp_callin(void)
+static void smp_callin(void)
 {
     unsigned int cpu = smp_processor_id();
     int i, rc;
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/time.c       Fri Dec 07 13:47:48 2012 +0100
@@ -1151,7 +1151,7 @@ static void local_time_calibration(void)
  * The Linux original version of this function is
  * Copyright (c) 2006, Red Hat, Inc., Ingo Molnar
  */
-void check_tsc_warp(unsigned long tsc_khz, unsigned long *max_warp)
+static void check_tsc_warp(unsigned long tsc_khz, unsigned long *max_warp)
 {
 #define rdtsc_barrier() mb()
     static DEFINE_SPINLOCK(sync_lock);
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c       Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/x86_64/traps.c       Fri Dec 07 13:47:48 2012 +0100
@@ -45,7 +45,7 @@ static void _show_registers(
     const struct cpu_user_regs *regs, unsigned long crs[8],
     enum context context, const struct vcpu *v)
 {
-    const static char *context_names[] = {
+    static const char *const context_names[] = {
         [CTXT_hypervisor] = "hypervisor",
         [CTXT_pv_guest]   = "pv guest",
         [CTXT_hvm_guest]  = "hvm guest"
diff -r 18b25321cea6 -r b881901cca83 xen/include/asm-x86/hvm/svm/emulate.h
--- a/xen/include/asm-x86/hvm/svm/emulate.h     Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/emulate.h     Fri Dec 07 13:47:48 2012 +0100
@@ -45,7 +45,7 @@ enum instruction_index {
 struct vcpu;
 
 int __get_instruction_length_from_list(
-    struct vcpu *v, enum instruction_index *list, unsigned int list_count);
+    struct vcpu *, const enum instruction_index *, unsigned int list_count);
 
 static inline int __get_instruction_length(
     struct vcpu *v, enum instruction_index instr)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.