LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 2/2] bnx2fc: bnx2fc_io.c: match wait_for_completion_timeout return type
@ 2015-03-04 14:27 Nicholas Mc Guire
2015-03-04 14:27 ` Nicholas Mc Guire
2015-03-09 13:54 ` Chad Dupuis
0 siblings, 2 replies; 3+ messages in thread
From: Nicholas Mc Guire @ 2015-03-04 14:27 UTC (permalink / raw)
To: James E.J. Bottomley; +Cc: linux-scsi, linux-kernel, Nicholas Mc Guire
return type of wait_for_completion_timeout is unsigned long not int. An
appropriately named variable of type unsigned long is added and the
assignments fixed up.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
The was only compile tested with x86_64_defconfig + SCSI_LOWLEVEL
CONFIG_SCSI_FC_ATTRS=m, CONFIG_LIBFC=m, CONFIG_LIBFCOE=m,
CONFIG_SCSI_BNX2X_FCOE=m
Patch is against 4.0-rc2 (localversion-next is -next-20150304)
drivers/scsi/bnx2fc/bnx2fc_io.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 9ecca85..77f8c1e 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -703,6 +703,7 @@ static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
struct fcp_cmnd *fcp_cmnd;
int task_idx, index;
int rc = SUCCESS;
+ unsigned long time_left;
u16 xid;
u32 sid, did;
unsigned long start = jiffies;
@@ -810,7 +811,7 @@ retry_tmf:
bnx2fc_ring_doorbell(tgt);
spin_unlock_bh(&tgt->tgt_lock);
- rc = wait_for_completion_timeout(&io_req->tm_done,
+ time_left = wait_for_completion_timeout(&io_req->tm_done,
BNX2FC_TM_TIMEOUT * HZ);
spin_lock_bh(&tgt->tgt_lock);
@@ -824,17 +825,17 @@ retry_tmf:
io_req->wait_for_comp = 1;
bnx2fc_initiate_cleanup(io_req);
spin_unlock_bh(&tgt->tgt_lock);
- rc = wait_for_completion_timeout(&io_req->tm_done,
+ time_left = wait_for_completion_timeout(&io_req->tm_done,
BNX2FC_FW_TIMEOUT);
spin_lock_bh(&tgt->tgt_lock);
io_req->wait_for_comp = 0;
- if (!rc)
+ if (!time_left)
kref_put(&io_req->refcount, bnx2fc_cmd_release);
}
spin_unlock_bh(&tgt->tgt_lock);
- if (!rc) {
+ if (!time_left) {
BNX2FC_TGT_DBG(tgt, "task mgmt command failed...\n");
rc = FAILED;
} else {
--
1.7.10.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] bnx2fc: bnx2fc_io.c: match wait_for_completion_timeout return type
2015-03-04 14:27 [PATCH 2/2] bnx2fc: bnx2fc_io.c: match wait_for_completion_timeout return type Nicholas Mc Guire
@ 2015-03-04 14:27 ` Nicholas Mc Guire
2015-03-09 13:54 ` Chad Dupuis
1 sibling, 0 replies; 3+ messages in thread
From: Nicholas Mc Guire @ 2015-03-04 14:27 UTC (permalink / raw)
To: James E.J. Bottomley; +Cc: linux-scsi, linux-kernel, Nicholas Mc Guire
return type of wait_for_completion_timeout is unsigned long not int. An
appropriately named variable of type unsigned long is added and the
assignments fixed up.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
The was only complie tested with x86_64_defconfig + SCSI_LOWLEVEL
CONFIG_SCSI_FC_ATTRS=m, CONFIG_LIBFC=m, CONFIG_LIBFCOE=m,
CONFIG_SCSI_BNX2X_FCOE=m
Patch is against 4.0-rc2 (localversion-next is -next-20150304)
drivers/scsi/bnx2fc/bnx2fc_io.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 9ecca85..77f8c1e 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -703,6 +703,7 @@ static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
struct fcp_cmnd *fcp_cmnd;
int task_idx, index;
int rc = SUCCESS;
+ unsigned long time_left;
u16 xid;
u32 sid, did;
unsigned long start = jiffies;
@@ -810,7 +811,7 @@ retry_tmf:
bnx2fc_ring_doorbell(tgt);
spin_unlock_bh(&tgt->tgt_lock);
- rc = wait_for_completion_timeout(&io_req->tm_done,
+ time_left = wait_for_completion_timeout(&io_req->tm_done,
BNX2FC_TM_TIMEOUT * HZ);
spin_lock_bh(&tgt->tgt_lock);
@@ -824,17 +825,17 @@ retry_tmf:
io_req->wait_for_comp = 1;
bnx2fc_initiate_cleanup(io_req);
spin_unlock_bh(&tgt->tgt_lock);
- rc = wait_for_completion_timeout(&io_req->tm_done,
+ time_left = wait_for_completion_timeout(&io_req->tm_done,
BNX2FC_FW_TIMEOUT);
spin_lock_bh(&tgt->tgt_lock);
io_req->wait_for_comp = 0;
- if (!rc)
+ if (!time_left)
kref_put(&io_req->refcount, bnx2fc_cmd_release);
}
spin_unlock_bh(&tgt->tgt_lock);
- if (!rc) {
+ if (!time_left) {
BNX2FC_TGT_DBG(tgt, "task mgmt command failed...\n");
rc = FAILED;
} else {
--
1.7.10.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] bnx2fc: bnx2fc_io.c: match wait_for_completion_timeout return type
2015-03-04 14:27 [PATCH 2/2] bnx2fc: bnx2fc_io.c: match wait_for_completion_timeout return type Nicholas Mc Guire
2015-03-04 14:27 ` Nicholas Mc Guire
@ 2015-03-09 13:54 ` Chad Dupuis
1 sibling, 0 replies; 3+ messages in thread
From: Chad Dupuis @ 2015-03-09 13:54 UTC (permalink / raw)
To: Nicholas Mc Guire; +Cc: James E.J. Bottomley, linux-scsi, linux-kernel
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
On Wed, 4 Mar 2015, Nicholas Mc Guire wrote:
> return type of wait_for_completion_timeout is unsigned long not int. An
> appropriately named variable of type unsigned long is added and the
> assignments fixed up.
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
>
> The was only compile tested with x86_64_defconfig + SCSI_LOWLEVEL
> CONFIG_SCSI_FC_ATTRS=m, CONFIG_LIBFC=m, CONFIG_LIBFCOE=m,
> CONFIG_SCSI_BNX2X_FCOE=m
>
> Patch is against 4.0-rc2 (localversion-next is -next-20150304)
>
> drivers/scsi/bnx2fc/bnx2fc_io.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
> index 9ecca85..77f8c1e 100644
> --- a/drivers/scsi/bnx2fc/bnx2fc_io.c
> +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
> @@ -703,6 +703,7 @@ static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
> struct fcp_cmnd *fcp_cmnd;
> int task_idx, index;
> int rc = SUCCESS;
> + unsigned long time_left;
> u16 xid;
> u32 sid, did;
> unsigned long start = jiffies;
> @@ -810,7 +811,7 @@ retry_tmf:
> bnx2fc_ring_doorbell(tgt);
> spin_unlock_bh(&tgt->tgt_lock);
>
> - rc = wait_for_completion_timeout(&io_req->tm_done,
> + time_left = wait_for_completion_timeout(&io_req->tm_done,
> BNX2FC_TM_TIMEOUT * HZ);
> spin_lock_bh(&tgt->tgt_lock);
>
> @@ -824,17 +825,17 @@ retry_tmf:
> io_req->wait_for_comp = 1;
> bnx2fc_initiate_cleanup(io_req);
> spin_unlock_bh(&tgt->tgt_lock);
> - rc = wait_for_completion_timeout(&io_req->tm_done,
> + time_left = wait_for_completion_timeout(&io_req->tm_done,
> BNX2FC_FW_TIMEOUT);
> spin_lock_bh(&tgt->tgt_lock);
> io_req->wait_for_comp = 0;
> - if (!rc)
> + if (!time_left)
> kref_put(&io_req->refcount, bnx2fc_cmd_release);
> }
>
> spin_unlock_bh(&tgt->tgt_lock);
>
> - if (!rc) {
> + if (!time_left) {
> BNX2FC_TGT_DBG(tgt, "task mgmt command failed...\n");
> rc = FAILED;
> } else {
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-09 14:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-04 14:27 [PATCH 2/2] bnx2fc: bnx2fc_io.c: match wait_for_completion_timeout return type Nicholas Mc Guire
2015-03-04 14:27 ` Nicholas Mc Guire
2015-03-09 13:54 ` Chad Dupuis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).