On Fri, Sep 20, 2019 at 01:15:06PM +0200, Jan Beulich wrote:
> On 03.09.2019 18:14, Roger Pau Monne wrote:
> > @@ -821,6 +851,9 @@ int hvm_create_ioreq_server(struct domain *d, int 
> > bufioreq_handling,
> >      if ( i >= MAX_NR_IOREQ_SERVERS )
> >          goto fail;
> >  
> > +    ASSERT((internal &&
> > +            i >= MAX_NR_EXTERNAL_IOREQ_SERVERS && i < 
> > MAX_NR_IOREQ_SERVERS) ||
> > +           (!internal && i < MAX_NR_EXTERNAL_IOREQ_SERVERS));
> 
> Perhaps easier to read both here and in the event the assertion
> would actually trigger as either
> 
>     ASSERT(internal
>            ? i >= MAX_NR_EXTERNAL_IOREQ_SERVERS && i < MAX_NR_IOREQ_SERVERS
>            : i < MAX_NR_EXTERNAL_IOREQ_SERVERS);
> 
> or even
> 
>     ASSERT(i < MAX_NR_EXTERNAL_IOREQ_SERVERS
>            ? !internal
>            : internal && i < MAX_NR_IOREQ_SERVERS);
> 
> ?

I went with the last variation of your proposed ASSERT.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to