aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/scsi/qedf/qedf_main.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2021-05-09 21:12:11 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2021-05-14 22:40:54 -0400
commit09c65383970e79db0322962efc9e56a0785580f3 (patch)
tree1c068c9931125a460bef311d190b101fc8a2cc5b /drivers/scsi/qedf/qedf_main.c
parentscsi: target: iscsi: Drop unnecessary container_of() (diff)
downloadwireguard-linux-09c65383970e79db0322962efc9e56a0785580f3.tar.xz
wireguard-linux-09c65383970e79db0322962efc9e56a0785580f3.zip
scsi: qedf: Drop unnecessary NULL checks after container_of()
The result of container_of() operations is never NULL unless the embedded element is the first element of the structure, which is not the case here. The NULL checks are therefore unnecessary and misleading. Remove them. The changes in this patch were made automatically using the following Coccinelle script. @@ type t; identifier v; statement s; @@ <+... ( t v = container_of(...); | v = container_of(...); ) ... when != v - if (\( !v \| v == NULL \) ) s ...+> Link: https://lore.kernel.org/r/20210510041211.2051325-1-linux@roeck-us.net Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qedf/qedf_main.c')
-rw-r--r--drivers/scsi/qedf/qedf_main.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 69f7784233f9..9c7efdf40dd5 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -3971,10 +3971,6 @@ void qedf_stag_change_work(struct work_struct *work)
struct qedf_ctx *qedf =
container_of(work, struct qedf_ctx, stag_work.work);
- if (!qedf) {
- QEDF_ERR(NULL, "qedf is NULL");
- return;
- }
QEDF_ERR(&qedf->dbg_ctx, "Performing software context reset.\n");
qedf_ctx_soft_reset(qedf->lport);
}