OSDN Git Service

IB/rxe: Refactor lookup memory function
authorParav Pandit <parav@mellanox.com>
Mon, 27 Aug 2018 05:44:17 +0000 (08:44 +0300)
committerDoug Ledford <dledford@redhat.com>
Thu, 30 Aug 2018 20:31:50 +0000 (16:31 -0400)
commit1703129ed2c12c112889f471bddf242012791b47
tree9a4eaa2516e4aa44593c2b1c6acd48590232c24b
parent536a631d1ec1de6ed51453954407068c10473eea
IB/rxe: Refactor lookup memory function

Consolidate all error checks under single if() condition and use helper
unlikely() macro for them, in addition drop unneeded goto labels.

rxe_pool_get_index() already provides RB tree based efficient lookup.
Avoid doing extra checks for error cases which are rare and already
covered by rxe_pool_get_index().

Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rxe/rxe_mr.c