Message ID | 10dc3a59085c801c91551625c036fcc9e5eb4729.1713956723.git.alessandro.zucchelli@bugseng.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | x86: address remaining violation of Rule 7.2 | expand |
On 24.04.2024 14:11, Alessandro Zucchelli wrote: > This addresses violations of MISRA C:2012 Rule 7.2 which states as > following: A “u” or “U” suffix shall be applied to all integer constants > that are represented in an unsigned type. > > No functional change. > > Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com> Acked-by: Jan Beulich <jbeulich@suse.com> > --- a/xen/arch/x86/x86_64/pci.c > +++ b/xen/arch/x86/x86_64/pci.c > @@ -9,7 +9,7 @@ > #include <asm/io.h> > > #define PCI_CONF_ADDRESS(sbdf, reg) \ > - (0x80000000 | ((sbdf).bdf << 8) | ((reg) & ~3)) > + (0x80000000U | ((sbdf).bdf << 8) | ((reg) & ~3)) > > uint8_t pci_conf_read8(pci_sbdf_t sbdf, unsigned int reg) > { This is x86'es PCI, so the subject prefix may ant to be "x86/pci:". Jan
On 2024-04-24 14:47, Jan Beulich wrote: > On 24.04.2024 14:11, Alessandro Zucchelli wrote: >> This addresses violations of MISRA C:2012 Rule 7.2 which states as >> following: A “u” or “U” suffix shall be applied to all integer >> constants >> that are represented in an unsigned type. >> >> No functional change. >> >> Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com> > > Acked-by: Jan Beulich <jbeulich@suse.com> > >> --- a/xen/arch/x86/x86_64/pci.c >> +++ b/xen/arch/x86/x86_64/pci.c >> @@ -9,7 +9,7 @@ >> #include <asm/io.h> >> >> #define PCI_CONF_ADDRESS(sbdf, reg) \ >> - (0x80000000 | ((sbdf).bdf << 8) | ((reg) & ~3)) >> + (0x80000000U | ((sbdf).bdf << 8) | ((reg) & ~3)) >> >> uint8_t pci_conf_read8(pci_sbdf_t sbdf, unsigned int reg) >> { > > This is x86'es PCI, so the subject prefix may ant to be "x86/pci:". Noted, thanks.
diff --git a/xen/arch/x86/x86_64/pci.c b/xen/arch/x86/x86_64/pci.c index aad1c3f7cf..8d33429103 100644 --- a/xen/arch/x86/x86_64/pci.c +++ b/xen/arch/x86/x86_64/pci.c @@ -9,7 +9,7 @@ #include <asm/io.h> #define PCI_CONF_ADDRESS(sbdf, reg) \ - (0x80000000 | ((sbdf).bdf << 8) | ((reg) & ~3)) + (0x80000000U | ((sbdf).bdf << 8) | ((reg) & ~3)) uint8_t pci_conf_read8(pci_sbdf_t sbdf, unsigned int reg) {
This addresses violations of MISRA C:2012 Rule 7.2 which states as following: A “u” or “U” suffix shall be applied to all integer constants that are represented in an unsigned type. No functional change. Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com> --- xen/arch/x86/x86_64/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)