[PATCH] x86/MCE: purge mce_amd.h

Jan Beulich posted 1 patch 3 weeks, 6 days ago
[PATCH] x86/MCE: purge mce_amd.h
Posted by Jan Beulich 3 weeks, 6 days ago
The sole two declarations there aren't needed, as the functions aren't
reference from outside of mce_amd.c. (This also addresses two Misra rule
8.7 violations, just that we apparently didn't accept that rule for some
reason.)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
If it wouldn't result in more churn, I would have been inclined to also
drop at least the mc_ prefixes of both functions.

--- a/xen/arch/x86/cpu/mcheck/mce_amd.c
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -56,7 +56,6 @@
 
 #include "mce.h"
 #include "x86_mca.h"
-#include "mce_amd.h"
 #include "mcaction.h"
 #include "vmce.h"
 
@@ -101,7 +100,7 @@ mc_ec2type(uint16_t errorcode)
     return 0;
 }
 
-bool cf_check mc_amd_recoverable_scan(uint64_t status)
+static bool cf_check mc_amd_recoverable_scan(uint64_t status)
 {
     bool ret = false;
     enum mc_ec_type ectype;
@@ -131,7 +130,8 @@ bool cf_check mc_amd_recoverable_scan(ui
     return ret;
 }
 
-bool cf_check mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype)
+static bool cf_check mc_amd_addrcheck(uint64_t status, uint64_t misc,
+                                      int addrtype)
 {
     enum mc_ec_type ectype;
     uint16_t errorcode;
--- a/xen/arch/x86/cpu/mcheck/mce_amd.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _MCHECK_AMD_H
-#define _MCHECK_AMD_H
-
-bool cf_check mc_amd_recoverable_scan(uint64_t status);
-bool cf_check mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype);
-
-#endif
Re: [PATCH] x86/MCE: purge mce_amd.h
Posted by Baptiste Le Duc 3 weeks, 6 days ago
LGTM:
Reviewed-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>

On 10/27/26 2:28 PM, Jan Beulich wrote:
> The sole two declarations there aren't needed, as the functions aren't
> reference from outside of mce_amd.c. (This also addresses two Misra rule
> 8.7 violations, just that we apparently didn't accept that rule for some
> reason.)
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> If it wouldn't result in more churn, I would have been inclined to also
> drop at least the mc_ prefixes of both functions.
> 
> --- a/xen/arch/x86/cpu/mcheck/mce_amd.c
> +++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
> @@ -56,7 +56,6 @@
>   
>   #include "mce.h"
>   #include "x86_mca.h"
> -#include "mce_amd.h"
>   #include "mcaction.h"
>   #include "vmce.h"
>   
> @@ -101,7 +100,7 @@ mc_ec2type(uint16_t errorcode)
>       return 0;
>   }
>   
> -bool cf_check mc_amd_recoverable_scan(uint64_t status)
> +static bool cf_check mc_amd_recoverable_scan(uint64_t status)
>   {
>       bool ret = false;
>       enum mc_ec_type ectype;
> @@ -131,7 +130,8 @@ bool cf_check mc_amd_recoverable_scan(ui
>       return ret;
>   }
>   
> -bool cf_check mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype)
> +static bool cf_check mc_amd_addrcheck(uint64_t status, uint64_t misc,
> +                                      int addrtype)
>   {
>       enum mc_ec_type ectype;
>       uint16_t errorcode;
> --- a/xen/arch/x86/cpu/mcheck/mce_amd.h
> +++ /dev/null
> @@ -1,7 +0,0 @@
> -#ifndef _MCHECK_AMD_H
> -#define _MCHECK_AMD_H
> -
> -bool cf_check mc_amd_recoverable_scan(uint64_t status);
> -bool cf_check mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype);
> -
> -#endif