[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v10 01/11] x86/hvm/ioreq: maintain an array of ioreq servers rather than a list



>>> On 10.10.17 at 18:31, <paul.durrant@xxxxxxxxxx> wrote:
> --- a/xen/arch/x86/hvm/ioreq.c
> +++ b/xen/arch/x86/hvm/ioreq.c
> @@ -33,6 +33,37 @@
>  
>  #include <public/hvm/ioreq.h>
>  
> +static void set_ioreq_server(struct domain *d, unsigned int id,
> +                             struct hvm_ioreq_server *s)
> +{
> +    ASSERT(id < MAX_NR_IOREQ_SERVERS);
> +    ASSERT(!s || !d->arch.hvm_domain.ioreq_server.server[id]);
> +
> +    d->arch.hvm_domain.ioreq_server.server[id] = s;
> +}
> +
> +#define GET_IOREQ_SERVER(d, id) \
> +    (d)->arch.hvm_domain.ioreq_server.server[id]
> +
> +static struct hvm_ioreq_server *get_ioreq_server(const struct domain *d,
> +                                                 unsigned int id)
> +{
> +    if ( id >= MAX_NR_IOREQ_SERVERS )
> +        return NULL;
> +
> +    return GET_IOREQ_SERVER(d, id);
> +}
> +
> +#define IS_DEFAULT(s) \
> +    ((s) && (s) == get_ioreq_server((s)->domain, DEFAULT_IOSERVID))

Any reason not to use GET_IOREQ_SERVER() here?

> +/* Iterate over all possible ioreq servers */
> +#define FOR_EACH_IOREQ_SERVER(d, id, s) \
> +    for ( (id) = 0; (id) < MAX_NR_IOREQ_SERVERS; (id)++ ) \
> +        if ( !(s = GET_IOREQ_SERVER((d), (id))) ) \

The two pairs of innermost parentheses are pointless here.

With the first one at least explained and the second one taken
care of (easily doable at commit time)
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.