diff mbox series

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

Message ID d1be6a0bad7e5cd6277a7b258a1fa70e58a68140.1691053438.git.simone.ballarin@bugseng.com (mailing list archive)
State New, archived
Headers show
Series xen: address violations of MISRA C:2012 Rule 7.3 | expand

Commit Message

Simone Ballarin Aug. 3, 2023, 10:22 a.m. UTC
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(-)

Comments

Stefano Stabellini Aug. 4, 2023, 12:50 a.m. UTC | #1
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>
Jan Beulich Aug. 7, 2023, 2:24 p.m. UTC | #2
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>
Jan Beulich Aug. 7, 2023, 2:25 p.m. UTC | #3
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
Simone Ballarin Sept. 12, 2023, 4:18 p.m. UTC | #4
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?
Paul Durrant Sept. 13, 2023, 6:53 a.m. UTC | #5
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>
diff mbox series

Patch

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);