lkml.org 
[lkml]   [2006]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read
Hi Arnd,

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?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-10-24 20:45    [W:0.039 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site