]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen: modify or add declarations for variables where needed
authorNicola Vetrini <nicola.vetrini@bugseng.com>
Tue, 21 Nov 2023 09:06:57 +0000 (10:06 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 21 Nov 2023 09:06:57 +0000 (10:06 +0100)
Some variables with external linkage used in C code do not have
a visible declaration where they are defined. Other variables
can be made static, thereby eliminating the need for a declaration.
Doing so also resolves violations of MISRA C:2012 Rule 8.4.

Fix typo s/mcinfo_dumpped/mcinfo_dumped/ while making
the variable static.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/arm/include/asm/setup.h
xen/arch/arm/include/asm/smp.h
xen/arch/arm/platform_hypercall.c
xen/arch/x86/cpu/mcheck/mce.c
xen/arch/x86/irq.c

index 6c71f8c31b30fd437160a2274d5ce7daa68717c5..ccb857ca2ea95db0efddbe7068dd4a03fd2a8131 100644 (file)
@@ -189,9 +189,12 @@ int map_range_to_domain(const struct dt_device_node *dev,
 extern lpae_t boot_pgtable[XEN_PT_LPAE_ENTRIES];
 
 #ifdef CONFIG_ARM_64
+extern lpae_t boot_first[XEN_PT_LPAE_ENTRIES];
 extern lpae_t boot_first_id[XEN_PT_LPAE_ENTRIES];
 #endif
+extern lpae_t boot_second[XEN_PT_LPAE_ENTRIES];
 extern lpae_t boot_second_id[XEN_PT_LPAE_ENTRIES];
+extern lpae_t boot_third[XEN_PT_LPAE_ENTRIES * XEN_NR_ENTRIES(2)];
 extern lpae_t boot_third_id[XEN_PT_LPAE_ENTRIES];
 
 /* Find where Xen will be residing at runtime and return a PT entry */
index 22e12f38db6bc3b8eb90f81694f7d53818cfd6ae..bd489793fa8c7bafc78e3071dfc9ea84605f33a2 100644 (file)
@@ -6,6 +6,9 @@
 #include <asm/current.h>
 #endif
 
+extern struct init_info init_data;
+extern unsigned long smp_up_cpu;
+
 DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
 DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
 
index 743687a303909a377a250059fc8ce5e1e164f9e7..fde4bc3e5809202a38bd5401af427cd764b78508 100644 (file)
@@ -17,7 +17,7 @@
 #include <asm/current.h>
 #include <asm/event.h>
 
-DEFINE_SPINLOCK(xenpf_lock);
+static DEFINE_SPINLOCK(xenpf_lock);
 
 long do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 {
index 6141b7eb9cf1ede2a9d78a4f9e05188aaa9c649c..779a458cd88fc83edf37d5fa65197be46dafbe39 100644 (file)
@@ -1682,13 +1682,14 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
     return ret;
 }
 
-int mcinfo_dumpped;
+static int mcinfo_dumped;
+
 static int cf_check x86_mcinfo_dump_panic(mctelem_cookie_t mctc)
 {
     struct mc_info *mcip = mctelem_dataptr(mctc);
 
     x86_mcinfo_dump(mcip);
-    mcinfo_dumpped++;
+    mcinfo_dumped++;
 
     return 0;
 }
@@ -1702,7 +1703,7 @@ static void mc_panic_dump(void)
     for_each_online_cpu(cpu)
         mctelem_process_deferred(cpu, x86_mcinfo_dump_panic,
                                  mctelem_has_deferred_lmce(cpu));
-    dprintk(XENLOG_ERR, "End dump mc_info, %x mcinfo dumped\n", mcinfo_dumpped);
+    dprintk(XENLOG_ERR, "End dump mc_info, %x mcinfo dumped\n", mcinfo_dumped);
 }
 
 void mc_panic(const char *s)
index 16d9fceba1e88343a935dfae0eff141569d0907f..6e668b1b4fe2092437990e514a763345f833a74d 100644 (file)
@@ -43,7 +43,7 @@ int __read_mostly opt_irq_vector_map = OPT_IRQ_VECTOR_MAP_DEFAULT;
 static unsigned char __read_mostly irq_max_guests;
 integer_param("irq-max-guests", irq_max_guests);
 
-vmask_t global_used_vector_map;
+static vmask_t global_used_vector_map;
 
 struct irq_desc __read_mostly *irq_desc = NULL;