From nobody Fri Oct 31 04:01:20 2025 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; dkim=pass; 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; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1749168537; cv=none; d=zohomail.com; s=zohoarc; b=OZycJMytSyR/G/SNYK01ZQmdFnMTjVRbIvJ2a3uJMeoILTQyYJzm/kfFwOXSXdSe23/ogTu/ykGYBg8hdvP54x0HYcvIccOVkVhX09sGdKBH5hgl6yZ0Ila6wUbnPq0Y8h9wdP95SY070Dp3mWKrIlq4s9D0h7V77wmNf61uVjg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749168537; h=Content-Type:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Oh/IEnpr8DyjEUifupk5xNIHvdBTou9mTY3U3nxIN3c=; b=C09+Jgy9dO7HmowmfWTjdr1mfdBMi7/oGpalBHaRjrdOy4x2VCgXrafC0kMFgo5GXkifX9t4n8ABnd+4eRJtmu3N41uCKblDtIRUNyCi9xERqIRjvoLcMUvJVr02axQi4KZSiRgZAatiPUZ3zLldweLvaBe2ybexYcykqW0lv8A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1749168537911390.33650924568406; Thu, 5 Jun 2025 17:08:57 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1007726.1386990 (Exim 4.92) (envelope-from ) id 1uNKdZ-0002ro-Mz; Fri, 06 Jun 2025 00:08:45 +0000 Received: by outflank-mailman (output) from mailman id 1007726.1386990; Fri, 06 Jun 2025 00:08: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 1uNKdZ-0002rh-KJ; Fri, 06 Jun 2025 00:08:45 +0000 Received: by outflank-mailman (input) for mailman id 1007726; Fri, 06 Jun 2025 00:08: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 1uNKdY-0002fD-L1 for xen-devel@lists.xenproject.org; Fri, 06 Jun 2025 00:08:44 +0000 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 67bdeb19-426a-11f0-a300-13f23c93f187; Fri, 06 Jun 2025 02:08:43 +0200 (CEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 0E13D43D24; Fri, 6 Jun 2025 00:08:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E086CC4CEE7; Fri, 6 Jun 2025 00:08:40 +0000 (UTC) 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: 67bdeb19-426a-11f0-a300-13f23c93f187 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749168521; bh=Y0eNZf6WgSeSHgRZA85F4qsPOOHxtJMS7AUAA/I8TwU=; h=Date:From:To:cc:Subject:From; b=bZA9lSmeC54sxYeWMGJVdUIc3DPPaR+6pXLgioqJbQLmx1f5Yd9GmW2ziogqQgREa bRAfMiLfrwyHb2ZEtU0drE57WOgULctqFoDIhgM+QuduNVesQPjPue0Z1vmk2D7Y2L kfbWBuyFmpXXDcE7SipEiM1ap41gxgZThfors7AmjqOeTB/oxTxRPjuzNT4ryrvO8V MxIHKPL+4aFsNYABugqW0zg33ghNnggFTGjmNhL1sTwQ4giFCzF+lGxDZENKdum/Ai c/ehTdwYrTC4sJNmauUNCABYVIKv8TgVKsJwEU+0Msgc9geqBRufwOKbMmZc1bqHL0 3/Sk1dD9qeZoA== Date: Thu, 5 Jun 2025 17:08:40 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: xen-devel@lists.xenproject.org cc: sstabellini@kernel.org, andrew.cooper3@citrix.com, anthony.perard@vates.tech, michal.orzel@amd.com, jbeulich@suse.com, julien@xen.org, roger.pau@citrix.com Subject: [PATCH v2] xen: add header guards to generated asm generic headers Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1749168539978116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" MISRA D4.10 requires to have proper header guards in place in all header files. Add header guards for generated asm generic headers as well. Suggested-by: Jan Beulich Signed-off-by: Stefano Stabellini Acked-by: Jan Beulich --- Changes in v2: - write to $@.new and move the file - change the header guard name --- xen/scripts/Makefile.asm-generic | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/scripts/Makefile.asm-generic b/xen/scripts/Makefile.asm-ge= neric index b0d356bfa3..1e85a92c32 100644 --- a/xen/scripts/Makefile.asm-generic +++ b/xen/scripts/Makefile.asm-generic @@ -32,7 +32,14 @@ old-headers :=3D $(wildcard $(obj)/*.h) unwanted :=3D $(filter-out $(generic-y) $(generated-y),$(old-headers)) =20 quiet_cmd_wrap =3D WRAP $@ - cmd_wrap =3D echo "\#include " > $@ + cmd_wrap =3D \ + arch=3D$$(echo $@ | sed -n 's:.*arch/\([^/]*\)/.*:\1:p' | tr a-z A-Z); \ + upper=3D$$(echo $*.h | tr a-z A-Z | tr '/.' '__'); \ + printf "\#ifndef $${arch}_GENERIC_$${upper}\n" > $@.new; \ + printf "\#define $${arch}_GENERIC_$${upper}\n" >> $@.new; \ + printf "\#include \n" >> $@.new; \ + printf "\#endif /* $${arch}_GENERIC_$${upper} */\n" >> $@.new; \ + mv -f $@.new $@ =20 quiet_cmd_remove =3D REMOVE $(unwanted) cmd_remove =3D rm -f $(unwanted) --=20 2.25.1