From patchwork Tue Jul 23 08:14:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alessandro Zucchelli X-Patchwork-Id: 13739675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7476EC3DA64 for ; Tue, 23 Jul 2024 08:15:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.762673.1172879 (Exim 4.92) (envelope-from ) id 1sWAgM-0007wI-62; Tue, 23 Jul 2024 08:15:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 762673.1172879; Tue, 23 Jul 2024 08:15:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sWAgM-0007wB-3X; Tue, 23 Jul 2024 08:15:38 +0000 Received: by outflank-mailman (input) for mailman id 762673; Tue, 23 Jul 2024 08:15:36 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sWAgK-0007w0-IF for xen-devel@lists.xenproject.org; Tue, 23 Jul 2024 08:15:36 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bbd56a9e-48cb-11ef-8776-851b0ebba9a2; Tue, 23 Jul 2024 10:15:34 +0200 (CEST) Received: from delta.bugseng.com.homenet.telecomitalia.it (host-79-35-51-193.retail.telecomitalia.it [79.35.51.193]) by support.bugseng.com (Postfix) with ESMTPSA id 59F2B4EE0739; Tue, 23 Jul 2024 10:15:28 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: bbd56a9e-48cb-11ef-8776-851b0ebba9a2 From: Alessandro Zucchelli To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Alessandro Zucchelli , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Simone Ballarin , Doug Goldstein , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , "Daniel P. Smith" , =?utf-8?q?Marek_Marczykow?= =?utf-8?q?ski-G=C3=B3recki?= , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu Subject: [XEN PATCH v5 00/17] xen: address violation of MISRA C:2012 Directive 4.10 Date: Tue, 23 Jul 2024 10:14:52 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 -> ___H - asm-generic headers -> ASM_GENERIC___H - arch//include/asm//.h -> ASM_______H - include/xen -> XEN___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(-)