From: Gianluca Luparini Date: Mon, 28 Aug 2023 13:25:54 +0000 (+0200) Subject: xen/vpci: address violations of MISRA C:2012 Rule 7.3 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ccc55b7c616784c2dd879852271e0a756197e9df;p=people%2Froyger%2Fxen.git xen/vpci: address violations of MISRA C:2012 Rule 7.3 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 Signed-off-by: Simone Ballarin Reviewed-by: Stefano Stabellini Acked-by: Roger Pau Monné --- 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 f9df506f29..7c71cbbd1c 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;