RDMA/uverbs: Factor out the add/get pattern into a helper
authorJason Gunthorpe <jgg@mellanox.com>
Mon, 12 Nov 2018 20:59:51 +0000 (22:59 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 22 Nov 2018 18:57:32 +0000 (11:57 -0700)
commitc27f6aa8c9df7f3270d5f5f2957a2a024262eb99
tree086324fd179a7bf19bf1027a69b66dff4d48f328
parent0cbf432db405289216747a8d31d74bab2452337c
RDMA/uverbs: Factor out the add/get pattern into a helper

The next patch needs another copy of this, provide a simple helper to
reduce the coding. uapi_add_get_elm() returns an existing entry or adds a
new one.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/infiniband/core/uverbs_uapi.c