Commit d8424f68 authored by Joe Perches's avatar Joe Perches Committed by James Bottomley

[SCSI] qla2xxx: Make the logging functions verify their arguments and fixed...

[SCSI] qla2xxx: Make the logging functions verify their arguments and fixed the current broken uses as appropriate.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: default avatarChad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 086b3e8a
...@@ -667,7 +667,7 @@ qla2x00_sysfs_write_edc(struct file *filp, struct kobject *kobj, ...@@ -667,7 +667,7 @@ qla2x00_sysfs_write_edc(struct file *filp, struct kobject *kobj,
dev, adr, len, opt); dev, adr, len, opt);
if (rval != QLA_SUCCESS) { if (rval != QLA_SUCCESS) {
ql_log(ql_log_warn, vha, 0x7074, ql_log(ql_log_warn, vha, 0x7074,
"Unable to write EDC (%x) %02x:%04x:%02x:%02hhx\n", "Unable to write EDC (%x) %02x:%04x:%02x:%02x:%02hhx\n",
rval, dev, adr, opt, len, buf[8]); rval, dev, adr, opt, len, buf[8]);
return -EIO; return -EIO;
} }
...@@ -724,7 +724,7 @@ qla2x00_sysfs_write_edc_status(struct file *filp, struct kobject *kobj, ...@@ -724,7 +724,7 @@ qla2x00_sysfs_write_edc_status(struct file *filp, struct kobject *kobj,
dev, adr, len, opt); dev, adr, len, opt);
if (rval != QLA_SUCCESS) { if (rval != QLA_SUCCESS) {
ql_log(ql_log_info, vha, 0x7075, ql_log(ql_log_info, vha, 0x7075,
"Unable to write EDC status (%x) %02x:%04x:%02x.\n", "Unable to write EDC status (%x) %02x:%04x:%02x:%02x.\n",
rval, dev, adr, opt, len); rval, dev, adr, opt, len);
return -EIO; return -EIO;
} }
......
...@@ -244,14 +244,14 @@ struct qla2xxx_fw_dump { ...@@ -244,14 +244,14 @@ struct qla2xxx_fw_dump {
extern int ql_errlev; extern int ql_errlev;
void void __attribute__((format (printf, 4, 5)))
ql_dbg(uint32_t, scsi_qla_host_t *vha, int32_t, const char *fmt, ...); ql_dbg(uint32_t, scsi_qla_host_t *vha, int32_t, const char *fmt, ...);
void void __attribute__((format (printf, 4, 5)))
ql_dbg_pci(uint32_t, struct pci_dev *pdev, int32_t, const char *fmt, ...); ql_dbg_pci(uint32_t, struct pci_dev *pdev, int32_t, const char *fmt, ...);
void void __attribute__((format (printf, 4, 5)))
ql_log(uint32_t, scsi_qla_host_t *vha, int32_t, const char *fmt, ...); ql_log(uint32_t, scsi_qla_host_t *vha, int32_t, const char *fmt, ...);
void void __attribute__((format (printf, 4, 5)))
ql_log_pci(uint32_t, struct pci_dev *pdev, int32_t, const char *fmt, ...); ql_log_pci(uint32_t, struct pci_dev *pdev, int32_t, const char *fmt, ...);
/* Debug Levels */ /* Debug Levels */
......
...@@ -4188,7 +4188,8 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) ...@@ -4188,7 +4188,8 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
spin_unlock_irqrestore(&ha->vport_slock, flags); spin_unlock_irqrestore(&ha->vport_slock, flags);
} else { } else {
ql_log(ql_log_warn, vha, 0x8023, "%s **** FAILED ****.\n"); ql_log(ql_log_warn, vha, 0x8023, "%s **** FAILED ****.\n",
__func__);
} }
return(status); return(status);
......
...@@ -1004,7 +1004,7 @@ qla24xx_walk_and_build_sglist(struct qla_hw_data *ha, srb_t *sp, uint32_t *dsd, ...@@ -1004,7 +1004,7 @@ qla24xx_walk_and_build_sglist(struct qla_hw_data *ha, srb_t *sp, uint32_t *dsd,
sle_dma = sg_dma_address(sg); sle_dma = sg_dma_address(sg);
ql_dbg(ql_dbg_io, vha, 0x300a, ql_dbg(ql_dbg_io, vha, 0x300a,
"sg entry %d - addr=0x%x 0x%x, " "len=%d for cmd=%p.\n", "sg entry %d - addr=0x%x 0x%x, " "len=%d for cmd=%p.\n",
cur_dsd, i, LSD(sle_dma), MSD(sle_dma), sg_dma_len(sg), i, LSD(sle_dma), MSD(sle_dma), sg_dma_len(sg),
sp->cmd); sp->cmd);
*cur_dsd++ = cpu_to_le32(LSD(sle_dma)); *cur_dsd++ = cpu_to_le32(LSD(sle_dma));
*cur_dsd++ = cpu_to_le32(MSD(sle_dma)); *cur_dsd++ = cpu_to_le32(MSD(sle_dma));
......
...@@ -298,7 +298,7 @@ qla81xx_idc_event(scsi_qla_host_t *vha, uint16_t aen, uint16_t descr) ...@@ -298,7 +298,7 @@ qla81xx_idc_event(scsi_qla_host_t *vha, uint16_t aen, uint16_t descr)
return; return;
ql_dbg(ql_dbg_async, vha, 0x5022, ql_dbg(ql_dbg_async, vha, 0x5022,
"Inter-Driver Commucation %s -- ACK timeout=%d.\n", "%lu Inter-Driver Communication %s -- ACK timeout=%d.\n",
vha->host_no, event[aen & 0xff], timeout); vha->host_no, event[aen & 0xff], timeout);
rval = qla2x00_post_idc_ack_work(vha, mb); rval = qla2x00_post_idc_ack_work(vha, mb);
......
...@@ -369,7 +369,7 @@ qla82xx_pci_set_crbwindow_2M(struct qla_hw_data *ha, ulong *off) ...@@ -369,7 +369,7 @@ qla82xx_pci_set_crbwindow_2M(struct qla_hw_data *ha, ulong *off)
ql_dbg(ql_dbg_p3p, vha, 0xb000, ql_dbg(ql_dbg_p3p, vha, 0xb000,
"%s: Written crbwin (0x%x) " "%s: Written crbwin (0x%x) "
"!= Read crbwin (0x%x), off=0x%lx.\n", "!= Read crbwin (0x%x), off=0x%lx.\n",
ha->crb_win, win_read, *off); __func__, ha->crb_win, win_read, *off);
} }
*off = (*off & MASK(16)) + CRB_INDIRECT_2M + ha->nx_pcibase; *off = (*off & MASK(16)) + CRB_INDIRECT_2M + ha->nx_pcibase;
} }
...@@ -409,7 +409,7 @@ qla82xx_pci_set_crbwindow(struct qla_hw_data *ha, u64 off) ...@@ -409,7 +409,7 @@ qla82xx_pci_set_crbwindow(struct qla_hw_data *ha, u64 off)
} }
/* strange address given */ /* strange address given */
ql_dbg(ql_dbg_p3p, vha, 0xb001, ql_dbg(ql_dbg_p3p, vha, 0xb001,
"%x: Warning: unm_nic_pci_set_crbwindow " "%s: Warning: unm_nic_pci_set_crbwindow "
"called with an unknown address(%llx).\n", "called with an unknown address(%llx).\n",
QLA2XXX_DRIVER_NAME, off); QLA2XXX_DRIVER_NAME, off);
return off; return off;
...@@ -1711,12 +1711,12 @@ qla82xx_iospace_config(struct qla_hw_data *ha) ...@@ -1711,12 +1711,12 @@ qla82xx_iospace_config(struct qla_hw_data *ha)
ql_dbg_pci(ql_dbg_multiq, ha->pdev, 0xc006, ql_dbg_pci(ql_dbg_multiq, ha->pdev, 0xc006,
"nx_pci_base=%p iobase=%p " "nx_pci_base=%p iobase=%p "
"max_req_queues=%d msix_count=%d.\n", "max_req_queues=%d msix_count=%d.\n",
ha->nx_pcibase, ha->iobase, (void *)ha->nx_pcibase, ha->iobase,
ha->max_req_queues, ha->msix_count); ha->max_req_queues, ha->msix_count);
ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0010, ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0010,
"nx_pci_base=%p iobase=%p " "nx_pci_base=%p iobase=%p "
"max_req_queues=%d msix_count=%d.\n", "max_req_queues=%d msix_count=%d.\n",
ha->nx_pcibase, ha->iobase, (void *)ha->nx_pcibase, ha->iobase,
ha->max_req_queues, ha->msix_count); ha->max_req_queues, ha->msix_count);
return 0; return 0;
...@@ -1744,7 +1744,7 @@ qla82xx_pci_config(scsi_qla_host_t *vha) ...@@ -1744,7 +1744,7 @@ qla82xx_pci_config(scsi_qla_host_t *vha)
ret = pci_set_mwi(ha->pdev); ret = pci_set_mwi(ha->pdev);
ha->chip_revision = ha->pdev->revision; ha->chip_revision = ha->pdev->revision;
ql_dbg(ql_dbg_init, vha, 0x0043, ql_dbg(ql_dbg_init, vha, 0x0043,
"Chip revision:%ld.\n", "Chip revision:%d.\n",
ha->chip_revision); ha->chip_revision);
return 0; return 0;
} }
...@@ -3661,8 +3661,7 @@ qla82xx_check_md_needed(scsi_qla_host_t *vha) ...@@ -3661,8 +3661,7 @@ qla82xx_check_md_needed(scsi_qla_host_t *vha)
qla82xx_md_prep(vha); qla82xx_md_prep(vha);
} else } else
ql_log(ql_log_info, vha, 0xb02e, ql_log(ql_log_info, vha, 0xb02e,
"Firmware dump available to retrieve\n", "Firmware dump available to retrieve\n");
vha->host_no);
} }
} }
return rval; return rval;
...@@ -4067,7 +4066,7 @@ int qla2x00_wait_for_fcoe_ctx_reset(scsi_qla_host_t *vha) ...@@ -4067,7 +4066,7 @@ int qla2x00_wait_for_fcoe_ctx_reset(scsi_qla_host_t *vha)
} }
} }
ql_dbg(ql_dbg_p3p, vha, 0xb027, ql_dbg(ql_dbg_p3p, vha, 0xb027,
"%s status=%d.\n", status); "%s: status=%d.\n", __func__, status);
return status; return status;
} }
......
...@@ -1017,7 +1017,7 @@ __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type, ...@@ -1017,7 +1017,7 @@ __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type,
eh_reset_failed: eh_reset_failed:
ql_log(ql_log_info, vha, 0x800f, ql_log(ql_log_info, vha, 0x800f,
"%s RESET FAILED: %s for id %d lun %d cmd=%p.\n", name, "%s RESET FAILED: %s for id %d lun %d cmd=%p.\n", name,
reset_errors[err], cmd->device->id, cmd->device->lun); reset_errors[err], cmd->device->id, cmd->device->lun, cmd);
return FAILED; return FAILED;
} }
...@@ -1819,7 +1819,7 @@ qla2x00_set_isp_flags(struct qla_hw_data *ha) ...@@ -1819,7 +1819,7 @@ qla2x00_set_isp_flags(struct qla_hw_data *ha)
else else
ha->flags.port0 = 0; ha->flags.port0 = 0;
ql_dbg_pci(ql_dbg_init, ha->pdev, 0x000b, ql_dbg_pci(ql_dbg_init, ha->pdev, 0x000b,
"device_type=0x%x port=%d fw_srisc_address=%p.\n", "device_type=0x%x port=%d fw_srisc_address=0x%x.\n",
ha->device_type, ha->flags.port0, ha->fw_srisc_address); ha->device_type, ha->flags.port0, ha->fw_srisc_address);
} }
...@@ -1860,8 +1860,8 @@ qla2x00_iospace_config(struct qla_hw_data *ha) ...@@ -1860,8 +1860,8 @@ qla2x00_iospace_config(struct qla_hw_data *ha)
} }
ha->pio_address = pio; ha->pio_address = pio;
ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0014, ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0014,
"PIO address=%p.\n", "PIO address=%llu.\n",
ha->pio_address); (unsigned long long)ha->pio_address);
skip_pio: skip_pio:
/* Use MMIO operations for all accesses. */ /* Use MMIO operations for all accesses. */
...@@ -2227,7 +2227,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2227,7 +2227,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
ql_dbg(ql_dbg_init, base_vha, 0x0033, ql_dbg(ql_dbg_init, base_vha, 0x0033,
"max_id=%d this_id=%d " "max_id=%d this_id=%d "
"cmd_per_len=%d unique_id=%d max_cmd_len=%d max_channel=%d " "cmd_per_len=%d unique_id=%d max_cmd_len=%d max_channel=%d "
"max_lun=%d transportt=%p, vendor_id=%d.\n", host->max_id, "max_lun=%d transportt=%p, vendor_id=%llu.\n", host->max_id,
host->this_id, host->cmd_per_lun, host->unique_id, host->this_id, host->cmd_per_lun, host->unique_id,
host->max_cmd_len, host->max_channel, host->max_lun, host->max_cmd_len, host->max_channel, host->max_lun,
host->transportt, sht->vendor_id); 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,7 +2833,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
if (!ha->sns_cmd) if (!ha->sns_cmd)
goto fail_dma_pool; goto fail_dma_pool;
ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0026, ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0026,
"sns_cmd.\n", ha->sns_cmd); "sns_cmd: %p.\n", ha->sns_cmd);
} else { } else {
/* Get consistent memory allocated for MS IOCB */ /* Get consistent memory allocated for MS IOCB */
ha->ms_iocb = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, ha->ms_iocb = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL,
......
...@@ -904,8 +904,9 @@ qla2xxx_get_fdt_info(scsi_qla_host_t *vha) ...@@ -904,8 +904,9 @@ qla2xxx_get_fdt_info(scsi_qla_host_t *vha)
} }
done: done:
ql_dbg(ql_dbg_init, vha, 0x004d, ql_dbg(ql_dbg_init, vha, 0x004d,
"FDT[%x]: (0x%x/0x%x) erase=0x%x " "FDT[%s]: (0x%x/0x%x) erase=0x%x "
"pr=%x upro=%x wrtd=0x%x blk=0x%x.\n", loc, mid, fid, "pr=%x wrtd=0x%x blk=0x%x.\n",
loc, mid, fid,
ha->fdt_erase_cmd, ha->fdt_protect_sec_cmd, ha->fdt_erase_cmd, ha->fdt_protect_sec_cmd,
ha->fdt_wrt_disable, ha->fdt_block_size); ha->fdt_wrt_disable, ha->fdt_block_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment