On Tue, May 22, 2018 at 04:05:41PM -0600, Jason Gunthorpe wrote: > On Tue, May 15, 2018 at 05:09:41PM +0300, Leon Romanovsky wrote: > > > +static int uverbs_free_counters(struct ib_uobject *uobject, > > + enum rdma_remove_reason why) > > +{ > > + struct ib_counters *counters = > > + (struct ib_counters *)(uobject->object); > > No casts from void *. > > > +static int UVERBS_HANDLER(UVERBS_METHOD_COUNTERS_CREATE)(struct ib_device *ib_dev, > > + struct ib_uverbs_file *file, > > + struct uverbs_attr_bundle *attrs) > > +{ > > + const struct uverbs_attr *uattr; > > + struct ib_counters *counters; > > + struct ib_uobject *uobj; > > + int ret; > > + > > + if (!ib_dev->create_counters) > > + return -EOPNOTSUPP; > > The methods shouldn't even exist in the parse tree if the function > pointer is not present - we have systematically made this mistake in > the new uapi, and it needs more infrastructure to fix, so we can leave > it here for now.. But noting it to help not forget.. > > > + uattr = uverbs_attr_get(attrs, UVERBS_ATTR_CREATE_COUNTERS_HANDLE); > > + uobj = uattr->obj_attr.uobject; > > Would prefer to see this patch as part of this series: > > https://patchwork.kernel.org/patch/10401247/ > > And the above to use it, as we are going to forget to do this conversion. > > > +DECLARE_UVERBS_NAMED_OBJECT(UVERBS_OBJECT_COUNTERS, > > + &UVERBS_TYPE_ALLOC_IDR(uverbs_free_counters), > > + &UVERBS_METHOD(UVERBS_METHOD_COUNTERS_CREATE), > > + &UVERBS_METHOD(UVERBS_METHOD_COUNTERS_DESTROY)); > > And this doesn't compile out of sequence with the devx patches, is '0' > the right ordering level for counters? It needed DevX patches where we did cleanup in some macros. > > Jason
Attachment:
signature.asc
Description: PGP signature