Re: [PATCH v3] ASoC: loongson: Fix invalid position error in ls_pcm_pointer
From: Mark Brown
Date: Wed Jun 10 2026 - 09:44:01 EST
On Tue, Jun 02, 2026 at 10:01:32AM +0800, Li Jun wrote:
> The "invalid position" error occurred when the DMA position descriptor
> returned an invalid address value (e.g., pos = -1048838144). This happened
> + if (addr < runtime->dma_addr ||
> + addr > runtime->dma_addr + runtime->dma_bytes) {
> + dev_warn(dev, "WARNING! dma_addr:0x%x\n", addr);
> x = 0;
This breaks the x86 allmodconfig build:
In file included from /build/stage/linux/include/linux/device.h:15,
from /build/stage/linux/include/linux/pm_runtime.h:11,
from /build/stage/linux/sound/soc/loongson/loongson_dma.c:12:
/build/stage/linux/sound/soc/loongson/loongson_dma.c: In function ‘loongson_pcm_
pointer’:
/build/stage/linux/sound/soc/loongson/loongson_dma.c:213:31: error: format ‘%x’
expects argument of type ‘unsigned int’, but argument 3 has type ‘u64’ {aka ‘lon
g long unsigned int’} [-Werror=format=]
213 | dev_warn(dev, "WARNING! dma_addr:0x%x\n", addr);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/build/stage/linux/include/linux/dev_printk.h:110:30: note: in definition of mac
ro ‘dev_printk_index_wrap’
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
/build/stage/linux/include/linux/dev_printk.h:156:61: note: in expansion of macro ‘dev_fmt’
156 | dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
/build/stage/linux/sound/soc/loongson/loongson_dma.c:213:17: note: in expansion of macro ‘dev_warn’
213 | dev_warn(dev, "WARNING! dma_addr:0x%x\n", addr);
| ^~~~~~~~
/build/stage/linux/sound/soc/loongson/loongson_dma.c:213:53: note: format string is defined here
213 | dev_warn(dev, "WARNING! dma_addr:0x%x\n", addr);
| ~^
| |
| unsigned int
| %llx
cc1: all warnings being treated as errors
Attachment:
signature.asc
Description: PGP signature