]> xenbits.xensource.com Git - xen.git/commitdiff
xen: Consistently use 'static' first
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 3 Apr 2025 20:39:19 +0000 (21:39 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 7 Apr 2025 18:17:38 +0000 (19:17 +0100)
MISRA C:2012 Amendment 3 (which is under consideration, but not used by Xen
yet) is more particular about having the storage class specifier first.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
xen/arch/arm/gic-v2.c
xen/arch/x86/genapic/x2apic.c
xen/arch/x86/hvm/dom0_build.c
xen/include/xen/init.h

index 02043c0d4b1f32a4601ef71aa86ca1589ba7f429..b23e72a3d05d8d7d8b801dae85545d26eff6a72d 100644 (file)
@@ -1311,7 +1311,7 @@ static void gicv2_do_LPI(unsigned int lpi)
     BUG();
 }
 
-const static struct gic_hw_operations gicv2_ops = {
+static const struct gic_hw_operations gicv2_ops = {
     .info                = &gicv2_info,
     .init                = gicv2_init,
     .secondary_init      = gicv2_secondary_cpu_init,
index 74a6d808ac30abae8d5c829d3dda8277efc09528..1d55eb6b8a41c353968efe4bb960c96df7d17d8a 100644 (file)
@@ -216,9 +216,9 @@ static struct notifier_block x2apic_cpu_nfb = {
 static int8_t __initdata x2apic_phys = -1;
 boolean_param("x2apic_phys", x2apic_phys);
 
-enum {
+static enum {
    unset, physical, mixed
-} static __initdata x2apic_mode = unset;
+} x2apic_mode __initdata = unset;
 
 static int __init cf_check parse_x2apic_mode(const char *s)
 {
index daf1b6f88b14631b165b7d8262eef1cabfc695c9..9fd68df7b936c04891fd16bb8c5675809fd00dbe 100644 (file)
@@ -91,10 +91,10 @@ static int __init pvh_populate_memory_range(struct domain *d,
                                             unsigned long start,
                                             unsigned long nr_pages)
 {
-    struct {
+    static const struct {
         unsigned long align;
         unsigned int order;
-    } static const __initconst orders[] = {
+    } orders[] __initconst = {
         /* NB: must be sorted by decreasing size. */
         { .align = PFN_DOWN(GB(1)), .order = PAGE_ORDER_1G },
         { .align = PFN_DOWN(MB(2)), .order = PAGE_ORDER_2M },
index 0a4223833755ed04b74eca8bb44b2d921ef62256..abf275f0eb726c50d05b0d4f81d295a3050c5cab 100644 (file)
@@ -63,9 +63,9 @@ typedef int (*initcall_t)(void);
 typedef void (*exitcall_t)(void);
 
 #define presmp_initcall(fn) \
-    const static initcall_t __initcall_##fn __init_call("presmp") = (fn)
+    static const initcall_t __initcall_##fn __init_call("presmp") = (fn)
 #define __initcall(fn) \
-    const static initcall_t __initcall_##fn __init_call("1") = (fn)
+    static const initcall_t __initcall_##fn __init_call("1") = (fn)
 #define __exitcall(fn) \
     static exitcall_t __exitcall_##fn __exit_call = fn