public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Will Schmidt <will_schmidt@vnet.ibm.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>,
	cbe-oss-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read
Date: Tue, 24 Oct 2006 14:53:22 -0500	[thread overview]
Message-ID: <1161719603.8946.84.camel@farscape> (raw)
In-Reply-To: <200610242107.44115.arnd@arndb.de>

On Tue, 2006-24-10 at 21:07 +0200, Arnd Bergmann wrote:
> On Tuesday 24 October 2006 20:42, Pekka Enberg wrote:
> > On 10/24/06, Arnd Bergmann <arnd@arndb.de> wrote:
> > >         spu_acquire(ctx);
> > > -       for (count = 0; count <= len; count += 4, udata++) {
> > > +       for (count = 0; (count + 4) <= len; count += 4, udata++) {
> >
> > Wouldn't this be more obvious as
> >
> >   for (count = 0, count < (len / 4); count++, udata++) {
> >
> > And then do count * 4 if you need the actual index somewhere. Hmm?
> 
> Count is the return value from a write() file operation. I find it
> more readable to update that every time I do one put_user(), to
> the exact value, than calculating the return code later.

Hey Arnd, 
   just curiosity..   What was the behavior before this patch?   just
leaving a few (0 - 3) characters behind?


> 
> 	Arnd <>< 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev


  reply	other threads:[~2006-10-24 19:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-24 16:01 [PATCH 0/3] cell fixes 2.6.19 Arnd Bergmann
2006-10-24 16:01 ` [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read Arnd Bergmann
2006-10-24 18:42   ` Pekka Enberg
2006-10-24 19:07     ` Arnd Bergmann
2006-10-24 19:53       ` Will Schmidt [this message]
2006-10-24 19:58         ` Arnd Bergmann
2006-10-24 16:01 ` [PATCH 3/3] cell: update defconfig Arnd Bergmann
2006-10-24 16:27 ` [PATCH 1/3] spufs: fix signal2 file to report signal2 Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1161719603.8946.84.camel@farscape \
    --to=will_schmidt@vnet.ibm.com \
    --cc=arnd@arndb.de \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=penberg@cs.helsinki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox