All of lore.kernel.org
 help / color / mirror / Atom feed
* [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3
@ 2023-08-03 10:22 Simone Ballarin
  2023-08-03 10:22 ` [XEN PATCH 01/13] AMD/IOMMU: " Simone Ballarin
                   ` (13 more replies)
  0 siblings, 14 replies; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Simone Ballarin, Jan Beulich, Andrew Cooper,
	Roger Pau Monné, Wei Liu, Stefano Stabellini, Julien Grall,
	Bertrand Marquis, Volodymyr Babchuk, Paul Durrant,
	Tamas K Lengyel, Alexandru Isaila, Petre Pircalabu, George Dunlap

This series aims to address some violations ofMISRA C:2012 Rule 7.3:
"The lowercase character 'l' shall not be used in a literal suffix".

This patch replaces "l" suffixes with "L", to comply with the rule.
If the "u" suffix is used near "L", use the "U" suffix instead, for consistency.

Gianluca Luparini (13):
  AMD/IOMMU: address violations of MISRA C:2012 Rule 7.3
  x86/svm: address violations of MISRA C:2012 Rule 7.3
  xen/arm: address violations of MISRA C:2012 Rule 7.3
  x86/IOMMU: address violations of MISRA C:2012 Rule 7.3
  xen/ioreq: address violations of MISRA C:2012 Rule 7.3
  xen/mem_access: address violations of MISRA C:2012 Rule 7.3
  xen/vpci: address violations of MISRA C:2012 Rule 7.3
  xen/hvm: address violations of MISRA C:2012 Rule 7.3
  x86/mm: address violations of MISRA C:2012 Rule 7.3
  x86/viridian: address violations of MISRA C:2012 Rule 7.3
  xen/x86: address violations of MISRA C:2012 Rule 7.3
  xen/common: address violations of MISRA C:2012 Rule 7.3
  xen: address violations of MISRA C:2012 Rule 7.3

 xen/arch/arm/include/asm/processor.h        |  6 +++---
 xen/arch/arm/vtimer.c                       |  2 +-
 xen/arch/x86/cpu-policy.c                   |  4 ++--
 xen/arch/x86/dom0_build.c                   |  2 +-
 xen/arch/x86/e820.c                         |  2 +-
 xen/arch/x86/hpet.c                         |  2 +-
 xen/arch/x86/hvm/emulate.c                  |  2 +-
 xen/arch/x86/hvm/hpet.c                     |  6 +++---
 xen/arch/x86/hvm/hvm.c                      |  6 +++---
 xen/arch/x86/hvm/io.c                       |  2 +-
 xen/arch/x86/hvm/stdvga.c                   |  2 +-
 xen/arch/x86/hvm/svm/svm.c                  |  4 ++--
 xen/arch/x86/hvm/viridian/synic.c           |  2 +-
 xen/arch/x86/hvm/viridian/time.c            | 10 +++++-----
 xen/arch/x86/include/asm/apicdef.h          |  4 ++--
 xen/arch/x86/include/asm/debugreg.h         | 16 ++++++++--------
 xen/arch/x86/include/asm/guest_pt.h         | 16 ++++++++--------
 xen/arch/x86/include/asm/pv/domain.h        |  2 +-
 xen/arch/x86/mm.c                           |  4 ++--
 xen/arch/x86/mm/p2m-pt.c                    |  6 +++---
 xen/arch/x86/mm/p2m.c                       | 20 ++++++++++----------
 xen/arch/x86/mm/physmap.c                   |  4 ++--
 xen/arch/x86/msr.c                          |  2 +-
 xen/arch/x86/nmi.c                          |  2 +-
 xen/arch/x86/psr.c                          |  8 ++++----
 xen/arch/x86/spec_ctrl.c                    |  6 +++---
 xen/arch/x86/x86_64/mm.c                    |  4 ++--
 xen/arch/x86/xstate.c                       |  2 +-
 xen/common/ioreq.c                          |  2 +-
 xen/common/mem_access.c                     |  4 ++--
 xen/common/page_alloc.c                     |  6 +++---
 xen/common/rangeset.c                       |  2 +-
 xen/common/softirq.c                        |  8 ++++----
 xen/common/vsprintf.c                       |  2 +-
 xen/drivers/passthrough/amd/iommu_guest.c   |  2 +-
 xen/drivers/passthrough/amd/iommu_map.c     |  2 +-
 xen/drivers/passthrough/amd/pci_amd_iommu.c |  2 +-
 xen/drivers/passthrough/x86/iommu.c         |  8 ++++----
 xen/drivers/vpci/header.c                   |  2 +-
 xen/drivers/vpci/msi.c                      |  2 +-
 xen/drivers/vpci/msix.c                     | 10 +++++-----
 xen/include/xen/bitops.h                    |  8 ++++----
 xen/include/xen/ioreq.h                     |  2 +-
 xen/include/xen/tasklet.h                   |  4 ++--
 xen/include/xen/time.h                      |  4 ++--
 xen/lib/x86/cpuid.c                         |  4 ++--
 46 files changed, 111 insertions(+), 111 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 46+ messages in thread

* [XEN PATCH 01/13] AMD/IOMMU: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
@ 2023-08-03 10:22 ` Simone Ballarin
  2023-08-04  0:40   ` Stefano Stabellini
  2023-08-03 10:22 ` [XEN PATCH 02/13] x86/svm: " Simone Ballarin
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Gianluca Luparini, Jan Beulich, Andrew Cooper,
	Simone Ballarin

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/drivers/passthrough/amd/iommu_guest.c   | 2 +-
 xen/drivers/passthrough/amd/iommu_map.c     | 2 +-
 xen/drivers/passthrough/amd/pci_amd_iommu.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passthrough/amd/iommu_guest.c
index 47a912126a..80d289b8bf 100644
--- a/xen/drivers/passthrough/amd/iommu_guest.c
+++ b/xen/drivers/passthrough/amd/iommu_guest.c
@@ -87,7 +87,7 @@ static uint64_t dte_get_gcr3_table(const struct amd_iommu_dte *dte)
 static void dte_set_gcr3_table(struct amd_iommu_dte *dte, uint16_t dom_id,
                                uint64_t addr, bool gv, uint8_t glx)
 {
-#define GCR3_MASK(hi, lo) (((1ul << ((hi) + 1)) - 1) & ~((1ul << (lo)) - 1))
+#define GCR3_MASK(hi, lo) (((1UL << ((hi) + 1)) - 1) & ~((1UL << (lo)) - 1))
 
     /* I bit must be set when gcr3 is enabled */
     dte->i = true;
diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 993bac6f88..daa24a4858 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -838,7 +838,7 @@ int cf_check amd_iommu_quarantine_init(struct pci_dev *pdev, bool scratch_page)
 {
     struct domain_iommu *hd = dom_iommu(dom_io);
     unsigned long end_gfn =
-        1ul << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT);
+        1UL << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT);
     unsigned int level = amd_iommu_get_paging_mode(end_gfn);
     unsigned int req_id = get_dma_requestor_id(pdev->seg, pdev->sbdf.bdf);
     const struct ivrs_mappings *ivrs_mappings = get_ivrs_mappings(pdev->seg);
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 94e3775506..bea70db4b7 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -368,7 +368,7 @@ static int cf_check amd_iommu_domain_init(struct domain *d)
      */
     hd->arch.amd.paging_mode = max(amd_iommu_get_paging_mode(
             is_hvm_domain(d)
-            ? 1ul << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT)
+            ? 1UL << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT)
             : get_upper_mfn_bound() + 1),
         amd_iommu_min_paging_mode);
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [XEN PATCH 02/13] x86/svm: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
  2023-08-03 10:22 ` [XEN PATCH 01/13] AMD/IOMMU: " Simone Ballarin
@ 2023-08-03 10:22 ` Simone Ballarin
  2023-08-04  0:42   ` Stefano Stabellini
  2023-08-03 10:22 ` [XEN PATCH 03/13] xen/arm: " Simone Ballarin
                   ` (11 subsequent siblings)
  13 siblings, 1 reply; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Gianluca Luparini, Jan Beulich, Andrew Cooper,
	Roger Pau Monné, Wei Liu, Simone Ballarin

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/svm/svm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index b3845bdca7..01dd592d9b 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1077,7 +1077,7 @@ static void svm_guest_osvw_init(struct domain *d)
      * Guests should see errata 400 and 415 as fixed (assuming that
      * HLT and IO instructions are intercepted).
      */
-    svm->osvw.length = min(max(3ul, osvw_length), 64ul);
+    svm->osvw.length = min(max(3UL, osvw_length), 64UL);
     svm->osvw.status = osvw_status & ~6;
 
     /*
@@ -1652,7 +1652,7 @@ static void svm_do_nested_pgfault(struct vcpu *v,
     else if ( pfec & NPT_PFEC_in_gpt )
         npfec.kind = npfec_kind_in_gpt;
 
-    ret = hvm_hap_nested_page_fault(gpa, ~0ul, npfec);
+    ret = hvm_hap_nested_page_fault(gpa, ~0UL, npfec);
 
     if ( tb_init_done )
     {
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [XEN PATCH 03/13] xen/arm: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
  2023-08-03 10:22 ` [XEN PATCH 01/13] AMD/IOMMU: " Simone Ballarin
  2023-08-03 10:22 ` [XEN PATCH 02/13] x86/svm: " Simone Ballarin
@ 2023-08-03 10:22 ` Simone Ballarin
  2023-08-03 13:44   ` Luca Fancellu
  2023-08-04  0:44   ` Stefano Stabellini
  2023-08-03 10:22 ` [XEN PATCH 04/13] x86/IOMMU: " Simone Ballarin
                   ` (10 subsequent siblings)
  13 siblings, 2 replies; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Gianluca Luparini, Stefano Stabellini, Julien Grall,
	Bertrand Marquis, Volodymyr Babchuk, Simone Ballarin

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/arm/include/asm/processor.h | 6 +++---
 xen/arch/arm/vtimer.c                | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index 7e42ff8811..8e02410465 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -521,9 +521,9 @@ extern register_t __cpu_logical_map[];
 #define CNTKCTL_EL1_EL0PTEN  (1u<<9) /* Expose phys timer registers to EL0 */
 
 /* Timer control registers */
-#define CNTx_CTL_ENABLE   (1ul<<0)  /* Enable timer */
-#define CNTx_CTL_MASK     (1ul<<1)  /* Mask IRQ */
-#define CNTx_CTL_PENDING  (1ul<<2)  /* IRQ pending */
+#define CNTx_CTL_ENABLE   (1UL<<0)  /* Enable timer */
+#define CNTx_CTL_MASK     (1UL<<1)  /* Mask IRQ */
+#define CNTx_CTL_PENDING  (1UL<<2)  /* IRQ pending */
 
 /* Timer frequency mask */
 #define CNTFRQ_MASK       GENMASK(31, 0)
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 48f2daa907..c54360e202 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -206,7 +206,7 @@ static bool vtimer_cntp_tval(struct cpu_user_regs *regs, register_t *r,
 
     if ( read )
     {
-        *r = (uint32_t)((v->arch.phys_timer.cval - cntpct) & 0xffffffffull);
+        *r = (uint32_t)((v->arch.phys_timer.cval - cntpct) & 0xffffffffULL);
     }
     else
     {
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [XEN PATCH 04/13] x86/IOMMU: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
                   ` (2 preceding siblings ...)
  2023-08-03 10:22 ` [XEN PATCH 03/13] xen/arm: " Simone Ballarin
@ 2023-08-03 10:22 ` Simone Ballarin
  2023-08-04  0:45   ` Stefano Stabellini
  2023-08-03 10:22 ` [XEN PATCH 05/13] xen/ioreq: " Simone Ballarin
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Gianluca Luparini, Jan Beulich, Paul Durrant,
	Roger Pau Monné, Simone Ballarin

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/drivers/passthrough/x86/iommu.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index d290855959..c85549ccad 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -576,16 +576,16 @@ struct page_info *iommu_alloc_pgtable(struct domain_iommu *hd,
 
         ASSERT((CONTIG_LEVEL_SHIFT & (contig_mask >> shift)) == CONTIG_LEVEL_SHIFT);
 
-        p[0] = (CONTIG_LEVEL_SHIFT + 0ull) << shift;
+        p[0] = (CONTIG_LEVEL_SHIFT + 0ULL) << shift;
         p[1] = 0;
-        p[2] = 1ull << shift;
+        p[2] = 1ULL << shift;
         p[3] = 0;
 
         for ( i = 4; i < PAGE_SIZE / sizeof(*p); i += 4 )
         {
-            p[i + 0] = (find_first_set_bit(i) + 0ull) << shift;
+            p[i + 0] = (find_first_set_bit(i) + 0ULL) << shift;
             p[i + 1] = 0;
-            p[i + 2] = 1ull << shift;
+            p[i + 2] = 1ULL << shift;
             p[i + 3] = 0;
         }
     }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [XEN PATCH 05/13] xen/ioreq: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
                   ` (3 preceding siblings ...)
  2023-08-03 10:22 ` [XEN PATCH 04/13] x86/IOMMU: " Simone Ballarin
@ 2023-08-03 10:22 ` Simone Ballarin
  2023-08-04  0:46   ` Stefano Stabellini
                     ` (2 more replies)
  2023-08-03 10:22 ` [XEN PATCH 06/13] xen/mem_access: " Simone Ballarin
                   ` (8 subsequent siblings)
  13 siblings, 3 replies; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel; +Cc: consulting, Gianluca Luparini, Paul Durrant, Simone Ballarin

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/common/ioreq.c      | 2 +-
 xen/include/xen/ioreq.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/ioreq.c b/xen/common/ioreq.c
index 7cb717f7a2..62b907f4c4 100644
--- a/xen/common/ioreq.c
+++ b/xen/common/ioreq.c
@@ -1182,7 +1182,7 @@ static int ioreq_send_buffered(struct ioreq_server *s, ioreq_t *p)
      *  - the count field is usually used with data_is_ptr and since we don't
      *    support data_is_ptr we do not waste space for the count field either
      */
-    if ( (p->addr > 0xffffful) || p->data_is_ptr || (p->count != 1) )
+    if ( (p->addr > 0xfffffUL) || p->data_is_ptr || (p->count != 1) )
         return 0;
 
     switch ( p->size )
diff --git a/xen/include/xen/ioreq.h b/xen/include/xen/ioreq.h
index a26614d331..cd399adf17 100644
--- a/xen/include/xen/ioreq.h
+++ b/xen/include/xen/ioreq.h
@@ -60,7 +60,7 @@ struct ioreq_server {
 static inline paddr_t ioreq_mmio_first_byte(const ioreq_t *p)
 {
     return unlikely(p->df) ?
-           p->addr - (p->count - 1ul) * p->size :
+           p->addr - (p->count - 1UL) * p->size :
            p->addr;
 }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [XEN PATCH 06/13] xen/mem_access: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
                   ` (4 preceding siblings ...)
  2023-08-03 10:22 ` [XEN PATCH 05/13] xen/ioreq: " Simone Ballarin
@ 2023-08-03 10:22 ` Simone Ballarin
  2023-08-04  0:47   ` Stefano Stabellini
  2023-08-03 10:22 ` [XEN PATCH 07/13] xen/vpci: " Simone Ballarin
                   ` (7 subsequent siblings)
  13 siblings, 1 reply; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Gianluca Luparini, Tamas K Lengyel, Alexandru Isaila,
	Petre Pircalabu, Simone Ballarin

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/common/mem_access.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/mem_access.c b/xen/common/mem_access.c
index 010e6f8dbf..385950789c 100644
--- a/xen/common/mem_access.c
+++ b/xen/common/mem_access.c
@@ -60,7 +60,7 @@ int mem_access_memop(unsigned long cmd,
 
     case XENMEM_access_op_set_access:
         rc = -EINVAL;
-        if ( (mao.pfn != ~0ull) &&
+        if ( (mao.pfn != ~0ULL) &&
              (mao.nr < start_iter ||
               ((mao.pfn + mao.nr - 1) < mao.pfn) ||
               ((mao.pfn + mao.nr - 1) > domain_get_maximum_gpfn(d))) )
@@ -96,7 +96,7 @@ int mem_access_memop(unsigned long cmd,
             break;
 
         rc = -EINVAL;
-        if ( (mao.pfn > domain_get_maximum_gpfn(d)) && mao.pfn != ~0ull )
+        if ( (mao.pfn > domain_get_maximum_gpfn(d)) && mao.pfn != ~0ULL )
             break;
 
         rc = p2m_get_mem_access(d, _gfn(mao.pfn), &access, 0);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [XEN PATCH 07/13] xen/vpci: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
                   ` (5 preceding siblings ...)
  2023-08-03 10:22 ` [XEN PATCH 06/13] xen/mem_access: " Simone Ballarin
@ 2023-08-03 10:22 ` Simone Ballarin
  2023-08-04  0:48   ` Stefano Stabellini
  2023-08-24 12:22   ` Roger Pau Monné
  2023-08-03 10:22 ` [XEN PATCH 08/13] xen/hvm: " Simone Ballarin
                   ` (6 subsequent siblings)
  13 siblings, 2 replies; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Gianluca Luparini, Roger Pau Monné,
	Simone Ballarin

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/drivers/vpci/header.c |  2 +-
 xen/drivers/vpci/msi.c    |  2 +-
 xen/drivers/vpci/msix.c   | 10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 60f7049e34..767c1ba718 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -447,7 +447,7 @@ static void cf_check bar_write(
      * Update the cached address, so that when memory decoding is enabled
      * Xen can map the BAR into the guest p2m.
      */
-    bar->addr &= ~(0xffffffffull << (hi ? 32 : 0));
+    bar->addr &= ~(0xffffffffULL << (hi ? 32 : 0));
     bar->addr |= (uint64_t)val << (hi ? 32 : 0);
 
     /* Make sure Xen writes back the same value for the BAR RO bits. */
diff --git a/xen/drivers/vpci/msi.c b/xen/drivers/vpci/msi.c
index 8f2b59e61a..9090d97c9a 100644
--- a/xen/drivers/vpci/msi.c
+++ b/xen/drivers/vpci/msi.c
@@ -103,7 +103,7 @@ static void cf_check address_write(
     struct vpci_msi *msi = data;
 
     /* Clear low part. */
-    msi->address &= ~0xffffffffull;
+    msi->address &= ~0xffffffffULL;
     msi->address |= val;
 
     update_msi(pdev, msi);
diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 25bde77586..bc77d4825d 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -273,7 +273,7 @@ static int adjacent_read(const struct domain *d, const struct vpci_msix *msix,
     struct vpci *vpci = msix->pdev->vpci;
     unsigned int slot;
 
-    *data = ~0ul;
+    *data = ~0UL;
 
     if ( !adjacent_handle(msix, addr + len - 1) )
         return X86EMUL_OKAY;
@@ -305,13 +305,13 @@ static int adjacent_read(const struct domain *d, const struct vpci_msix *msix,
          */
         for ( i = 0; i < len; i++ )
         {
-            unsigned long partial = ~0ul;
+            unsigned long partial = ~0UL;
             int rc = adjacent_read(d, msix, addr + i, 1, &partial);
 
             if ( rc != X86EMUL_OKAY )
                 return rc;
 
-            *data &= ~(0xfful << (i * 8));
+            *data &= ~(0xffUL << (i * 8));
             *data |= (partial & 0xff) << (i * 8);
         }
 
@@ -363,7 +363,7 @@ static int cf_check msix_read(
     const struct vpci_msix_entry *entry;
     unsigned int offset;
 
-    *data = ~0ul;
+    *data = ~0UL;
 
     if ( !msix )
         return X86EMUL_RETRY;
@@ -525,7 +525,7 @@ static int cf_check msix_write(
             entry->addr = data;
             break;
         }
-        entry->addr &= ~0xffffffffull;
+        entry->addr &= ~0xffffffffULL;
         entry->addr |= data;
         break;
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [XEN PATCH 08/13] xen/hvm: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
                   ` (6 preceding siblings ...)
  2023-08-03 10:22 ` [XEN PATCH 07/13] xen/vpci: " Simone Ballarin
@ 2023-08-03 10:22 ` Simone Ballarin
  2023-08-04  0:50   ` Stefano Stabellini
                     ` (2 more replies)
  2023-08-03 10:22 ` [XEN PATCH 09/13] x86/mm: " Simone Ballarin
                   ` (5 subsequent siblings)
  13 siblings, 3 replies; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Gianluca Luparini, Paul Durrant, Jan Beulich,
	Andrew Cooper, Roger Pau Monné, Wei Liu, Simone Ballarin

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



^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [XEN PATCH 09/13] x86/mm: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
                   ` (7 preceding siblings ...)
  2023-08-03 10:22 ` [XEN PATCH 08/13] xen/hvm: " Simone Ballarin
@ 2023-08-03 10:22 ` Simone Ballarin
  2023-08-04  0:52   ` Stefano Stabellini
  2023-08-03 10:22 ` [XEN PATCH 10/13] x86/viridian: " Simone Ballarin
                   ` (4 subsequent siblings)
  13 siblings, 1 reply; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Gianluca Luparini, Jan Beulich, Andrew Cooper,
	George Dunlap, Roger Pau Monné, Wei Liu, Simone Ballarin

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/mm/p2m-pt.c  |  6 +++---
 xen/arch/x86/mm/p2m.c     | 20 ++++++++++----------
 xen/arch/x86/mm/physmap.c |  4 ++--
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 6d1bb5daad..b2b14746c1 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -552,7 +552,7 @@ static void check_entry(mfn_t mfn, p2m_type_t new, p2m_type_t old,
     if ( new == p2m_mmio_direct )
         ASSERT(!mfn_eq(mfn, INVALID_MFN) &&
                !rangeset_overlaps_range(mmio_ro_ranges, mfn_x(mfn),
-                                        mfn_x(mfn) + (1ul << order)));
+                                        mfn_x(mfn) + (1UL << order)));
     else if ( p2m_allows_invalid_mfn(new) || new == p2m_invalid ||
               new == p2m_mmio_dm )
         ASSERT(mfn_valid(mfn) || mfn_eq(mfn, INVALID_MFN));
@@ -745,9 +745,9 @@ p2m_pt_set_entry(struct p2m_domain *p2m, gfn_t gfn_, mfn_t mfn,
     if ( need_iommu_pt_sync(p2m->domain) &&
          (iommu_old_flags != iommu_pte_flags || old_mfn != mfn_x(mfn)) )
         rc = iommu_pte_flags
-             ? iommu_legacy_map(d, _dfn(gfn), mfn, 1ul << page_order,
+             ? iommu_legacy_map(d, _dfn(gfn), mfn, 1UL << page_order,
                                 iommu_pte_flags)
-             : iommu_legacy_unmap(d, _dfn(gfn), 1ul << page_order);
+             : iommu_legacy_unmap(d, _dfn(gfn), 1UL << page_order);
 
     /*
      * Free old intermediate tables if necessary.  This has to be the
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index f6df35767a..0983bd71d9 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -392,7 +392,7 @@ int p2m_set_entry(struct p2m_domain *p2m, gfn_t gfn, mfn_t mfn,
                   unsigned int page_order, p2m_type_t p2mt, p2m_access_t p2ma)
 {
     bool hap = hap_enabled(p2m->domain);
-    unsigned long todo = 1ul << page_order;
+    unsigned long todo = 1UL << page_order;
     int set_rc, rc = 0;
 
     ASSERT(gfn_locked_by_me(p2m, gfn));
@@ -401,10 +401,10 @@ int p2m_set_entry(struct p2m_domain *p2m, gfn_t gfn, mfn_t mfn,
     {
         unsigned long fn_mask = (!mfn_eq(mfn, INVALID_MFN) ? mfn_x(mfn) : 0) |
                                 gfn_x(gfn) | todo;
-        unsigned int order = (!(fn_mask & ((1ul << PAGE_ORDER_1G) - 1)) &&
+        unsigned int order = (!(fn_mask & ((1UL << PAGE_ORDER_1G) - 1)) &&
                               hap && hap_has_1gb)
                              ? PAGE_ORDER_1G
-                             : (!(fn_mask & ((1ul << PAGE_ORDER_2M) - 1)) &&
+                             : (!(fn_mask & ((1UL << PAGE_ORDER_2M) - 1)) &&
                                 (!hap || hap_has_2mb))
                                ? PAGE_ORDER_2M : PAGE_ORDER_4K;
 
@@ -412,10 +412,10 @@ int p2m_set_entry(struct p2m_domain *p2m, gfn_t gfn, mfn_t mfn,
         if ( set_rc )
             rc = set_rc;
 
-        gfn = gfn_add(gfn, 1ul << order);
+        gfn = gfn_add(gfn, 1UL << order);
         if ( !mfn_eq(mfn, INVALID_MFN) )
-            mfn = mfn_add(mfn, 1ul << order);
-        todo -= 1ul << order;
+            mfn = mfn_add(mfn, 1UL << order);
+        todo -= 1UL << order;
     }
 
     return rc;
@@ -1407,7 +1407,7 @@ void np2m_flush_base(struct vcpu *v, unsigned long np2m_base)
     struct p2m_domain *p2m;
     unsigned int i;
 
-    np2m_base &= ~(0xfffull);
+    np2m_base &= ~(0xfffULL);
 
     nestedp2m_lock(d);
     for ( i = 0; i < MAX_NESTEDP2M; i++ )
@@ -1456,7 +1456,7 @@ p2m_get_nestedp2m_locked(struct vcpu *v)
     bool needs_flush = true;
 
     /* Mask out low bits; this avoids collisions with P2M_BASE_EADDR */
-    np2m_base &= ~(0xfffull);
+    np2m_base &= ~(0xfffULL);
 
     if (nv->nv_flushp2m && nv->nv_p2m) {
         nv->nv_p2m = NULL;
@@ -1614,8 +1614,8 @@ unsigned long paging_gva_to_gfn(struct vcpu *v,
          * Sanity check that l1_gfn can be used properly as a 4K mapping, even
          * if it mapped by a nested superpage.
          */
-        ASSERT((l2_gfn & ((1ul << l1_page_order) - 1)) ==
-               (l1_gfn & ((1ul << l1_page_order) - 1)));
+        ASSERT((l2_gfn & ((1UL << l1_page_order) - 1)) ==
+               (l1_gfn & ((1UL << l1_page_order) - 1)));
 
         return l1_gfn;
     }
diff --git a/xen/arch/x86/mm/physmap.c b/xen/arch/x86/mm/physmap.c
index f1695e456e..098ccdf541 100644
--- a/xen/arch/x86/mm/physmap.c
+++ b/xen/arch/x86/mm/physmap.c
@@ -72,7 +72,7 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
         if ( !is_iommu_enabled(d) )
             return 0;
         return iommu_legacy_map(d, _dfn(gfn), _mfn(gfn),
-                                1ul << PAGE_ORDER_4K,
+                                1UL << PAGE_ORDER_4K,
                                 p2m_access_to_iommu_flags(p2ma));
     }
 
@@ -85,7 +85,7 @@ int clear_identity_p2m_entry(struct domain *d, unsigned long gfn)
     {
         if ( !is_iommu_enabled(d) )
             return 0;
-        return iommu_legacy_unmap(d, _dfn(gfn), 1ul << PAGE_ORDER_4K);
+        return iommu_legacy_unmap(d, _dfn(gfn), 1UL << PAGE_ORDER_4K);
     }
 
     return p2m_remove_identity_entry(d, gfn);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [XEN PATCH 10/13] x86/viridian: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
                   ` (8 preceding siblings ...)
  2023-08-03 10:22 ` [XEN PATCH 09/13] x86/mm: " Simone Ballarin
@ 2023-08-03 10:22 ` Simone Ballarin
  2023-08-04  0:54   ` Stefano Stabellini
  2023-09-12  6:23   ` Paul Durrant
  2023-08-03 10:22 ` [XEN PATCH 11/13] xen/x86: " Simone Ballarin
                   ` (3 subsequent siblings)
  13 siblings, 2 replies; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Gianluca Luparini, Paul Durrant, Wei Liu, Jan Beulich,
	Andrew Cooper, Roger Pau Monné, Simone Ballarin

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/viridian/synic.c |  2 +-
 xen/arch/x86/hvm/viridian/time.c  | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/synic.c b/xen/arch/x86/hvm/viridian/synic.c
index 83d7addfc3..8cf600cec6 100644
--- a/xen/arch/x86/hvm/viridian/synic.c
+++ b/xen/arch/x86/hvm/viridian/synic.c
@@ -233,7 +233,7 @@ int viridian_synic_rdmsr(const struct vcpu *v, uint32_t idx, uint64_t *val)
          * should be set to. Assume everything but the bottom bit
          * should be zero.
          */
-        *val = 1ul;
+        *val = 1UL;
         break;
 
     case HV_X64_MSR_SIEFP:
diff --git a/xen/arch/x86/hvm/viridian/time.c b/xen/arch/x86/hvm/viridian/time.c
index a3ea3fa067..137577384f 100644
--- a/xen/arch/x86/hvm/viridian/time.c
+++ b/xen/arch/x86/hvm/viridian/time.c
@@ -66,7 +66,7 @@ static void update_reference_tsc(const struct domain *d, bool initialize)
      * The offset value is calculated on restore after migration and
      * ensures that Windows will not see a large jump in ReferenceTime.
      */
-    p->tsc_scale = ((10000ul << 32) / d->arch.tsc_khz) << 32;
+    p->tsc_scale = ((10000UL << 32) / d->arch.tsc_khz) << 32;
     p->tsc_offset = trc->off;
     smp_wmb();
 
@@ -79,7 +79,7 @@ static uint64_t trc_val(const struct domain *d, int64_t offset)
     uint64_t tsc, scale;
 
     tsc = hvm_get_guest_tsc(pt_global_vcpu_target(d));
-    scale = ((10000ul << 32) / d->arch.tsc_khz) << 32;
+    scale = ((10000UL << 32) / d->arch.tsc_khz) << 32;
 
     return hv_scale_tsc(tsc, scale, offset);
 }
@@ -201,7 +201,7 @@ static void start_stimer(struct viridian_stimer *vs)
     ASSERT(expiration - now > 0);
 
     vs->expiration = expiration;
-    timeout = (expiration - now) * 100ull;
+    timeout = (expiration - now) * 100ULL;
 
     vs->started = true;
     clear_bit(stimerx, &vv->stimer_pending);
@@ -413,14 +413,14 @@ int viridian_time_rdmsr(const struct vcpu *v, uint32_t idx, uint64_t *val)
         if ( viridian_feature_mask(d) & HVMPV_no_freq )
             return X86EMUL_EXCEPTION;
 
-        *val = (uint64_t)d->arch.tsc_khz * 1000ull;
+        *val = (uint64_t)d->arch.tsc_khz * 1000ULL;
         break;
 
     case HV_X64_MSR_APIC_FREQUENCY:
         if ( viridian_feature_mask(d) & HVMPV_no_freq )
             return X86EMUL_EXCEPTION;
 
-        *val = 1000000000ull / APIC_BUS_CYCLE_NS;
+        *val = 1000000000ULL / APIC_BUS_CYCLE_NS;
         break;
 
     case HV_X64_MSR_REFERENCE_TSC:
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [XEN PATCH 11/13] xen/x86: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
                   ` (9 preceding siblings ...)
  2023-08-03 10:22 ` [XEN PATCH 10/13] x86/viridian: " Simone Ballarin
@ 2023-08-03 10:22 ` Simone Ballarin
  2023-08-04  0:59   ` Stefano Stabellini
  2023-08-03 10:22 ` [XEN PATCH 12/13] xen/common: " Simone Ballarin
                   ` (2 subsequent siblings)
  13 siblings, 1 reply; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Gianluca Luparini, Jan Beulich, Andrew Cooper,
	Roger Pau Monné, Wei Liu, Simone Ballarin

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/cpu-policy.c            |  4 ++--
 xen/arch/x86/dom0_build.c            |  2 +-
 xen/arch/x86/e820.c                  |  2 +-
 xen/arch/x86/hpet.c                  |  2 +-
 xen/arch/x86/hvm/hpet.c              |  6 +++---
 xen/arch/x86/hvm/hvm.c               |  6 +++---
 xen/arch/x86/hvm/stdvga.c            |  2 +-
 xen/arch/x86/include/asm/apicdef.h   |  4 ++--
 xen/arch/x86/include/asm/debugreg.h  | 16 ++++++++--------
 xen/arch/x86/include/asm/guest_pt.h  | 16 ++++++++--------
 xen/arch/x86/include/asm/pv/domain.h |  2 +-
 xen/arch/x86/mm.c                    |  4 ++--
 xen/arch/x86/msr.c                   |  2 +-
 xen/arch/x86/nmi.c                   |  2 +-
 xen/arch/x86/psr.c                   |  8 ++++----
 xen/arch/x86/spec_ctrl.c             |  6 +++---
 xen/arch/x86/x86_64/mm.c             |  4 ++--
 xen/arch/x86/xstate.c                |  2 +-
 xen/lib/x86/cpuid.c                  |  4 ++--
 19 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index 1f954d4e59..5fbb3602ae 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -250,9 +250,9 @@ static void recalculate_xstate(struct cpu_policy *p)
     else
         xstates &= ~XSTATE_XSAVES_ONLY;
 
-    for ( i = 2; i < min(63ul, ARRAY_SIZE(p->xstate.comp)); ++i )
+    for ( i = 2; i < min(63UL, ARRAY_SIZE(p->xstate.comp)); ++i )
     {
-        uint64_t curr_xstate = 1ul << i;
+        uint64_t curr_xstate = 1UL << i;
 
         if ( !(xstates & curr_xstate) )
             continue;
diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 8b1fcc6471..09fb8b063a 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -537,7 +537,7 @@ int __init dom0_setup_permissions(struct domain *d)
     for ( i = 0; i < e820.nr_map; i++ )
     {
         unsigned long sfn, efn;
-        sfn = max_t(unsigned long, paddr_to_pfn(e820.map[i].addr), 0x100ul);
+        sfn = max_t(unsigned long, paddr_to_pfn(e820.map[i].addr), 0x100UL);
         efn = paddr_to_pfn(e820.map[i].addr + e820.map[i].size - 1);
         if ( (e820.map[i].type == E820_UNUSABLE) &&
              (e820.map[i].size != 0) &&
diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c
index 0b89935510..4911e64b8c 100644
--- a/xen/arch/x86/e820.c
+++ b/xen/arch/x86/e820.c
@@ -450,7 +450,7 @@ static uint64_t __init mtrr_top_of_ram(void)
 
     /* paddr_bits must have been set at this point */
     ASSERT(paddr_bits);
-    addr_mask = ((1ull << paddr_bits) - 1) & PAGE_MASK;
+    addr_mask = ((1ULL << paddr_bits) - 1) & PAGE_MASK;
 
     rdmsrl(MSR_MTRRcap, mtrr_cap);
     rdmsrl(MSR_MTRRdefType, mtrr_def);
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index bc164dd82c..a2df1c7df4 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -619,7 +619,7 @@ void __init cf_check hpet_broadcast_init(void)
          * math multiplication factor for nanosecond to hpet tick conversion.
          */
         hpet_events[i].mult = div_sc((unsigned long)hpet_rate,
-                                     1000000000ul, 32);
+                                     1000000000UL, 32);
         hpet_events[i].shift = 32;
         hpet_events[i].next_event = STIME_MAX;
         spin_lock_init(&hpet_events[i].lock);
diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index dff27b760e..80f323316c 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -161,7 +161,7 @@ static int cf_check hpet_read(
 
     if ( !v->domain->arch.hvm.params[HVM_PARAM_HPET_ENABLED] )
     {
-        result = ~0ul;
+        result = ~0UL;
         goto out;
     }
 
@@ -169,7 +169,7 @@ static int cf_check hpet_read(
 
     if ( hpet_check_access_length(addr, length) != 0 )
     {
-        result = ~0ul;
+        result = ~0UL;
         goto out;
     }
 
@@ -486,7 +486,7 @@ static int cf_check hpet_write(
         if ( timer_is_periodic(h, tn) &&
              !(h->hpet.timers[tn].config & HPET_TN_SETVAL) )
         {
-            uint64_t max_period = (timer_is_32bit(h, tn) ? ~0u : ~0ull) >> 1;
+            uint64_t max_period = (timer_is_32bit(h, tn) ? ~0u : ~0ULL) >> 1;
 
             /*
              * Clamp period to reasonable min/max values:
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 2180abeb33..3a99c0ff20 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -294,7 +294,7 @@ void hvm_get_guest_pat(struct vcpu *v, uint64_t *guest_pat)
 static bool pat_valid(uint64_t val)
 {
     /* Yields a non-zero value in any lane which had value greater than 7. */
-    uint64_t any_gt_7   =  val & 0xf8f8f8f8f8f8f8f8ull;
+    uint64_t any_gt_7   =  val & 0xf8f8f8f8f8f8f8f8ULL;
 
     /*
      * With the > 7 case covered, identify lanes with the value 0-3 by finding
@@ -302,7 +302,7 @@ static bool pat_valid(uint64_t val)
      *
      * Yields bit 2 set in each lane which has a value <= 3.
      */
-    uint64_t any_le_3   = ~val & 0x0404040404040404ull;
+    uint64_t any_le_3   = ~val & 0x0404040404040404ULL;
 
     /*
      * Logically, any_2_or_3 is "any_le_3 && bit 1 set".
@@ -3626,7 +3626,7 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
 
  gp_fault:
     ret = X86EMUL_EXCEPTION;
-    *msr_content = -1ull;
+    *msr_content = -1ULL;
     goto out;
 }
 
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index 798a9a0549..2586891863 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -305,7 +305,7 @@ static int cf_check stdvga_mem_read(
     const struct hvm_io_handler *handler, uint64_t addr, uint32_t size,
     uint64_t *p_data)
 {
-    uint64_t data = ~0ul;
+    uint64_t data = ~0UL;
 
     switch ( size )
     {
diff --git a/xen/arch/x86/include/asm/apicdef.h b/xen/arch/x86/include/asm/apicdef.h
index 2440d83c8d..a261436993 100644
--- a/xen/arch/x86/include/asm/apicdef.h
+++ b/xen/arch/x86/include/asm/apicdef.h
@@ -34,8 +34,8 @@
 #define			SET_xAPIC_LOGICAL_ID(x)	(((x)<<24))
 #define			APIC_ALL_CPUS		0xFF
 #define		APIC_DFR	0xE0
-#define			APIC_DFR_CLUSTER		0x0FFFFFFFul
-#define			APIC_DFR_FLAT			0xFFFFFFFFul
+#define			APIC_DFR_CLUSTER		0x0FFFFFFFUL
+#define			APIC_DFR_FLAT			0xFFFFFFFFUL
 #define		APIC_SPIV	0xF0
 #define			APIC_SPIV_FOCUS_DISABLED	(1<<9)
 #define			APIC_SPIV_APIC_ENABLED		(1<<8)
diff --git a/xen/arch/x86/include/asm/debugreg.h b/xen/arch/x86/include/asm/debugreg.h
index c57914efc6..86aa6d7143 100644
--- a/xen/arch/x86/include/asm/debugreg.h
+++ b/xen/arch/x86/include/asm/debugreg.h
@@ -21,8 +21,8 @@
 #define DR_STEP         (0x4000)        /* single-step */
 #define DR_SWITCH       (0x8000)        /* task switch */
 #define DR_NOT_RTM      (0x10000)       /* clear: #BP inside RTM region */
-#define DR_STATUS_RESERVED_ZERO (~0xffffeffful) /* Reserved, read as zero */
-#define DR_STATUS_RESERVED_ONE  0xffff0ff0ul /* Reserved, read as one */
+#define DR_STATUS_RESERVED_ZERO (~0xffffefffUL) /* Reserved, read as zero */
+#define DR_STATUS_RESERVED_ONE  0xffff0ff0UL /* Reserved, read as one */
 
 /* Now define a bunch of things for manipulating the control register.
    The top two bytes of the control register consist of 4 fields of 4
@@ -61,12 +61,12 @@
    We can slow the instruction pipeline for instructions coming via the
    gdt or the ldt if we want to.  I am not sure why this is an advantage */
 
-#define DR_CONTROL_RESERVED_ZERO (~0xffff27fful) /* Reserved, read as zero */
-#define DR_CONTROL_RESERVED_ONE  (0x00000400ul) /* Reserved, read as one */
-#define DR_LOCAL_EXACT_ENABLE    (0x00000100ul) /* Local exact enable */
-#define DR_GLOBAL_EXACT_ENABLE   (0x00000200ul) /* Global exact enable */
-#define DR_RTM_ENABLE            (0x00000800ul) /* RTM debugging enable */
-#define DR_GENERAL_DETECT        (0x00002000ul) /* General detect enable */
+#define DR_CONTROL_RESERVED_ZERO (~0xffff27ffUL) /* Reserved, read as zero */
+#define DR_CONTROL_RESERVED_ONE  (0x00000400UL) /* Reserved, read as one */
+#define DR_LOCAL_EXACT_ENABLE    (0x00000100UL) /* Local exact enable */
+#define DR_GLOBAL_EXACT_ENABLE   (0x00000200UL) /* Global exact enable */
+#define DR_RTM_ENABLE            (0x00000800UL) /* RTM debugging enable */
+#define DR_GENERAL_DETECT        (0x00002000UL) /* General detect enable */
 
 #define write_debugreg(reg, val) do {                       \
     unsigned long __val = val;                              \
diff --git a/xen/arch/x86/include/asm/guest_pt.h b/xen/arch/x86/include/asm/guest_pt.h
index bde7588342..bc312343cd 100644
--- a/xen/arch/x86/include/asm/guest_pt.h
+++ b/xen/arch/x86/include/asm/guest_pt.h
@@ -32,15 +32,15 @@ gfn_to_paddr(gfn_t gfn)
 
 /* Mask covering the reserved bits from superpage alignment. */
 #define SUPERPAGE_RSVD(bit)                                             \
-    (((1ul << (bit)) - 1) & ~(_PAGE_PSE_PAT | (_PAGE_PSE_PAT - 1ul)))
+    (((1UL << (bit)) - 1) & ~(_PAGE_PSE_PAT | (_PAGE_PSE_PAT - 1UL)))
 
 static inline uint32_t fold_pse36(uint64_t val)
 {
-    return (val & ~(0x1fful << 13)) | ((val & (0x1fful << 32)) >> (32 - 13));
+    return (val & ~(0x1ffUL << 13)) | ((val & (0x1ffUL << 32)) >> (32 - 13));
 }
 static inline uint64_t unfold_pse36(uint32_t val)
 {
-    return (val & ~(0x1fful << 13)) | ((val & (0x1fful << 13)) << (32 - 13));
+    return (val & ~(0x1ffUL << 13)) | ((val & (0x1ffUL << 13)) << (32 - 13));
 }
 
 /* Types of the guest's page tables and access functions for them */
@@ -99,10 +99,10 @@ static inline guest_l2e_t guest_l2e_from_gfn(gfn_t gfn, u32 flags)
 #define GUEST_L2_PAGETABLE_SHIFT         21
 #define GUEST_L3_PAGETABLE_SHIFT         30
 
-#define GUEST_L1_PAGETABLE_RSVD            0x7ff0000000000000ul
-#define GUEST_L2_PAGETABLE_RSVD            0x7ff0000000000000ul
+#define GUEST_L1_PAGETABLE_RSVD            0x7ff0000000000000UL
+#define GUEST_L2_PAGETABLE_RSVD            0x7ff0000000000000UL
 #define GUEST_L3_PAGETABLE_RSVD                                      \
-    (0xfff0000000000000ul | _PAGE_GLOBAL | _PAGE_PSE | _PAGE_DIRTY | \
+    (0xfff0000000000000UL | _PAGE_GLOBAL | _PAGE_PSE | _PAGE_DIRTY | \
      _PAGE_ACCESSED | _PAGE_USER | _PAGE_RW)
 
 #else /* GUEST_PAGING_LEVELS == 4 */
@@ -281,7 +281,7 @@ static always_inline bool guest_pks_enabled(const struct vcpu *v)
 static always_inline uint64_t guest_rsvd_bits(const struct vcpu *v)
 {
     return ((PADDR_MASK &
-             ~((1ul << v->domain->arch.cpuid->extd.maxphysaddr) - 1)) |
+             ~((1UL << v->domain->arch.cpuid->extd.maxphysaddr) - 1)) |
             (guest_nx_enabled(v) ? 0 : put_pte_flags(_PAGE_NX_BIT)));
 }
 
@@ -301,7 +301,7 @@ static always_inline bool guest_l2e_rsvd_bits(const struct vcpu *v,
             ((l2e.l2 & _PAGE_PSE) &&
              (l2e.l2 & ((GUEST_PAGING_LEVELS == 2 && guest_can_use_pse36(v->domain))
                           /* PSE36 tops out at 40 bits of address width. */
-                        ? (fold_pse36(rsvd_bits | (1ul << 40)))
+                        ? (fold_pse36(rsvd_bits | (1UL << 40)))
                         : SUPERPAGE_RSVD(GUEST_L2_PAGETABLE_SHIFT)))));
 }
 
diff --git a/xen/arch/x86/include/asm/pv/domain.h b/xen/arch/x86/include/asm/pv/domain.h
index db7a40f68e..75a6b9e5c7 100644
--- a/xen/arch/x86/include/asm/pv/domain.h
+++ b/xen/arch/x86/include/asm/pv/domain.h
@@ -93,7 +93,7 @@ static inline int pv_vcpu_initialise(struct vcpu *v) { return -EOPNOTSUPP; }
 static inline void pv_domain_destroy(struct domain *d) {}
 static inline int pv_domain_initialise(struct domain *d) { return -EOPNOTSUPP; }
 
-static inline unsigned long pv_make_cr4(const struct vcpu *v) { return ~0ul; }
+static inline unsigned long pv_make_cr4(const struct vcpu *v) { return ~0UL; }
 
 static inline uint64_t pv_get_reg(struct vcpu *v, unsigned int reg)
 {
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index be2b10a391..ad0eafc900 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3057,10 +3057,10 @@ static int _get_page_type(struct page_info *page, unsigned long type,
 
             if ( (x & PGT_type_mask) == PGT_writable_page )
                 rc = iommu_legacy_unmap(d, _dfn(mfn_x(mfn)),
-                                        1ul << PAGE_ORDER_4K);
+                                        1UL << PAGE_ORDER_4K);
             else
                 rc = iommu_legacy_map(d, _dfn(mfn_x(mfn)), mfn,
-                                      1ul << PAGE_ORDER_4K,
+                                      1UL << PAGE_ORDER_4K,
                                       IOMMUF_readable | IOMMUF_writable);
 
             if ( unlikely(rc) )
diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index ecf126566d..ef55498c1a 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -431,7 +431,7 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
     {
         bool old_cpuid_faulting = msrs->misc_features_enables.cpuid_faulting;
 
-        rsvd = ~0ull;
+        rsvd = ~0ULL;
         if ( cp->platform_info.cpuid_faulting )
             rsvd &= ~MSR_MISC_FEATURES_CPUID_FAULTING;
 
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 7656023748..c5c28300b0 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -205,7 +205,7 @@ void __init check_nmi_watchdog(void)
      * (Intel SDM, section 18.22.2)
      */
     if ( nmi_watchdog == NMI_LOCAL_APIC )
-        nmi_hz = max(1ul, cpu_khz >> 20);
+        nmi_hz = max(1UL, cpu_khz >> 20);
 
     return;
 }
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index 90bcb25e60..4c01813c4b 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -289,7 +289,7 @@ static bool cf_check cat_check_cbm(const struct feat_node *feat, uint32_t *val)
     unsigned long cbm = *val;
 
     /* Set bits should only in the range of [0, cbm_len). */
-    if ( cbm & (~0ul << cbm_len) )
+    if ( cbm & (~0UL << cbm_len) )
         return false;
 
     /* At least one bit need to be set. */
@@ -360,7 +360,7 @@ static bool cat_init_feature(const struct cpuid_leaf *regs,
         wrmsrl(MSR_IA32_PSR_L3_MASK(1), cat_default_val(feat->cat.cbm_len));
         rdmsrl(MSR_IA32_PSR_L3_QOS_CFG, val);
         wrmsrl(MSR_IA32_PSR_L3_QOS_CFG,
-               val | (1ull << PSR_L3_QOS_CDP_ENABLE_BIT));
+               val | (1ULL << PSR_L3_QOS_CDP_ENABLE_BIT));
 
         break;
     }
@@ -636,7 +636,7 @@ static void __init init_psr_cmt(unsigned int rmid_max)
 
     psr_cmt->features = edx;
     psr_cmt->rmid_max = min(rmid_max, ebx);
-    rmid_mask = ~(~0ull << get_count_order(ebx));
+    rmid_mask = ~(~0ULL << get_count_order(ebx));
 
     if ( psr_cmt->features & PSR_RESOURCE_TYPE_L3 )
     {
@@ -738,7 +738,7 @@ static void psr_assoc_init(void)
         unsigned int cos_max = get_max_cos_max(info);
 
         if ( info->feat_init )
-            psra->cos_mask = ((1ull << get_count_order(cos_max)) - 1) <<
+            psra->cos_mask = ((1ULL << get_count_order(cos_max)) - 1) <<
                              ASSOC_REG_SHIFT;
     }
 
diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 4081cef200..bc50173620 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -1047,7 +1047,7 @@ static __init void l1tf_calculations(void)
      * The address mask which the L1D cache uses, which might be wider than
      * the CPUID-reported maxphysaddr.
      */
-    l1tf_addr_mask = ((1ul << l1d_maxphysaddr) - 1) & PAGE_MASK;
+    l1tf_addr_mask = ((1UL << l1d_maxphysaddr) - 1) & PAGE_MASK;
 
     /*
      * To be safe, l1tf_safe_maddr must be above the highest cacheable entity
@@ -1087,8 +1087,8 @@ static __init void l1tf_calculations(void)
      *   information is in terms of guest physical layout.
      */
     l1tf_safe_maddr = max(l1tf_safe_maddr, ((l1d_maxphysaddr > paddr_bits)
-                                            ? (1ul << paddr_bits)
-                                            : (3ul << (paddr_bits - 2))));
+                                            ? (1UL << paddr_bits)
+                                            : (3UL << (paddr_bits - 2))));
 }
 
 /* Calculate whether this CPU is vulnerable to MDS. */
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 60db439af3..15b36e332d 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -1313,7 +1313,7 @@ int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm)
     {
         for ( i = spfn; i < epfn; i++ )
             if ( iommu_legacy_map(hardware_domain, _dfn(i), _mfn(i),
-                                  1ul << PAGE_ORDER_4K,
+                                  1UL << PAGE_ORDER_4K,
                                   IOMMUF_readable | IOMMUF_writable) )
                 break;
         if ( i != epfn )
@@ -1321,7 +1321,7 @@ int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm)
             while (i-- > old_max)
                 /* If statement to satisfy __must_check. */
                 if ( iommu_legacy_unmap(hardware_domain, _dfn(i),
-                                        1ul << PAGE_ORDER_4K) )
+                                        1UL << PAGE_ORDER_4K) )
                     continue;
 
             goto destroy_m2p;
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 92496f3795..3062c28219 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -150,7 +150,7 @@ static void setup_xstate_comp(uint16_t *comp_offsets,
     offset = comp_offsets[2];
     for ( i = 2; i < xstate_features; i++ )
     {
-        if ( (1ul << i) & xcomp_bv )
+        if ( (1UL << i) & xcomp_bv )
         {
             if ( test_bit(i, &xstate_align) )
                 offset = ROUNDUP(offset, 64);
diff --git a/xen/lib/x86/cpuid.c b/xen/lib/x86/cpuid.c
index 07e5501914..2006cbaa1c 100644
--- a/xen/lib/x86/cpuid.c
+++ b/xen/lib/x86/cpuid.c
@@ -211,7 +211,7 @@ void x86_cpu_policy_fill_native(struct cpu_policy *p)
         for ( i = 2; i < min_t(unsigned int, 63,
                                ARRAY_SIZE(p->xstate.raw)); ++i )
         {
-            if ( xstates & (1ull << i) )
+            if ( xstates & (1ULL << i) )
                 cpuid_count_leaf(0xd, i, &p->xstate.raw[i]);
         }
     }
@@ -419,7 +419,7 @@ int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
               &(struct cpuid_leaf){ p->hv2_limit });
 
     /* Extended leaves. */
-    for ( leaf = 0; leaf <= MIN(p->extd.max_leaf & 0xfffful,
+    for ( leaf = 0; leaf <= MIN(p->extd.max_leaf & 0xffffUL,
                                 ARRAY_SIZE(p->extd.raw) - 1); ++leaf )
         COPY_LEAF(0x80000000 | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [XEN PATCH 12/13] xen/common: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
                   ` (10 preceding siblings ...)
  2023-08-03 10:22 ` [XEN PATCH 11/13] xen/x86: " Simone Ballarin
@ 2023-08-03 10:22 ` Simone Ballarin
  2023-08-04  1:00   ` Stefano Stabellini
  2023-08-03 10:22 ` [XEN PATCH 13/13] xen: " Simone Ballarin
  2023-08-23  8:15 ` [XEN PATCH 00/13] " Jan Beulich
  13 siblings, 1 reply; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Gianluca Luparini, Andrew Cooper, George Dunlap,
	Jan Beulich, Julien Grall, Stefano Stabellini, Wei Liu,
	Simone Ballarin

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/common/page_alloc.c | 6 +++---
 xen/common/rangeset.c   | 2 +-
 xen/common/softirq.c    | 8 ++++----
 xen/common/vsprintf.c   | 2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index e40473f71e..03b63d0ee7 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -2380,7 +2380,7 @@ int assign_pages(
         if ( unlikely(nr > d->max_pages - tot_pages) )
         {
             gprintk(XENLOG_INFO, "Over-allocation for %pd: %Lu > %u\n",
-                    d, tot_pages + 0ull + nr, d->max_pages);
+                    d, tot_pages + 0ULL + nr, d->max_pages);
             rc = -E2BIG;
             goto out;
         }
@@ -2392,7 +2392,7 @@ int assign_pages(
         {
             gprintk(XENLOG_INFO,
                     "Excess allocation for %pd: %Lu (%u extra)\n",
-                    d, d->tot_pages + 0ull + nr, d->extra_pages);
+                    d, d->tot_pages + 0ULL + nr, d->extra_pages);
             if ( pg[0].count_info & PGC_extra )
                 d->extra_pages -= nr;
             rc = -E2BIG;
@@ -2460,7 +2460,7 @@ struct page_info *alloc_domheap_pages(
         {
             unsigned long i;
 
-            for ( i = 0; i < (1ul << order); i++ )
+            for ( i = 0; i < (1UL << order); i++ )
             {
                 ASSERT(!pg[i].count_info);
                 pg[i].count_info = PGC_extra;
diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index a6ef264046..f3baf52ab6 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -393,7 +393,7 @@ static int cf_check merge(unsigned long s, unsigned long e, void *data)
 
 int rangeset_merge(struct rangeset *r1, struct rangeset *r2)
 {
-    return rangeset_report_ranges(r2, 0, ~0ul, merge, r1);
+    return rangeset_report_ranges(r2, 0, ~0UL, merge, r1);
 }
 
 int rangeset_add_singleton(
diff --git a/xen/common/softirq.c b/xen/common/softirq.c
index 063e93cbe3..321d26902d 100644
--- a/xen/common/softirq.c
+++ b/xen/common/softirq.c
@@ -29,7 +29,7 @@ static void __do_softirq(unsigned long ignore_mask)
 {
     unsigned int i, cpu;
     unsigned long pending;
-    bool rcu_allowed = !(ignore_mask & (1ul << RCU_SOFTIRQ));
+    bool rcu_allowed = !(ignore_mask & (1UL << RCU_SOFTIRQ));
 
     ASSERT(!rcu_allowed || rcu_quiesce_allowed());
 
@@ -57,12 +57,12 @@ static void __do_softirq(unsigned long ignore_mask)
 void process_pending_softirqs(void)
 {
     /* Do not enter scheduler as it can preempt the calling context. */
-    unsigned long ignore_mask = (1ul << SCHEDULE_SOFTIRQ) |
-                                (1ul << SCHED_SLAVE_SOFTIRQ);
+    unsigned long ignore_mask = (1UL << SCHEDULE_SOFTIRQ) |
+                                (1UL << SCHED_SLAVE_SOFTIRQ);
 
     /* Block RCU processing in case of rcu_read_lock() held. */
     if ( !rcu_quiesce_allowed() )
-        ignore_mask |= 1ul << RCU_SOFTIRQ;
+        ignore_mask |= 1UL << RCU_SOFTIRQ;
 
     ASSERT(!in_irq() && local_irq_is_enabled());
     __do_softirq(ignore_mask);
diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c
index 94c1ba7257..c49631c0a4 100644
--- a/xen/common/vsprintf.c
+++ b/xen/common/vsprintf.c
@@ -225,7 +225,7 @@ static char *print_bitmap_string(char *str, const char *end,
      */
     for ( i = ROUNDUP(nr_bits, CHUNKSZ) - CHUNKSZ; i >= 0; i -= CHUNKSZ )
     {
-        unsigned int chunkmask = (1ull << chunksz) - 1;
+        unsigned int chunkmask = (1ULL << chunksz) - 1;
         unsigned int word      = i / BITS_PER_LONG;
         unsigned int offset    = i % BITS_PER_LONG;
         unsigned long val      = (bitmap[word] >> offset) & chunkmask;
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [XEN PATCH 13/13] xen: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
                   ` (11 preceding siblings ...)
  2023-08-03 10:22 ` [XEN PATCH 12/13] xen/common: " Simone Ballarin
@ 2023-08-03 10:22 ` Simone Ballarin
  2023-08-04  1:02   ` Stefano Stabellini
  2023-08-23  8:15 ` [XEN PATCH 00/13] " Jan Beulich
  13 siblings, 1 reply; 46+ messages in thread
From: Simone Ballarin @ 2023-08-03 10:22 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Gianluca Luparini, Andrew Cooper, George Dunlap,
	Jan Beulich, Julien Grall, Stefano Stabellini, Wei Liu,
	Simone Ballarin

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/include/xen/bitops.h  | 8 ++++----
 xen/include/xen/tasklet.h | 4 ++--
 xen/include/xen/time.h    | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index e926047932..654f525fb4 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -186,12 +186,12 @@ static inline unsigned int generic_hweight64(uint64_t w)
     if ( BITS_PER_LONG < 64 )
         return generic_hweight32(w >> 32) + generic_hweight32(w);
 
-    w -= (w >> 1) & 0x5555555555555555ul;
-    w =  (w & 0x3333333333333333ul) + ((w >> 2) & 0x3333333333333333ul);
-    w =  (w + (w >> 4)) & 0x0f0f0f0f0f0f0f0ful;
+    w -= (w >> 1) & 0x5555555555555555UL;
+    w =  (w & 0x3333333333333333UL) + ((w >> 2) & 0x3333333333333333UL);
+    w =  (w + (w >> 4)) & 0x0f0f0f0f0f0f0f0fUL;
 
     if ( IS_ENABLED(CONFIG_HAS_FAST_MULTIPLY) )
-        return (w * 0x0101010101010101ul) >> 56;
+        return (w * 0x0101010101010101UL) >> 56;
 
     w += w >> 8;
     w += w >> 16;
diff --git a/xen/include/xen/tasklet.h b/xen/include/xen/tasklet.h
index ea73171f6e..193acf8f42 100644
--- a/xen/include/xen/tasklet.h
+++ b/xen/include/xen/tasklet.h
@@ -37,8 +37,8 @@ struct tasklet
 DECLARE_PER_CPU(unsigned long, tasklet_work_to_do);
 #define _TASKLET_enqueued  0 /* Tasklet work is enqueued for this CPU. */
 #define _TASKLET_scheduled 1 /* Scheduler has scheduled do_tasklet(). */
-#define TASKLET_enqueued   (1ul << _TASKLET_enqueued)
-#define TASKLET_scheduled  (1ul << _TASKLET_scheduled)
+#define TASKLET_enqueued   (1UL << _TASKLET_enqueued)
+#define TASKLET_scheduled  (1UL << _TASKLET_scheduled)
 
 static inline bool tasklet_work_to_do(unsigned int cpu)
 {
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index 9ceaec541f..5aafdda4f3 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -57,9 +57,9 @@ struct tm wallclock_time(uint64_t *ns);
 #define SECONDS(_s)     ((s_time_t)((_s)  * 1000000000ULL))
 #define MILLISECS(_ms)  ((s_time_t)((_ms) * 1000000ULL))
 #define MICROSECS(_us)  ((s_time_t)((_us) * 1000ULL))
-#define STIME_MAX ((s_time_t)((uint64_t)~0ull>>1))
+#define STIME_MAX ((s_time_t)((uint64_t)~0ULL>>1))
 /* Chosen so (NOW() + delta) wont overflow without an uptime of 200 years */
-#define STIME_DELTA_MAX ((s_time_t)((uint64_t)~0ull>>2))
+#define STIME_DELTA_MAX ((s_time_t)((uint64_t)~0ULL>>2))
 
 /* Explicitly OR with 1 just in case version number gets out of sync. */
 #define version_update_begin(v) (((v) + 1) | 1)
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 03/13] xen/arm: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 03/13] xen/arm: " Simone Ballarin
@ 2023-08-03 13:44   ` Luca Fancellu
  2023-08-04  0:44   ` Stefano Stabellini
  1 sibling, 0 replies; 46+ messages in thread
From: Luca Fancellu @ 2023-08-03 13:44 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: Xen-devel, consulting@bugseng.com, Gianluca Luparini,
	Stefano Stabellini, Julien Grall, Bertrand Marquis,
	Volodymyr Babchuk



> On 3 Aug 2023, at 11:22, Simone Ballarin <simone.ballarin@bugseng.com> 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: Luca Fancellu <luca.fancellu@arm.com>





^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 01/13] AMD/IOMMU: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 01/13] AMD/IOMMU: " Simone Ballarin
@ 2023-08-04  0:40   ` Stefano Stabellini
  2023-08-07 14:22     ` Jan Beulich
  0 siblings, 1 reply; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-04  0:40 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Jan Beulich,
	Andrew Cooper

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>


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 02/13] x86/svm: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 02/13] x86/svm: " Simone Ballarin
@ 2023-08-04  0:42   ` Stefano Stabellini
  2023-08-07 14:22     ` Jan Beulich
  0 siblings, 1 reply; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-04  0:42 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Jan Beulich,
	Andrew Cooper, Roger Pau Monné, Wei Liu

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>


> ---
>  xen/arch/x86/hvm/svm/svm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
> index b3845bdca7..01dd592d9b 100644
> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -1077,7 +1077,7 @@ static void svm_guest_osvw_init(struct domain *d)
>       * Guests should see errata 400 and 415 as fixed (assuming that
>       * HLT and IO instructions are intercepted).
>       */
> -    svm->osvw.length = min(max(3ul, osvw_length), 64ul);
> +    svm->osvw.length = min(max(3UL, osvw_length), 64UL);
>      svm->osvw.status = osvw_status & ~6;
>  
>      /*
> @@ -1652,7 +1652,7 @@ static void svm_do_nested_pgfault(struct vcpu *v,
>      else if ( pfec & NPT_PFEC_in_gpt )
>          npfec.kind = npfec_kind_in_gpt;
>  
> -    ret = hvm_hap_nested_page_fault(gpa, ~0ul, npfec);
> +    ret = hvm_hap_nested_page_fault(gpa, ~0UL, npfec);
>  
>      if ( tb_init_done )
>      {
> -- 
> 2.34.1
> 
> 


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 03/13] xen/arm: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 03/13] xen/arm: " Simone Ballarin
  2023-08-03 13:44   ` Luca Fancellu
@ 2023-08-04  0:44   ` Stefano Stabellini
  1 sibling, 0 replies; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-04  0:44 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Stefano Stabellini,
	Julien Grall, Bertrand Marquis, Volodymyr Babchuk

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>


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 04/13] x86/IOMMU: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 04/13] x86/IOMMU: " Simone Ballarin
@ 2023-08-04  0:45   ` Stefano Stabellini
  2023-08-07 14:23     ` Jan Beulich
  0 siblings, 1 reply; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-04  0:45 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Jan Beulich,
	Paul Durrant, Roger Pau Monné

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>


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 05/13] xen/ioreq: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 05/13] xen/ioreq: " Simone Ballarin
@ 2023-08-04  0:46   ` Stefano Stabellini
  2023-09-12 16:19   ` Simone Ballarin
  2023-09-13  6:52   ` Paul Durrant
  2 siblings, 0 replies; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-04  0:46 UTC (permalink / raw)
  To: Simone Ballarin; +Cc: xen-devel, consulting, Gianluca Luparini, Paul Durrant

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>


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 06/13] xen/mem_access: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 06/13] xen/mem_access: " Simone Ballarin
@ 2023-08-04  0:47   ` Stefano Stabellini
  2023-08-24 10:54     ` Jan Beulich
  0 siblings, 1 reply; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-04  0:47 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Tamas K Lengyel,
	Alexandru Isaila, Petre Pircalabu

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>


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 07/13] xen/vpci: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 07/13] xen/vpci: " Simone Ballarin
@ 2023-08-04  0:48   ` Stefano Stabellini
  2023-08-24 12:22   ` Roger Pau Monné
  1 sibling, 0 replies; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-04  0:48 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Roger Pau Monné

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>


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 08/13] xen/hvm: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 08/13] xen/hvm: " Simone Ballarin
@ 2023-08-04  0:50   ` Stefano Stabellini
  2023-08-07 14:24     ` Jan Beulich
  2023-09-12 16:18   ` Simone Ballarin
  2023-09-13  6:53   ` Paul Durrant
  2 siblings, 1 reply; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-04  0:50 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Paul Durrant,
	Jan Beulich, Andrew Cooper, Roger Pau Monné, Wei Liu

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>


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 09/13] x86/mm: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 09/13] x86/mm: " Simone Ballarin
@ 2023-08-04  0:52   ` Stefano Stabellini
  2023-08-07 14:26     ` Jan Beulich
  0 siblings, 1 reply; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-04  0:52 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Jan Beulich,
	Andrew Cooper, George Dunlap, Roger Pau Monné, Wei Liu

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>


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 10/13] x86/viridian: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 10/13] x86/viridian: " Simone Ballarin
@ 2023-08-04  0:54   ` Stefano Stabellini
  2023-09-12  6:23   ` Paul Durrant
  1 sibling, 0 replies; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-04  0:54 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Paul Durrant, Wei Liu,
	Jan Beulich, Andrew Cooper, Roger Pau Monné

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>


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 11/13] xen/x86: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 11/13] xen/x86: " Simone Ballarin
@ 2023-08-04  0:59   ` Stefano Stabellini
  2023-08-07 14:53     ` Jan Beulich
  0 siblings, 1 reply; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-04  0:59 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Jan Beulich,
	Andrew Cooper, Roger Pau Monné, Wei Liu

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>

But I think I need an eyes exam after reviewing this patch


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 12/13] xen/common: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 12/13] xen/common: " Simone Ballarin
@ 2023-08-04  1:00   ` Stefano Stabellini
  0 siblings, 0 replies; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-04  1:00 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Andrew Cooper,
	George Dunlap, Jan Beulich, Julien Grall, Stefano Stabellini,
	Wei Liu

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>


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 13/13] xen: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 13/13] xen: " Simone Ballarin
@ 2023-08-04  1:02   ` Stefano Stabellini
  0 siblings, 0 replies; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-04  1:02 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Andrew Cooper,
	George Dunlap, Jan Beulich, Julien Grall, Stefano Stabellini,
	Wei Liu

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>


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 01/13] AMD/IOMMU: address violations of MISRA C:2012 Rule 7.3
  2023-08-04  0:40   ` Stefano Stabellini
@ 2023-08-07 14:22     ` Jan Beulich
  0 siblings, 0 replies; 46+ messages in thread
From: Jan Beulich @ 2023-08-07 14:22 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Andrew Cooper,
	Stefano Stabellini

On 04.08.2023 02:40, 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>



^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 02/13] x86/svm: address violations of MISRA C:2012 Rule 7.3
  2023-08-04  0:42   ` Stefano Stabellini
@ 2023-08-07 14:22     ` Jan Beulich
  0 siblings, 0 replies; 46+ messages in thread
From: Jan Beulich @ 2023-08-07 14:22 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Andrew Cooper,
	Roger Pau Monné, Wei Liu, Stefano Stabellini

On 04.08.2023 02:42, 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>




^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 04/13] x86/IOMMU: address violations of MISRA C:2012 Rule 7.3
  2023-08-04  0:45   ` Stefano Stabellini
@ 2023-08-07 14:23     ` Jan Beulich
  0 siblings, 0 replies; 46+ messages in thread
From: Jan Beulich @ 2023-08-07 14:23 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Paul Durrant,
	Roger Pau Monné, Stefano Stabellini

On 04.08.2023 02:45, 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>



^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 08/13] xen/hvm: address violations of MISRA C:2012 Rule 7.3
  2023-08-04  0:50   ` Stefano Stabellini
@ 2023-08-07 14:24     ` Jan Beulich
  2023-08-07 14:25       ` Jan Beulich
  0 siblings, 1 reply; 46+ messages in thread
From: Jan Beulich @ 2023-08-07 14:24 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Paul Durrant,
	Andrew Cooper, Roger Pau Monné, Wei Liu, Stefano Stabellini

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>



^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 08/13] xen/hvm: address violations of MISRA C:2012 Rule 7.3
  2023-08-07 14:24     ` Jan Beulich
@ 2023-08-07 14:25       ` Jan Beulich
  0 siblings, 0 replies; 46+ messages in thread
From: Jan Beulich @ 2023-08-07 14:25 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Paul Durrant,
	Andrew Cooper, Roger Pau Monné, Wei Liu, Stefano Stabellini

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


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 09/13] x86/mm: address violations of MISRA C:2012 Rule 7.3
  2023-08-04  0:52   ` Stefano Stabellini
@ 2023-08-07 14:26     ` Jan Beulich
  0 siblings, 0 replies; 46+ messages in thread
From: Jan Beulich @ 2023-08-07 14:26 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Andrew Cooper,
	George Dunlap, Roger Pau Monné, Wei Liu, Stefano Stabellini

On 04.08.2023 02:52, 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>



^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 11/13] xen/x86: address violations of MISRA C:2012 Rule 7.3
  2023-08-04  0:59   ` Stefano Stabellini
@ 2023-08-07 14:53     ` Jan Beulich
  0 siblings, 0 replies; 46+ messages in thread
From: Jan Beulich @ 2023-08-07 14:53 UTC (permalink / raw)
  To: Stefano Stabellini, Simone Ballarin
  Cc: xen-devel, consulting, Gianluca Luparini, Andrew Cooper,
	Roger Pau Monné, Wei Liu

On 04.08.2023 02:59, 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>

> But I think I need an eyes exam after reviewing this patch

Thanks for sacrificing your eyes for the good purpose.

Jan


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
                   ` (12 preceding siblings ...)
  2023-08-03 10:22 ` [XEN PATCH 13/13] xen: " Simone Ballarin
@ 2023-08-23  8:15 ` Jan Beulich
  2023-08-28 12:41   ` Simone Ballarin
  13 siblings, 1 reply; 46+ messages in thread
From: Jan Beulich @ 2023-08-23  8:15 UTC (permalink / raw)
  To: Simone Ballarin
  Cc: consulting, Andrew Cooper, Roger Pau Monné, Wei Liu,
	Stefano Stabellini, Julien Grall, Bertrand Marquis,
	Volodymyr Babchuk, Paul Durrant, Tamas K Lengyel,
	Alexandru Isaila, Petre Pircalabu, George Dunlap, xen-devel

On 03.08.2023 12:22, Simone Ballarin wrote:
> This series aims to address some violations ofMISRA C:2012 Rule 7.3:
> "The lowercase character 'l' shall not be used in a literal suffix".
> 
> This patch replaces "l" suffixes with "L", to comply with the rule.
> If the "u" suffix is used near "L", use the "U" suffix instead, for consistency.
> 
> Gianluca Luparini (13):
>   AMD/IOMMU: address violations of MISRA C:2012 Rule 7.3
>   x86/svm: address violations of MISRA C:2012 Rule 7.3
>   xen/arm: address violations of MISRA C:2012 Rule 7.3
>   x86/IOMMU: address violations of MISRA C:2012 Rule 7.3
>   xen/ioreq: address violations of MISRA C:2012 Rule 7.3
>   xen/mem_access: address violations of MISRA C:2012 Rule 7.3
>   xen/vpci: address violations of MISRA C:2012 Rule 7.3
>   xen/hvm: address violations of MISRA C:2012 Rule 7.3
>   x86/mm: address violations of MISRA C:2012 Rule 7.3
>   x86/viridian: address violations of MISRA C:2012 Rule 7.3
>   xen/x86: address violations of MISRA C:2012 Rule 7.3
>   xen/common: address violations of MISRA C:2012 Rule 7.3
>   xen: address violations of MISRA C:2012 Rule 7.3

Since about half the patches are still pending due to missing acks,
just to mention it: It's normally the submitter who is to chase them.

Jan


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 06/13] xen/mem_access: address violations of MISRA C:2012 Rule 7.3
  2023-08-04  0:47   ` Stefano Stabellini
@ 2023-08-24 10:54     ` Jan Beulich
  2023-08-24 21:37       ` Stefano Stabellini
  0 siblings, 1 reply; 46+ messages in thread
From: Jan Beulich @ 2023-08-24 10:54 UTC (permalink / raw)
  To: Tamas K Lengyel, George Dunlap
  Cc: xen-devel, consulting, Gianluca Luparini, Alexandru Isaila,
	Petre Pircalabu, Simone Ballarin, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]

On 04.08.2023 02:47, 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>

I notice this again was committed with an ack by Tamas which has never appeared
on list. At that time I pointed out that the reason may have been connected to
the mail (as you had forwarded) having been a HTML one.

Yet then looks like the same has happened to me, with "Re: Ping: [PATCH]
mem-sharing: move (x86) / drop (Arm) arch_dump_shared_mem_info()". I can't find
record of this in the list archive. And that mail, from all I can tell, was a
plain text one.

George, for the earlier instance Stefano had Cc-ed you, apparently on the
assumption that you might be able to do something about this, or initiate that
something be done. Is there anything that was found out? Just in case I'll
attach the mail I did receive.

I also wonder what other mails from you, Tamas, may not have appeared on list,
and instead were (presumably) only delivered to people explicitly Cc-ed.

Jan

[-- Attachment #2: Ping: [PATCH] mem-sharing: move (x86) / drop (Arm) arch_dump_shared_mem_info().eml --]
[-- Type: message/rfc822, Size: 9360 bytes --]

From: Tamas K Lengyel <tamas@tklengyel.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>, "George Dunlap" <george.dunlap@citrix.com>, "Julien Grall" <julien@xen.org>, "Stefano Stabellini" <sstabellini@kernel.org>, "Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>, "Bertrand Marquis" <bertrand.marquis@arm.com>, "Volodymyr Babchuk" <volodymyr_babchuk@epam.com>, "Shawn Anastasio" <sanastasio@raptorengineering.com>, "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: Ping: [PATCH] mem-sharing: move (x86) / drop (Arm) arch_dump_shared_mem_info()
Date: Mon, 21 Aug 2023 18:20:07 +0200
Message-ID: <CABfawhkmywaLwmtda2RgzbmM14gab1-Xirxsg4COeW-KODk-yA@mail.gmail.com>

> > When !MEM_SHARING no useful output is produced. Move the function into
> > mm/mem_sharing.c while conditionalizing the call to it, thus allowing to
> > drop it altogether from Arm (and eliminating the need to introduce stubs
> > on PPC and RISC-V).
> >
> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> Tamas - any chance of an ack?

Acked-by: Tamas K Lengyel <tamas@tklengyel.com>

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 07/13] xen/vpci: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 07/13] xen/vpci: " Simone Ballarin
  2023-08-04  0:48   ` Stefano Stabellini
@ 2023-08-24 12:22   ` Roger Pau Monné
  1 sibling, 0 replies; 46+ messages in thread
From: Roger Pau Monné @ 2023-08-24 12:22 UTC (permalink / raw)
  To: Simone Ballarin; +Cc: xen-devel, consulting, Gianluca Luparini

On Thu, Aug 03, 2023 at 12:22:22PM +0200, 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>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks, Roger.


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 06/13] xen/mem_access: address violations of MISRA C:2012 Rule 7.3
  2023-08-24 10:54     ` Jan Beulich
@ 2023-08-24 21:37       ` Stefano Stabellini
  0 siblings, 0 replies; 46+ messages in thread
From: Stefano Stabellini @ 2023-08-24 21:37 UTC (permalink / raw)
  To: tamas
  Cc: George Dunlap, xen-devel, consulting, jbeulich, Gianluca Luparini,
	Alexandru Isaila, Petre Pircalabu, Simone Ballarin,
	Stefano Stabellini

Tamas, is it possible that you are not actually subscribed to xen-devel
with your email tamas@tklengyel.com  ?

Sorry for top-posting I wanted to make sure Tamas saw this.


On Thu, 24 Aug 2023, Jan Beulich wrote:
> On 04.08.2023 02:47, 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>
> 
> I notice this again was committed with an ack by Tamas which has never appeared
> on list. At that time I pointed out that the reason may have been connected to
> the mail (as you had forwarded) having been a HTML one.
> 
> Yet then looks like the same has happened to me, with "Re: Ping: [PATCH]
> mem-sharing: move (x86) / drop (Arm) arch_dump_shared_mem_info()". I can't find
> record of this in the list archive. And that mail, from all I can tell, was a
> plain text one.
> 
> George, for the earlier instance Stefano had Cc-ed you, apparently on the
> assumption that you might be able to do something about this, or initiate that
> something be done. Is there anything that was found out? Just in case I'll
> attach the mail I did receive.
> 
> I also wonder what other mails from you, Tamas, may not have appeared on list,
> and instead were (presumably) only delivered to people explicitly Cc-ed.



^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3
  2023-08-23  8:15 ` [XEN PATCH 00/13] " Jan Beulich
@ 2023-08-28 12:41   ` Simone Ballarin
  2023-08-28 13:33     ` Jan Beulich
  0 siblings, 1 reply; 46+ messages in thread
From: Simone Ballarin @ 2023-08-28 12:41 UTC (permalink / raw)
  To: Jan Beulich
  Cc: consulting, Andrew Cooper, Roger Pau Monné, Wei Liu,
	Stefano Stabellini, Julien Grall, Bertrand Marquis,
	Volodymyr Babchuk, Paul Durrant, Tamas K Lengyel,
	Alexandru Isaila, Petre Pircalabu, George Dunlap, xen-devel

On 23/08/23 10:15, Jan Beulich wrote:
> On 03.08.2023 12:22, Simone Ballarin wrote:
>> This series aims to address some violations ofMISRA C:2012 Rule 7.3:
>> "The lowercase character 'l' shall not be used in a literal suffix".
>>
>> This patch replaces "l" suffixes with "L", to comply with the rule.
>> If the "u" suffix is used near "L", use the "U" suffix instead, for consistency.
>>
>> Gianluca Luparini (13):
>>    AMD/IOMMU: address violations of MISRA C:2012 Rule 7.3
>>    x86/svm: address violations of MISRA C:2012 Rule 7.3
>>    xen/arm: address violations of MISRA C:2012 Rule 7.3
>>    x86/IOMMU: address violations of MISRA C:2012 Rule 7.3
>>    xen/ioreq: address violations of MISRA C:2012 Rule 7.3
>>    xen/mem_access: address violations of MISRA C:2012 Rule 7.3
>>    xen/vpci: address violations of MISRA C:2012 Rule 7.3
>>    xen/hvm: address violations of MISRA C:2012 Rule 7.3
>>    x86/mm: address violations of MISRA C:2012 Rule 7.3
>>    x86/viridian: address violations of MISRA C:2012 Rule 7.3
>>    xen/x86: address violations of MISRA C:2012 Rule 7.3
>>    xen/common: address violations of MISRA C:2012 Rule 7.3
>>    xen: address violations of MISRA C:2012 Rule 7.3
> 
> Since about half the patches are still pending due to missing acks,
> just to mention it: It's normally the submitter who is to chase them.
> 
> Jan
> 

This is the list of the pending patches:
- 10/13 x86/viridian: address violations of MISRA C:2012 Rule 7.3
- 08/13 xen/hvm: address violations of MISRA C:2012 Rule 7.3
- 05/13 xen/ioreq: address violations of MISRA C:2012 Rule 7.3

The maintainer for that files are Paul Durrant and Wei Liu.

-- 
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com)



^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3
  2023-08-28 12:41   ` Simone Ballarin
@ 2023-08-28 13:33     ` Jan Beulich
  0 siblings, 0 replies; 46+ messages in thread
From: Jan Beulich @ 2023-08-28 13:33 UTC (permalink / raw)
  To: Simone Ballarin; +Cc: xen-devel

(reducing Cc list)

On 28.08.2023 14:41, Simone Ballarin wrote:
> On 23/08/23 10:15, Jan Beulich wrote:
>> On 03.08.2023 12:22, Simone Ballarin wrote:
>>> This series aims to address some violations ofMISRA C:2012 Rule 7.3:
>>> "The lowercase character 'l' shall not be used in a literal suffix".
>>>
>>> This patch replaces "l" suffixes with "L", to comply with the rule.
>>> If the "u" suffix is used near "L", use the "U" suffix instead, for consistency.
>>>
>>> Gianluca Luparini (13):
>>>    AMD/IOMMU: address violations of MISRA C:2012 Rule 7.3
>>>    x86/svm: address violations of MISRA C:2012 Rule 7.3
>>>    xen/arm: address violations of MISRA C:2012 Rule 7.3
>>>    x86/IOMMU: address violations of MISRA C:2012 Rule 7.3
>>>    xen/ioreq: address violations of MISRA C:2012 Rule 7.3
>>>    xen/mem_access: address violations of MISRA C:2012 Rule 7.3
>>>    xen/vpci: address violations of MISRA C:2012 Rule 7.3
>>>    xen/hvm: address violations of MISRA C:2012 Rule 7.3
>>>    x86/mm: address violations of MISRA C:2012 Rule 7.3
>>>    x86/viridian: address violations of MISRA C:2012 Rule 7.3
>>>    xen/x86: address violations of MISRA C:2012 Rule 7.3
>>>    xen/common: address violations of MISRA C:2012 Rule 7.3
>>>    xen: address violations of MISRA C:2012 Rule 7.3
>>
>> Since about half the patches are still pending due to missing acks,
>> just to mention it: It's normally the submitter who is to chase them.
> 
> This is the list of the pending patches:
> - 10/13 x86/viridian: address violations of MISRA C:2012 Rule 7.3
> - 08/13 xen/hvm: address violations of MISRA C:2012 Rule 7.3
> - 05/13 xen/ioreq: address violations of MISRA C:2012 Rule 7.3
> 
> The maintainer for that files are Paul Durrant and Wei Liu.

I'm aware of that, so it's unclear to me what you're trying to tell me.

Jan


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 10/13] x86/viridian: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 10/13] x86/viridian: " Simone Ballarin
  2023-08-04  0:54   ` Stefano Stabellini
@ 2023-09-12  6:23   ` Paul Durrant
  1 sibling, 0 replies; 46+ messages in thread
From: Paul Durrant @ 2023-09-12  6:23 UTC (permalink / raw)
  To: Simone Ballarin, xen-devel
  Cc: consulting, Gianluca Luparini, Wei Liu, Jan Beulich,
	Andrew Cooper, Roger Pau Monné

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/viridian/synic.c |  2 +-
>   xen/arch/x86/hvm/viridian/time.c  | 10 +++++-----
>   2 files changed, 6 insertions(+), 6 deletions(-)
> 

Reviewed-by: Paul Durrant <paul@xen.org>



^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 08/13] xen/hvm: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 08/13] xen/hvm: " Simone Ballarin
  2023-08-04  0:50   ` Stefano Stabellini
@ 2023-09-12 16:18   ` Simone Ballarin
  2023-09-13  6:53   ` Paul Durrant
  2 siblings, 0 replies; 46+ messages in thread
From: Simone Ballarin @ 2023-09-12 16:18 UTC (permalink / raw)
  To: xen-devel, Paul Durrant
  Cc: consulting, Gianluca Luparini, Jan Beulich, Andrew Cooper,
	Roger Pau Monné, Wei Liu

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)



^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 05/13] xen/ioreq: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 05/13] xen/ioreq: " Simone Ballarin
  2023-08-04  0:46   ` Stefano Stabellini
@ 2023-09-12 16:19   ` Simone Ballarin
  2023-09-13  6:52   ` Paul Durrant
  2 siblings, 0 replies; 46+ messages in thread
From: Simone Ballarin @ 2023-09-12 16:19 UTC (permalink / raw)
  To: xen-devel, Paul Durrant; +Cc: consulting, Gianluca Luparini

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/common/ioreq.c      | 2 +-
>   xen/include/xen/ioreq.h | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/common/ioreq.c b/xen/common/ioreq.c
> index 7cb717f7a2..62b907f4c4 100644
> --- a/xen/common/ioreq.c
> +++ b/xen/common/ioreq.c
> @@ -1182,7 +1182,7 @@ static int ioreq_send_buffered(struct ioreq_server *s, ioreq_t *p)
>        *  - the count field is usually used with data_is_ptr and since we don't
>        *    support data_is_ptr we do not waste space for the count field either
>        */
> -    if ( (p->addr > 0xffffful) || p->data_is_ptr || (p->count != 1) )
> +    if ( (p->addr > 0xfffffUL) || p->data_is_ptr || (p->count != 1) )
>           return 0;
>   
>       switch ( p->size )
> diff --git a/xen/include/xen/ioreq.h b/xen/include/xen/ioreq.h
> index a26614d331..cd399adf17 100644
> --- a/xen/include/xen/ioreq.h
> +++ b/xen/include/xen/ioreq.h
> @@ -60,7 +60,7 @@ struct ioreq_server {
>   static inline paddr_t ioreq_mmio_first_byte(const ioreq_t *p)
>   {
>       return unlikely(p->df) ?
> -           p->addr - (p->count - 1ul) * p->size :
> +           p->addr - (p->count - 1UL) * p->size :
>              p->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)



^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 05/13] xen/ioreq: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 05/13] xen/ioreq: " Simone Ballarin
  2023-08-04  0:46   ` Stefano Stabellini
  2023-09-12 16:19   ` Simone Ballarin
@ 2023-09-13  6:52   ` Paul Durrant
  2 siblings, 0 replies; 46+ messages in thread
From: Paul Durrant @ 2023-09-13  6:52 UTC (permalink / raw)
  To: Simone Ballarin, xen-devel; +Cc: consulting, Gianluca Luparini

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/common/ioreq.c      | 2 +-
>   xen/include/xen/ioreq.h | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 

Acked-by: Paul Durrant <paul@xen.org>



^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [XEN PATCH 08/13] xen/hvm: address violations of MISRA C:2012 Rule 7.3
  2023-08-03 10:22 ` [XEN PATCH 08/13] xen/hvm: " Simone Ballarin
  2023-08-04  0:50   ` Stefano Stabellini
  2023-09-12 16:18   ` Simone Ballarin
@ 2023-09-13  6:53   ` Paul Durrant
  2 siblings, 0 replies; 46+ messages in thread
From: Paul Durrant @ 2023-09-13  6:53 UTC (permalink / raw)
  To: Simone Ballarin, xen-devel
  Cc: consulting, Gianluca Luparini, Jan Beulich, Andrew Cooper,
	Roger Pau Monné, Wei Liu

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>



^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2023-09-13  6:54 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03 10:22 [XEN PATCH 00/13] xen: address violations of MISRA C:2012 Rule 7.3 Simone Ballarin
2023-08-03 10:22 ` [XEN PATCH 01/13] AMD/IOMMU: " Simone Ballarin
2023-08-04  0:40   ` Stefano Stabellini
2023-08-07 14:22     ` Jan Beulich
2023-08-03 10:22 ` [XEN PATCH 02/13] x86/svm: " Simone Ballarin
2023-08-04  0:42   ` Stefano Stabellini
2023-08-07 14:22     ` Jan Beulich
2023-08-03 10:22 ` [XEN PATCH 03/13] xen/arm: " Simone Ballarin
2023-08-03 13:44   ` Luca Fancellu
2023-08-04  0:44   ` Stefano Stabellini
2023-08-03 10:22 ` [XEN PATCH 04/13] x86/IOMMU: " Simone Ballarin
2023-08-04  0:45   ` Stefano Stabellini
2023-08-07 14:23     ` Jan Beulich
2023-08-03 10:22 ` [XEN PATCH 05/13] xen/ioreq: " Simone Ballarin
2023-08-04  0:46   ` Stefano Stabellini
2023-09-12 16:19   ` Simone Ballarin
2023-09-13  6:52   ` Paul Durrant
2023-08-03 10:22 ` [XEN PATCH 06/13] xen/mem_access: " Simone Ballarin
2023-08-04  0:47   ` Stefano Stabellini
2023-08-24 10:54     ` Jan Beulich
2023-08-24 21:37       ` Stefano Stabellini
2023-08-03 10:22 ` [XEN PATCH 07/13] xen/vpci: " Simone Ballarin
2023-08-04  0:48   ` Stefano Stabellini
2023-08-24 12:22   ` Roger Pau Monné
2023-08-03 10:22 ` [XEN PATCH 08/13] xen/hvm: " Simone Ballarin
2023-08-04  0:50   ` Stefano Stabellini
2023-08-07 14:24     ` Jan Beulich
2023-08-07 14:25       ` Jan Beulich
2023-09-12 16:18   ` Simone Ballarin
2023-09-13  6:53   ` Paul Durrant
2023-08-03 10:22 ` [XEN PATCH 09/13] x86/mm: " Simone Ballarin
2023-08-04  0:52   ` Stefano Stabellini
2023-08-07 14:26     ` Jan Beulich
2023-08-03 10:22 ` [XEN PATCH 10/13] x86/viridian: " Simone Ballarin
2023-08-04  0:54   ` Stefano Stabellini
2023-09-12  6:23   ` Paul Durrant
2023-08-03 10:22 ` [XEN PATCH 11/13] xen/x86: " Simone Ballarin
2023-08-04  0:59   ` Stefano Stabellini
2023-08-07 14:53     ` Jan Beulich
2023-08-03 10:22 ` [XEN PATCH 12/13] xen/common: " Simone Ballarin
2023-08-04  1:00   ` Stefano Stabellini
2023-08-03 10:22 ` [XEN PATCH 13/13] xen: " Simone Ballarin
2023-08-04  1:02   ` Stefano Stabellini
2023-08-23  8:15 ` [XEN PATCH 00/13] " Jan Beulich
2023-08-28 12:41   ` Simone Ballarin
2023-08-28 13:33     ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.