aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/uverbs_main.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2020-01-08 19:21:58 +0200
committerJason Gunthorpe <jgg@mellanox.com>2020-01-13 16:20:15 -0400
commit5bd48c18c8cea0154800b40ec75201fa71684312 (patch)
tree21bcf3edbc6ceaf64476a570c8747229a9811b0c /drivers/infiniband/core/uverbs_main.c
parentRDMA/core: Make ib_ucq_object use ib_uevent_object (diff)
downloadlinux-dev-5bd48c18c8cea0154800b40ec75201fa71684312.tar.xz
linux-dev-5bd48c18c8cea0154800b40ec75201fa71684312.zip
RDMA/core: Do not erase the type of ib_cq.uobject
This is a struct ib_ucq_object pointer, instead of using container_of() all over the place just store it with its actual type. Link: https://lore.kernel.org/r/1578504126-9400-7-git-send-email-yishaih@mellanox.com Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/core/uverbs_main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 940bb291a57d..2849bf40bc97 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -408,9 +408,9 @@ void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq_context)
return;
}
- uobj = container_of(cq->uobject, struct ib_ucq_object, uevent.uobject);
+ uobj = cq->uobject;
- entry->desc.comp.cq_handle = cq->uobject->user_handle;
+ entry->desc.comp.cq_handle = cq->uobject->uevent.uobject.user_handle;
entry->counter = &uobj->comp_events_reported;
list_add_tail(&entry->list, &ev_queue->event_list);
@@ -457,8 +457,7 @@ static void ib_uverbs_async_handler(struct ib_uverbs_file *file,
void ib_uverbs_cq_event_handler(struct ib_event *event, void *context_ptr)
{
- struct ib_uevent_object *uobj = container_of(
- event->element.cq->uobject, struct ib_uevent_object, uobject);
+ struct ib_uevent_object *uobj = &event->element.cq->uobject->uevent;
ib_uverbs_async_handler(uobj->uobject.ufile, uobj->uobject.user_handle,
event->event, &uobj->event_list,