[ofa-general] [PATCH] ipoib: Bug fix in ipoib_poll - resend
Roland Dreier
rdreier at cisco.com
Tue Nov 27 07:32:06 PST 2007
> > > + if (unlikely(n < 1))
> > > + break;
> > >
> > > for (i = 0; i < n; i++) {
> > > struct ib_wc *wc = priv->ibwc + i;
>
> > The 'for' loop (followed by the "if (n != t) break" check)
> > should take care of this, isn't it?
>
> Oh you're saying that since this is signed arithmetic we should never
> enter the for loop. I saw a problem when I worked on some patch and that
> seemed to solve the problem...
What does signed arithmetic have to do with anything? I don't see how
your patch changes the behavior at all: if the condition (n < 1) ever
tests as true then the for loop cannot be entered, and since t is
always at least 1, the condition (n != t) will be true and we'll break
out of the while loop anyway.
- R.
More information about the general
mailing list