[XEN PATCH] x86/mtrr: address violations of MISRA C:2012 Rule 8.3 on parameter types

Federico Serafini posted 1 patch 9 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/76dba3f8a6a7bc12f15a9e4fc8c73826a08e4b5c.1689849810.git.federico.serafini@bugseng.com
There is a newer version of this series
xen/arch/x86/include/asm/mtrr.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
[XEN PATCH] x86/mtrr: address violations of MISRA C:2012 Rule 8.3 on parameter types
Posted by Federico Serafini 9 months, 2 weeks ago
Change parameter types of function declarations to be consistent with
the ones used in the corresponding definitions,
thus addressing violations of MISRA C:2012 Rule 8.3 ("All declarations
of an object or function shall use the same names and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/x86/include/asm/mtrr.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index e4f6ca6048..5d57a596ea 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -59,9 +59,10 @@ extern int mtrr_del_page(int reg, unsigned long base, unsigned long size);
 extern int mtrr_get_type(const struct mtrr_state *m, paddr_t pa,
                          unsigned int order);
 extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi);
-extern u32 get_pat_flags(struct vcpu *v, u32 gl1e_flags, paddr_t gpaddr,
-                  paddr_t spaddr, uint8_t gmtrr_mtype);
-extern unsigned char pat_type_2_pte_flags(unsigned char pat_type);
+extern uint32_t get_pat_flags(struct vcpu *v, uint32_t gl1e_flags,
+                              paddr_t gpaddr, paddr_t spaddr,
+															uint8_t gmtrr_mtype);
+extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
 extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
-- 
2.34.1
Re: [XEN PATCH] x86/mtrr: address violations of MISRA C:2012 Rule 8.3 on parameter types
Posted by Roger Pau Monné 9 months, 2 weeks ago
On Thu, Jul 20, 2023 at 12:48:36PM +0200, Federico Serafini wrote:
> Change parameter types of function declarations to be consistent with
> the ones used in the corresponding definitions,
> thus addressing violations of MISRA C:2012 Rule 8.3 ("All declarations
> of an object or function shall use the same names and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
>  xen/arch/x86/include/asm/mtrr.h | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
> index e4f6ca6048..5d57a596ea 100644
> --- a/xen/arch/x86/include/asm/mtrr.h
> +++ b/xen/arch/x86/include/asm/mtrr.h
> @@ -59,9 +59,10 @@ extern int mtrr_del_page(int reg, unsigned long base, unsigned long size);
>  extern int mtrr_get_type(const struct mtrr_state *m, paddr_t pa,
>                           unsigned int order);
>  extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi);
> -extern u32 get_pat_flags(struct vcpu *v, u32 gl1e_flags, paddr_t gpaddr,
> -                  paddr_t spaddr, uint8_t gmtrr_mtype);
> -extern unsigned char pat_type_2_pte_flags(unsigned char pat_type);
> +extern uint32_t get_pat_flags(struct vcpu *v, uint32_t gl1e_flags,
> +                              paddr_t gpaddr, paddr_t spaddr,
> +															uint8_t gmtrr_mtype);

Wrong usage of hard tabs.

Thanks, Roger.
Re: [XEN PATCH] x86/mtrr: address violations of MISRA C:2012 Rule 8.3 on parameter types
Posted by Federico Serafini 9 months, 2 weeks ago

On 20/07/23 14:15, Roger Pau Monné wrote:
> On Thu, Jul 20, 2023 at 12:48:36PM +0200, Federico Serafini wrote:
>> +extern uint32_t get_pat_flags(struct vcpu *v, uint32_t gl1e_flags,
>> +                              paddr_t gpaddr, paddr_t spaddr,
>> +															uint8_t gmtrr_mtype);
> 
> Wrong usage of hard tabs.
> 
> Thanks, Roger.

Sorry, some update must have changed the settings of my editor.
Thanks for reporting.

Regards
-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)