scsi: pm8001: clean up dead code when PM8001_USE_MSIX is defined
authorColin Ian King <colin.king@canonical.com>
Thu, 28 Mar 2019 23:43:28 +0000 (23:43 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 4 Apr 2019 03:45:59 +0000 (23:45 -0400)
When macro PM8001_USE_MSIX is defined there are redundant dead code calls
to pm8001_chip_intx_interrupt_{enable|disable} and pm8001_cr32.

Clean this up for the defined PM8001_USE_MSIX and undefined
PM8001_USE_MSIX cases.

[mkp: squashed two patches]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/pm8001/pm8001_hwi.c
drivers/scsi/pm8001/pm80xx_hwi.c

index e4209091c1da49456554dff9c32d4791d4869e1e..43d03ca510cf4089ae604c05e9aa311d7452af6b 100644 (file)
@@ -1204,6 +1204,7 @@ void pm8001_chip_iounmap(struct pm8001_hba_info *pm8001_ha)
        }
 }
 
+#ifndef PM8001_USE_MSIX
 /**
  * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
  * @pm8001_ha: our hba card information
@@ -1225,6 +1226,8 @@ pm8001_chip_intx_interrupt_disable(struct pm8001_hba_info *pm8001_ha)
        pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_MASK_ALL);
 }
 
+#else
+
 /**
  * pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt
  * @pm8001_ha: our hba card information
@@ -1256,6 +1259,7 @@ pm8001_chip_msix_interrupt_disable(struct pm8001_hba_info *pm8001_ha,
        msi_index += MSIX_TABLE_BASE;
        pm8001_cw32(pm8001_ha, 0,  msi_index, MSIX_INTERRUPT_DISABLE);
 }
+#endif
 
 /**
  * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
@@ -1266,10 +1270,9 @@ pm8001_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
 {
 #ifdef PM8001_USE_MSIX
        pm8001_chip_msix_interrupt_enable(pm8001_ha, 0);
-       return;
-#endif
+#else
        pm8001_chip_intx_interrupt_enable(pm8001_ha);
-
+#endif
 }
 
 /**
@@ -1281,10 +1284,9 @@ pm8001_chip_interrupt_disable(struct pm8001_hba_info *pm8001_ha, u8 vec)
 {
 #ifdef PM8001_USE_MSIX
        pm8001_chip_msix_interrupt_disable(pm8001_ha, 0);
-       return;
-#endif
+#else
        pm8001_chip_intx_interrupt_disable(pm8001_ha);
-
+#endif
 }
 
 /**
@@ -4625,15 +4627,16 @@ static int pm8001_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
 
 static u32 pm8001_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha)
 {
-       u32 value;
 #ifdef PM8001_USE_MSIX
        return 1;
-#endif
+#else
+       u32 value;
+
        value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
        if (value)
                return 1;
        return 0;
-
+#endif
 }
 
 /**
index 536d2b4384f8257639f5662565835e1acdb11fc7..4a176e60307fabc3d4811df700e3ff65c6122212 100644 (file)
@@ -4619,15 +4619,16 @@ static int pm80xx_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
 
 static u32 pm80xx_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha)
 {
-       u32 value;
 #ifdef PM8001_USE_MSIX
        return 1;
-#endif
+#else
+       u32 value;
+
        value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
        if (value)
                return 1;
        return 0;
-
+#endif
 }
 
 /**