From nobody Fri Nov 22 07:27:39 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 1718121249076673.9789167986505; Tue, 11 Jun 2024 08:54:09 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.738555.1145365 (Exim 4.92) (envelope-from ) id 1sH3of-0005Ph-GH; Tue, 11 Jun 2024 15:53:45 +0000 Received: by outflank-mailman (output) from mailman id 738555.1145365; Tue, 11 Jun 2024 15:53:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sH3of-0005ML-7k; Tue, 11 Jun 2024 15:53:45 +0000 Received: by outflank-mailman (input) for mailman id 738555; Tue, 11 Jun 2024 15:53:43 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sH3od-0005DH-87 for xen-devel@lists.xenproject.org; Tue, 11 Jun 2024 15:53:43 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c66ffc9c-280a-11ef-90a3-e314d9c70b13; Tue, 11 Jun 2024 17:53:41 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 9693E4EE0757; Tue, 11 Jun 2024 17:53:40 +0200 (CEST) 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: c66ffc9c-280a-11ef-90a3-e314d9c70b13 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, Simone Ballarin , Doug Goldstein Subject: [XEN PATCH 1/6] automation/eclair: address violations of MISRA C Rule 20.7 Date: Tue, 11 Jun 2024 17:53:31 +0200 Message-Id: <44d392cb30949ed9ddb4551fa7f2a5faa504629f.1718117557.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1718121249341100002 Content-Type: text/plain; charset="utf-8" MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". The helper macro bitmap_switch has parameters that cannot be parenthesized in order to comply with the rule, as that would break its functionality. Moreover, the risk of misuse due developer confusion is deemed not substantial enough to warrant a more involved refactor, thus the macro is deviated for this rule. No functional change. Signed-off-by: Nicola Vetrini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/= eclair_analysis/ECLAIR/deviations.ecl index 447c1e6661d1..c2698e7074aa 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -463,6 +463,14 @@ of this macro do not lead to developer confusion, and = can thus be deviated." -config=3DMC3R1.R20.7,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^c= ount_args_$))))"} -doc_end =20 +-doc_begin=3D"The arguments of macro bitmap_switch macro can't be parenthe= sized as +the rule would require, without breaking the functionality of the macro. T= his is +a specialized local helper macro only used within the bitmap.h header, so = it is +less likely to lead to developer confusion and it is deemed better to devi= ate it." +-file_tag+=3D{xen_bitmap_h, "^xen/include/xen/bitmap\\.h$"} +-config=3DMC3R1.R20.7,reports+=3D{safe, "any_area(any_loc(any_exp(macro(lo= c(file(xen_bitmap_h))&&^bitmap_switch$))))"} +-doc_end + -doc_begin=3D"Uses of variadic macros that have one of their arguments def= ined as a macro and used within the body for both ordinary parameter expansion and= as an operand to the # or ## operators have a behavior that is well-understood a= nd --=20 2.34.1 From nobody Fri Nov 22 07:27:39 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 1718121247628714.2092156420268; Tue, 11 Jun 2024 08:54:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.738557.1145379 (Exim 4.92) (envelope-from ) id 1sH3og-0005jW-Ea; Tue, 11 Jun 2024 15:53:46 +0000 Received: by outflank-mailman (output) from mailman id 738557.1145379; Tue, 11 Jun 2024 15:53:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sH3og-0005g8-6L; Tue, 11 Jun 2024 15:53:46 +0000 Received: by outflank-mailman (input) for mailman id 738557; Tue, 11 Jun 2024 15:53:44 +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 1sH3oe-0004vT-Ns for xen-devel@lists.xenproject.org; Tue, 11 Jun 2024 15:53:44 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c6fd1c78-280a-11ef-b4bb-af5377834399; Tue, 11 Jun 2024 17:53:42 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 9D6B04EE0758; Tue, 11 Jun 2024 17:53:41 +0200 (CEST) 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: c6fd1c78-280a-11ef-b4bb-af5377834399 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, Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall Subject: [XEN PATCH 2/6] xen/self-tests: address violations of MISRA rule 20.7 Date: Tue, 11 Jun 2024 17:53:32 +0200 Message-Id: <38d6b849e0ed868f1025d4af548dcebe89bda42d.1718117557.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1718121249345100003 Content-Type: text/plain; charset="utf-8" MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure that all current and future users will be safe with respect to expansions that can possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini Reviewed-by: Jan Beulich --- In this case the use of parentheses can detect misuses of the COMPILE_CHECK macro for the fn argument that happen to pass the compile-time check (see e.g. https://godbolt.org/z/n4zTdz595). An alternative would be to deviate these macros, but since they are used to check the correctness of other code it seemed the better alternative to futher ensure that all usages of the macros are safe. --- xen/include/xen/self-tests.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/include/xen/self-tests.h b/xen/include/xen/self-tests.h index 42a4cc4d17fe..58484fe5a8ae 100644 --- a/xen/include/xen/self-tests.h +++ b/xen/include/xen/self-tests.h @@ -19,11 +19,11 @@ #if !defined(CONFIG_CC_IS_CLANG) || CONFIG_CLANG_VERSION >=3D 80000 #define COMPILE_CHECK(fn, val, res) \ do { \ - typeof(fn(val)) real =3D fn(val); \ + typeof((fn)(val)) real =3D (fn)(val); \ \ if ( !__builtin_constant_p(real) ) \ asm ( ".error \"'" STR(fn(val)) "' not compile-time constant\"= " ); \ - else if ( real !=3D res ) \ + else if ( real !=3D (res) ) \ asm ( ".error \"Compile time check '" STR(fn(val) =3D=3D res) = "' failed\"" ); \ } while ( 0 ) #else @@ -37,9 +37,9 @@ */ #define RUNTIME_CHECK(fn, val, res) \ do { \ - typeof(fn(val)) real =3D fn(HIDE(val)); \ + typeof((fn)(val)) real =3D (fn)(HIDE(val)); \ \ - if ( real !=3D res ) \ + if ( real !=3D (res) ) \ panic("%s: %s(%s) expected %u, got %u\n", \ __func__, #fn, #val, real, res); \ } while ( 0 ) --=20 2.34.1 From nobody Fri Nov 22 07:27:39 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 1718121250928501.2175998543414; Tue, 11 Jun 2024 08:54:10 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.738556.1145371 (Exim 4.92) (envelope-from ) id 1sH3og-0005ce-13; Tue, 11 Jun 2024 15:53:46 +0000 Received: by outflank-mailman (output) from mailman id 738556.1145371; Tue, 11 Jun 2024 15:53:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sH3of-0005al-PZ; Tue, 11 Jun 2024 15:53:45 +0000 Received: by outflank-mailman (input) for mailman id 738556; Tue, 11 Jun 2024 15:53:44 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sH3oe-0005DH-8P for xen-devel@lists.xenproject.org; Tue, 11 Jun 2024 15:53:44 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c75677dd-280a-11ef-90a3-e314d9c70b13; Tue, 11 Jun 2024 17:53:43 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 830934EE0756; Tue, 11 Jun 2024 17:53:42 +0200 (CEST) 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: c75677dd-280a-11ef-90a3-e314d9c70b13 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, Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall Subject: [XEN PATCH 3/6] xen/guest_access: address violations of MISRA rule 20.7 Date: Tue, 11 Jun 2024 17:53:33 +0200 Message-Id: <2dbc4b40261b91de2148e467ce0fdade5cc89c50.1718117557.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1718121251316100007 Content-Type: text/plain; charset="utf-8" MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure that all current and future users will be safe with respect to expansions that can possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Jan Beulich --- xen/include/xen/guest_access.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/xen/guest_access.h b/xen/include/xen/guest_access.h index af33ae3ab652..8bd2a124e823 100644 --- a/xen/include/xen/guest_access.h +++ b/xen/include/xen/guest_access.h @@ -49,9 +49,9 @@ ((XEN_GUEST_HANDLE(type)) { &(hnd).p->fld }) =20 #define guest_handle_from_ptr(ptr, type) \ - ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)ptr }) + ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)(ptr) }) #define const_guest_handle_from_ptr(ptr, type) \ - ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)ptr }) + ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)(ptr) }) =20 /* * Copy an array of objects to guest context via a guest handle, --=20 2.34.1 From nobody Fri Nov 22 07:27:39 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 1718121247086855.089071186237; Tue, 11 Jun 2024 08:54:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.738560.1145393 (Exim 4.92) (envelope-from ) id 1sH3oh-0005xY-CN; Tue, 11 Jun 2024 15:53:47 +0000 Received: by outflank-mailman (output) from mailman id 738560.1145393; Tue, 11 Jun 2024 15:53:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sH3og-0005vr-Uw; Tue, 11 Jun 2024 15:53:46 +0000 Received: by outflank-mailman (input) for mailman id 738560; Tue, 11 Jun 2024 15:53:45 +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 1sH3of-0004vT-O1 for xen-devel@lists.xenproject.org; Tue, 11 Jun 2024 15:53:45 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c7aba4e1-280a-11ef-b4bb-af5377834399; Tue, 11 Jun 2024 17:53:43 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 1BA284EE0755; Tue, 11 Jun 2024 17:53:43 +0200 (CEST) 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: c7aba4e1-280a-11ef-b4bb-af5377834399 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, Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [XEN PATCH 4/6] x86emul: address violations of MISRA C Rule 20.7 Date: Tue, 11 Jun 2024 17:53:34 +0200 Message-Id: <0a502d2a9c5ce13be13281d9de49d263313b7852.1718117557.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1718121249338100001 Content-Type: text/plain; charset="utf-8" MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure that all current and future users will be safe with respect to expansions that can possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- These local helpers could in principle be deviated, but the readability and functionality are essentially unchanged by complying with the rule, so I decided to modify the macro definition as the preferred option. --- xen/arch/x86/x86_emulate/x86_emulate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emul= ate/x86_emulate.c index 2d5c1de8ecc2..9352d341346a 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -2255,7 +2255,7 @@ x86_emulate( switch ( modrm_reg & 7 ) { #define GRP2(name, ext) \ - case ext: \ + case (ext): \ if ( ops->rmw && dst.type =3D=3D OP_MEM ) \ state->rmw =3D rmw_##name; \ else \ @@ -8611,7 +8611,7 @@ int x86_emul_rmw( unsigned long dummy; =20 #define XADD(sz, cst, mod) \ - case sz: \ + case (sz): \ asm ( "" \ COND_LOCK(xadd) " %"#mod"[reg], %[mem]; " \ _POST_EFLAGS("[efl]", "[msk]", "[tmp]") \ --=20 2.34.1 From nobody Fri Nov 22 07:27:39 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 1718121249720658.6561674843948; Tue, 11 Jun 2024 08:54:09 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.738561.1145413 (Exim 4.92) (envelope-from ) id 1sH3oi-0006ap-Ol; Tue, 11 Jun 2024 15:53:48 +0000 Received: by outflank-mailman (output) from mailman id 738561.1145413; Tue, 11 Jun 2024 15:53:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sH3oi-0006Yw-Ep; Tue, 11 Jun 2024 15:53:48 +0000 Received: by outflank-mailman (input) for mailman id 738561; Tue, 11 Jun 2024 15:53:46 +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 1sH3og-0004vT-O5 for xen-devel@lists.xenproject.org; Tue, 11 Jun 2024 15:53:46 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c80337eb-280a-11ef-b4bb-af5377834399; Tue, 11 Jun 2024 17:53:44 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id A42F54EE0759; Tue, 11 Jun 2024 17:53:43 +0200 (CEST) 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: c80337eb-280a-11ef-b4bb-af5377834399 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, Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall Subject: [XEN PATCH 5/6] x86/irq: address violations of MISRA C Rule 20.7 Date: Tue, 11 Jun 2024 17:53:35 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1718121251317100008 Content-Type: text/plain; charset="utf-8" MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure that all current and future users will be safe with respect to expansions that can possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Jan Beulich --- Note that the rule does not apply to f because that parameter is not used as an expression in the macro, but rather as an identifier. --- xen/include/xen/irq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h index adf33547d25f..0401f06c4fca 100644 --- a/xen/include/xen/irq.h +++ b/xen/include/xen/irq.h @@ -178,7 +178,7 @@ extern struct pirq *pirq_get_info(struct domain *d, int= pirq); =20 #define pirq_field(d, p, f, def) ({ \ const struct pirq *__pi =3D pirq_info(d, p); \ - __pi ? __pi->f : def; \ + __pi ? __pi->f : (def); \ }) #define pirq_to_evtchn(d, pirq) pirq_field(d, pirq, evtchn, 0) #define pirq_masked(d, pirq) pirq_field(d, pirq, masked, 0) --=20 2.34.1 From nobody Fri Nov 22 07:27:39 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 171812125185743.55938974832111; Tue, 11 Jun 2024 08:54:11 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.738558.1145387 (Exim 4.92) (envelope-from ) id 1sH3og-0005sK-UQ; Tue, 11 Jun 2024 15:53:46 +0000 Received: by outflank-mailman (output) from mailman id 738558.1145387; Tue, 11 Jun 2024 15:53:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sH3og-0005qr-KA; Tue, 11 Jun 2024 15:53:46 +0000 Received: by outflank-mailman (input) for mailman id 738558; Tue, 11 Jun 2024 15:53:45 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sH3of-0005DH-BH for xen-devel@lists.xenproject.org; Tue, 11 Jun 2024 15:53:45 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c850d614-280a-11ef-90a3-e314d9c70b13; Tue, 11 Jun 2024 17:53:44 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 3DA734EE075B; Tue, 11 Jun 2024 17:53:44 +0200 (CEST) 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: c850d614-280a-11ef-90a3-e314d9c70b13 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, Simone Ballarin , Doug Goldstein Subject: [XEN PATCH 6/6] automation/eclair_analysis: clean ECLAIR configuration scripts Date: Tue, 11 Jun 2024 17:53:36 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1718121253373100011 Content-Type: text/plain; charset="utf-8" Remove from the ECLAIR integration scripts an unused option, which was already ignored, and make the help texts consistent with the rest of the scripts. No functional change. Signed-off-by: Nicola Vetrini --- automation/eclair_analysis/ECLAIR/analyze.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/automation/eclair_analysis/ECLAIR/analyze.sh b/automation/ecla= ir_analysis/ECLAIR/analyze.sh index 0ea5520c93a6..e96456c3c18d 100755 --- a/automation/eclair_analysis/ECLAIR/analyze.sh +++ b/automation/eclair_analysis/ECLAIR/analyze.sh @@ -11,7 +11,7 @@ fatal() { } =20 usage() { - fatal "Usage: ${script_name} " + fatal "Usage: ${script_name} " } =20 if [[ $# -ne 2 ]]; then @@ -40,7 +40,6 @@ ECLAIR_REPORT_LOG=3D${ECLAIR_OUTPUT_DIR}/REPORT.log if [[ "$1" =3D "X86_64" ]]; then export CROSS_COMPILE=3D export XEN_TARGET_ARCH=3Dx86_64 - EXTRA_ECLAIR_ENV_OPTIONS=3D-disable=3DMC3R1.R20.7 elif [[ "$1" =3D "ARM64" ]]; then export CROSS_COMPILE=3Daarch64-linux-gnu- export XEN_TARGET_ARCH=3Darm64 --=20 2.34.1