]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/vpci: address violations of MISRA C:2012 Rule 7.3
authorGianluca Luparini <gianluca.luparini@bugseng.com>
Mon, 28 Aug 2023 13:25:54 +0000 (15:25 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 28 Aug 2023 13:25:54 +0000 (15:25 +0200)
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: Roger Pau Monné <roger.pau@citrix.com>
xen/drivers/vpci/header.c
xen/drivers/vpci/msi.c
xen/drivers/vpci/msix.c

index 60f7049e3498829a45004baf72444c52624ffd92..767c1ba718d7dec4c454a5397f3dd6e4b323251d 100644 (file)
@@ -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. */
index 8f2b59e61aa42eca4d2bb583019a6e2df952b9f3..9090d97c9a563ce047fb037f130f576a9f1dbd52 100644 (file)
@@ -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);
index f9df506f29bf92f1cfee79aa376f08290ab8bcd6..7c71cbbd1c3f47a7a90fc427e2d2b0d2ca3b6feb 100644 (file)
@@ -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;