[XEN PATCH v2 00/10] address violations of MISRA C:2012 Directive 4.10

Simone Ballarin posted 10 patches 2 weeks, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/cover.1694510856.git.simone.ballarin@bugseng.com
.../eclair_analysis/ECLAIR/deviations.ecl     |  7 ----
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/hypercall.h          |  1 +
xen/arch/x86/Makefile                         |  8 ++---
xen/arch/x86/cpu/cpu.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/efibind.h            |  5 +++
xen/arch/x86/include/asm/hypercall.h          |  1 +
xen/arch/x86/x86_64/mmconfig.h                |  5 +++
xen/arch/x86/x86_emulate/private.h            |  5 +++
xen/common/decompress.h                       |  5 +++
xen/common/efi/efi.h                          |  5 +++
xen/common/event_channel.h                    |  5 +++
xen/include/Makefile                          | 10 ++++--
xen/include/public/arch-x86/cpufeatureset.h   |  1 +
xen/include/public/errno.h                    |  1 +
xen/include/xen/err.h                         |  4 ++-
xen/include/xen/pci_ids.h                     |  5 +++
xen/include/xen/softirq.h                     |  4 ++-
xen/include/xen/unaligned.h                   |  1 +
xen/include/xen/vmap.h                        |  4 ++-
25 files changed, 115 insertions(+), 21 deletions(-)
[XEN PATCH v2 00/10] address violations of MISRA C:2012 Directive 4.10
Posted by Simone Ballarin 2 weeks, 1 day ago
Add or move inclusion guards to address violations of
MISRA C:2012 Directive 4.10 ("Precautions shall be taken in order
to prevent the contents of a header file being included more than
once").

Inclusion guards must appear at the beginning of the headers
(comments are permitted anywhere) and the #if directive cannot
be used for other checks.

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

 .../eclair_analysis/ECLAIR/deviations.ecl     |  7 ----
 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/hypercall.h          |  1 +
 xen/arch/x86/Makefile                         |  8 ++---
 xen/arch/x86/cpu/cpu.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/efibind.h            |  5 +++
 xen/arch/x86/include/asm/hypercall.h          |  1 +
 xen/arch/x86/x86_64/mmconfig.h                |  5 +++
 xen/arch/x86/x86_emulate/private.h            |  5 +++
 xen/common/decompress.h                       |  5 +++
 xen/common/efi/efi.h                          |  5 +++
 xen/common/event_channel.h                    |  5 +++
 xen/include/Makefile                          | 10 ++++--
 xen/include/public/arch-x86/cpufeatureset.h   |  1 +
 xen/include/public/errno.h                    |  1 +
 xen/include/xen/err.h                         |  4 ++-
 xen/include/xen/pci_ids.h                     |  5 +++
 xen/include/xen/softirq.h                     |  4 ++-
 xen/include/xen/unaligned.h                   |  1 +
 xen/include/xen/vmap.h                        |  4 ++-
 25 files changed, 115 insertions(+), 21 deletions(-)

-- 
2.34.1
Re: [XEN PATCH v2 00/10] address violations of MISRA C:2012 Directive 4.10
Posted by Jan Beulich 2 weeks ago
On 12.09.2023 11:36, Simone Ballarin wrote:
> Add or move inclusion guards to address violations of
> MISRA C:2012 Directive 4.10 ("Precautions shall be taken in order
> to prevent the contents of a header file being included more than
> once").
> 
> Inclusion guards must appear at the beginning of the headers
> (comments are permitted anywhere) and the #if directive cannot
> be used for other checks.
> 
> 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

Just to mention it here again for the entire series, seeing that despite
my earlier comments to this effect a few R-b have arrived: If private
headers need to gain guards (for, imo, no real reason), we first need to
settle on a naming scheme for these guards, such that guards used in
private headers aren't at risk of colliding with ones used headers
living in one of the usual include directories. IOW imo fair parts of
this series may need redoing.

Jan