[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6bc632150804181101i701f220an20dddf54389be273@mail.gmail.com>
Date: Fri, 18 Apr 2008 23:31:29 +0530
From: "pradeep singh rautela" <rautelap@...il.com>
To: "Ray Lee" <ray-lk@...rabbit.org>
Cc: "Rusty Russell" <rusty@...tcorp.com.au>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
"Max Krasnyansky" <maxk@...lcomm.com>,
virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH 5/5] tun: vringfd xmit support.
On Fri, Apr 18, 2008 at 7:55 PM, Ray Lee <ray-lk@...rabbit.org> wrote:
> On Fri, Apr 18, 2008 at 4:46 AM, pradeep singh rautela
> <rautelap@...il.com> wrote:
> >
> > On Fri, Apr 18, 2008 at 10:13 AM, Rusty Russell <rusty@...tcorp.com.au> wrote:
>
> > > + /* How many pages will this take? */
> > > + npages = 1 + (base + len - 1)/PAGE_SIZE - base/PAGE_SIZE;
> >
> > Hi Rusty,
> > A trivial suggestion, how about
> > npages = 1+(len -1)/PAGE_SIZE ?
>
> That's not the same. In particular, his version accounts for the
> fractional page at the beginning, while yours doesn't.
Oh thanks for correcting me Ray. :)
>
> While it's tempting to use algebra to simplify things, it's not safe
> to do so when the expression involves division over the integers. The
> only care-free integer math in a computer is subtraction and ++.
I stand corrected.
Sorry for noise.
Thanks,
--
Pradeep Singh Rautela
http://eagain.wordpress.com
http://emptydomain.googlepages.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists