Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Colin Ian King and committed by
Martin K. Petersen
292c04cc f99b77e0

+16 -12
+12 -9
drivers/scsi/pm8001/pm8001_hwi.c
··· 1204 1204 } 1205 1205 } 1206 1206 1207 + #ifndef PM8001_USE_MSIX 1207 1208 /** 1208 1209 * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt 1209 1210 * @pm8001_ha: our hba card information ··· 1225 1224 { 1226 1225 pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_MASK_ALL); 1227 1226 } 1227 + 1228 + #else 1228 1229 1229 1230 /** 1230 1231 * pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt ··· 1259 1256 msi_index += MSIX_TABLE_BASE; 1260 1257 pm8001_cw32(pm8001_ha, 0, msi_index, MSIX_INTERRUPT_DISABLE); 1261 1258 } 1259 + #endif 1262 1260 1263 1261 /** 1264 1262 * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt ··· 1270 1266 { 1271 1267 #ifdef PM8001_USE_MSIX 1272 1268 pm8001_chip_msix_interrupt_enable(pm8001_ha, 0); 1273 - return; 1274 - #endif 1269 + #else 1275 1270 pm8001_chip_intx_interrupt_enable(pm8001_ha); 1276 - 1271 + #endif 1277 1272 } 1278 1273 1279 1274 /** ··· 1284 1281 { 1285 1282 #ifdef PM8001_USE_MSIX 1286 1283 pm8001_chip_msix_interrupt_disable(pm8001_ha, 0); 1287 - return; 1288 - #endif 1284 + #else 1289 1285 pm8001_chip_intx_interrupt_disable(pm8001_ha); 1290 - 1286 + #endif 1291 1287 } 1292 1288 1293 1289 /** ··· 4627 4625 4628 4626 static u32 pm8001_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha) 4629 4627 { 4630 - u32 value; 4631 4628 #ifdef PM8001_USE_MSIX 4632 4629 return 1; 4633 - #endif 4630 + #else 4631 + u32 value; 4632 + 4634 4633 value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR); 4635 4634 if (value) 4636 4635 return 1; 4637 4636 return 0; 4638 - 4637 + #endif 4639 4638 } 4640 4639 4641 4640 /**
+4 -3
drivers/scsi/pm8001/pm80xx_hwi.c
··· 4619 4619 4620 4620 static u32 pm80xx_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha) 4621 4621 { 4622 - u32 value; 4623 4622 #ifdef PM8001_USE_MSIX 4624 4623 return 1; 4625 - #endif 4624 + #else 4625 + u32 value; 4626 + 4626 4627 value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR); 4627 4628 if (value) 4628 4629 return 1; 4629 4630 return 0; 4630 - 4631 + #endif 4631 4632 } 4632 4633 4633 4634 /**