From 331d00ba745cf7c97c1e35c3c2129d8bb6315a51 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Tue, 21 Mar 2017 09:24:07 +0000 Subject: [PATCH] Minor cosmetic addition to r315673. Now CAM_SIM_LOCK() macros are not used and may be removed later. MFC after: 2 weeks --- sys/cam/cam_xpt.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 7d86129f04d4..6be86ce65b80 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -4241,7 +4241,7 @@ xpt_async_bcast(struct async_list *async_head, struct cam_path *path, void *async_arg) { struct async_node *cur_entry; - int lock; + struct mtx *mtx; cur_entry = SLIST_FIRST(async_head); while (cur_entry != NULL) { @@ -4253,14 +4253,15 @@ xpt_async_bcast(struct async_list *async_head, */ next_entry = SLIST_NEXT(cur_entry, links); if ((cur_entry->event_enable & async_code) != 0) { - lock = cur_entry->event_lock; - if (lock) - CAM_SIM_LOCK(path->device->sim); + mtx = cur_entry->event_lock ? + path->device->sim->mtx : NULL; + if (mtx) + mtx_lock(mtx); cur_entry->callback(cur_entry->callback_arg, async_code, path, async_arg); - if (lock) - CAM_SIM_UNLOCK(path->device->sim); + if (mtx) + mtx_unlock(mtx); } cur_entry = next_entry; }