Thread (8 messages) 8 messages, 3 authors, 2006-10-24

Re: [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read

From: Pekka Enberg <hidden>
Date: 2006-10-24 18:42:32
Also in: lkml

Hi Arnd,

On 10/24/06, Arnd Bergmann [off-list ref] 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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help