scst: Convert a loop to keep smatch happy

Avoid that smatch reports the following warning:
scst_init_session() info: loop could be replaced with if statement.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5613 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2014-06-20 04:00:41 +00:00
parent e902f79ecf
commit 18e4fb0c83

View File

@@ -7025,7 +7025,7 @@ restart:
static int scst_init_session(struct scst_session *sess)
{
int res = 0;
struct scst_cmd *cmd;
struct scst_cmd *cmd, *cmd_tmp;
struct scst_mgmt_cmd *mcmd, *tm;
int mwake = 0;
@@ -7096,16 +7096,14 @@ failed:
else
sess->init_phase = SCST_SESS_IPH_FAILED;
restart:
list_for_each_entry(cmd, &sess->init_deferred_cmd_list,
cmd_list_entry) {
list_for_each_entry_safe(cmd, cmd_tmp, &sess->init_deferred_cmd_list,
cmd_list_entry) {
TRACE_DBG("Deleting cmd %p from init deferred cmd list", cmd);
list_del(&cmd->cmd_list_entry);
atomic_dec(&sess->sess_cmd_count);
spin_unlock_irq(&sess->sess_list_lock);
scst_cmd_init_done(cmd, SCST_CONTEXT_THREAD);
spin_lock_irq(&sess->sess_list_lock);
goto restart;
}
spin_lock(&scst_mcmd_lock);