summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi_tcp.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-03-04 20:39:10 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2019-03-06 19:26:45 -0500
commit038d710fca5bb149d3af2e0b71f1284f8430a979 (patch)
tree5d80d81cbc7b7edb19b7a3d9e461ffdd4d98403d /drivers/scsi/libiscsi_tcp.c
parent1ffdd2c0440dfda533ca9477a89550c9f48f4b35 (diff)
downloadlinux-stable-038d710fca5bb149d3af2e0b71f1284f8430a979.tar.gz
linux-stable-038d710fca5bb149d3af2e0b71f1284f8430a979.tar.bz2
linux-stable-038d710fca5bb149d3af2e0b71f1284f8430a979.zip
scsi: qla2xxx: avoid printf format warning
Depending on the target architecture and configuration, both phys_addr_t and dma_addr_t may be smaller than 'long long', so we get a warning when printing either of them using the %llx format string: drivers/scsi/qla2xxx/qla_iocb.c: In function 'qla24xx_walk_and_build_prot_sglist': drivers/scsi/qla2xxx/qla_iocb.c:1140:46: error: format '%llx' expects argument of type 'long long unsigned int', but argument 6 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=] "%s: page boundary crossing (phys=%llx len=%x)\n", ~~~^ %x __func__, sle_phys, sg->length); ~~~~~~~~ drivers/scsi/qla2xxx/qla_iocb.c:1180:29: error: format '%llx' expects argument of type 'long long unsigned int', but argument 7 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=] "%s: sg[%x] (phys=%llx sglen=%x) ldma_sg_len: %x dif_bundl_len: %x ldma_needed: %x\n", ~~~^ There are special %pad and %pap format strings in Linux that we could use here, but since the driver already does 64-bit arithmetic on the values, using a plain 'u64' seems more consistent here. Note: A possible related issue may be that the driver possibly checks the wrong kind of overflow: when an IOMMU is in use, buffers that cross a 32-bit boundary in physical addresses would still be mapped into dma addresses within the low 4GB space, so I suspect that we actually want to check sg_dma_address() instead of sg_phys() here. Fixes: 50b812755e97 ("scsi: qla2xxx: Fix DMA error when the DIF sg buffer crosses 4GB boundary") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/libiscsi_tcp.c')
0 files changed, 0 insertions, 0 deletions