]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: lpfc: Simplify error handling for failed lpfc_get_sli4_parameters cmd
authorJustin Tee <justin.tee@broadcom.com>
Wed, 18 Jun 2025 19:21:31 +0000 (12:21 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 23 Jun 2025 17:10:33 +0000 (13:10 -0400)
There are unnecessary checks on an HBA's interface type and family before
erroring out a failed lpfc_get_sli4_parameters mailbox command.  Simplify
the error handling by logging a message and proceeding to memory free
labels.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20250618192138.124116-7-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_init.c

index 20fa450def03b0783dd28304e797880ff47e9460..7695a815de7a39b74b0acfa2299b20c6a4a1e1de 100644 (file)
@@ -7919,8 +7919,6 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
        int longs;
        int extra;
        uint64_t wwn;
-       u32 if_type;
-       u32 if_fam;
 
        phba->sli4_hba.num_present_cpu = lpfc_present_cpu;
        phba->sli4_hba.num_possible_cpu = cpumask_last(cpu_possible_mask) + 1;
@@ -8180,28 +8178,11 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
         */
        rc = lpfc_get_sli4_parameters(phba, mboxq);
        if (rc) {
-               if_type = bf_get(lpfc_sli_intf_if_type,
-                                &phba->sli4_hba.sli_intf);
-               if_fam = bf_get(lpfc_sli_intf_sli_family,
-                               &phba->sli4_hba.sli_intf);
-               if (phba->sli4_hba.extents_in_use &&
-                   phba->sli4_hba.rpi_hdrs_in_use) {
-                       lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
-                                       "2999 Unsupported SLI4 Parameters "
-                                       "Extents and RPI headers enabled.\n");
-                       if (if_type == LPFC_SLI_INTF_IF_TYPE_0 &&
-                           if_fam ==  LPFC_SLI_INTF_FAMILY_BE2) {
-                               mempool_free(mboxq, phba->mbox_mem_pool);
-                               rc = -EIO;
-                               goto out_free_bsmbx;
-                       }
-               }
-               if (!(if_type == LPFC_SLI_INTF_IF_TYPE_0 &&
-                     if_fam == LPFC_SLI_INTF_FAMILY_BE2)) {
-                       mempool_free(mboxq, phba->mbox_mem_pool);
-                       rc = -EIO;
-                       goto out_free_bsmbx;
-               }
+               lpfc_log_msg(phba, KERN_WARNING, LOG_INIT,
+                            "2999 Could not get SLI4 parameters\n");
+               rc = -EIO;
+               mempool_free(mboxq, phba->mbox_mem_pool);
+               goto out_free_bsmbx;
        }
 
        /*