From: Haowen Bai <baihaowen@meizu.com>
To: James Smart <james.smart@broadcom.com>,
Ram Vegesna <ram.vegesna@broadcom.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Haowen Bai <baihaowen@meizu.com>, <linux-scsi@vger.kernel.org>,
<target-devel@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] scsi: elx: efct: remove null check after call container_of()
Date: Tue, 17 May 2022 09:25:36 +0800 [thread overview]
Message-ID: <1652750737-22673-1-git-send-email-baihaowen@meizu.com> (raw)
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(-)
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;
}
--
2.7.4
next reply other threads:[~2022-05-17 1:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-17 1:25 Haowen Bai [this message]
2022-05-20 1:09 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1652750737-22673-1-git-send-email-baihaowen@meizu.com \
--to=baihaowen@meizu.com \
--cc=james.smart@broadcom.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ram.vegesna@broadcom.com \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®