[XEN PATCH 08/13] xen/hvm: address violations of MISRA C:2012 Rule 7.3

Simone Ballarin posted 13 patches 2 years, 6 months ago
[XEN PATCH 08/13] xen/hvm: address violations of MISRA C:2012 Rule 7.3
Posted by Simone Ballarin 2 years, 6 months ago
From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contain violations of MISRA C:2012 Rule 7.3 whose headline
states:
"The lowercase character 'l' shall not be used in a literal suffix".

Use the "L" suffix instead of the "l" suffix, to avoid potential ambiguity.
If the "u" suffix is used near "L", use the "U" suffix instead, for consistency.

The changes in this patch are mechanical.

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
---
 xen/arch/x86/hvm/emulate.c | 2 +-
 xen/arch/x86/hvm/io.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 75ee98a73b..053c6b495d 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -74,7 +74,7 @@ static int cf_check null_read(
     const struct hvm_io_handler *io_handler, uint64_t addr, uint32_t size,
     uint64_t *data)
 {
-    *data = ~0ul;
+    *data = ~0UL;
     return X86EMUL_OKAY;
 }
 
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 53de1a967d..d75af83ad0 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -400,7 +400,7 @@ static int cf_check vpci_mmcfg_read(
     unsigned int reg;
     pci_sbdf_t sbdf;
 
-    *data = ~0ul;
+    *data = ~0UL;
 
     read_lock(&d->arch.hvm.mmcfg_lock);
     mmcfg = vpci_mmcfg_find(d, addr);
-- 
2.34.1
Re: [XEN PATCH 08/13] xen/hvm: address violations of MISRA C:2012 Rule 7.3
Posted by Paul Durrant 2 years, 4 months ago
On 03/08/2023 11:22, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contain violations of MISRA C:2012 Rule 7.3 whose headline
> states:
> "The lowercase character 'l' shall not be used in a literal suffix".
> 
> Use the "L" suffix instead of the "l" suffix, to avoid potential ambiguity.
> If the "u" suffix is used near "L", use the "U" suffix instead, for consistency.
> 
> The changes in this patch are mechanical.
> 
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> ---
>   xen/arch/x86/hvm/emulate.c | 2 +-
>   xen/arch/x86/hvm/io.c      | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 

Acked-by: Paul Durrant <paul@xen.org>
Re: [XEN PATCH 08/13] xen/hvm: address violations of MISRA C:2012 Rule 7.3
Posted by Simone Ballarin 2 years, 4 months ago
On 03/08/23 12:22, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contain violations of MISRA C:2012 Rule 7.3 whose headline
> states:
> "The lowercase character 'l' shall not be used in a literal suffix".
> 
> Use the "L" suffix instead of the "l" suffix, to avoid potential ambiguity.
> If the "u" suffix is used near "L", use the "U" suffix instead, for consistency.
> 
> The changes in this patch are mechanical.
> 
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> ---
>   xen/arch/x86/hvm/emulate.c | 2 +-
>   xen/arch/x86/hvm/io.c      | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
> index 75ee98a73b..053c6b495d 100644
> --- a/xen/arch/x86/hvm/emulate.c
> +++ b/xen/arch/x86/hvm/emulate.c
> @@ -74,7 +74,7 @@ static int cf_check null_read(
>       const struct hvm_io_handler *io_handler, uint64_t addr, uint32_t size,
>       uint64_t *data)
>   {
> -    *data = ~0ul;
> +    *data = ~0UL;
>       return X86EMUL_OKAY;
>   }
>   
> diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
> index 53de1a967d..d75af83ad0 100644
> --- a/xen/arch/x86/hvm/io.c
> +++ b/xen/arch/x86/hvm/io.c
> @@ -400,7 +400,7 @@ static int cf_check vpci_mmcfg_read(
>       unsigned int reg;
>       pci_sbdf_t sbdf;
>   
> -    *data = ~0ul;
> +    *data = ~0UL;
>   
>       read_lock(&d->arch.hvm.mmcfg_lock);
>       mmcfg = vpci_mmcfg_find(d, addr);

This patch still applies cleanly on staging, any change of getting an Ack?

-- 
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com)
Re: [XEN PATCH 08/13] xen/hvm: address violations of MISRA C:2012 Rule 7.3
Posted by Stefano Stabellini 2 years, 6 months ago
On Thu, 3 Aug 2023, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contain violations of MISRA C:2012 Rule 7.3 whose headline
> states:
> "The lowercase character 'l' shall not be used in a literal suffix".
> 
> Use the "L" suffix instead of the "l" suffix, to avoid potential ambiguity.
> If the "u" suffix is used near "L", use the "U" suffix instead, for consistency.
> 
> The changes in this patch are mechanical.
> 
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Re: [XEN PATCH 08/13] xen/hvm: address violations of MISRA C:2012 Rule 7.3
Posted by Jan Beulich 2 years, 6 months ago
On 04.08.2023 02:50, Stefano Stabellini wrote:
> On Thu, 3 Aug 2023, Simone Ballarin wrote:
>> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
>>
>> The xen sources contain violations of MISRA C:2012 Rule 7.3 whose headline
>> states:
>> "The lowercase character 'l' shall not be used in a literal suffix".
>>
>> Use the "L" suffix instead of the "l" suffix, to avoid potential ambiguity.
>> If the "u" suffix is used near "L", use the "U" suffix instead, for consistency.
>>
>> The changes in this patch are mechanical.
>>
>> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
>> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Acked-by: Jan Beulich <jbeulich@suse.com>
Re: [XEN PATCH 08/13] xen/hvm: address violations of MISRA C:2012 Rule 7.3
Posted by Jan Beulich 2 years, 6 months ago
On 07.08.2023 16:24, Jan Beulich wrote:
> On 04.08.2023 02:50, Stefano Stabellini wrote:
>> On Thu, 3 Aug 2023, Simone Ballarin wrote:
>>> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
>>>
>>> The xen sources contain violations of MISRA C:2012 Rule 7.3 whose headline
>>> states:
>>> "The lowercase character 'l' shall not be used in a literal suffix".
>>>
>>> Use the "L" suffix instead of the "l" suffix, to avoid potential ambiguity.
>>> If the "u" suffix is used near "L", use the "U" suffix instead, for consistency.
>>>
>>> The changes in this patch are mechanical.
>>>
>>> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
>>> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
>>
>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>

Actually - I'm sorry. I can't ack this. This needs an ack from Paul instead.

Jan