Re: [Xen-devel] [PATCH v4 08/34] vmap: Make the while loop less fishy.

2016-03-21 Thread Jan Beulich
>>> On 21.03.16 at 15:22, wrote: > Or to take a different tack: I understand that you don't think there's > no particular benefit to adding a comment in cases like this; could > you explain to me why you think it would have a significant cost? There's no significant cost here. Yet I do think that

Re: [Xen-devel] [PATCH v4 08/34] vmap: Make the while loop less fishy.

2016-03-21 Thread George Dunlap
On Mon, Mar 21, 2016 at 1:26 PM, Jan Beulich wrote: On 21.03.16 at 13:04, wrote: >> On Thu, Mar 17, 2016 at 4:08 PM, Ian Jackson >> wrote: >>> Konrad Rzeszutek Wilk writes ("[PATCH v4 08/34] vmap: Make the while loop >>> less fishy."): error: -while ( i-- ) -f

Re: [Xen-devel] [PATCH v4 08/34] vmap: Make the while loop less fishy.

2016-03-21 Thread Jan Beulich
>>> On 21.03.16 at 13:04, wrote: > On Thu, Mar 17, 2016 at 4:08 PM, Ian Jackson > wrote: >> Konrad Rzeszutek Wilk writes ("[PATCH v4 08/34] vmap: Make the while loop >> less fishy."): >>> error: >>> -while ( i-- ) >>> -free_domheap_page(mfn_to_page(mfn_x(mfn[i]))); >>> +while

Re: [Xen-devel] [PATCH v4 08/34] vmap: Make the while loop less fishy.

2016-03-21 Thread George Dunlap
On Thu, Mar 17, 2016 at 4:08 PM, Ian Jackson wrote: > Konrad Rzeszutek Wilk writes ("[PATCH v4 08/34] vmap: Make the while loop > less fishy."): >> error: >> -while ( i-- ) >> -free_domheap_page(mfn_to_page(mfn_x(mfn[i]))); >> +while ( i ) >> +free_domheap_page(mfn_to_pa

Re: [Xen-devel] [PATCH v4 08/34] vmap: Make the while loop less fishy.

2016-03-19 Thread Ian Jackson
Konrad Rzeszutek Wilk writes ("[PATCH v4 08/34] vmap: Make the while loop less fishy."): > error: > -while ( i-- ) > -free_domheap_page(mfn_to_page(mfn_x(mfn[i]))); > +while ( i ) > +free_domheap_page(mfn_to_page(mfn_x(mfn[--i]))); I quite strongly dislike this. It is g

Re: [Xen-devel] [PATCH v4 08/34] vmap: Make the while loop less fishy.

2016-03-19 Thread Jan Beulich
>>> On 17.03.16 at 15:37, wrote: > On 17/03/16 11:49, Jan Beulich wrote: > On 15.03.16 at 20:33, wrote: >>> On 15/03/16 17:56, Konrad Rzeszutek Wilk wrote: It looks like it could underflow at first glance. That is if i is zero and you get in the while loop with the i--. However

Re: [Xen-devel] [PATCH v4 08/34] vmap: Make the while loop less fishy.

2016-03-19 Thread Jan Beulich
>>> On 15.03.16 at 20:33, wrote: > On 15/03/16 17:56, Konrad Rzeszutek Wilk wrote: >> It looks like it could underflow at first glance. That is >> if i is zero and you get in the while loop with the >> i--. However the postfix expression is evaluated after the >> conditional so the loop is fine an

Re: [Xen-devel] [PATCH v4 08/34] vmap: Make the while loop less fishy.

2016-03-19 Thread Andrew Cooper
On 17/03/16 11:49, Jan Beulich wrote: On 15.03.16 at 20:33, wrote: >> On 15/03/16 17:56, Konrad Rzeszutek Wilk wrote: >>> It looks like it could underflow at first glance. That is >>> if i is zero and you get in the while loop with the >>> i--. However the postfix expression is evaluated afte

Re: [Xen-devel] [PATCH v4 08/34] vmap: Make the while loop less fishy.

2016-03-19 Thread Jan Beulich
>>> On 15.03.16 at 18:56, wrote: > It looks like it could underflow at first glance. That is > if i is zero and you get in the while loop with the > i--. However the postfix expression is evaluated after the > conditional so the loop is fine and won't execute (with i==0). I don't think this is th

Re: [Xen-devel] [PATCH v4 08/34] vmap: Make the while loop less fishy.

2016-03-18 Thread Ian Jackson
Jan Beulich writes ("Re: [Xen-devel] [PATCH v4 08/34] vmap: Make the while loop less fishy."): > On 17.03.16 at 15:37, wrote: > > 213 error: > > CID 63648: Overflowed constant (INTEGER_OVERFLOW) > > 7. overflow_const: Decrement (--) operation ov

Re: [Xen-devel] [PATCH v4 08/34] vmap: Make the while loop less fishy.

2016-03-15 Thread Andrew Cooper
On 15/03/16 17:56, Konrad Rzeszutek Wilk wrote: > It looks like it could underflow at first glance. That is > if i is zero and you get in the while loop with the > i--. However the postfix expression is evaluated after the > conditional so the loop is fine and won't execute (with i==0). > > However