All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][scsi-next] scsi: qla2xxx: remove redundant null check on tgt
@ 2017-06-05 17:29 ` Colin King
  0 siblings, 0 replies; 12+ messages in thread
From: Colin King @ 2017-06-05 17:29 UTC (permalink / raw)
  To: qla2xxx-upstream, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

An earlier commit ed7fb808477b846bb2 ("scsi: qla2xxx: Remove
redundant wait when target is stopped.") removed a null check
on ha->tgt.tgt_ops and replaced it with a new check that null
checked tgt, thus making the subsequent null check on tgt
totally redundant. Remove it.

Detected by CoverityScan, CID#1440452 ("Logically Dead Code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/qla2xxx/qla_target.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index cb33ca87ca37..3594a76f6155 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -5519,12 +5519,6 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha,
 	if (!tgt || tgt->tgt_stop || tgt->tgt_stopped)
 		return;
 
-	if (unlikely(tgt == NULL)) {
-		ql_dbg(ql_dbg_tgt, vha, 0xe03a,
-		    "ASYNC EVENT %#x, but no tgt (ha %p)\n", code, ha);
-		return;
-	}
-
 	if (((code == MBA_POINT_TO_POINT) || (code == MBA_CHG_IN_CONNECTION)) &&
 	    IS_QLA2100(ha))
 		return;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH][scsi-next] scsi: qla2xxx: remove redundant null check on tgt
@ 2017-06-05 17:29 ` Colin King
  0 siblings, 0 replies; 12+ messages in thread
From: Colin King @ 2017-06-05 17:29 UTC (permalink / raw)
  To: qla2xxx-upstream, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

An earlier commit ed7fb808477b846bb2 ("scsi: qla2xxx: Remove
redundant wait when target is stopped.") removed a null check
on ha->tgt.tgt_ops and replaced it with a new check that null
checked tgt, thus making the subsequent null check on tgt
totally redundant. Remove it.

Detected by CoverityScan, CID#1440452 ("Logically Dead Code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/qla2xxx/qla_target.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index cb33ca87ca37..3594a76f6155 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -5519,12 +5519,6 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha,
 	if (!tgt || tgt->tgt_stop || tgt->tgt_stopped)
 		return;
 
-	if (unlikely(tgt = NULL)) {
-		ql_dbg(ql_dbg_tgt, vha, 0xe03a,
-		    "ASYNC EVENT %#x, but no tgt (ha %p)\n", code, ha);
-		return;
-	}
-
 	if (((code = MBA_POINT_TO_POINT) || (code = MBA_CHG_IN_CONNECTION)) &&
 	    IS_QLA2100(ha))
 		return;
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH][scsi-next] scsi: qla2xxx: remove redundant null check on tgt
  2017-06-05 17:29 ` Colin King
@ 2017-06-07 22:42   ` Madhani, Himanshu
  -1 siblings, 0 replies; 12+ messages in thread
From: Madhani, Himanshu @ 2017-06-07 22:42 UTC (permalink / raw)
  To: Colin King
  Cc: Dept-Eng QLA2xxx Upstream, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi, kernel-janitors, linux-kernel


> On Jun 5, 2017, at 10:29 AM, Colin King <colin.king@canonical.com> wrote:
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> An earlier commit ed7fb808477b846bb2 ("scsi: qla2xxx: Remove
> redundant wait when target is stopped.") removed a null check
> on ha->tgt.tgt_ops and replaced it with a new check that null
> checked tgt, thus making the subsequent null check on tgt
> totally redundant. Remove it.
> 
> Detected by CoverityScan, CID#1440452 ("Logically Dead Code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/scsi/qla2xxx/qla_target.c | 6 ------
> 1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
> index cb33ca87ca37..3594a76f6155 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -5519,12 +5519,6 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha,
> 	if (!tgt || tgt->tgt_stop || tgt->tgt_stopped)
> 		return;
> 
> -	if (unlikely(tgt == NULL)) {
> -		ql_dbg(ql_dbg_tgt, vha, 0xe03a,
> -		    "ASYNC EVENT %#x, but no tgt (ha %p)\n", code, ha);
> -		return;
> -	}
> -
> 	if (((code == MBA_POINT_TO_POINT) || (code == MBA_CHG_IN_CONNECTION)) &&
> 	    IS_QLA2100(ha))
> 		return;
> -- 
> 2.11.0
> 

Looks good.

Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>

Thanks,
- Himanshu

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][scsi-next] scsi: qla2xxx: remove redundant null check on tgt
@ 2017-06-07 22:42   ` Madhani, Himanshu
  0 siblings, 0 replies; 12+ messages in thread
From: Madhani, Himanshu @ 2017-06-07 22:42 UTC (permalink / raw)
  To: Colin King
  Cc: Dept-Eng QLA2xxx Upstream, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi, kernel-janitors, linux-kernel


> On Jun 5, 2017, at 10:29 AM, Colin King <colin.king@canonical.com> wrote:
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> An earlier commit ed7fb808477b846bb2 ("scsi: qla2xxx: Remove
> redundant wait when target is stopped.") removed a null check
> on ha->tgt.tgt_ops and replaced it with a new check that null
> checked tgt, thus making the subsequent null check on tgt
> totally redundant. Remove it.
> 
> Detected by CoverityScan, CID#1440452 ("Logically Dead Code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/scsi/qla2xxx/qla_target.c | 6 ------
> 1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
> index cb33ca87ca37..3594a76f6155 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -5519,12 +5519,6 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha,
> 	if (!tgt || tgt->tgt_stop || tgt->tgt_stopped)
> 		return;
> 
> -	if (unlikely(tgt == NULL)) {
> -		ql_dbg(ql_dbg_tgt, vha, 0xe03a,
> -		    "ASYNC EVENT %#x, but no tgt (ha %p)\n", code, ha);
> -		return;
> -	}
> -
> 	if (((code == MBA_POINT_TO_POINT) || (code == MBA_CHG_IN_CONNECTION)) &&
> 	    IS_QLA2100(ha))
> 		return;
> -- 
> 2.11.0
> 

Looks good.

Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>

Thanks,
- Himanshu


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][scsi-next] scsi: qla2xxx: remove redundant null check on tgt
  2017-06-05 17:29 ` Colin King
@ 2017-06-13  1:12   ` Martin K. Petersen
  -1 siblings, 0 replies; 12+ messages in thread
From: Martin K. Petersen @ 2017-06-13  1:12 UTC (permalink / raw)
  To: Colin King
  Cc: qla2xxx-upstream, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi, kernel-janitors, linux-kernel


Colin,

> An earlier commit ed7fb808477b846bb2 ("scsi: qla2xxx: Remove redundant
> wait when target is stopped.") removed a null check on ha->tgt.tgt_ops
> and replaced it with a new check that null checked tgt, thus making
> the subsequent null check on tgt totally redundant. Remove it.

Applied to 4.13/scsi-queue. Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][scsi-next] scsi: qla2xxx: remove redundant null check on tgt
@ 2017-06-13  1:12   ` Martin K. Petersen
  0 siblings, 0 replies; 12+ messages in thread
From: Martin K. Petersen @ 2017-06-13  1:12 UTC (permalink / raw)
  To: Colin King
  Cc: qla2xxx-upstream, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi, kernel-janitors, linux-kernel


Colin,

> An earlier commit ed7fb808477b846bb2 ("scsi: qla2xxx: Remove redundant
> wait when target is stopped.") removed a null check on ha->tgt.tgt_ops
> and replaced it with a new check that null checked tgt, thus making
> the subsequent null check on tgt totally redundant. Remove it.

Applied to 4.13/scsi-queue. Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH][scsi-next] scsi: qla2xxx: remove redundant assignment of d
  2017-06-05 17:29 ` Colin King
@ 2018-01-05 15:50 ` Colin King
  -1 siblings, 0 replies; 12+ messages in thread
From: Colin King @ 2018-01-05 15:50 UTC (permalink / raw)
  To: qla2xxx-upstream, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The initialization of d is redundant as this value is never read
and it is overwritten inside the subsequent for-loop.  Remove this
redundant assignment.

Cleans up clang warning:
drivers/scsi/qla2xxx/qla_gs.c:3985:29: warning: Value stored to 'd'
during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/qla2xxx/qla_gs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index 6bfe24eeb402..f40ea8f120b7 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -3982,7 +3982,7 @@ static void qla2x00_async_gpnft_gnnft_sp_done(void *s, int res)
 		(struct ct_sns_req *)sp->u.iocb_cmd.u.ctarg.req;
 	struct ct_sns_gpnft_rsp *ct_rsp =
 		(struct ct_sns_gpnft_rsp *)sp->u.iocb_cmd.u.ctarg.rsp;
-	struct ct_sns_gpn_ft_data *d = &ct_rsp->entries[0];
+	struct ct_sns_gpn_ft_data *d;
 	struct fab_scan_rp *rp;
 	int i, j, k;
 	u16 cmd = be16_to_cpu(ct_req->command);
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH][scsi-next] scsi: qla2xxx: remove redundant assignment of d
@ 2018-01-05 15:50 ` Colin King
  0 siblings, 0 replies; 12+ messages in thread
From: Colin King @ 2018-01-05 15:50 UTC (permalink / raw)
  To: qla2xxx-upstream, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The initialization of d is redundant as this value is never read
and it is overwritten inside the subsequent for-loop.  Remove this
redundant assignment.

Cleans up clang warning:
drivers/scsi/qla2xxx/qla_gs.c:3985:29: warning: Value stored to 'd'
during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/qla2xxx/qla_gs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index 6bfe24eeb402..f40ea8f120b7 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -3982,7 +3982,7 @@ static void qla2x00_async_gpnft_gnnft_sp_done(void *s, int res)
 		(struct ct_sns_req *)sp->u.iocb_cmd.u.ctarg.req;
 	struct ct_sns_gpnft_rsp *ct_rsp  		(struct ct_sns_gpnft_rsp *)sp->u.iocb_cmd.u.ctarg.rsp;
-	struct ct_sns_gpn_ft_data *d = &ct_rsp->entries[0];
+	struct ct_sns_gpn_ft_data *d;
 	struct fab_scan_rp *rp;
 	int i, j, k;
 	u16 cmd = be16_to_cpu(ct_req->command);
-- 
2.15.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH][scsi-next] scsi: qla2xxx: remove redundant assignment of d
  2018-01-05 15:50 ` Colin King
@ 2018-01-10 21:50   ` Martin K. Petersen
  -1 siblings, 0 replies; 12+ messages in thread
From: Martin K. Petersen @ 2018-01-10 21:50 UTC (permalink / raw)
  To: Colin King
  Cc: qla2xxx-upstream, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi, kernel-janitors, linux-kernel


Colin,

> The initialization of d is redundant as this value is never read
> and it is overwritten inside the subsequent for-loop.  Remove this
> redundant assignment.

Applied to 4.16/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][scsi-next] scsi: qla2xxx: remove redundant assignment of d
@ 2018-01-10 21:50   ` Martin K. Petersen
  0 siblings, 0 replies; 12+ messages in thread
From: Martin K. Petersen @ 2018-01-10 21:50 UTC (permalink / raw)
  To: Colin King
  Cc: qla2xxx-upstream, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi, kernel-janitors, linux-kernel


Colin,

> The initialization of d is redundant as this value is never read
> and it is overwritten inside the subsequent for-loop.  Remove this
> redundant assignment.

Applied to 4.16/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH][scsi-next] scsi: qla2xxx: remove unused variable status
  2017-06-05 17:29 ` Colin King
@ 2018-12-10 23:33 ` Colin King
  -1 siblings, 0 replies; 12+ messages in thread
From: Colin King @ 2018-12-10 23:33 UTC (permalink / raw)
  To: qla2xxx-upstream, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable 'status' is declared but not used, remove it.

Cleans up warning:
warning: unused variable ‘status’ [-Wunused-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/qla2xxx/qla_os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 63c47bc7ae59..db331cb5ba3c 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1788,7 +1788,7 @@ static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res,
 static void
 __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res)
 {
-	int cnt, status;
+	int cnt;
 	unsigned long flags;
 	srb_t *sp;
 	scsi_qla_host_t *vha = qp->vha;
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH][scsi-next] scsi: qla2xxx: remove unused variable status
@ 2018-12-10 23:33 ` Colin King
  0 siblings, 0 replies; 12+ messages in thread
From: Colin King @ 2018-12-10 23:33 UTC (permalink / raw)
  To: qla2xxx-upstream, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable 'status' is declared but not used, remove it.

Cleans up warning:
warning: unused variable ‘status’ [-Wunused-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/qla2xxx/qla_os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 63c47bc7ae59..db331cb5ba3c 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1788,7 +1788,7 @@ static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res,
 static void
 __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res)
 {
-	int cnt, status;
+	int cnt;
 	unsigned long flags;
 	srb_t *sp;
 	scsi_qla_host_t *vha = qp->vha;
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-12-10 23:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-05 17:29 [PATCH][scsi-next] scsi: qla2xxx: remove redundant null check on tgt Colin King
2017-06-05 17:29 ` Colin King
2017-06-07 22:42 ` Madhani, Himanshu
2017-06-07 22:42   ` Madhani, Himanshu
2017-06-13  1:12 ` Martin K. Petersen
2017-06-13  1:12   ` Martin K. Petersen
2018-01-05 15:50 [PATCH][scsi-next] scsi: qla2xxx: remove redundant assignment of d Colin King
2018-01-05 15:50 ` Colin King
2018-01-10 21:50 ` Martin K. Petersen
2018-01-10 21:50   ` Martin K. Petersen
2018-12-10 23:33 [PATCH][scsi-next] scsi: qla2xxx: remove unused variable status Colin King
2018-12-10 23:33 ` Colin King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.