diff options
author | Joe Perches <joe@perches.com> | 2011-11-18 12:03:06 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-12-15 01:55:02 -0500 |
commit | d8424f68c0160c45c446e56cb586fd8b9c538a1a (patch) | |
tree | 060328584036c01127be743b5a54393b1c62f9e5 /drivers | |
parent | 086b3e8a399ecd089534280597cfba45b2b55887 (diff) |
[SCSI] qla2xxx: Make the logging functions verify their arguments and fixed the current broken uses as appropriate.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_dbg.h | 8 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_nx.c | 15 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 12 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_sup.c | 5 |
8 files changed, 26 insertions, 25 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 6465dae5883a..9298649514a5 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -667,7 +667,7 @@ qla2x00_sysfs_write_edc(struct file *filp, struct kobject *kobj, | |||
667 | dev, adr, len, opt); | 667 | dev, adr, len, opt); |
668 | if (rval != QLA_SUCCESS) { | 668 | if (rval != QLA_SUCCESS) { |
669 | ql_log(ql_log_warn, vha, 0x7074, | 669 | ql_log(ql_log_warn, vha, 0x7074, |
670 | "Unable to write EDC (%x) %02x:%04x:%02x:%02hhx\n", | 670 | "Unable to write EDC (%x) %02x:%04x:%02x:%02x:%02hhx\n", |
671 | rval, dev, adr, opt, len, buf[8]); | 671 | rval, dev, adr, opt, len, buf[8]); |
672 | return -EIO; | 672 | return -EIO; |
673 | } | 673 | } |
@@ -724,7 +724,7 @@ qla2x00_sysfs_write_edc_status(struct file *filp, struct kobject *kobj, | |||
724 | dev, adr, len, opt); | 724 | dev, adr, len, opt); |
725 | if (rval != QLA_SUCCESS) { | 725 | if (rval != QLA_SUCCESS) { |
726 | ql_log(ql_log_info, vha, 0x7075, | 726 | ql_log(ql_log_info, vha, 0x7075, |
727 | "Unable to write EDC status (%x) %02x:%04x:%02x.\n", | 727 | "Unable to write EDC status (%x) %02x:%04x:%02x:%02x.\n", |
728 | rval, dev, adr, opt, len); | 728 | rval, dev, adr, opt, len); |
729 | return -EIO; | 729 | return -EIO; |
730 | } | 730 | } |
diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h index 06928141cf64..29a7822848ae 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.h +++ b/drivers/scsi/qla2xxx/qla_dbg.h | |||
@@ -244,14 +244,14 @@ struct qla2xxx_fw_dump { | |||
244 | 244 | ||
245 | extern int ql_errlev; | 245 | extern int ql_errlev; |
246 | 246 | ||
247 | void | 247 | void __attribute__((format (printf, 4, 5))) |
248 | ql_dbg(uint32_t, scsi_qla_host_t *vha, int32_t, const char *fmt, ...); | 248 | ql_dbg(uint32_t, scsi_qla_host_t *vha, int32_t, const char *fmt, ...); |
249 | void | 249 | void __attribute__((format (printf, 4, 5))) |
250 | ql_dbg_pci(uint32_t, struct pci_dev *pdev, int32_t, const char *fmt, ...); | 250 | ql_dbg_pci(uint32_t, struct pci_dev *pdev, int32_t, const char *fmt, ...); |
251 | 251 | ||
252 | void | 252 | void __attribute__((format (printf, 4, 5))) |
253 | ql_log(uint32_t, scsi_qla_host_t *vha, int32_t, const char *fmt, ...); | 253 | ql_log(uint32_t, scsi_qla_host_t *vha, int32_t, const char *fmt, ...); |
254 | void | 254 | void __attribute__((format (printf, 4, 5))) |
255 | ql_log_pci(uint32_t, struct pci_dev *pdev, int32_t, const char *fmt, ...); | 255 | ql_log_pci(uint32_t, struct pci_dev *pdev, int32_t, const char *fmt, ...); |
256 | 256 | ||
257 | /* Debug Levels */ | 257 | /* Debug Levels */ |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 54ea68cec4c5..68cd0dd528df 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -4188,7 +4188,8 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) | |||
4188 | spin_unlock_irqrestore(&ha->vport_slock, flags); | 4188 | spin_unlock_irqrestore(&ha->vport_slock, flags); |
4189 | 4189 | ||
4190 | } else { | 4190 | } else { |
4191 | ql_log(ql_log_warn, vha, 0x8023, "%s **** FAILED ****.\n"); | 4191 | ql_log(ql_log_warn, vha, 0x8023, "%s **** FAILED ****.\n", |
4192 | __func__); | ||
4192 | } | 4193 | } |
4193 | 4194 | ||
4194 | return(status); | 4195 | return(status); |
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index a4b267e60a35..d63132536c88 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c | |||
@@ -1004,7 +1004,7 @@ qla24xx_walk_and_build_sglist(struct qla_hw_data *ha, srb_t *sp, uint32_t *dsd, | |||
1004 | sle_dma = sg_dma_address(sg); | 1004 | sle_dma = sg_dma_address(sg); |
1005 | ql_dbg(ql_dbg_io, vha, 0x300a, | 1005 | ql_dbg(ql_dbg_io, vha, 0x300a, |
1006 | "sg entry %d - addr=0x%x 0x%x, " "len=%d for cmd=%p.\n", | 1006 | "sg entry %d - addr=0x%x 0x%x, " "len=%d for cmd=%p.\n", |
1007 | cur_dsd, i, LSD(sle_dma), MSD(sle_dma), sg_dma_len(sg), | 1007 | i, LSD(sle_dma), MSD(sle_dma), sg_dma_len(sg), |
1008 | sp->cmd); | 1008 | sp->cmd); |
1009 | *cur_dsd++ = cpu_to_le32(LSD(sle_dma)); | 1009 | *cur_dsd++ = cpu_to_le32(LSD(sle_dma)); |
1010 | *cur_dsd++ = cpu_to_le32(MSD(sle_dma)); | 1010 | *cur_dsd++ = cpu_to_le32(MSD(sle_dma)); |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 7b91b290ffd6..53d83d66a015 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -298,7 +298,7 @@ qla81xx_idc_event(scsi_qla_host_t *vha, uint16_t aen, uint16_t descr) | |||
298 | return; | 298 | return; |
299 | 299 | ||
300 | ql_dbg(ql_dbg_async, vha, 0x5022, | 300 | ql_dbg(ql_dbg_async, vha, 0x5022, |
301 | "Inter-Driver Commucation %s -- ACK timeout=%d.\n", | 301 | "%lu Inter-Driver Communication %s -- ACK timeout=%d.\n", |
302 | vha->host_no, event[aen & 0xff], timeout); | 302 | vha->host_no, event[aen & 0xff], timeout); |
303 | 303 | ||
304 | rval = qla2x00_post_idc_ack_work(vha, mb); | 304 | rval = qla2x00_post_idc_ack_work(vha, mb); |
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index 03554934b0a5..360b9cb7153f 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c | |||
@@ -369,7 +369,7 @@ qla82xx_pci_set_crbwindow_2M(struct qla_hw_data *ha, ulong *off) | |||
369 | ql_dbg(ql_dbg_p3p, vha, 0xb000, | 369 | ql_dbg(ql_dbg_p3p, vha, 0xb000, |
370 | "%s: Written crbwin (0x%x) " | 370 | "%s: Written crbwin (0x%x) " |
371 | "!= Read crbwin (0x%x), off=0x%lx.\n", | 371 | "!= Read crbwin (0x%x), off=0x%lx.\n", |
372 | ha->crb_win, win_read, *off); | 372 | __func__, ha->crb_win, win_read, *off); |
373 | } | 373 | } |
374 | *off = (*off & MASK(16)) + CRB_INDIRECT_2M + ha->nx_pcibase; | 374 | *off = (*off & MASK(16)) + CRB_INDIRECT_2M + ha->nx_pcibase; |
375 | } | 375 | } |
@@ -409,7 +409,7 @@ qla82xx_pci_set_crbwindow(struct qla_hw_data *ha, u64 off) | |||
409 | } | 409 | } |
410 | /* strange address given */ | 410 | /* strange address given */ |
411 | ql_dbg(ql_dbg_p3p, vha, 0xb001, | 411 | ql_dbg(ql_dbg_p3p, vha, 0xb001, |
412 | "%x: Warning: unm_nic_pci_set_crbwindow " | 412 | "%s: Warning: unm_nic_pci_set_crbwindow " |
413 | "called with an unknown address(%llx).\n", | 413 | "called with an unknown address(%llx).\n", |
414 | QLA2XXX_DRIVER_NAME, off); | 414 | QLA2XXX_DRIVER_NAME, off); |
415 | return off; | 415 | return off; |
@@ -1711,12 +1711,12 @@ qla82xx_iospace_config(struct qla_hw_data *ha) | |||
1711 | ql_dbg_pci(ql_dbg_multiq, ha->pdev, 0xc006, | 1711 | ql_dbg_pci(ql_dbg_multiq, ha->pdev, 0xc006, |
1712 | "nx_pci_base=%p iobase=%p " | 1712 | "nx_pci_base=%p iobase=%p " |
1713 | "max_req_queues=%d msix_count=%d.\n", | 1713 | "max_req_queues=%d msix_count=%d.\n", |
1714 | ha->nx_pcibase, ha->iobase, | 1714 | (void *)ha->nx_pcibase, ha->iobase, |
1715 | ha->max_req_queues, ha->msix_count); | 1715 | ha->max_req_queues, ha->msix_count); |
1716 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0010, | 1716 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0010, |
1717 | "nx_pci_base=%p iobase=%p " | 1717 | "nx_pci_base=%p iobase=%p " |
1718 | "max_req_queues=%d msix_count=%d.\n", | 1718 | "max_req_queues=%d msix_count=%d.\n", |
1719 | ha->nx_pcibase, ha->iobase, | 1719 | (void *)ha->nx_pcibase, ha->iobase, |
1720 | ha->max_req_queues, ha->msix_count); | 1720 | ha->max_req_queues, ha->msix_count); |
1721 | return 0; | 1721 | return 0; |
1722 | 1722 | ||
@@ -1744,7 +1744,7 @@ qla82xx_pci_config(scsi_qla_host_t *vha) | |||
1744 | ret = pci_set_mwi(ha->pdev); | 1744 | ret = pci_set_mwi(ha->pdev); |
1745 | ha->chip_revision = ha->pdev->revision; | 1745 | ha->chip_revision = ha->pdev->revision; |
1746 | ql_dbg(ql_dbg_init, vha, 0x0043, | 1746 | ql_dbg(ql_dbg_init, vha, 0x0043, |
1747 | "Chip revision:%ld.\n", | 1747 | "Chip revision:%d.\n", |
1748 | ha->chip_revision); | 1748 | ha->chip_revision); |
1749 | return 0; | 1749 | return 0; |
1750 | } | 1750 | } |
@@ -3661,8 +3661,7 @@ qla82xx_check_md_needed(scsi_qla_host_t *vha) | |||
3661 | qla82xx_md_prep(vha); | 3661 | qla82xx_md_prep(vha); |
3662 | } else | 3662 | } else |
3663 | ql_log(ql_log_info, vha, 0xb02e, | 3663 | ql_log(ql_log_info, vha, 0xb02e, |
3664 | "Firmware dump available to retrieve\n", | 3664 | "Firmware dump available to retrieve\n"); |
3665 | vha->host_no); | ||
3666 | } | 3665 | } |
3667 | } | 3666 | } |
3668 | return rval; | 3667 | return rval; |
@@ -4067,7 +4066,7 @@ int qla2x00_wait_for_fcoe_ctx_reset(scsi_qla_host_t *vha) | |||
4067 | } | 4066 | } |
4068 | } | 4067 | } |
4069 | ql_dbg(ql_dbg_p3p, vha, 0xb027, | 4068 | ql_dbg(ql_dbg_p3p, vha, 0xb027, |
4070 | "%s status=%d.\n", status); | 4069 | "%s: status=%d.\n", __func__, status); |
4071 | 4070 | ||
4072 | return status; | 4071 | return status; |
4073 | } | 4072 | } |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index f9e5b85e84d8..8b4214502e45 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1017,7 +1017,7 @@ __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type, | |||
1017 | eh_reset_failed: | 1017 | eh_reset_failed: |
1018 | ql_log(ql_log_info, vha, 0x800f, | 1018 | ql_log(ql_log_info, vha, 0x800f, |
1019 | "%s RESET FAILED: %s for id %d lun %d cmd=%p.\n", name, | 1019 | "%s RESET FAILED: %s for id %d lun %d cmd=%p.\n", name, |
1020 | reset_errors[err], cmd->device->id, cmd->device->lun); | 1020 | reset_errors[err], cmd->device->id, cmd->device->lun, cmd); |
1021 | return FAILED; | 1021 | return FAILED; |
1022 | } | 1022 | } |
1023 | 1023 | ||
@@ -1819,7 +1819,7 @@ qla2x00_set_isp_flags(struct qla_hw_data *ha) | |||
1819 | else | 1819 | else |
1820 | ha->flags.port0 = 0; | 1820 | ha->flags.port0 = 0; |
1821 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x000b, | 1821 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x000b, |
1822 | "device_type=0x%x port=%d fw_srisc_address=%p.\n", | 1822 | "device_type=0x%x port=%d fw_srisc_address=0x%x.\n", |
1823 | ha->device_type, ha->flags.port0, ha->fw_srisc_address); | 1823 | ha->device_type, ha->flags.port0, ha->fw_srisc_address); |
1824 | } | 1824 | } |
1825 | 1825 | ||
@@ -1860,8 +1860,8 @@ qla2x00_iospace_config(struct qla_hw_data *ha) | |||
1860 | } | 1860 | } |
1861 | ha->pio_address = pio; | 1861 | ha->pio_address = pio; |
1862 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0014, | 1862 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0014, |
1863 | "PIO address=%p.\n", | 1863 | "PIO address=%llu.\n", |
1864 | ha->pio_address); | 1864 | (unsigned long long)ha->pio_address); |
1865 | 1865 | ||
1866 | skip_pio: | 1866 | skip_pio: |
1867 | /* Use MMIO operations for all accesses. */ | 1867 | /* Use MMIO operations for all accesses. */ |
@@ -2227,7 +2227,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2227 | ql_dbg(ql_dbg_init, base_vha, 0x0033, | 2227 | ql_dbg(ql_dbg_init, base_vha, 0x0033, |
2228 | "max_id=%d this_id=%d " | 2228 | "max_id=%d this_id=%d " |
2229 | "cmd_per_len=%d unique_id=%d max_cmd_len=%d max_channel=%d " | 2229 | "cmd_per_len=%d unique_id=%d max_cmd_len=%d max_channel=%d " |
2230 | "max_lun=%d transportt=%p, vendor_id=%d.\n", host->max_id, | 2230 | "max_lun=%d transportt=%p, vendor_id=%llu.\n", host->max_id, |
2231 | host->this_id, host->cmd_per_lun, host->unique_id, | 2231 | host->this_id, host->cmd_per_lun, host->unique_id, |
2232 | host->max_cmd_len, host->max_channel, host->max_lun, | 2232 | host->max_cmd_len, host->max_channel, host->max_lun, |
2233 | host->transportt, sht->vendor_id); | 2233 | host->transportt, sht->vendor_id); |
@@ -2833,7 +2833,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, | |||
2833 | if (!ha->sns_cmd) | 2833 | if (!ha->sns_cmd) |
2834 | goto fail_dma_pool; | 2834 | goto fail_dma_pool; |
2835 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0026, | 2835 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0026, |
2836 | "sns_cmd.\n", ha->sns_cmd); | 2836 | "sns_cmd: %p.\n", ha->sns_cmd); |
2837 | } else { | 2837 | } else { |
2838 | /* Get consistent memory allocated for MS IOCB */ | 2838 | /* Get consistent memory allocated for MS IOCB */ |
2839 | ha->ms_iocb = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, | 2839 | ha->ms_iocb = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, |
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index eff13563c82d..16bc72844a97 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c | |||
@@ -904,8 +904,9 @@ no_flash_data: | |||
904 | } | 904 | } |
905 | done: | 905 | done: |
906 | ql_dbg(ql_dbg_init, vha, 0x004d, | 906 | ql_dbg(ql_dbg_init, vha, 0x004d, |
907 | "FDT[%x]: (0x%x/0x%x) erase=0x%x " | 907 | "FDT[%s]: (0x%x/0x%x) erase=0x%x " |
908 | "pr=%x upro=%x wrtd=0x%x blk=0x%x.\n", loc, mid, fid, | 908 | "pr=%x wrtd=0x%x blk=0x%x.\n", |
909 | loc, mid, fid, | ||
909 | ha->fdt_erase_cmd, ha->fdt_protect_sec_cmd, | 910 | ha->fdt_erase_cmd, ha->fdt_protect_sec_cmd, |
910 | ha->fdt_wrt_disable, ha->fdt_block_size); | 911 | ha->fdt_wrt_disable, ha->fdt_block_size); |
911 | 912 | ||