From 937348097de4ef831edf8c91dc8e86e486b11518 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 6 Feb 2004 22:49:38 -0600 Subject: [PATCH] [PATCH] Fix qla2xxx warnings On ppc64: drivers/scsi/qla2xxx/qla_dbg.c: In function `qla2300_fw_dump': drivers/scsi/qla2xxx/qla_dbg.c:64: warning: int format, different type arg (arg 5) drivers/scsi/qla2xxx/qla_dbg.c: In function `qla2100_fw_dump': drivers/scsi/qla2xxx/qla_dbg.c:600: warning: int format, different type arg (arg 5) drivers/scsi/qla2xxx/qla_os.c: In function `qla2x00_proc_info': drivers/scsi/qla2xxx/qla_os.c:2386: warning: cast to pointer from integer of different size drivers/scsi/qla2xxx/qla_os.c:2386: warning: cast to pointer from integer of different size The qla_dbg() warning occurs because on ppc64 size_t is a long. sizeof returns a size_t. I used %Z rather than the more modern %z, because gcc-2.95 warns about %z. printk supports both. For printing out dma_addr_t's, we really don't know what size they are here, so treating them as unsigned long long is best. --- drivers/scsi/qla2xxx/qla_dbg.c | 4 ++-- drivers/scsi/qla2xxx/qla_os.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 9e19f079dac0e..02bbfa4a9649e 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -62,7 +62,7 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked) ha->fw_dump_order); if (ha->fw_dump == NULL) { qla_printk(KERN_WARNING, ha, - "Unable to allocated memory for firmware dump (%d/%d).\n", + "Unable to allocated memory for firmware dump (%d/%Zd).\n", ha->fw_dump_order, sizeof(struct qla2300_fw_dump)); return; } @@ -598,7 +598,7 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked) ha->fw_dump_order); if (ha->fw_dump == NULL) { qla_printk(KERN_WARNING, ha, - "Unable to allocated memory for firmware dump (%d/%d).\n", + "Unable to allocated memory for firmware dump (%d/%Zd).\n", ha->fw_dump_order, sizeof(struct qla2100_fw_dump)); return; } diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index acde58daa022d..37407716fb34a 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -2382,8 +2382,9 @@ qla2x00_proc_info(struct Scsi_Host *shost, char *buffer, ha->brd_info->isp_name, ('A' + tmp_sn/100000), (tmp_sn%100000)); copy_info(&info, - "Request Queue = 0x%p, Response Queue = 0x%p\n", - (void *)ha->request_dma, (void *)ha->response_dma); + "Request Queue = 0x%llx, Response Queue = 0x%llx\n", + (unsigned long long)ha->request_dma, + (unsigned long long)ha->response_dma); copy_info(&info, "Request Queue count = %ld, Response Queue count = %ld\n", -- 2.53.0