[PATCH] MISRA: Rephrase the deviation for Directive 4.10

Andrew Cooper posted 1 patch 11 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20250304235701.2770842-1-andrew.cooper3@citrix.com
automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +-
xen/arch/arm/include/asm/perfc_defn.h            | 2 +-
xen/arch/x86/include/asm/perfc_defn.h            | 2 +-
xen/include/asm-generic/perfc_defn.h             | 2 +-
xen/include/xen/perfc_defn.h                     | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
[PATCH] MISRA: Rephrase the deviation for Directive 4.10
Posted by Andrew Cooper 11 months, 1 week ago
The use of "legitimately" mixes the concepts of "it was designed to do this"
and "it was correct to do this".

The latter in particular can go stale.  "intended" is a better way of phrasing
this.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Julien Grall <julien@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +-
 xen/arch/arm/include/asm/perfc_defn.h            | 2 +-
 xen/arch/x86/include/asm/perfc_defn.h            | 2 +-
 xen/include/asm-generic/perfc_defn.h             | 2 +-
 xen/include/xen/perfc_defn.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index dfa5f34b3952..2c8fb9271391 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -74,7 +74,7 @@ they are not instances of commented-out code."
 
 -doc_begin="Files that are intended to be included more than once do not need to
 conform to the directive."
--config=MC3A2.D4.10,reports+={safe, "first_area(text(^/\\* This file is legitimately included multiple times\\. \\*/$, begin-4))"}
+-config=MC3A2.D4.10,reports+={safe, "first_area(text(^/\\* This file is intended to be included multiple times\\. \\*/$, begin-4))"}
 -config=MC3A2.D4.10,reports+={safe, "first_area(text(^/\\* Generated file, do not edit! \\*/$, begin-3))"}
 -config=MC3A2.D4.10,reports+={safe, "all_area(all_loc(file(^xen/include/generated/autoconf.h$)))"}
 -doc_end
diff --git a/xen/arch/arm/include/asm/perfc_defn.h b/xen/arch/arm/include/asm/perfc_defn.h
index 3ab0391175d7..effd25b69ecc 100644
--- a/xen/arch/arm/include/asm/perfc_defn.h
+++ b/xen/arch/arm/include/asm/perfc_defn.h
@@ -1,4 +1,4 @@
-/* This file is legitimately included multiple times. */
+/* This file is intended to be included multiple times. */
 /*#ifndef __XEN_PERFC_DEFN_H__*/
 /*#define __XEN_PERFC_DEFN_H__*/
 
diff --git a/xen/arch/x86/include/asm/perfc_defn.h b/xen/arch/x86/include/asm/perfc_defn.h
index 487e20dc9734..d6127cb91ea5 100644
--- a/xen/arch/x86/include/asm/perfc_defn.h
+++ b/xen/arch/x86/include/asm/perfc_defn.h
@@ -1,4 +1,4 @@
-/* This file is legitimately included multiple times. */
+/* This file is intended to be included multiple times. */
 /*#ifndef __XEN_PERFC_DEFN_H__*/
 /*#define __XEN_PERFC_DEFN_H__*/
 
diff --git a/xen/include/asm-generic/perfc_defn.h b/xen/include/asm-generic/perfc_defn.h
index 8237636d83fb..726cddc1b3e8 100644
--- a/xen/include/asm-generic/perfc_defn.h
+++ b/xen/include/asm-generic/perfc_defn.h
@@ -1,4 +1,4 @@
-/* This file is legitimately included multiple times. */
+/* This file is intended to be included multiple times. */
 /* #ifndef ASM_GENERIC_PERFC_DEFN_H */
 /* #define ASM_GENERIC_PERFC_DEFN_H */
 
diff --git a/xen/include/xen/perfc_defn.h b/xen/include/xen/perfc_defn.h
index a987d80dd6f1..afbabad0b3be 100644
--- a/xen/include/xen/perfc_defn.h
+++ b/xen/include/xen/perfc_defn.h
@@ -1,4 +1,4 @@
-/* This file is legitimately included multiple times. */
+/* This file is intended to be included multiple times. */
 /*#ifndef __XEN_PERFC_DEFN_H__*/
 /*#define __XEN_PERFC_DEFN_H__*/
 

base-commit: 83e043ee72b8c2fe1d620d137c20a2ffb040da01
-- 
2.39.5


Re: [PATCH] MISRA: Rephrase the deviation for Directive 4.10
Posted by Stefano Stabellini 11 months, 1 week ago
On Tue, 4 Mar 2025, Andrew Cooper wrote:
> The use of "legitimately" mixes the concepts of "it was designed to do this"
> and "it was correct to do this".
> 
> The latter in particular can go stale.  "intended" is a better way of phrasing
> this.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> CC: Anthony PERARD <anthony.perard@vates.tech>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Julien Grall <julien@xen.org>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
>  automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +-
>  xen/arch/arm/include/asm/perfc_defn.h            | 2 +-
>  xen/arch/x86/include/asm/perfc_defn.h            | 2 +-
>  xen/include/asm-generic/perfc_defn.h             | 2 +-
>  xen/include/xen/perfc_defn.h                     | 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
> index dfa5f34b3952..2c8fb9271391 100644
> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -74,7 +74,7 @@ they are not instances of commented-out code."
>  
>  -doc_begin="Files that are intended to be included more than once do not need to
>  conform to the directive."
> --config=MC3A2.D4.10,reports+={safe, "first_area(text(^/\\* This file is legitimately included multiple times\\. \\*/$, begin-4))"}
> +-config=MC3A2.D4.10,reports+={safe, "first_area(text(^/\\* This file is intended to be included multiple times\\. \\*/$, begin-4))"}
>  -config=MC3A2.D4.10,reports+={safe, "first_area(text(^/\\* Generated file, do not edit! \\*/$, begin-3))"}
>  -config=MC3A2.D4.10,reports+={safe, "all_area(all_loc(file(^xen/include/generated/autoconf.h$)))"}
>  -doc_end
> diff --git a/xen/arch/arm/include/asm/perfc_defn.h b/xen/arch/arm/include/asm/perfc_defn.h
> index 3ab0391175d7..effd25b69ecc 100644
> --- a/xen/arch/arm/include/asm/perfc_defn.h
> +++ b/xen/arch/arm/include/asm/perfc_defn.h
> @@ -1,4 +1,4 @@
> -/* This file is legitimately included multiple times. */
> +/* This file is intended to be included multiple times. */
>  /*#ifndef __XEN_PERFC_DEFN_H__*/
>  /*#define __XEN_PERFC_DEFN_H__*/
>  
> diff --git a/xen/arch/x86/include/asm/perfc_defn.h b/xen/arch/x86/include/asm/perfc_defn.h
> index 487e20dc9734..d6127cb91ea5 100644
> --- a/xen/arch/x86/include/asm/perfc_defn.h
> +++ b/xen/arch/x86/include/asm/perfc_defn.h
> @@ -1,4 +1,4 @@
> -/* This file is legitimately included multiple times. */
> +/* This file is intended to be included multiple times. */
>  /*#ifndef __XEN_PERFC_DEFN_H__*/
>  /*#define __XEN_PERFC_DEFN_H__*/
>  
> diff --git a/xen/include/asm-generic/perfc_defn.h b/xen/include/asm-generic/perfc_defn.h
> index 8237636d83fb..726cddc1b3e8 100644
> --- a/xen/include/asm-generic/perfc_defn.h
> +++ b/xen/include/asm-generic/perfc_defn.h
> @@ -1,4 +1,4 @@
> -/* This file is legitimately included multiple times. */
> +/* This file is intended to be included multiple times. */
>  /* #ifndef ASM_GENERIC_PERFC_DEFN_H */
>  /* #define ASM_GENERIC_PERFC_DEFN_H */
>  
> diff --git a/xen/include/xen/perfc_defn.h b/xen/include/xen/perfc_defn.h
> index a987d80dd6f1..afbabad0b3be 100644
> --- a/xen/include/xen/perfc_defn.h
> +++ b/xen/include/xen/perfc_defn.h
> @@ -1,4 +1,4 @@
> -/* This file is legitimately included multiple times. */
> +/* This file is intended to be included multiple times. */
>  /*#ifndef __XEN_PERFC_DEFN_H__*/
>  /*#define __XEN_PERFC_DEFN_H__*/
>  
> 
> base-commit: 83e043ee72b8c2fe1d620d137c20a2ffb040da01
> -- 
> 2.39.5
> 
Re: [PATCH] MISRA: Rephrase the deviation for Directive 4.10
Posted by Julien Grall 11 months ago
Hi,

On 05/03/2025 00:17, Stefano Stabellini wrote:
> On Tue, 4 Mar 2025, Andrew Cooper wrote:
>> The use of "legitimately" mixes the concepts of "it was designed to do this"
>> and "it was correct to do this".
>>
>> The latter in particular can go stale.  "intended" is a better way of phrasing
>> this.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
 > Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Going through my email, I noticed this patch was not committed. I wonder 
if there was any reason?

Cheers,

-- 
Julien Grall
Re: [PATCH] MISRA: Rephrase the deviation for Directive 4.10
Posted by Andrew Cooper 11 months ago
On 11/03/2025 7:48 pm, Julien Grall wrote:
> Hi,
>
> On 05/03/2025 00:17, Stefano Stabellini wrote:
>> On Tue, 4 Mar 2025, Andrew Cooper wrote:
>>> The use of "legitimately" mixes the concepts of "it was designed to
>>> do this"
>>> and "it was correct to do this".
>>>
>>> The latter in particular can go stale.  "intended" is a better way
>>> of phrasing
>>> this.
>>>
>>> No functional change.
>>>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
> > Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Thanks.

>
> Going through my email, I noticed this patch was not committed. I
> wonder if there was any reason?

Urgh, it was supposed to go in ahead of 3da2149cf4dc6 ("x86/IDT:
Generate bsp_idt[] at build time") which uses the new format.

Also ahead of XSN-2, although the part needing this has been deferred
for the meantime.

But eclair is still non-blocking on D4.10, hence why staging is happy.

I'll pick this up in my next sweep.

~Andrew