Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A2250C433F5 for ; Thu, 31 Mar 2022 10:35:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.296877.505505 (Exim 4.92) (envelope-from ) id 1nZs8o-0005fL-O7; Thu, 31 Mar 2022 10:34:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 296877.505505; Thu, 31 Mar 2022 10:34:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nZs8o-0005fE-L1; Thu, 31 Mar 2022 10:34:58 +0000 Received: by outflank-mailman (input) for mailman id 296877; Thu, 31 Mar 2022 10:34:57 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nZs8m-0005f6-W1 for xen-devel@lists.xenproject.org; Thu, 31 Mar 2022 10:34:56 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nZs8m-0003J3-1G; Thu, 31 Mar 2022 10:34:56 +0000 Received: from 54-240-197-228.amazon.com ([54.240.197.228] helo=[10.7.236.30]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nZs8l-0005pa-QD; Thu, 31 Mar 2022 10:34:55 +0000 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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=At4KFQTq80hBpXxj+/tmnjXriuHD/1WNosfxyjpkoNs=; b=RC+7wU9bKlstm4sBDwDHF0INeY s+sEdBeyXnveauoFCw67aQU2Ss+ip4g1M8soEb+HWVAIAL5ru5f7s7wfjpdN/muYmQ0RxE9+btPbh FVYZemL8SKa7iF/cG5bGuRp57KfCUBC1QJciSOl9ra4EcSFIXgBdjp/m829+jCJaDudw=; Message-ID: <5a5db691-4add-17fa-3cc6-1eda8d24753e@xen.org> Date: Thu, 31 Mar 2022 11:34:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v4 3/4] include: move STR() and IS_ALIGNED() To: Jan Beulich , "xen-devel@lists.xenproject.org" Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , Andrew Cooper , George Dunlap , Stefano Stabellini , Wei Liu , Bertrand Marquis References: <6e540bc9-c536-84ac-fb1c-8271e7731b3e@suse.com> <9a0cf101-17fa-cad2-e791-15d8d8cc5b79@suse.com> From: Julien Grall In-Reply-To: <9a0cf101-17fa-cad2-e791-15d8d8cc5b79@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Jan, On 31/03/2022 10:31, Jan Beulich wrote: > lib.h is imo a better fit for them than config.h. > > Signed-off-by: Jan Beulich Reviewed-by: Julien Grall Cheers, > --- > v4: New. > --- > Originally I thought I'd also move KB() etc, but they're used in places > where yet further adjustments (adding of #include) would be necessary. > > --- a/xen/arch/arm/xen.lds.S > +++ b/xen/arch/arm/xen.lds.S > @@ -3,6 +3,7 @@ > /* Modified for ARM Xen by Ian Campbell */ > > #include > +#include > #include > #undef ENTRY > #undef ALIGN > --- a/xen/arch/x86/xen.lds.S > +++ b/xen/arch/x86/xen.lds.S > @@ -2,6 +2,7 @@ > /* Modified for i386/x86-64 Xen by Keir Fraser */ > > #include > +#include > #include > #undef ENTRY > #undef ALIGN > --- a/xen/include/xen/config.h > +++ b/xen/include/xen/config.h > @@ -82,11 +82,6 @@ > #define MB(_mb) (_AC(_mb, ULL) << 20) > #define GB(_gb) (_AC(_gb, ULL) << 30) > > -#define IS_ALIGNED(val, align) (((val) & ((align) - 1)) == 0) > - > -#define __STR(...) #__VA_ARGS__ > -#define STR(...) __STR(__VA_ARGS__) > - > /* allow existing code to work with Kconfig variable */ > #define NR_CPUS CONFIG_NR_CPUS > > --- a/xen/include/xen/lib.h > +++ b/xen/include/xen/lib.h > @@ -3,6 +3,8 @@ > > #define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1)) > > +#define IS_ALIGNED(val, align) (!((val) & ((align) - 1))) > + > #define DIV_ROUND(n, d) (((n) + (d) / 2) / (d)) > #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) > > @@ -17,6 +19,9 @@ > #define PASTE_(a, b) a ## b > #define PASTE(a, b) PASTE_(a, b) > > +#define __STR(...) #__VA_ARGS__ > +#define STR(...) __STR(__VA_ARGS__) > + > #ifndef __ASSEMBLY__ > > #include > -- Julien Grall