linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] scsi: lpfc: remove dead code on second !ndlp check
@ 2020-11-18 13:37 Colin King
  2020-11-19 20:57 ` James Smart
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Colin King @ 2020-11-18 13:37 UTC (permalink / raw)
  To: James Smart, Dick Kennedy, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

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

Currently there is a null check on the pointer ndlp that exits via
error path issue_ct_rsp_exit followed by another null check on the
same pointer that is almost identical to the previous null check
stanza and yet can never can be reached because the previous check
exited via issue_ct_rsp_exit. This is deadcode and can be removed.

Addresses-Coverity: ("Logically dead code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/lpfc/lpfc_bsg.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index 35f4998504c1..41e3657c2d8d 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -1526,12 +1526,6 @@ lpfc_issue_ct_rsp(struct lpfc_hba *phba, struct bsg_job *job, uint32_t tag,
 			goto issue_ct_rsp_exit;
 		}
 
-		/* Check if the ndlp is active */
-		if (!ndlp) {
-			rc = IOCB_ERROR;
-			goto issue_ct_rsp_exit;
-		}
-
 		/* get a refernece count so the ndlp doesn't go away while
 		 * we respond
 		 */
-- 
2.28.0


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

* Re: [PATCH][next] scsi: lpfc: remove dead code on second !ndlp check
  2020-11-18 13:37 [PATCH][next] scsi: lpfc: remove dead code on second !ndlp check Colin King
@ 2020-11-19 20:57 ` James Smart
  2020-11-20  3:17 ` Martin K. Petersen
  2020-11-24  3:58 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: James Smart @ 2020-11-19 20:57 UTC (permalink / raw)
  To: Colin King, Dick Kennedy, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]



On 11/18/2020 5:37 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently there is a null check on the pointer ndlp that exits via
> error path issue_ct_rsp_exit followed by another null check on the
> same pointer that is almost identical to the previous null check
> stanza and yet can never can be reached because the previous check
> exited via issue_ct_rsp_exit. This is deadcode and can be removed.
>
> Addresses-Coverity: ("Logically dead code")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/scsi/lpfc/lpfc_bsg.c | 6 ------
>   1 file changed, 6 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
> index 35f4998504c1..41e3657c2d8d 100644
> --- a/drivers/scsi/lpfc/lpfc_bsg.c
> +++ b/drivers/scsi/lpfc/lpfc_bsg.c
> @@ -1526,12 +1526,6 @@ lpfc_issue_ct_rsp(struct lpfc_hba *phba, struct bsg_job *job, uint32_t tag,
>   			goto issue_ct_rsp_exit;
>   		}
>   
> -		/* Check if the ndlp is active */
> -		if (!ndlp) {
> -			rc = IOCB_ERROR;
> -			goto issue_ct_rsp_exit;
> -		}
> -
>   		/* get a refernece count so the ndlp doesn't go away while
>   		 * we respond
>   		 */
Looks good.

Reviewed-by: James Smart <james.smart@broadcom.com>

-- james


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4163 bytes --]

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

* Re: [PATCH][next] scsi: lpfc: remove dead code on second !ndlp check
  2020-11-18 13:37 [PATCH][next] scsi: lpfc: remove dead code on second !ndlp check Colin King
  2020-11-19 20:57 ` James Smart
@ 2020-11-20  3:17 ` Martin K. Petersen
  2020-11-24  3:58 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2020-11-20  3:17 UTC (permalink / raw)
  To: Colin King
  Cc: James Smart, Dick Kennedy, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi, kernel-janitors, linux-kernel


Colin,

> Currently there is a null check on the pointer ndlp that exits via
> error path issue_ct_rsp_exit followed by another null check on the
> same pointer that is almost identical to the previous null check
> stanza and yet can never can be reached because the previous check
> exited via issue_ct_rsp_exit. This is deadcode and can be removed.

Applied to 5.11/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH][next] scsi: lpfc: remove dead code on second !ndlp check
  2020-11-18 13:37 [PATCH][next] scsi: lpfc: remove dead code on second !ndlp check Colin King
  2020-11-19 20:57 ` James Smart
  2020-11-20  3:17 ` Martin K. Petersen
@ 2020-11-24  3:58 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2020-11-24  3:58 UTC (permalink / raw)
  To: linux-scsi, James Smart, Colin King, James E . J . Bottomley,
	Dick Kennedy
  Cc: Martin K . Petersen, linux-kernel, kernel-janitors

On Wed, 18 Nov 2020 13:37:44 +0000, Colin King wrote:

> Currently there is a null check on the pointer ndlp that exits via
> error path issue_ct_rsp_exit followed by another null check on the
> same pointer that is almost identical to the previous null check
> stanza and yet can never can be reached because the previous check
> exited via issue_ct_rsp_exit. This is deadcode and can be removed.

Applied to 5.11/scsi-queue, thanks!

[1/1] scsi: lpfc: Remove dead code on second !ndlp check
      https://git.kernel.org/mkp/scsi/c/61795a5316ad

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2020-11-24  3:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 13:37 [PATCH][next] scsi: lpfc: remove dead code on second !ndlp check Colin King
2020-11-19 20:57 ` James Smart
2020-11-20  3:17 ` Martin K. Petersen
2020-11-24  3:58 ` Martin K. Petersen

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).