linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cxlflash: remove an unnecessary NULL check
@ 2020-06-05 11:02 Dan Carpenter
  2020-06-10  2:02 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-06-05 11:02 UTC (permalink / raw)
  To: Manoj N. Kumar, Matthew R. Ochs
  Cc: Uma Krishnan, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, linux-kernel, kernel-janitors

The "cmd" pointer was already dereferenced a couple lines earlier so
this NULL check is too late.  Fortunately, the pointer can never be NULL
and the check can be removed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/scsi/cxlflash/main.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index fcc5aa9f60147..94250ebe9e803 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -47,9 +47,6 @@ static void process_cmd_err(struct afu_cmd *cmd, struct scsi_cmnd *scp)
 	struct sisl_ioasa *ioasa;
 	u32 resid;
 
-	if (unlikely(!cmd))
-		return;
-
 	ioasa = &(cmd->sa);
 
 	if (ioasa->rc.flags & SISL_RC_FLAGS_UNDERRUN) {
-- 
2.26.2


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

* Re: [PATCH] cxlflash: remove an unnecessary NULL check
  2020-06-05 11:02 [PATCH] cxlflash: remove an unnecessary NULL check Dan Carpenter
@ 2020-06-10  2:02 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2020-06-10  2:02 UTC (permalink / raw)
  To: Matthew R. Ochs, Dan Carpenter, Manoj N. Kumar
  Cc: Martin K . Petersen, kernel-janitors, James E.J. Bottomley,
	linux-kernel, Uma Krishnan, linux-scsi

On Fri, 5 Jun 2020 14:02:58 +0300, Dan Carpenter wrote:

> The "cmd" pointer was already dereferenced a couple lines earlier so
> this NULL check is too late.  Fortunately, the pointer can never be NULL
> and the check can be removed.

Applied to 5.8/scsi-queue, thanks!

[1/1] scsi: cxlflash: Remove an unnecessary NULL check
      https://git.kernel.org/mkp/scsi/c/89dd9ce784fb

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2020-06-10  2:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-05 11:02 [PATCH] cxlflash: remove an unnecessary NULL check Dan Carpenter
2020-06-10  2:02 ` 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).