From nobody Mon Feb 9 06:31:07 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 171014763766816.964231464551517; Mon, 11 Mar 2024 02:00:37 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.691270.1077124 (Exim 4.92) (envelope-from ) id 1rjbW9-0000KW-Vr; Mon, 11 Mar 2024 09:00:21 +0000 Received: by outflank-mailman (output) from mailman id 691270.1077124; Mon, 11 Mar 2024 09:00:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rjbW9-0000Ek-7p; Mon, 11 Mar 2024 09:00:21 +0000 Received: by outflank-mailman (input) for mailman id 691270; Mon, 11 Mar 2024 09:00:18 +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 1rjbW6-0006iu-1H for xen-devel@lists.xenproject.org; Mon, 11 Mar 2024 09:00:18 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c7f9c963-df85-11ee-afdc-a90da7624cb6; Mon, 11 Mar 2024 10:00:17 +0100 (CET) Received: from beta.station (net-93-144-106-196.cust.vodafonedsl.it [93.144.106.196]) by support.bugseng.com (Postfix) with ESMTPSA id D11F94EE0C95; Mon, 11 Mar 2024 10:00:16 +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: c7f9c963-df85-11ee-afdc-a90da7624cb6 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, sstabellini@kernel.org, Maria Celeste Cesario , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Wei Liu , Simone Ballarin Subject: [XEN PATCH v3 12/16] xen: address violations of MISRA C:2012 Directive 4.10 Date: Mon, 11 Mar 2024 09:59:21 +0100 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: 1710147638476100002 Content-Type: text/plain; charset="utf-8" From: Maria Celeste Cesario 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). Modify generic-y creation rule to generate code without violations and to conform to the new standard. Mechanical change. --- Commit introduced in v3 Signed-off-by: Maria Celeste Cesario Signed-off-by: Simone Ballarin --- xen/build.mk | 6 ++++-- xen/scripts/Makefile.asm-generic | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/xen/build.mk b/xen/build.mk index 0f490ca71b..bd8b93e2ae 100644 --- a/xen/build.mk +++ b/xen/build.mk @@ -45,6 +45,8 @@ asm-offsets.s: arch/$(SRCARCH)/$(ARCH)/asm-offsets.c $(CC) $(call cpp_flags,$(c_flags)) -S -g0 -o $@.new -MQ $@ $< $(call move-if-changed,$@.new,$@) =20 +ARCHDIR =3D $(shell echo $(SRCARCH) | tr a-z A-Z) + arch/$(SRCARCH)/include/asm/asm-offsets.h: asm-offsets.s @(set -e; \ echo "/*"; \ @@ -54,8 +56,8 @@ arch/$(SRCARCH)/include/asm/asm-offsets.h: asm-offsets.s echo " *"; \ echo " */"; \ echo ""; \ - echo "#ifndef __ASM_OFFSETS_H__"; \ - echo "#define __ASM_OFFSETS_H__"; \ + echo "#ifndef ASM_$(ARCHDIR)_ASM_OFFSETS_H"; \ + echo "#define ASM_$(ARCHDIR)_ASM_OFFSETS_H"; \ echo ""; \ sed -rne "/^[^#].*=3D=3D>/{s:.*=3D=3D>(.*)<=3D=3D.*:\1:; s: [\$$#]: :; = p;}"; \ echo ""; \ diff --git a/xen/scripts/Makefile.asm-generic b/xen/scripts/Makefile.asm-ge= neric index b0d356bfa3..3b538bc7a4 100644 --- a/xen/scripts/Makefile.asm-generic +++ b/xen/scripts/Makefile.asm-generic @@ -31,8 +31,22 @@ generated-y :=3D $(addprefix $(obj)/, $(generated-y)) old-headers :=3D $(wildcard $(obj)/*.h) unwanted :=3D $(filter-out $(generic-y) $(generated-y),$(old-headers)) =20 +define header_stub +#ifndef ASM_GENERIC_$(3)_$(2)_H +#define ASM_GENERIC_$(3)_$(2)_H + +#include + +#endif /* ASM_GENERIC_$(3)_$(2)_H */ +endef + +arch =3D $(shell echo $(SRCARCH) | tr a-z A-Z) + +header_body =3D $(call header_stub,$*,$(shell echo "$*" | tr a-z A-Z),$(ar= ch)) +export header_body + quiet_cmd_wrap =3D WRAP $@ - cmd_wrap =3D echo "\#include " > $@ + cmd_wrap =3D echo "$$header_body" > $@ =20 quiet_cmd_remove =3D REMOVE $(unwanted) cmd_remove =3D rm -f $(unwanted) --=20 2.34.1