Re: [Xen-devel] [PATCH] x86/xen: Use DIV_ROUND_UP

2016-06-29 Thread David Vrabel
On 29/06/16 16:00, Amitoj Kaur Chawla wrote: > The kernel.h macro DIV_ROUND_UP performs the computation > (((n) + (d) - 1) /(d)) but is perhaps more readable. > > The Coccinelle script used to make this change is as follows: > @haskernel@ > @@ > > #include > > @depends on haskernel@ > expressio

Re: [Xen-devel] [PATCH] x86/xen: Use DIV_ROUND_UP

2016-06-29 Thread Juergen Gross
On 29/06/16 17:34, Jan Beulich wrote: On 29.06.16 at 17:00, wrote: >> --- a/arch/x86/xen/enlighten.c >> +++ b/arch/x86/xen/enlighten.c >> @@ -591,7 +591,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr) >> { >> unsigned long va = dtr->address; >> unsigned int size = dtr->si

Re: [Xen-devel] [PATCH] x86/xen: Use DIV_ROUND_UP

2016-06-29 Thread Jan Beulich
>>> On 29.06.16 at 17:00, wrote: > --- a/arch/x86/xen/enlighten.c > +++ b/arch/x86/xen/enlighten.c > @@ -591,7 +591,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr) > { > unsigned long va = dtr->address; > unsigned int size = dtr->size + 1; > - unsigned pages = (size + PA

[Xen-devel] [PATCH] x86/xen: Use DIV_ROUND_UP

2016-06-29 Thread Amitoj Kaur Chawla
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)) but is perhaps more readable. The Coccinelle script used to make this change is as follows: @haskernel@ @@ #include @depends on haskernel@ expression n,d; @@ ( - (n + d - 1) / d + DIV_ROUND_UP(n,d) | - (n + (d - 1)