]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: qedf: Remove dead code
authorLiao Chen <liaochen4@huawei.com>
Sat, 21 Sep 2024 06:29:56 +0000 (06:29 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 4 Oct 2024 01:37:35 +0000 (21:37 -0400)
If container_of() is used correctly, its result is never NULL. Remove the
code that depends on container_of() returning a NULL pointer.

Signed-off-by: Liao Chen <liaochen4@huawei.com>
Link: https://lore.kernel.org/r/20240921062956.2027563-1-liaochen4@huawei.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qedf/qedf_main.c

index cf13148ba281c1efccb7e3871717d41f6e711dab..df756f3eef3e85180a7f78bfd09a81a9d3e9f841 100644 (file)
@@ -4018,11 +4018,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(&qedf->dbg_ctx, "qedf is NULL");
-               return;
-       }
-
        if (test_bit(QEDF_IN_RECOVERY, &qedf->flags)) {
                QEDF_ERR(&qedf->dbg_ctx,
                         "Already is in recovery, hence not calling software context reset.\n");