diff options
author | Bart Van Assche <bart.vanassche@sandisk.com> | 2015-07-09 10:25:46 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-08-26 13:46:04 -0400 |
commit | 8d16366b5f23e928e5fd22eaeaceeb0356921fc0 (patch) | |
tree | 85c5bdb786e768467383f3891a6954435a761d1b | |
parent | 8a318fe16096a45c03e8c9a39449d1f750fafd27 (diff) |
qla2xxx: Avoid that sparse complains about context imbalances
Surround conditional locking statements with "#ifndef __CHECKER__" /
"#endif" to hide these for the sparse static source code analysis
tool.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Acked-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_dbg.c | 36 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_nx.c | 8 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.c | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_tmpl.c | 4 |
4 files changed, 52 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 1a1a221e1759..583d52aae79d 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -695,8 +695,10 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
695 | 695 | ||
696 | flags = 0; | 696 | flags = 0; |
697 | 697 | ||
698 | #ifndef __CHECKER__ | ||
698 | if (!hardware_locked) | 699 | if (!hardware_locked) |
699 | spin_lock_irqsave(&ha->hardware_lock, flags); | 700 | spin_lock_irqsave(&ha->hardware_lock, flags); |
701 | #endif | ||
700 | 702 | ||
701 | if (!ha->fw_dump) { | 703 | if (!ha->fw_dump) { |
702 | ql_log(ql_log_warn, vha, 0xd002, | 704 | ql_log(ql_log_warn, vha, 0xd002, |
@@ -832,8 +834,12 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
832 | qla2xxx_dump_post_process(base_vha, rval); | 834 | qla2xxx_dump_post_process(base_vha, rval); |
833 | 835 | ||
834 | qla2300_fw_dump_failed: | 836 | qla2300_fw_dump_failed: |
837 | #ifndef __CHECKER__ | ||
835 | if (!hardware_locked) | 838 | if (!hardware_locked) |
836 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 839 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
840 | #else | ||
841 | ; | ||
842 | #endif | ||
837 | } | 843 | } |
838 | 844 | ||
839 | /** | 845 | /** |
@@ -859,8 +865,10 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
859 | mb0 = mb2 = 0; | 865 | mb0 = mb2 = 0; |
860 | flags = 0; | 866 | flags = 0; |
861 | 867 | ||
868 | #ifndef __CHECKER__ | ||
862 | if (!hardware_locked) | 869 | if (!hardware_locked) |
863 | spin_lock_irqsave(&ha->hardware_lock, flags); | 870 | spin_lock_irqsave(&ha->hardware_lock, flags); |
871 | #endif | ||
864 | 872 | ||
865 | if (!ha->fw_dump) { | 873 | if (!ha->fw_dump) { |
866 | ql_log(ql_log_warn, vha, 0xd004, | 874 | ql_log(ql_log_warn, vha, 0xd004, |
@@ -1030,8 +1038,12 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
1030 | qla2xxx_dump_post_process(base_vha, rval); | 1038 | qla2xxx_dump_post_process(base_vha, rval); |
1031 | 1039 | ||
1032 | qla2100_fw_dump_failed: | 1040 | qla2100_fw_dump_failed: |
1041 | #ifndef __CHECKER__ | ||
1033 | if (!hardware_locked) | 1042 | if (!hardware_locked) |
1034 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 1043 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
1044 | #else | ||
1045 | ; | ||
1046 | #endif | ||
1035 | } | 1047 | } |
1036 | 1048 | ||
1037 | void | 1049 | void |
@@ -1057,8 +1069,10 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
1057 | flags = 0; | 1069 | flags = 0; |
1058 | ha->fw_dump_cap_flags = 0; | 1070 | ha->fw_dump_cap_flags = 0; |
1059 | 1071 | ||
1072 | #ifndef __CHECKER__ | ||
1060 | if (!hardware_locked) | 1073 | if (!hardware_locked) |
1061 | spin_lock_irqsave(&ha->hardware_lock, flags); | 1074 | spin_lock_irqsave(&ha->hardware_lock, flags); |
1075 | #endif | ||
1062 | 1076 | ||
1063 | if (!ha->fw_dump) { | 1077 | if (!ha->fw_dump) { |
1064 | ql_log(ql_log_warn, vha, 0xd006, | 1078 | ql_log(ql_log_warn, vha, 0xd006, |
@@ -1282,8 +1296,12 @@ qla24xx_fw_dump_failed_0: | |||
1282 | qla2xxx_dump_post_process(base_vha, rval); | 1296 | qla2xxx_dump_post_process(base_vha, rval); |
1283 | 1297 | ||
1284 | qla24xx_fw_dump_failed: | 1298 | qla24xx_fw_dump_failed: |
1299 | #ifndef __CHECKER__ | ||
1285 | if (!hardware_locked) | 1300 | if (!hardware_locked) |
1286 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 1301 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
1302 | #else | ||
1303 | ; | ||
1304 | #endif | ||
1287 | } | 1305 | } |
1288 | 1306 | ||
1289 | void | 1307 | void |
@@ -1305,8 +1323,10 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
1305 | flags = 0; | 1323 | flags = 0; |
1306 | ha->fw_dump_cap_flags = 0; | 1324 | ha->fw_dump_cap_flags = 0; |
1307 | 1325 | ||
1326 | #ifndef __CHECKER__ | ||
1308 | if (!hardware_locked) | 1327 | if (!hardware_locked) |
1309 | spin_lock_irqsave(&ha->hardware_lock, flags); | 1328 | spin_lock_irqsave(&ha->hardware_lock, flags); |
1329 | #endif | ||
1310 | 1330 | ||
1311 | if (!ha->fw_dump) { | 1331 | if (!ha->fw_dump) { |
1312 | ql_log(ql_log_warn, vha, 0xd008, | 1332 | ql_log(ql_log_warn, vha, 0xd008, |
@@ -1598,8 +1618,12 @@ qla25xx_fw_dump_failed_0: | |||
1598 | qla2xxx_dump_post_process(base_vha, rval); | 1618 | qla2xxx_dump_post_process(base_vha, rval); |
1599 | 1619 | ||
1600 | qla25xx_fw_dump_failed: | 1620 | qla25xx_fw_dump_failed: |
1621 | #ifndef __CHECKER__ | ||
1601 | if (!hardware_locked) | 1622 | if (!hardware_locked) |
1602 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 1623 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
1624 | #else | ||
1625 | ; | ||
1626 | #endif | ||
1603 | } | 1627 | } |
1604 | 1628 | ||
1605 | void | 1629 | void |
@@ -1621,8 +1645,10 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
1621 | flags = 0; | 1645 | flags = 0; |
1622 | ha->fw_dump_cap_flags = 0; | 1646 | ha->fw_dump_cap_flags = 0; |
1623 | 1647 | ||
1648 | #ifndef __CHECKER__ | ||
1624 | if (!hardware_locked) | 1649 | if (!hardware_locked) |
1625 | spin_lock_irqsave(&ha->hardware_lock, flags); | 1650 | spin_lock_irqsave(&ha->hardware_lock, flags); |
1651 | #endif | ||
1626 | 1652 | ||
1627 | if (!ha->fw_dump) { | 1653 | if (!ha->fw_dump) { |
1628 | ql_log(ql_log_warn, vha, 0xd00a, | 1654 | ql_log(ql_log_warn, vha, 0xd00a, |
@@ -1916,8 +1942,12 @@ qla81xx_fw_dump_failed_0: | |||
1916 | qla2xxx_dump_post_process(base_vha, rval); | 1942 | qla2xxx_dump_post_process(base_vha, rval); |
1917 | 1943 | ||
1918 | qla81xx_fw_dump_failed: | 1944 | qla81xx_fw_dump_failed: |
1945 | #ifndef __CHECKER__ | ||
1919 | if (!hardware_locked) | 1946 | if (!hardware_locked) |
1920 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 1947 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
1948 | #else | ||
1949 | ; | ||
1950 | #endif | ||
1921 | } | 1951 | } |
1922 | 1952 | ||
1923 | void | 1953 | void |
@@ -1939,8 +1969,10 @@ qla83xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
1939 | flags = 0; | 1969 | flags = 0; |
1940 | ha->fw_dump_cap_flags = 0; | 1970 | ha->fw_dump_cap_flags = 0; |
1941 | 1971 | ||
1972 | #ifndef __CHECKER__ | ||
1942 | if (!hardware_locked) | 1973 | if (!hardware_locked) |
1943 | spin_lock_irqsave(&ha->hardware_lock, flags); | 1974 | spin_lock_irqsave(&ha->hardware_lock, flags); |
1975 | #endif | ||
1944 | 1976 | ||
1945 | if (!ha->fw_dump) { | 1977 | if (!ha->fw_dump) { |
1946 | ql_log(ql_log_warn, vha, 0xd00c, | 1978 | ql_log(ql_log_warn, vha, 0xd00c, |
@@ -2419,8 +2451,12 @@ qla83xx_fw_dump_failed_0: | |||
2419 | qla2xxx_dump_post_process(base_vha, rval); | 2451 | qla2xxx_dump_post_process(base_vha, rval); |
2420 | 2452 | ||
2421 | qla83xx_fw_dump_failed: | 2453 | qla83xx_fw_dump_failed: |
2454 | #ifndef __CHECKER__ | ||
2422 | if (!hardware_locked) | 2455 | if (!hardware_locked) |
2423 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 2456 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
2457 | #else | ||
2458 | ; | ||
2459 | #endif | ||
2424 | } | 2460 | } |
2425 | 2461 | ||
2426 | /****************************************************************************/ | 2462 | /****************************************************************************/ |
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index bb0ee7c604c7..eb0cc5475c45 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c | |||
@@ -476,7 +476,9 @@ qla82xx_wr_32(struct qla_hw_data *ha, ulong off_in, u32 data) | |||
476 | BUG_ON(rv == -1); | 476 | BUG_ON(rv == -1); |
477 | 477 | ||
478 | if (rv == 1) { | 478 | if (rv == 1) { |
479 | #ifndef __CHECKER__ | ||
479 | write_lock_irqsave(&ha->hw_lock, flags); | 480 | write_lock_irqsave(&ha->hw_lock, flags); |
481 | #endif | ||
480 | qla82xx_crb_win_lock(ha); | 482 | qla82xx_crb_win_lock(ha); |
481 | qla82xx_pci_set_crbwindow_2M(ha, off_in, &off); | 483 | qla82xx_pci_set_crbwindow_2M(ha, off_in, &off); |
482 | } | 484 | } |
@@ -485,7 +487,9 @@ qla82xx_wr_32(struct qla_hw_data *ha, ulong off_in, u32 data) | |||
485 | 487 | ||
486 | if (rv == 1) { | 488 | if (rv == 1) { |
487 | qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM7_UNLOCK)); | 489 | qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM7_UNLOCK)); |
490 | #ifndef __CHECKER__ | ||
488 | write_unlock_irqrestore(&ha->hw_lock, flags); | 491 | write_unlock_irqrestore(&ha->hw_lock, flags); |
492 | #endif | ||
489 | } | 493 | } |
490 | return 0; | 494 | return 0; |
491 | } | 495 | } |
@@ -503,7 +507,9 @@ qla82xx_rd_32(struct qla_hw_data *ha, ulong off_in) | |||
503 | BUG_ON(rv == -1); | 507 | BUG_ON(rv == -1); |
504 | 508 | ||
505 | if (rv == 1) { | 509 | if (rv == 1) { |
510 | #ifndef __CHECKER__ | ||
506 | write_lock_irqsave(&ha->hw_lock, flags); | 511 | write_lock_irqsave(&ha->hw_lock, flags); |
512 | #endif | ||
507 | qla82xx_crb_win_lock(ha); | 513 | qla82xx_crb_win_lock(ha); |
508 | qla82xx_pci_set_crbwindow_2M(ha, off_in, &off); | 514 | qla82xx_pci_set_crbwindow_2M(ha, off_in, &off); |
509 | } | 515 | } |
@@ -511,7 +517,9 @@ qla82xx_rd_32(struct qla_hw_data *ha, ulong off_in) | |||
511 | 517 | ||
512 | if (rv == 1) { | 518 | if (rv == 1) { |
513 | qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM7_UNLOCK)); | 519 | qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM7_UNLOCK)); |
520 | #ifndef __CHECKER__ | ||
514 | write_unlock_irqrestore(&ha->hw_lock, flags); | 521 | write_unlock_irqrestore(&ha->hw_lock, flags); |
522 | #endif | ||
515 | } | 523 | } |
516 | return data; | 524 | return data; |
517 | } | 525 | } |
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 445af44c9a7a..6b7736d02534 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c | |||
@@ -3955,16 +3955,20 @@ static void qlt_reject_free_srr_imm(struct scsi_qla_host *vha, | |||
3955 | struct qla_hw_data *ha = vha->hw; | 3955 | struct qla_hw_data *ha = vha->hw; |
3956 | unsigned long flags = 0; | 3956 | unsigned long flags = 0; |
3957 | 3957 | ||
3958 | #ifndef __CHECKER__ | ||
3958 | if (!ha_locked) | 3959 | if (!ha_locked) |
3959 | spin_lock_irqsave(&ha->hardware_lock, flags); | 3960 | spin_lock_irqsave(&ha->hardware_lock, flags); |
3961 | #endif | ||
3960 | 3962 | ||
3961 | qlt_send_notify_ack(vha, (void *)&imm->imm_ntfy, 0, 0, 0, | 3963 | qlt_send_notify_ack(vha, (void *)&imm->imm_ntfy, 0, 0, 0, |
3962 | NOTIFY_ACK_SRR_FLAGS_REJECT, | 3964 | NOTIFY_ACK_SRR_FLAGS_REJECT, |
3963 | NOTIFY_ACK_SRR_REJECT_REASON_UNABLE_TO_PERFORM, | 3965 | NOTIFY_ACK_SRR_REJECT_REASON_UNABLE_TO_PERFORM, |
3964 | NOTIFY_ACK_SRR_FLAGS_REJECT_EXPL_NO_EXPL); | 3966 | NOTIFY_ACK_SRR_FLAGS_REJECT_EXPL_NO_EXPL); |
3965 | 3967 | ||
3968 | #ifndef __CHECKER__ | ||
3966 | if (!ha_locked) | 3969 | if (!ha_locked) |
3967 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 3970 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
3971 | #endif | ||
3968 | 3972 | ||
3969 | kfree(imm); | 3973 | kfree(imm); |
3970 | } | 3974 | } |
diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c index f4eb65524ae4..ddbe2e7ac14d 100644 --- a/drivers/scsi/qla2xxx/qla_tmpl.c +++ b/drivers/scsi/qla2xxx/qla_tmpl.c | |||
@@ -939,8 +939,10 @@ qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked) | |||
939 | { | 939 | { |
940 | ulong flags = 0; | 940 | ulong flags = 0; |
941 | 941 | ||
942 | #ifndef __CHECKER__ | ||
942 | if (!hardware_locked) | 943 | if (!hardware_locked) |
943 | spin_lock_irqsave(&vha->hw->hardware_lock, flags); | 944 | spin_lock_irqsave(&vha->hw->hardware_lock, flags); |
945 | #endif | ||
944 | 946 | ||
945 | if (!vha->hw->fw_dump) | 947 | if (!vha->hw->fw_dump) |
946 | ql_log(ql_log_warn, vha, 0xd01e, "fwdump buffer missing.\n"); | 948 | ql_log(ql_log_warn, vha, 0xd01e, "fwdump buffer missing.\n"); |
@@ -953,6 +955,8 @@ qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked) | |||
953 | else | 955 | else |
954 | qla27xx_execute_fwdt_template(vha); | 956 | qla27xx_execute_fwdt_template(vha); |
955 | 957 | ||
958 | #ifndef __CHECKER__ | ||
956 | if (!hardware_locked) | 959 | if (!hardware_locked) |
957 | spin_unlock_irqrestore(&vha->hw->hardware_lock, flags); | 960 | spin_unlock_irqrestore(&vha->hw->hardware_lock, flags); |
961 | #endif | ||
958 | } | 962 | } |