Skip to content

xen: address violation of MISRA C:2012 Directive 4.10

Alessandro Zucchelli xen-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest17 patches 17 repliesIn review
  2. v117 patches 41 repliesSuperseded

Changes in v5 from the cover letter

edit inclusion guard naming conventions, according to feedback received edit inclusion guards in header files reflecting the naming convention fix some rebasing mistakes left in the previous version

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17misra: add deviation for headers that explicitly avoid guardsdocs/misra/safe.json xen/include/public/arch-x86/cpufeatureset.h xen/include/public/errno.h+10 -01 reply
2/17misra: modify deviations for empty and generated headersautomation/eclair_analysis/ECLAIR/deviations.ecl docs/misra/safe.json xen/arch/arm/efi/runtime.h +1 more+10 -80 replies
3/17misra: add deviations for direct inclusion guardsdocs/misra/safe.json xen/arch/arm/include/asm/hypercall.h xen/arch/x86/include/asm/hypercall.h+10 -00 replies
4/17xen/arm: address violations of MISRA C:2012 Directive 4.10xen/arch/arm/efi/efi-boot.h+6 -00 replies
5/17xen/x86: address violations of MISRA C:2012 Directive 4.10xen/arch/x86/Makefile xen/arch/x86/cpu/cpu.h xen/arch/x86/x86_64/mmconfig.h +1 more+20 -41 reply
6/17x86/EFI: address violations of MISRA C:2012 Directive 4.10xen/arch/x86/efi/efi-boot.h xen/arch/x86/efi/runtime.h+10 -00 replies
7/17xen/common: address violations of MISRA C:2012 Directive 4.10xen/common/decompress.h xen/common/event_channel.h+10 -00 replies
8/17xen/efi: address violations of MISRA C:2012 Directive 4.10xen/common/efi/efi.h+5 -00 replies
9/17xen: address violations of MISRA C:2012 Directive 4.10xen/include/xen/err.h xen/include/xen/pci_ids.h xen/include/xen/softirq.h +1 more+20 -91 reply
10/17x86/asm: address violations of MISRA C:2012 Directive 4.10docs/misra/safe.json xen/arch/x86/include/asm/compat.h xen/arch/x86/include/asm/cpufeatures.h +2 more+26 -62 replies
11/17xen/arm: address violations of MISRA C:2012 Directive 4.10xen/arch/arm/include/asm/domain.h xen/arch/arm/include/asm/efibind.h xen/arch/arm/include/asm/event.h +6 more+29 -240 replies
12/17xen: address violations of MISRA C:2012 Directive 4.10xen/build.mk xen/scripts/Makefile.asm-generic+11 -43 replies
13/17xen: add deviations for MISRA C 2012 Dir D4.10automation/eclair_analysis/ECLAIR/deviations.ecl docs/misra/deviations.rst+11 -02 replies
14/17xen/x86: rename inclusion guards for consistencyxen/arch/x86/include/asm/domain.h xen/arch/x86/include/asm/event.h xen/arch/x86/include/asm/grant_table.h +5 more+24 -241 reply
15/17xen/build: address violation of MISRA C Directive 4.10xen/build.mk xen/include/Makefile+9 -21 reply
16/17CODING_STYLE: Add a section on header guards naming conventionsCODING_STYLE+21 -04 replies
17/17include/asm-generic: rename inclusion guards for consistencyxen/include/asm-generic/altp2m.h xen/include/asm-generic/atomic-ops.h xen/include/asm-generic/device.h +9 more+36 -361 reply

Reviews trailers per patch

16 of 17 patches have a Reviewed-by or Acked-by.

PatchStefano StabelliniJulien GrallJan Beulich
1/17R-b
2/17R-b
3/17R-b
4/17R-b
5/17A-b
6/17R-b
7/17R-b
8/17R-b
9/17R-b A-b A-b
10/17R-b
11/17R-b
12/17R-b
13/17R-b
14/17R-b A-b
15/17R-b
16/17
17/17R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

Cover letter [XEN PATCH v5 00/17] xen: address violation of MISRA C:2012 Directive 4.10

The Xen sources contain violations of MISRA C:2012 Directive 4.10 whose headline states:
"Precautions shall be taken in order to prevent the contents of a header file being included more than once".

Following V2, V3 and V4, here are all the rules that have been applied:
- private headers -> <dir>__<filename>_H
- asm-generic headers -> ASM_GENERIC__<filename>_H
- arch/<architecture>/include/asm/<subdir>/<filename>.h -> ASM__<architecture>__<subdir>__<filename>_H
- include/xen -> XEN__<filename>_H

Links to the discussions:
https://lists.xenproject.org/archives/html/xen-devel/2023-09/msg01928.html
https://lists.xenproject.org/archives/html/xen-devel/2023-10/msg01784.html
https://lists.xenproject.org/archives/html/xen-devel/2023-10/msg02073.html

Furthermore, the violations arising from the autogenerated header files include/xen/compile.h and xen/hypercall-defs.h are addressed.

Changes in v5:
edit inclusion guard naming conventions, according to feedback received edit inclusion guards in header files reflecting the naming convention fix some rebasing mistakes left in the previous version

Changes in v4:
add/amend inclusion guards to address violations of the Directive and the new naming convention. drop teh XEN_ prefix when needed, according to the feedback received.
add inclusion guard naming convention section in CODING_STYLE

Changes in v3:
Add/amend inclusion guards to address violations of the Directive and the new naming convention. Remove trailing underscores.
Modify creation rule for asm-offsets.h to conform to the new standard and to not generate conflicting guards between architectures (which is a violation of the Directive).

Alessandro Zucchelli (3):
xen/build: address violation of MISRA C Directive 4.10
CODING_STYLE: Add a section on header guards naming conventions include/asm-generic: rename inclusion guards for consistency

Maria Celeste Cesario (3):
xen/arm: address violations of MISRA C:2012 Directive 4.10
xen: address violations of MISRA C:2012 Directive 4.10 xen/x86: rename inclusion guards for consistency

Nicola Vetrini (1):
xen: add deviations for MISRA C 2012 Dir D4.10

Simone Ballarin (10):
misra: add deviation for headers that explicitly avoid guards
misra: modify deviations for empty and generated headers
misra: add deviations for direct inclusion guards xen/arm: address violations of MISRA C:2012 Directive 4.10 xen/x86: address violations of MISRA C:2012 Directive 4.10 x86/EFI: address violations of MISRA C:2012 Directive 4.10 xen/common: address violations of MISRA C:2012 Directive 4.10 xen/efi: address violations of MISRA C:2012 Directive 4.10
xen: address violations of MISRA C:2012 Directive 4.10 x86/asm: address violations of MISRA C:2012 Directive 4.10

 CODING_STYLE                                  | 21 ++++++++++++
 .../eclair_analysis/ECLAIR/deviations.ecl     | 12 +++----
 docs/misra/deviations.rst                     |  6 ++++
 docs/misra/safe.json                          | 32 +++++++++++++++++++
 xen/arch/arm/efi/efi-boot.h                   |  6 ++++
 xen/arch/arm/efi/runtime.h                    |  1 +
 xen/arch/arm/include/asm/domain.h             |  6 ++--
 xen/arch/arm/include/asm/efibind.h            |  5 +++
 xen/arch/arm/include/asm/event.h              |  6 ++--
 xen/arch/arm/include/asm/grant_table.h        |  6 ++--
 xen/arch/arm/include/asm/hypercall.h          |  1 +
 xen/arch/arm/include/asm/io.h                 |  6 ++--
 xen/arch/arm/include/asm/irq.h                |  6 ++--
 xen/arch/arm/include/asm/smp.h                |  6 ++--
 xen/arch/arm/include/asm/spinlock.h           |  6 ++--
 xen/arch/arm/include/asm/system.h             |  6 ++--
 xen/arch/x86/Makefile                         |  9 +++---
 xen/arch/x86/cpu/cpu.h                        |  5 +++
 xen/arch/x86/efi/efi-boot.h                   |  5 +++
 xen/arch/x86/efi/runtime.h                    |  5 +++
 xen/arch/x86/include/asm/compat.h             |  5 +++
 xen/arch/x86/include/asm/cpufeatures.h        |  5 +--
 xen/arch/x86/include/asm/domain.h             |  6 ++--
 xen/arch/x86/include/asm/efibind.h            |  5 +++
 xen/arch/x86/include/asm/event.h              |  6 ++--
 xen/arch/x86/include/asm/grant_table.h        |  6 ++--
 xen/arch/x86/include/asm/hypercall.h          |  1 +
 xen/arch/x86/include/asm/io.h                 |  6 ++--
 xen/arch/x86/include/asm/irq.h                |  6 ++--
 xen/arch/x86/include/asm/smp.h                |  6 ++--
 xen/arch/x86/include/asm/spinlock.h           |  6 ++--
 xen/arch/x86/include/asm/system.h             |  6 ++--
 xen/arch/x86/x86_64/mmconfig.h                |  5 +++
 xen/arch/x86/x86_emulate/private.h            |  5 +++
 xen/build.mk                                  | 13 +++++---
 xen/common/decompress.h                       |  5 +++
 xen/common/efi/efi.h                          |  5 +++
 xen/common/event_channel.h                    |  5 +++
 xen/include/Makefile                          | 16 +++++++---
 xen/include/asm-generic/altp2m.h              |  6 ++--
 xen/include/asm-generic/atomic-ops.h          |  6 ++--
 xen/include/asm-generic/device.h              |  6 ++--
 xen/include/asm-generic/div64.h               |  6 ++--
 xen/include/asm-generic/hardirq.h             |  6 ++--
 xen/include/asm-generic/iocap.h               |  6 ++--
 xen/include/asm-generic/monitor.h             |  6 ++--
 xen/include/asm-generic/paging.h              |  6 ++--
 xen/include/asm-generic/percpu.h              |  6 ++--
 xen/include/asm-generic/random.h              |  6 ++--
 xen/include/asm-generic/softirq.h             |  6 ++--
 xen/include/asm-generic/vm_event.h            |  6 ++--
 xen/include/public/arch-x86/cpufeatureset.h   |  1 +
 xen/include/public/errno.h                    |  1 +
 xen/include/xen/err.h                         |  8 +++--
 xen/include/xen/pci_ids.h                     |  5 +++
 xen/include/xen/softirq.h                     |  8 +++--
 xen/include/xen/vmap.h                        |  8 +++--
 xen/scripts/Makefile.asm-generic              |  8 ++++-
 58 files changed, 268 insertions(+), 117 deletions(-)
Signature · 1 line
2.34.1