Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: iop-adma: use correct printk format strings

When compile-testing on other architectures, we get lots of warnings
about incorrect format strings, like:

drivers/dma/iop-adma.c: In function 'iop_adma_alloc_slots':
drivers/dma/iop-adma.c:307:6: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=]

drivers/dma/iop-adma.c: In function 'iop_adma_prep_dma_memcpy':
>> drivers/dma/iop-adma.c:518:40: warning: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'size_t {aka long unsigned int}' [-Wformat=]

Use %zu for printing size_t as required, and cast the dma_addr_t
arguments to 'u64' for printing with %llx. Ideally this should use
the %pad format string, but that requires an lvalue argument that
doesn't work here.

Link: https://lore.kernel.org/r/20190809163334.489360-3-arnd@arndb.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+9 -9
+9 -9
drivers/dma/iop-adma.c
··· 117 117 list_for_each_entry_safe(iter, _iter, &iop_chan->chain, 118 118 chain_node) { 119 119 pr_debug("\tcookie: %d slot: %d busy: %d " 120 - "this_desc: %#x next_desc: %#x ack: %d\n", 120 + "this_desc: %#x next_desc: %#llx ack: %d\n", 121 121 iter->async_tx.cookie, iter->idx, busy, 122 - iter->async_tx.phys, iop_desc_get_next_desc(iter), 122 + iter->async_tx.phys, (u64)iop_desc_get_next_desc(iter), 123 123 async_tx_test_ack(&iter->async_tx)); 124 124 prefetch(_iter); 125 125 prefetch(&_iter->async_tx); ··· 307 307 int i; 308 308 dev_dbg(iop_chan->device->common.dev, 309 309 "allocated slot: %d " 310 - "(desc %p phys: %#x) slots_per_op %d\n", 310 + "(desc %p phys: %#llx) slots_per_op %d\n", 311 311 iter->idx, iter->hw_desc, 312 - iter->async_tx.phys, slots_per_op); 312 + (u64)iter->async_tx.phys, slots_per_op); 313 313 314 314 /* pre-ack all but the last descriptor */ 315 315 if (num_slots != slots_per_op) ··· 517 517 return NULL; 518 518 BUG_ON(len > IOP_ADMA_MAX_BYTE_COUNT); 519 519 520 - dev_dbg(iop_chan->device->common.dev, "%s len: %u\n", 520 + dev_dbg(iop_chan->device->common.dev, "%s len: %zu\n", 521 521 __func__, len); 522 522 523 523 spin_lock_bh(&iop_chan->lock); ··· 550 550 BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT); 551 551 552 552 dev_dbg(iop_chan->device->common.dev, 553 - "%s src_cnt: %d len: %u flags: %lx\n", 553 + "%s src_cnt: %d len: %zu flags: %lx\n", 554 554 __func__, src_cnt, len, flags); 555 555 556 556 spin_lock_bh(&iop_chan->lock); ··· 583 583 if (unlikely(!len)) 584 584 return NULL; 585 585 586 - dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %u\n", 586 + dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %zu\n", 587 587 __func__, src_cnt, len); 588 588 589 589 spin_lock_bh(&iop_chan->lock); ··· 621 621 BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT); 622 622 623 623 dev_dbg(iop_chan->device->common.dev, 624 - "%s src_cnt: %d len: %u flags: %lx\n", 624 + "%s src_cnt: %d len: %zu flags: %lx\n", 625 625 __func__, src_cnt, len, flags); 626 626 627 627 if (dmaf_p_disabled_continue(flags)) ··· 684 684 return NULL; 685 685 BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT); 686 686 687 - dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %u\n", 687 + dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %zu\n", 688 688 __func__, src_cnt, len); 689 689 690 690 spin_lock_bh(&iop_chan->lock);