diff mbox series

scsi: elx: efct: remove null check after call container_of()

Message ID 1652750737-22673-1-git-send-email-baihaowen@meizu.com (mailing list archive)
State Accepted
Commit d627660c22b51121262c03dfa1a51bf54361f5a9
Headers show
Series scsi: elx: efct: remove null check after call container_of() | expand

Commit Message

baihaowen May 17, 2022, 1:25 a.m. UTC
container_of() will never return NULL, so remove useless code.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
 drivers/scsi/elx/efct/efct_lio.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Martin K. Petersen May 20, 2022, 1:09 a.m. UTC | #1
On Tue, 17 May 2022 09:25:36 +0800, Haowen Bai wrote:

> container_of() will never return NULL, so remove useless code.
> 
> 

Applied to 5.19/scsi-queue, thanks!

[1/1] scsi: elx: efct: remove null check after call container_of()
      https://git.kernel.org/mkp/scsi/c/d627660c22b5
diff mbox series

Patch

diff --git a/drivers/scsi/elx/efct/efct_lio.c b/drivers/scsi/elx/efct/efct_lio.c
index 8b004a5818d6..be4b5c1ee32d 100644
--- a/drivers/scsi/elx/efct/efct_lio.c
+++ b/drivers/scsi/elx/efct/efct_lio.c
@@ -370,9 +370,6 @@  static int efct_lio_get_cmd_state(struct se_cmd *cmd)
 		container_of(cmd, struct efct_scsi_tgt_io, cmd);
 	struct efct_io *io = container_of(ocp, struct efct_io, tgt_io);
 
-	if (!io)
-		return 0;
-
 	return io->tgt_io.state;
 }