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

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: apple-admac: Use {low,upp}er_32_bits() to split 64-bit address

If CONFIG_PHYS_ADDR_T_64BIT is not set:

drivers/dma/apple-admac.c: In function ‘admac_cyclic_write_one_desc’:
drivers/dma/apple-admac.c:213:22: error: right shift count >= width of type [-Werror=shift-count-overflow]
213 | writel_relaxed(addr >> 32, ad->base + REG_DESC_WRITE(channo));
| ^~

Fix this by using the {low,upp}er_32_bits() helper macros to obtain the
address parts.

Reported-by: noreply@ellerman.id.au
Fixes: b127315d9a78c011 ("dmaengine: apple-admac: Add Apple ADMAC driver")
Acked-by: Martin Povišer <povik+lin@cutebit.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20220616141312.1953819-1-geert@linux-m68k.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Geert Uytterhoeven and committed by
Vinod Koul
ce4b461b 81ce6f3d

+4 -4
+4 -4
drivers/dma/apple-admac.c
··· 209 209 dev_dbg(ad->dev, "ch%d descriptor: addr=0x%pad len=0x%zx flags=0x%lx\n", 210 210 channo, &addr, tx->period_len, FLAG_DESC_NOTIFY); 211 211 212 - writel_relaxed(addr, ad->base + REG_DESC_WRITE(channo)); 213 - writel_relaxed(addr >> 32, ad->base + REG_DESC_WRITE(channo)); 214 - writel_relaxed(tx->period_len, ad->base + REG_DESC_WRITE(channo)); 215 - writel_relaxed(FLAG_DESC_NOTIFY, ad->base + REG_DESC_WRITE(channo)); 212 + writel_relaxed(lower_32_bits(addr), ad->base + REG_DESC_WRITE(channo)); 213 + writel_relaxed(upper_32_bits(addr), ad->base + REG_DESC_WRITE(channo)); 214 + writel_relaxed(tx->period_len, ad->base + REG_DESC_WRITE(channo)); 215 + writel_relaxed(FLAG_DESC_NOTIFY, ad->base + REG_DESC_WRITE(channo)); 216 216 217 217 tx->submitted_pos += tx->period_len; 218 218 tx->submitted_pos %= 2 * tx->buf_len;