diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-03-28 19:43:28 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-04-03 23:45:59 -0400 |
commit | 292c04cca8b7a260a8fbbd75bd3cc627409fa347 (patch) | |
tree | 8c6aaf05f1e67d85fbd1e9f391103db0902189ec | |
parent | f99b77e0bf4d4e53b81b6b0d16fdd34835891f7c (diff) |
scsi: pm8001: clean up dead code when PM8001_USE_MSIX is defined
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>
-rw-r--r-- | drivers/scsi/pm8001/pm8001_hwi.c | 21 | ||||
-rw-r--r-- | drivers/scsi/pm8001/pm80xx_hwi.c | 7 |
2 files changed, 16 insertions, 12 deletions
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index e4209091c1da..43d03ca510cf 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c | |||
@@ -1204,6 +1204,7 @@ void pm8001_chip_iounmap(struct pm8001_hba_info *pm8001_ha) | |||
1204 | } | 1204 | } |
1205 | } | 1205 | } |
1206 | 1206 | ||
1207 | #ifndef PM8001_USE_MSIX | ||
1207 | /** | 1208 | /** |
1208 | * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt | 1209 | * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt |
1209 | * @pm8001_ha: our hba card information | 1210 | * @pm8001_ha: our hba card information |
@@ -1225,6 +1226,8 @@ pm8001_chip_intx_interrupt_disable(struct pm8001_hba_info *pm8001_ha) | |||
1225 | pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_MASK_ALL); | 1226 | pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_MASK_ALL); |
1226 | } | 1227 | } |
1227 | 1228 | ||
1229 | #else | ||
1230 | |||
1228 | /** | 1231 | /** |
1229 | * pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt | 1232 | * pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt |
1230 | * @pm8001_ha: our hba card information | 1233 | * @pm8001_ha: our hba card information |
@@ -1256,6 +1259,7 @@ pm8001_chip_msix_interrupt_disable(struct pm8001_hba_info *pm8001_ha, | |||
1256 | msi_index += MSIX_TABLE_BASE; | 1259 | msi_index += MSIX_TABLE_BASE; |
1257 | pm8001_cw32(pm8001_ha, 0, msi_index, MSIX_INTERRUPT_DISABLE); | 1260 | pm8001_cw32(pm8001_ha, 0, msi_index, MSIX_INTERRUPT_DISABLE); |
1258 | } | 1261 | } |
1262 | #endif | ||
1259 | 1263 | ||
1260 | /** | 1264 | /** |
1261 | * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt | 1265 | * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt |
@@ -1266,10 +1270,9 @@ pm8001_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec) | |||
1266 | { | 1270 | { |
1267 | #ifdef PM8001_USE_MSIX | 1271 | #ifdef PM8001_USE_MSIX |
1268 | pm8001_chip_msix_interrupt_enable(pm8001_ha, 0); | 1272 | pm8001_chip_msix_interrupt_enable(pm8001_ha, 0); |
1269 | return; | 1273 | #else |
1270 | #endif | ||
1271 | pm8001_chip_intx_interrupt_enable(pm8001_ha); | 1274 | pm8001_chip_intx_interrupt_enable(pm8001_ha); |
1272 | 1275 | #endif | |
1273 | } | 1276 | } |
1274 | 1277 | ||
1275 | /** | 1278 | /** |
@@ -1281,10 +1284,9 @@ pm8001_chip_interrupt_disable(struct pm8001_hba_info *pm8001_ha, u8 vec) | |||
1281 | { | 1284 | { |
1282 | #ifdef PM8001_USE_MSIX | 1285 | #ifdef PM8001_USE_MSIX |
1283 | pm8001_chip_msix_interrupt_disable(pm8001_ha, 0); | 1286 | pm8001_chip_msix_interrupt_disable(pm8001_ha, 0); |
1284 | return; | 1287 | #else |
1285 | #endif | ||
1286 | pm8001_chip_intx_interrupt_disable(pm8001_ha); | 1288 | pm8001_chip_intx_interrupt_disable(pm8001_ha); |
1287 | 1289 | #endif | |
1288 | } | 1290 | } |
1289 | 1291 | ||
1290 | /** | 1292 | /** |
@@ -4625,15 +4627,16 @@ static int pm8001_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha, | |||
4625 | 4627 | ||
4626 | static u32 pm8001_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha) | 4628 | static u32 pm8001_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha) |
4627 | { | 4629 | { |
4628 | u32 value; | ||
4629 | #ifdef PM8001_USE_MSIX | 4630 | #ifdef PM8001_USE_MSIX |
4630 | return 1; | 4631 | return 1; |
4631 | #endif | 4632 | #else |
4633 | u32 value; | ||
4634 | |||
4632 | value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR); | 4635 | value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR); |
4633 | if (value) | 4636 | if (value) |
4634 | return 1; | 4637 | return 1; |
4635 | return 0; | 4638 | return 0; |
4636 | 4639 | #endif | |
4637 | } | 4640 | } |
4638 | 4641 | ||
4639 | /** | 4642 | /** |
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 536d2b4384f8..4a176e60307f 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c | |||
@@ -4619,15 +4619,16 @@ static int pm80xx_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha, | |||
4619 | 4619 | ||
4620 | static u32 pm80xx_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha) | 4620 | static u32 pm80xx_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha) |
4621 | { | 4621 | { |
4622 | u32 value; | ||
4623 | #ifdef PM8001_USE_MSIX | 4622 | #ifdef PM8001_USE_MSIX |
4624 | return 1; | 4623 | return 1; |
4625 | #endif | 4624 | #else |
4625 | u32 value; | ||
4626 | |||
4626 | value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR); | 4627 | value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR); |
4627 | if (value) | 4628 | if (value) |
4628 | return 1; | 4629 | return 1; |
4629 | return 0; | 4630 | return 0; |
4630 | 4631 | #endif | |
4631 | } | 4632 | } |
4632 | 4633 | ||
4633 | /** | 4634 | /** |