Skip to content

Commit 00c9755

Browse files
committed
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/[email protected] Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Vinod Koul <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 7f8bf11 commit 00c9755

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
@@ -117,9 +117,9 @@ static void __iop_adma_slot_cleanup(struct iop_adma_chan *iop_chan)
117117
list_for_each_entry_safe(iter, _iter, &iop_chan->chain,
118118
chain_node) {
119119
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",
121121
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),
123123
async_tx_test_ack(&iter->async_tx));
124124
prefetch(_iter);
125125
prefetch(&_iter->async_tx);
@@ -307,9 +307,9 @@ iop_adma_alloc_slots(struct iop_adma_chan *iop_chan, int num_slots,
307307
int i;
308308
dev_dbg(iop_chan->device->common.dev,
309309
"allocated slot: %d "
310-
"(desc %p phys: %#x) slots_per_op %d\n",
310+
"(desc %p phys: %#llx) slots_per_op %d\n",
311311
iter->idx, iter->hw_desc,
312-
iter->async_tx.phys, slots_per_op);
312+
(u64)iter->async_tx.phys, slots_per_op);
313313

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

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

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

552552
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",
554554
__func__, src_cnt, len, flags);
555555

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

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",
587587
__func__, src_cnt, len);
588588

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

623623
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",
625625
__func__, src_cnt, len, flags);
626626

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

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",
688688
__func__, src_cnt, len);
689689

690690
spin_lock_bh(&iop_chan->lock);

0 commit comments

Comments
 (0)