ib_srpt: wait_for_completion_timeout does not return negative status
authorNicholas Mc Guire <der.herr@hofr.at>
Fri, 16 Jan 2015 11:20:17 +0000 (12:20 +0100)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 20 Jan 2015 23:48:17 +0000 (15:48 -0800)
This patch changes srpt_close_session() to properly use an unsigned long
for wait_for_completion_timeout()'s return value, and to update WARN_ON()
to only trigger for a zero return.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/infiniband/ulp/srpt/ib_srpt.c

index eb694ddad79fe069b6d2f796004a5e8acc77e833..6e0a477681e90b0efe53330de1b9118000bcc85a 100644 (file)
@@ -3518,7 +3518,7 @@ static void srpt_close_session(struct se_session *se_sess)
        DECLARE_COMPLETION_ONSTACK(release_done);
        struct srpt_rdma_ch *ch;
        struct srpt_device *sdev;
-       int res;
+       unsigned long res;
 
        ch = se_sess->fabric_sess_ptr;
        WARN_ON(ch->sess != se_sess);
@@ -3533,7 +3533,7 @@ static void srpt_close_session(struct se_session *se_sess)
        spin_unlock_irq(&sdev->spinlock);
 
        res = wait_for_completion_timeout(&release_done, 60 * HZ);
-       WARN_ON(res <= 0);
+       WARN_ON(res == 0);
 }
 
 /**