[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/3] x86/mm: Use IS_ALIGNED() rather than open coding it



On 14/10/16 17:02, Andrew Cooper wrote:
> Drop repeated identical BUILD_BUG_ON()'s
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
> ---
>  xen/arch/x86/x86_64/mm.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
> index b8b6b70..0083beb 100644
> --- a/xen/arch/x86/x86_64/mm.c
> +++ b/xen/arch/x86/x86_64/mm.c
> @@ -540,7 +540,7 @@ void __init paging_init(void)
>                   sizeof(*machine_to_phys_mapping));
>      for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
>      {
> -        BUILD_BUG_ON(RO_MPT_VIRT_START & ((1UL << L3_PAGETABLE_SHIFT) - 1));
> +        BUILD_BUG_ON(!IS_ALIGNED(RO_MPT_VIRT_START, L3_PAGETABLE_SHIFT));

This doesn't look right.  This is what I have for IS_ALIGNED (in
xen/include/xen/config.h):

#define IS_ALIGNED(val, align) (((val) & ((align) - 1)) == 0)

There's no shift in the #define, but you've taken it out of the calling
code.

Did I miss something?

 -George



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.