[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 14/25] argo: implement the unregister op
>>> On 01.12.18 at 02:32, <christopher.w.clark@xxxxxxxxx> wrote: > --- a/xen/common/argo.c > +++ b/xen/common/argo.c > @@ -510,6 +510,59 @@ argo_ring_find_info(const struct domain *d, const struct > argo_ring_id *id) > } > > static long > +argo_unregister_ring(struct domain *d, > + XEN_GUEST_HANDLE_PARAM(argo_ring_t) ring_hnd) > +{ > + struct argo_ring ring; > + struct argo_ring_info *ring_info; > + int ret = 0; > + > + read_lock(&argo_lock); > + > + do { > + if ( !d->argo ) > + { > + ret = -ENODEV; > + break; > + } > + > + ret = copy_from_guest_errno(&ring, ring_hnd, 1); > + if ( ret ) > + break; > + > + if ( ring.magic != ARGO_RING_MAGIC ) > + { > + argo_dprintk( > + "ring.magic(%"PRIx64") != ARGO_RING_MAGIC(%llx), EINVAL\n", > + ring.magic, ARGO_RING_MAGIC); > + ret = -EINVAL; > + break; > + } > + > + ring.id.addr.domain_id = d->domain_id; Why the override? > + write_lock(&d->argo->lock); > + > + ring_info = argo_ring_find_info(d, &ring.id); > + if ( ring_info ) > + argo_ring_remove_info(d, ring_info); > + > + write_unlock(&d->argo->lock); > + > + if ( !ring_info ) > + { > + argo_dprintk("ENOENT\n"); > + ret = -ENOENT; > + break; > + } > + > + } while ( 0 ); > + > + read_unlock(&argo_lock); > + return ret; > +} Blank line ahead of the main return statement of a function please. Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |