diff mbox series

xen: Swap 'const static' for 'static const'

Message ID 20250403204301.1658436-1-andrew.cooper3@citrix.com (mailing list archive)
State New
Headers show
Series xen: Swap 'const static' for 'static const' | expand

Commit Message

Andrew Cooper April 3, 2025, 8:43 p.m. UTC
MISRA C:2012 Ammendment 3 (which is under consideration, but not used by Xen
yet) is more particular about the order of keywords.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
CC: consulting@bugseng.com
---
 xen/arch/arm/gic-v2.c  | 2 +-
 xen/include/xen/init.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)


base-commit: befc384d21784affa3daf2abc85b02500e4dc545

Comments

Nicola Vetrini April 3, 2025, 9:04 p.m. UTC | #1
On 2025-04-03 22:43, Andrew Cooper wrote:
> MISRA C:2012 Ammendment 3 (which is under consideration, but not used 
> by Xen
                ^ typo
> yet) is more particular about the order of keywords.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Any specific reason not to give [1] and [2] the same treatment? Other 
than that, looks good to me.

[1] 
https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/people/bugseng/xen/ECLAIR_normal/MISRA_C_AMD3/X86_64/9616508934/PROJECT.ecd;/sources/xen/arch/x86/genapic/x2apic.c.html#R4145_1
[2] 
https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/people/bugseng/xen/ECLAIR_normal/MISRA_C_AMD3/X86_64/9616508934/PROJECT.ecd;/sources/xen/arch/x86/hvm/dom0_build.c.html#R13937_1

> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> CC: Bertrand Marquis <bertrand.marquis@arm.com>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
> CC: consulting@bugseng.com
> ---
>  xen/arch/arm/gic-v2.c  | 2 +-
>  xen/include/xen/init.h | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
> index 02043c0d4b1f..b23e72a3d05d 100644
> --- a/xen/arch/arm/gic-v2.c
> +++ b/xen/arch/arm/gic-v2.c
> @@ -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,
> diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h
> index 0a4223833755..abf275f0eb72 100644
> --- a/xen/include/xen/init.h
> +++ b/xen/include/xen/init.h
> @@ -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
> 
> 
> base-commit: befc384d21784affa3daf2abc85b02500e4dc545
Andrew Cooper April 3, 2025, 9:10 p.m. UTC | #2
On 03/04/2025 10:04 pm, Nicola Vetrini wrote:
> On 2025-04-03 22:43, Andrew Cooper wrote:
>> MISRA C:2012 Ammendment 3 (which is under consideration, but not used
>> by Xen
>                ^ typo
>> yet) is more particular about the order of keywords.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> Any specific reason not to give [1] and [2] the same treatment? Other
> than that, looks good to me.
>
> [1]
> https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/people/bugseng/xen/ECLAIR_normal/MISRA_C_AMD3/X86_64/9616508934/PROJECT.ecd;/sources/xen/arch/x86/genapic/x2apic.c.html#R4145_1
> [2]
> https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/people/bugseng/xen/ECLAIR_normal/MISRA_C_AMD3/X86_64/9616508934/PROJECT.ecd;/sources/xen/arch/x86/hvm/dom0_build.c.html#R13937_1

Oh, inattention to detail with my `git grep`.

I'll update to include these.  Thanks.

~Andrew
diff mbox series

Patch

diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 02043c0d4b1f..b23e72a3d05d 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -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,
diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h
index 0a4223833755..abf275f0eb72 100644
--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -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