Message ID | 4b97aa8203935ba6e202926add0baf8901af5ee9.1691053438.git.simone.ballarin@bugseng.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | xen: address violations of MISRA C:2012 Rule 7.3 | expand |
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>
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.
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;