summaryrefslogtreecommitdiffstats
path: root/hw/rdma/rdma_rm.c
diff options
context:
space:
mode:
authorSimran Singhal2020-04-02 08:50:35 +0200
committerStefan Hajnoczi2020-05-04 17:07:43 +0200
commit08b689aa6b521964b8275dd7a2564aefa5d68129 (patch)
treeca701fb56e5a97cdd654dc0c916d95bfd36d19f0 /hw/rdma/rdma_rm.c
parentlockable: replaced locks with lock guard macros where appropriate (diff)
downloadqemu-08b689aa6b521964b8275dd7a2564aefa5d68129.tar.gz
qemu-08b689aa6b521964b8275dd7a2564aefa5d68129.tar.xz
qemu-08b689aa6b521964b8275dd7a2564aefa5d68129.zip
lockable: Replace locks with lock guard macros
Replace manual lock()/unlock() calls with lock guard macros (QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD). Signed-off-by: Simran Singhal <singhalsimran0@gmail.com> Reviewed-by: Yuval Shaia <yuval.shaia.ml@gmail.com> Reviewed-by: Marcel Apfelbaum<marcel.apfelbaum@gmail.com> Tested-by: Yuval Shaia <yuval.shaia.ml@gmail.com> Message-id: 20200402065035.GA15477@simran-Inspiron-5558 Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/rdma/rdma_rm.c')
-rw-r--r--hw/rdma/rdma_rm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c
index 7e9ea283c9..60957f88db 100644
--- a/hw/rdma/rdma_rm.c
+++ b/hw/rdma/rdma_rm.c
@@ -147,14 +147,13 @@ static inline void rdma_res_tbl_dealloc(RdmaRmResTbl *tbl, uint32_t handle)
{
trace_rdma_res_tbl_dealloc(tbl->name, handle);
- qemu_mutex_lock(&tbl->lock);
+ QEMU_LOCK_GUARD(&tbl->lock);
if (handle < tbl->tbl_sz) {
clear_bit(handle, tbl->bitmap);
tbl->used--;
}
- qemu_mutex_unlock(&tbl->lock);
}
int rdma_rm_alloc_pd(RdmaDeviceResources *dev_res, RdmaBackendDev *backend_dev,