From nobody Fri May 17 08:24:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1709885455696510.79656656178656; Fri, 8 Mar 2024 00:10:55 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.690137.1075874 (Exim 4.92) (envelope-from ) id 1riVJG-0000fE-CN; Fri, 08 Mar 2024 08:10:30 +0000 Received: by outflank-mailman (output) from mailman id 690137.1075874; Fri, 08 Mar 2024 08:10:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1riVJG-0000f7-8x; Fri, 08 Mar 2024 08:10:30 +0000 Received: by outflank-mailman (input) for mailman id 690137; Fri, 08 Mar 2024 08:10:28 +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 1riVJE-0000f0-KY for xen-devel@lists.xenproject.org; Fri, 08 Mar 2024 08:10:28 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 52010593-dd23-11ee-a1ee-f123f15fe8a2; Fri, 08 Mar 2024 09:10:26 +0100 (CET) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id A63524EE0738; Fri, 8 Mar 2024 09:10:24 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 52010593-dd23-11ee-a1ee-f123f15fe8a2 From: Nicola Vetrini To: nicola.vetrini@bugseng.com, xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, bertrand.marquis@arm.com, julien@xen.org, Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu Subject: [XEN PATCH] xen/compiler: deviate the inline macro for MISRA C Rule 20.4 Date: Fri, 8 Mar 2024 09:10:21 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1709885457465100005 Content-Type: text/plain; charset="utf-8" Rule 20.4 states: "A macro shall not be defined with the same name as a keyword". Defining this macro with the same name as the inline keyword allows for additionally checking that out-of-lined static inline functions end up in the correct section while minimizing churn and has a positive impact on the overall safety. See [1] for additional context on the motivation of this deviation. No functional change. [1] https://lore.kernel.org/xen-devel/adaa6d55-266d-4df8-8967-9340080d17e4@= citrix.com/ Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- docs/misra/safe.json | 8 ++++++++ xen/include/xen/compiler.h | 1 + 2 files changed, 9 insertions(+) diff --git a/docs/misra/safe.json b/docs/misra/safe.json index 952324f85cf9..a2bbacddf06a 100644 --- a/docs/misra/safe.json +++ b/docs/misra/safe.json @@ -28,6 +28,14 @@ }, { "id": "SAF-3-safe", + "analyser": { + "eclair": "MC3R1.R20.4" + }, + "name": "MC3R1.R20.4: allow the augmentation of the inline key= word in some build configurations", + "text": "The definition of this macro named inline allows furt= her checking in some build configurations that certain symbols end up in th= e right sections." + }, + { + "id": "SAF-4-safe", "analyser": {}, "name": "Sentinel", "text": "Next ID to be used" diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h index 16d554f2a593..e3d9f9fb8e4b 100644 --- a/xen/include/xen/compiler.h +++ b/xen/include/xen/compiler.h @@ -82,6 +82,7 @@ * inline functions not expanded inline get placed in .init.text. */ #include +/* SAF-3-safe MISRA C Rule 20.4: define the inline macro to perform checks= */ #define inline inline __init #endif =20 --=20 2.34.1