From: "Jan Beulich" Subject: Re: [PATCH v6 3/4] xen: iommu: Define PAGE_{SHIFT, SIZE, ALIGN, MASK)_64K Date: Thu, 15 May 2014 14:20:49 +0100 Message-ID: <5374DB510200007800012AEB@mail.emea.novell.com> References: <1400158608-9617-1-git-send-email-julien.grall@linaro.org> <1400158608-9617-4-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wkvag-0007Nr-Hx for xen-devel@lists.xenproject.org; Thu, 15 May 2014 13:20:54 +0000 In-Reply-To: <1400158608-9617-4-git-send-email-julien.grall@linaro.org> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com, ian.campbell@citrix.com, Xiantao Zhang , tim@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 15.05.14 at 14:56, wrote: > Also add IOMMU_PAGE_* helper macros to help creating PAGE_* defines. > > Signed-off-by: Julien Grall Acked-by: Jan Beulich with a small nit: > #define PAGE_SHIFT_4K (12) > -#define PAGE_SIZE_4K (1UL << PAGE_SHIFT_4K) > -#define PAGE_MASK_4K (((u64)-1) << PAGE_SHIFT_4K) > -#define PAGE_ALIGN_4K(addr) (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K) > +#define PAGE_SIZE_4K IOMMU_PAGE_SIZE(4K) > +#define PAGE_MASK_4K IOMMU_PAGE_MASK(4K) > +#define PAGE_ALIGN_4K(addr) IOMMU_PAGE_ALIGN(4K, (addr)) Pointless parentheses around addr. > +#define PAGE_SHIFT_64K (16) > +#define PAGE_SIZE_64K IOMMU_PAGE_SIZE(64K) > +#define PAGE_MASK_64K IOMMU_PAGE_MASK(64K) > +#define PAGE_ALIGN_64K(addr) IOMMU_PAGE_ALIGN(64K, (addr)) Same here. Jan