From nobody Mon Feb 9 16:47:05 2026 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 171112335272755.11305958884907; Fri, 22 Mar 2024 09:02:32 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.696955.1088231 (Exim 4.92) (envelope-from ) id 1rnhLR-0001h6-3p; Fri, 22 Mar 2024 16:02:13 +0000 Received: by outflank-mailman (output) from mailman id 696955.1088231; Fri, 22 Mar 2024 16:02:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rnhLR-0001gF-0i; Fri, 22 Mar 2024 16:02:13 +0000 Received: by outflank-mailman (input) for mailman id 696955; Fri, 22 Mar 2024 16:02:12 +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 1rnhLP-0000W5-V7 for xen-devel@lists.xenproject.org; Fri, 22 Mar 2024 16:02:11 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8a331fa7-e865-11ee-a1ee-f123f15fe8a2; Fri, 22 Mar 2024 17:02:10 +0100 (CET) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id A7A714EE0C91; Fri, 22 Mar 2024 17:02:09 +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: 8a331fa7-e865-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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, bertrand.marquis@arm.com, julien@xen.org, George Dunlap Subject: [XEN PATCH 05/11] xen: address MISRA C Rule 20.7 violation in generated hypercall Date: Fri, 22 Mar 2024 17:01:54 +0100 Message-Id: <323c77d56f8dcbd6bf8f60c84aacff162265807e.1711118582.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: 1711123353143100001 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 --- xen/scripts/gen_hypercall.awk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/scripts/gen_hypercall.awk b/xen/scripts/gen_hypercall.awk index 9f7cfa298a6d..1a7e051fde10 100644 --- a/xen/scripts/gen_hypercall.awk +++ b/xen/scripts/gen_hypercall.awk @@ -277,7 +277,7 @@ END { if (call[i] =3D=3D ca && call_prio[i] =3D=3D p_lis= t[pl]) { fnd++; if (fnd =3D=3D 1) - printf(" if ( num =3D=3D __HYPERVIS= OR_%s ) \\\n", fn[call_fn[i]]); + printf(" if ( (num) =3D=3D __HYPERV= ISOR_%s ) \\\n", fn[call_fn[i]]); else printf(" else \\\n"); do_call(call_fn[i], call_p[i]); @@ -290,7 +290,7 @@ END { } else { for (i =3D 1; i <=3D nc; i++) if (call[i] =3D=3D ca && call_prio[i] =3D=3D p_list[pl= ]) { - printf("if ( likely(num =3D=3D __HYPERVISOR_%s) ) = \\\n", fn[call_fn[i]]); + printf("if ( likely((num) =3D=3D __HYPERVISOR_%s) = ) \\\n", fn[call_fn[i]]); do_call(call_fn[i], call_p[i]); } } --=20 2.34.1