]> xenbits.xensource.com Git - people/aperard/xen-arm.git/commitdiff
x86: mark certain items static
authorJan Beulich <jbeulich@suse.com>
Fri, 7 Dec 2012 12:47:48 +0000 (13:47 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 Dec 2012 12:47:48 +0000 (13:47 +0100)
..., and at once constify the data items among them.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/svm/emulate.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/mm/guest_walk.c
xen/arch/x86/smpboot.c
xen/arch/x86/time.c
xen/arch/x86/x86_64/traps.c
xen/include/asm-x86/hvm/svm/emulate.h

index b6026d79531b80547ccc4ad4f50d8cdc6fe42d8d..40c1ab219f463fb065536b8951c6785a21359b73 100644 (file)
@@ -4117,10 +4117,10 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         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) )
index 43c91b10a6cdf12f68e860214c4260ebe5f19028..2cbd8ef51b161ffa6722330bd80dc653e6bbf340 100644 (file)
@@ -152,7 +152,7 @@ static int fetch(struct vcpu *v, u8 *buf, unsigned long addr, int len)
 }
 
 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;
index 4c4abfc02956aea2c121f28fee7aa5e4a01f8827..c3dc048e848013e216f66d1fa40d27f304b9d066 100644 (file)
@@ -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(
index 9fb9562031283fea911a9d7bd2b0ccec587d399e..aee1f9e13831504c76958da600740bb9e478c183 100644 (file)
@@ -2475,9 +2475,11 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
         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. */
index 13ea0bb385840aa514d3692f079ade3a23a6a4dc..0f08fb0b9242b785084f39cecee5db01ba4b0e75 100644 (file)
@@ -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,
index fa46e43690b7a902b0659d38919893b9f87d8cb2..3df4e882a90dccbb2ff2d6f927f09d78100bc587 100644 (file)
@@ -179,7 +179,7 @@ static void synchronize_tsc_slave(unsigned int slave)
     }
 }
 
-void smp_callin(void)
+static void smp_callin(void)
 {
     unsigned int cpu = smp_processor_id();
     int i, rc;
index 6708740d1c8bb0d6133e814414a1848d32190938..ff15417a2b006374c5b0c24589affb7cfeca08d2 100644 (file)
@@ -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);
index 08785d0d35739010278f26cbbd2c346c7215053e..cf0db3ed368f0a5df4baa7343e1c1ee7bfd9225c 100644 (file)
@@ -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"
index 8779b82f81e1d20c25332efc9221e8ce53de43e5..2d4206d438289b19f1e13890d70438206c7c924b 100644 (file)
@@ -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)