[XEN PATCH v7 0/4] xen/x86: address violations of MISRA C:2012 Rule 7.2

Simone Ballarin posted 4 patches 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/cover.1695913900.git.simone.ballarin@bugseng.com
xen/arch/x86/apic.c                     |   2 +-
xen/arch/x86/cpu-policy.c               |  18 +--
xen/arch/x86/cpu/vpmu_intel.c           |   2 +-
xen/arch/x86/cpuid.c                    |   8 +-
xen/arch/x86/extable.c                  |   2 +-
xen/arch/x86/hvm/hypercall.c            |   2 +-
xen/arch/x86/hvm/pmtimer.c              |   4 +-
xen/arch/x86/hvm/stdvga.c               |  32 ++---
xen/arch/x86/hvm/vlapic.c               |   6 +-
xen/arch/x86/hvm/vmx/vmcs.c             |   6 +-
xen/arch/x86/hvm/vmx/vvmx.c             |   8 +-
xen/arch/x86/include/asm/apicdef.h      |   2 +-
xen/arch/x86/include/asm/config.h       |   2 +-
xen/arch/x86/include/asm/hpet.h         |   2 +-
xen/arch/x86/include/asm/hvm/trace.h    |   4 +-
xen/arch/x86/include/asm/hvm/vioapic.h  |   2 +-
xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  84 +++++------
xen/arch/x86/include/asm/hvm/vmx/vmx.h  |  16 +--
xen/arch/x86/include/asm/msi.h          |   2 +-
xen/arch/x86/include/asm/msr-index.h    | 182 ++++++++++++------------
xen/arch/x86/include/asm/pci.h          |   8 +-
xen/arch/x86/include/asm/x86-defns.h    |  22 +--
xen/arch/x86/percpu.c                   |   2 +-
xen/arch/x86/psr.c                      |   2 +-
xen/arch/x86/spec_ctrl.c                |  12 +-
25 files changed, 216 insertions(+), 216 deletions(-)
[XEN PATCH v7 0/4] xen/x86: address violations of MISRA C:2012 Rule 7.2
Posted by Simone Ballarin 7 months ago
The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline
states:
"A 'u' or 'U' suffix shall be applied to all integer constants that are
represented in an unsigned type".

These violations are caused by the missing "u" or "U" suffix in unsigned
integer constants, such as:

xen/arch/x86/hvm/hypercall.c:132.17-132.26
if ( (eax & 0x80000000) && is_viridian_domain(currd) )

If a rule is not met, changes are needed in order to achieve compliance.
The patches in this series achieve compliance for MISRA C:2012 Rule 7.2 by
adding the 'U' suffix to integers literals with unsigned type and also to
other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Gianluca Luparini (1):
  x86/vmx: address violations of MISRA C:2012 Rule 7.2

Simone Ballarin (3):
  x86/hvm: address violations of MISRA C:2012 Rule 7.2
  x86/include: address violations of MISRA C:2012 Rule 7.2
  xen/x86: address violations of MISRA C:2012 Rule 7.2

 xen/arch/x86/apic.c                     |   2 +-
 xen/arch/x86/cpu-policy.c               |  18 +--
 xen/arch/x86/cpu/vpmu_intel.c           |   2 +-
 xen/arch/x86/cpuid.c                    |   8 +-
 xen/arch/x86/extable.c                  |   2 +-
 xen/arch/x86/hvm/hypercall.c            |   2 +-
 xen/arch/x86/hvm/pmtimer.c              |   4 +-
 xen/arch/x86/hvm/stdvga.c               |  32 ++---
 xen/arch/x86/hvm/vlapic.c               |   6 +-
 xen/arch/x86/hvm/vmx/vmcs.c             |   6 +-
 xen/arch/x86/hvm/vmx/vvmx.c             |   8 +-
 xen/arch/x86/include/asm/apicdef.h      |   2 +-
 xen/arch/x86/include/asm/config.h       |   2 +-
 xen/arch/x86/include/asm/hpet.h         |   2 +-
 xen/arch/x86/include/asm/hvm/trace.h    |   4 +-
 xen/arch/x86/include/asm/hvm/vioapic.h  |   2 +-
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  84 +++++------
 xen/arch/x86/include/asm/hvm/vmx/vmx.h  |  16 +--
 xen/arch/x86/include/asm/msi.h          |   2 +-
 xen/arch/x86/include/asm/msr-index.h    | 182 ++++++++++++------------
 xen/arch/x86/include/asm/pci.h          |   8 +-
 xen/arch/x86/include/asm/x86-defns.h    |  22 +--
 xen/arch/x86/percpu.c                   |   2 +-
 xen/arch/x86/psr.c                      |   2 +-
 xen/arch/x86/spec_ctrl.c                |  12 +-
 25 files changed, 216 insertions(+), 216 deletions(-)

-- 
2.34.1