[XEN PATCH v2 0/8] address violations of MISRA C:2012 Rule 10.1

Nicola Vetrini posted 8 patches 6 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/cover.1697123806.git.nicola.vetrini@bugseng.com
There is a newer version of this series
.../eclair_analysis/ECLAIR/deviations.ecl      |  6 ++++++
docs/misra/safe.json                           |  8 ++++++++
xen/arch/arm/include/asm/bitops.h              |  6 ++++--
xen/arch/x86/cpu/mcheck/mctelem.c              |  2 --
xen/arch/x86/cpu/mcheck/mctelem.h              |  5 +++--
xen/arch/x86/include/asm/io_apic.h             |  7 ++++---
xen/arch/x86/x86_64/mm.c                       | 12 ++++++------
xen/include/xen/compat.h                       | 18 +++++++++++++-----
xen/include/xen/iommu.h                        |  1 +
xen/include/xen/macros.h                       |  6 ++++--
xen/include/xen/pdx.h                          |  2 +-
xen/include/xen/types.h                        |  8 ++++++++
12 files changed, 58 insertions(+), 23 deletions(-)
[XEN PATCH v2 0/8] address violations of MISRA C:2012 Rule 10.1
Posted by Nicola Vetrini 6 months, 3 weeks ago
The widely-used construct
(x & -x), where x is an unsigned integer quantity represented in 2's complement,
does yield the expected result. Since all architectures that are targets for
compliance do fulfill such requirements, the construct is deemed safe and
deviated.

The use of 'DECLARE_BITMAP(features, IOMMU_FEAT_count);' is deviated, to avoid
harming code readability.

On the contrary, other uses of inappropriate types are changed.

Changes in v2:
- the patch 'x86/cpu-policy' has been dropped, in favour of the patch submitted
  by Andrew Cooper.

Nicola Vetrini (8):
  xen/include: add macro LOWEST_BIT
  arm/bitops: encapsulate violation of MISRA C:2012 Rule 10.1
  xen/pdx: amend definition of PDX_GROUP_COUNT
  x86_64/mm: express macro CNT using LOWEST_BIT
  x86/io_apic: address violation of MISRA C:2012 Rule 10.1
  x86/mce: Move MC_NCLASSES into the enum mctelem_class
  xen/types: address Rule 10.1 for DECLARE_BITMAP use
  xen/compat: use BUILD_BUG_ON in CHECK_SIZE macros

 .../eclair_analysis/ECLAIR/deviations.ecl      |  6 ++++++
 docs/misra/safe.json                           |  8 ++++++++
 xen/arch/arm/include/asm/bitops.h              |  6 ++++--
 xen/arch/x86/cpu/mcheck/mctelem.c              |  2 --
 xen/arch/x86/cpu/mcheck/mctelem.h              |  5 +++--
 xen/arch/x86/include/asm/io_apic.h             |  7 ++++---
 xen/arch/x86/x86_64/mm.c                       | 12 ++++++------
 xen/include/xen/compat.h                       | 18 +++++++++++++-----
 xen/include/xen/iommu.h                        |  1 +
 xen/include/xen/macros.h                       |  6 ++++--
 xen/include/xen/pdx.h                          |  2 +-
 xen/include/xen/types.h                        |  8 ++++++++
 12 files changed, 58 insertions(+), 23 deletions(-)

--
2.34.1