Re: [PATCH 2/6] fs/direct-io.c: Use DIV_ROUND_UP

2008-02-14 Thread Nishanth Aravamudan
On 14.02.2008 [23:16:44 +0100], Mariusz Kozlowski wrote: > Hello, > > > > > Is it just me, or does > > > > > > > > ((user_addr + iov[seg].iov_len + PAGE_SIZE - 1)/PAGE_SIZE - > > > > user_addr/PAGE_SIZE) > > > > > > > > not simplify to > > > > > > > > = ((iov[seg].iov_len + PAGE

Re: [PATCH 2/6] fs/direct-io.c: Use DIV_ROUND_UP

2008-02-14 Thread Mariusz Kozlowski
Hello, > > > Is it just me, or does > > > > > > ((user_addr + iov[seg].iov_len + PAGE_SIZE - 1)/PAGE_SIZE - > > > user_addr/PAGE_SIZE) > > > > > > not simplify to > > > > > > = ((iov[seg].iov_len + PAGE_SIZE - 1)/PAGE_SIZE + > > > user_addr/PAGE_SIZE - user_addr/PAGE_SIZE) > >

Re: [PATCH 2/6] fs/direct-io.c: Use DIV_ROUND_UP

2008-02-14 Thread Julia Lawall
On Thu, 14 Feb 2008, Pekka Enberg wrote: > Hi Nishanth, > > On Thu, Feb 14, 2008 at 7:38 PM, Nishanth Aravamudan <[EMAIL PROTECTED]> > wrote: > > Is it just me, or does > > > > ((user_addr + iov[seg].iov_len + PAGE_SIZE - 1)/PAGE_SIZE - > > user_addr/PAGE_SIZE) > > > > not simplify to

Re: [PATCH 2/6] fs/direct-io.c: Use DIV_ROUND_UP

2008-02-14 Thread Pekka Enberg
Hi Nishanth, On Thu, Feb 14, 2008 at 7:38 PM, Nishanth Aravamudan <[EMAIL PROTECTED]> wrote: > Is it just me, or does > > ((user_addr + iov[seg].iov_len + PAGE_SIZE - 1)/PAGE_SIZE - > user_addr/PAGE_SIZE) > > not simplify to > > = ((iov[seg].iov_len + PAGE_SIZE - 1)/PAGE_SIZE +

Re: [PATCH 2/6] fs/direct-io.c: Use DIV_ROUND_UP

2008-02-14 Thread Nishanth Aravamudan
On 14.02.2008 [16:14:33 +0100], Julia Lawall wrote: > From: Julia Lawall <[EMAIL PROTECTED]> > > The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / > (d)) but is perhaps more readable. > > An extract of the semantic patch that makes this change is as follows: > (http://ww

Re: [PATCH 2/6] fs/direct-io.c: Use DIV_ROUND_UP

2008-02-14 Thread Zach Brown
Julia Lawall wrote: > From: Julia Lawall <[EMAIL PROTECTED]> > > The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / > (d)) but is perhaps more readable. It certainly looks better to me, thanks for doing this. > Signed-off-by: Julia Lawall <[EMAIL PROTECTED]> Acked-By: Z

[PATCH 2/6] fs/direct-io.c: Use DIV_ROUND_UP

2008-02-14 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #include @depe