Skip to content

Commit 7b5c256

Browse files
arndbgregkh
authored andcommitted
dmaengine: iop-adma: use correct printk format strings
[ Upstream commit 00c9755 ] 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/[email protected] Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Vinod Koul <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 151e5ef commit 7b5c256

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/dma/iop-adma.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ static void __iop_adma_slot_cleanup(struct iop_adma_chan *iop_chan)
116116
list_for_each_entry_safe(iter, _iter, &iop_chan->chain,
117117
chain_node) {
118118
pr_debug("\tcookie: %d slot: %d busy: %d "
119-
"this_desc: %#x next_desc: %#x ack: %d\n",
119+
"this_desc: %#x next_desc: %#llx ack: %d\n",
120120
iter->async_tx.cookie, iter->idx, busy,
121-
iter->async_tx.phys, iop_desc_get_next_desc(iter),
121+
iter->async_tx.phys, (u64)iop_desc_get_next_desc(iter),
122122
async_tx_test_ack(&iter->async_tx));
123123
prefetch(_iter);
124124
prefetch(&_iter->async_tx);
@@ -306,9 +306,9 @@ iop_adma_alloc_slots(struct iop_adma_chan *iop_chan, int num_slots,
306306
int i;
307307
dev_dbg(iop_chan->device->common.dev,
308308
"allocated slot: %d "
309-
"(desc %p phys: %#x) slots_per_op %d\n",
309+
"(desc %p phys: %#llx) slots_per_op %d\n",
310310
iter->idx, iter->hw_desc,
311-
iter->async_tx.phys, slots_per_op);
311+
(u64)iter->async_tx.phys, slots_per_op);
312312

313313
/* pre-ack all but the last descriptor */
314314
if (num_slots != slots_per_op)
@@ -516,7 +516,7 @@ iop_adma_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dma_dest,
516516
return NULL;
517517
BUG_ON(len > IOP_ADMA_MAX_BYTE_COUNT);
518518

519-
dev_dbg(iop_chan->device->common.dev, "%s len: %u\n",
519+
dev_dbg(iop_chan->device->common.dev, "%s len: %zu\n",
520520
__func__, len);
521521

522522
spin_lock_bh(&iop_chan->lock);
@@ -549,7 +549,7 @@ iop_adma_prep_dma_xor(struct dma_chan *chan, dma_addr_t dma_dest,
549549
BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT);
550550

551551
dev_dbg(iop_chan->device->common.dev,
552-
"%s src_cnt: %d len: %u flags: %lx\n",
552+
"%s src_cnt: %d len: %zu flags: %lx\n",
553553
__func__, src_cnt, len, flags);
554554

555555
spin_lock_bh(&iop_chan->lock);
@@ -582,7 +582,7 @@ iop_adma_prep_dma_xor_val(struct dma_chan *chan, dma_addr_t *dma_src,
582582
if (unlikely(!len))
583583
return NULL;
584584

585-
dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %u\n",
585+
dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %zu\n",
586586
__func__, src_cnt, len);
587587

588588
spin_lock_bh(&iop_chan->lock);
@@ -620,7 +620,7 @@ iop_adma_prep_dma_pq(struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src,
620620
BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT);
621621

622622
dev_dbg(iop_chan->device->common.dev,
623-
"%s src_cnt: %d len: %u flags: %lx\n",
623+
"%s src_cnt: %d len: %zu flags: %lx\n",
624624
__func__, src_cnt, len, flags);
625625

626626
if (dmaf_p_disabled_continue(flags))
@@ -683,7 +683,7 @@ iop_adma_prep_dma_pq_val(struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src,
683683
return NULL;
684684
BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT);
685685

686-
dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %u\n",
686+
dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %zu\n",
687687
__func__, src_cnt, len);
688688

689689
spin_lock_bh(&iop_chan->lock);

0 commit comments

Comments
 (0)