From e46be66d798ee8c31f7737685ec17f1e02272ab8 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 4 Sep 2012 00:02:17 +0000 Subject: [PATCH] scst_main: Convert a goto statement into a loop Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4504 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 1c40ffac3..ddcd82d60 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -442,12 +442,12 @@ void scst_unregister_target_template(struct scst_tgt_template *vtt) } #endif -restart: - list_for_each_entry(tgt, &vtt->tgt_list, tgt_list_entry) { + while (!list_empty(&vtt->tgt_list)) { + tgt = list_first_entry(&vtt->tgt_list, typeof(*tgt), + tgt_list_entry); mutex_unlock(&scst_mutex); scst_unregister_target(tgt); mutex_lock(&scst_mutex); - goto restart; } mutex_unlock(&scst_mutex);