Commit 9b8efc02 authored by Roland Dreier's avatar Roland Dreier

IB/uverbs: Remove unnecessary list_del()s

In ib_uverbs_cleanup_ucontext(), when iterating through the lists of
objects, there's no reason to do list_del() to remove the objects,
since both the objects and the lists that contain them are about to be
freed anyway.  Since list_del() is a moderately big inline function,
getting rid of this extra work saves quite a bit of .text:

add/remove: 0/0 grow/shrink: 1/2 up/down: 3/-217 (-214)
function                                     old     new   delta
ib_uverbs_comp_handler                       225     228      +3
ib_uverbs_async_handler                      256     255      -1
ib_uverbs_close                              905     689    -216
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 18320828
...@@ -188,7 +188,6 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file, ...@@ -188,7 +188,6 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
idr_remove_uobj(&ib_uverbs_ah_idr, uobj); idr_remove_uobj(&ib_uverbs_ah_idr, uobj);
ib_destroy_ah(ah); ib_destroy_ah(ah);
list_del(&uobj->list);
kfree(uobj); kfree(uobj);
} }
...@@ -200,7 +199,6 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file, ...@@ -200,7 +199,6 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
idr_remove_uobj(&ib_uverbs_qp_idr, uobj); idr_remove_uobj(&ib_uverbs_qp_idr, uobj);
ib_uverbs_detach_umcast(qp, uqp); ib_uverbs_detach_umcast(qp, uqp);
ib_destroy_qp(qp); ib_destroy_qp(qp);
list_del(&uobj->list);
ib_uverbs_release_uevent(file, &uqp->uevent); ib_uverbs_release_uevent(file, &uqp->uevent);
kfree(uqp); kfree(uqp);
} }
...@@ -213,7 +211,6 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file, ...@@ -213,7 +211,6 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
idr_remove_uobj(&ib_uverbs_cq_idr, uobj); idr_remove_uobj(&ib_uverbs_cq_idr, uobj);
ib_destroy_cq(cq); ib_destroy_cq(cq);
list_del(&uobj->list);
ib_uverbs_release_ucq(file, ev_file, ucq); ib_uverbs_release_ucq(file, ev_file, ucq);
kfree(ucq); kfree(ucq);
} }
...@@ -225,7 +222,6 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file, ...@@ -225,7 +222,6 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
idr_remove_uobj(&ib_uverbs_srq_idr, uobj); idr_remove_uobj(&ib_uverbs_srq_idr, uobj);
ib_destroy_srq(srq); ib_destroy_srq(srq);
list_del(&uobj->list);
ib_uverbs_release_uevent(file, uevent); ib_uverbs_release_uevent(file, uevent);
kfree(uevent); kfree(uevent);
} }
...@@ -243,7 +239,6 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file, ...@@ -243,7 +239,6 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
memobj = container_of(uobj, struct ib_umem_object, uobject); memobj = container_of(uobj, struct ib_umem_object, uobject);
ib_umem_release_on_close(mrdev, &memobj->umem); ib_umem_release_on_close(mrdev, &memobj->umem);
list_del(&uobj->list);
kfree(memobj); kfree(memobj);
} }
...@@ -252,7 +247,6 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file, ...@@ -252,7 +247,6 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
idr_remove_uobj(&ib_uverbs_pd_idr, uobj); idr_remove_uobj(&ib_uverbs_pd_idr, uobj);
ib_dealloc_pd(pd); ib_dealloc_pd(pd);
list_del(&uobj->list);
kfree(uobj); kfree(uobj);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment