diff options
author | Simran Singhal <singhalsimran0@gmail.com> | 2020-04-02 12:20:35 +0530 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2020-05-04 16:07:43 +0100 |
commit | 08b689aa6b521964b8275dd7a2564aefa5d68129 (patch) | |
tree | ca701fb56e5a97cdd654dc0c916d95bfd36d19f0 /hw/rdma/rdma_rm.c | |
parent | 6e8a355de6c4d32e9df336cdafb009cd78262836 (diff) |
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.c | 3 |
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, |