All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/17] xen: address violation of MISRA C:2012 Directive 4.10
@ 2024-07-01 11:10 Alessandro Zucchelli
  2024-07-01 11:10 ` [PATCH 01/17] misra: add deviation for headers that explicitly avoid guards Alessandro Zucchelli
                   ` (16 more replies)
  0 siblings, 17 replies; 59+ messages in thread
From: Alessandro Zucchelli @ 2024-07-01 11:10 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Alessandro Zucchelli, Andrew Cooper, Jan Beulich,
	Julien Grall, Stefano Stabellini, Roger Pau Monné,
	Simone Ballarin, Doug Goldstein, Bertrand Marquis, Michal Orzel,
	Volodymyr Babchuk, Daniel P. Smith,
	Marek Marczykowski-Górecki

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 and V3, 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/generated/<subdir>/<filename>.h-> GENERATED_<subdir>_<filename>_H
- arch/<architecture>/include/generated/asm/<filename>.h-> <arch>_GENERATED_ASM_<name>_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.

Patch 17/17 adds a new section for CODING_STYLE with the aforementioned naming
conventions. 
this is just a draft, please give us a feedback on whether something similar may
be appreciated. 

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 (2):
  xen/build: address violation of MISRA C Directive 4.10
  CODING_STYLE: Add a section on header guards naming conventions

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 (2):
  xen: add deviations for MISRA C 2012 Dir D4.10
  xen: add SAF deviation for MISRA C Dir 4.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                                  | 19 +++++++++
 .../eclair_analysis/ECLAIR/deviations.ecl     | 12 +++---
 docs/misra/deviations.rst                     |  7 ++++
 docs/misra/safe.json                          | 40 +++++++++++++++++++
 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                   |  7 ++++
 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                          | 18 +++++++--
 xen/include/public/arch-x86/cpufeatureset.h   |  1 +
 xen/include/public/arch-x86/xen.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 +++-
 47 files changed, 244 insertions(+), 81 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 59+ messages in thread

end of thread, other threads:[~2024-07-22  9:15 UTC | newest]

Thread overview: 59+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01 11:10 [PATCH 00/17] xen: address violation of MISRA C:2012 Directive 4.10 Alessandro Zucchelli
2024-07-01 11:10 ` [PATCH 01/17] misra: add deviation for headers that explicitly avoid guards Alessandro Zucchelli
2024-07-03 12:46   ` Jan Beulich
2024-07-01 11:10 ` [PATCH 02/17] misra: modify deviations for empty and generated headers Alessandro Zucchelli
2024-07-01 11:10 ` [PATCH 03/17] misra: add deviations for direct inclusion guards Alessandro Zucchelli
2024-07-01 14:16   ` Jan Beulich
2024-07-12 22:00     ` Stefano Stabellini
2024-07-01 13:35 ` [PATCH 04/17] xen/arm: address violations of MISRA C:2012 Directive 4.10 Alessandro Zucchelli
2024-07-12 22:09   ` Stefano Stabellini
2024-07-01 13:36 ` [PATCH 05/17] xen/x86: " Alessandro Zucchelli
2024-07-01 14:21   ` Jan Beulich
2024-07-09  7:38     ` Alessandro Zucchelli
2024-07-09  7:45       ` Jan Beulich
2024-07-12 22:09         ` Stefano Stabellini
2024-07-15  7:27           ` Jan Beulich
2024-07-01 13:36 ` [PATCH 06/17] x86/EFI: " Alessandro Zucchelli
2024-07-01 14:09   ` Marek Marczykowski-Górecki
2024-07-01 14:36     ` Alessandro Zucchelli
2024-07-01 14:11   ` Jan Beulich
2024-07-12 22:10     ` Stefano Stabellini
2024-07-01 13:36 ` [PATCH 07/17] xen/common: " Alessandro Zucchelli
2024-07-01 13:36 ` [PATCH 08/17] xen/efi: " Alessandro Zucchelli
2024-07-01 13:36 ` [PATCH 09/17] xen: " Alessandro Zucchelli
2024-07-03 12:30   ` Jan Beulich
2024-07-12 22:16     ` Stefano Stabellini
2024-07-01 13:36 ` [PATCH 10/17] x86/asm: " Alessandro Zucchelli
2024-07-03 12:49   ` Jan Beulich
2024-07-04  7:50     ` Alessandro Zucchelli
2024-07-01 13:43 ` [PATCH 11/17] xen/arm: " Alessandro Zucchelli
2024-07-12 22:19   ` Stefano Stabellini
2024-07-01 13:43 ` [PATCH 12/17] xen: " Alessandro Zucchelli
2024-07-03 12:51   ` Jan Beulich
2024-07-04  8:14     ` Alessandro Zucchelli
2024-07-01 13:45 ` [PATCH 13/17] xen: add deviations for MISRA C 2012 Dir D4.10 Alessandro Zucchelli
2024-07-12 22:22   ` Stefano Stabellini
2024-07-01 13:45 ` [PATCH 14/17] xen: add SAF deviation for MISRA C Dir 4.10 Alessandro Zucchelli
2024-07-03 13:23   ` Jan Beulich
2024-07-12 22:28     ` Stefano Stabellini
2024-07-22  8:54       ` Alessandro Zucchelli
2024-07-22  9:14         ` Jan Beulich
2024-07-01 13:46 ` [PATCH 15/17] xen/x86: rename inclusion guards for consistency Alessandro Zucchelli
2024-07-03 13:26   ` Jan Beulich
2024-07-01 13:46 ` [PATCH 16/17] xen/build: address violation of MISRA C Directive 4.10 Alessandro Zucchelli
2024-07-03 13:32   ` Jan Beulich
2024-07-01 13:46 ` [RFC PATCH 17/17] CODING_STYLE: Add a section on header guards naming conventions Alessandro Zucchelli
2024-07-03 13:48   ` Jan Beulich
2024-07-12 22:38     ` Stefano Stabellini
2024-07-15  7:23       ` Jan Beulich
2024-07-15  9:08         ` Alessandro Zucchelli
2024-07-16  0:43         ` Stefano Stabellini
2024-07-16  7:17           ` Jan Beulich
2024-07-17  0:20             ` Stefano Stabellini
2024-07-17 10:24               ` Jan Beulich
2024-07-17 23:02                 ` Stefano Stabellini
2024-07-18  8:59                   ` Jan Beulich
2024-07-18 22:01                     ` Stefano Stabellini
2024-07-19  9:05                       ` Jan Beulich
2024-07-19 15:21                         ` Stefano Stabellini
2024-07-22  6:56                           ` Alessandro Zucchelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.