From 4834b768d59f9e45d8c03c8580a72aded592a58b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 5 Dec 2014 10:33:22 +0000 Subject: [PATCH] scst: Clean up __scst_resume_activity() (merge r5589 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5918 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 3baead81b..858d39f0f 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -1051,6 +1051,7 @@ EXPORT_SYMBOL_GPL(scst_suspend_activity); static void __scst_resume_activity(void) { struct scst_cmd_threads *l; + struct scst_mgmt_cmd *m; TRACE_ENTRY(); @@ -1077,15 +1078,14 @@ static void __scst_resume_activity(void) wake_up_all(&scst_init_cmd_list_waitQ); spin_lock_irq(&scst_mcmd_lock); - if (!list_empty(&scst_delayed_mgmt_cmd_list)) { - struct scst_mgmt_cmd *m; - m = list_first_entry(&scst_delayed_mgmt_cmd_list, typeof(*m), - mgmt_cmd_list_entry); + list_for_each_entry(m, &scst_delayed_mgmt_cmd_list, + mgmt_cmd_list_entry) { TRACE_MGMT_DBG("Moving delayed mgmt cmd %p to head of active " "mgmt cmd list", m); - list_move(&m->mgmt_cmd_list_entry, &scst_active_mgmt_cmd_list); } + list_splice(&scst_delayed_mgmt_cmd_list, &scst_active_mgmt_cmd_list); spin_unlock_irq(&scst_mcmd_lock); + wake_up_all(&scst_mgmt_cmd_list_waitQ); out: