* [PATCH] drm/exynos: fix size_t format string
@ 2026-05-27 19:45 Arnd Bergmann
2026-05-27 21:03 ` Chen-Yu Tsai
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2026-05-27 19:45 UTC (permalink / raw)
To: Inki Dae, Seung-Woo Kim, Kyungmin Park, David Airlie,
Simona Vetter, Krzysztof Kozlowski, Chen-Yu Tsai,
Marek Szyprowski
Cc: Arnd Bergmann, Alim Akhtar, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
The exynos_gem->base.size argument is a size_t rather than an
unsigned long, so adapt the printk() format string accordingly:
In file included from drivers/gpu/drm/exynos/exynos_drm_gem.c:16:
drivers/gpu/drm/exynos/exynos_drm_gem.c: In function 'exynos_drm_alloc_buf':
drivers/gpu/drm/exynos/exynos_drm_gem.c:69:49: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
69 | DRM_DEV_DEBUG_KMS(drm_dev_dma_dev(dev), "dma_addr(0x%lx), size(0x%lx)\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70 | (unsigned long)exynos_gem->dma_addr, exynos_gem->base.size);
| ~~~~~~~~~~~~~~~~~~~~~
| |
| size_t {aka unsigned int}
The dma_addr in the same line is already printed using a cast
to unsigned long, so change that similarly to use the correct
%pad format.
Fixes: 11e898373fba ("drm/exynos: Drop exynos_drm_gem.size field")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/exynos/exynos_drm_gem.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index 297a93b087cd..8e357f2beb9e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -66,8 +66,8 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem, bool kvmap)
if (kvmap)
exynos_gem->kvaddr = exynos_gem->cookie;
- DRM_DEV_DEBUG_KMS(drm_dev_dma_dev(dev), "dma_addr(0x%lx), size(0x%lx)\n",
- (unsigned long)exynos_gem->dma_addr, exynos_gem->base.size);
+ DRM_DEV_DEBUG_KMS(drm_dev_dma_dev(dev), "dma_addr(%pad), size(0x%zx)\n",
+ &exynos_gem->dma_addr, exynos_gem->base.size);
return 0;
}
@@ -80,8 +80,8 @@ static void exynos_drm_free_buf(struct exynos_drm_gem *exynos_gem)
return;
}
- DRM_DEV_DEBUG_KMS(dev->dev, "dma_addr(0x%lx), size(0x%lx)\n",
- (unsigned long)exynos_gem->dma_addr, exynos_gem->base.size);
+ DRM_DEV_DEBUG_KMS(dev->dev, "dma_addr(0x%pad), size(0x%zx)\n",
+ &exynos_gem->dma_addr, exynos_gem->base.size);
dma_free_attrs(drm_dev_dma_dev(dev), exynos_gem->base.size, exynos_gem->cookie,
(dma_addr_t)exynos_gem->dma_addr,
--
2.39.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] drm/exynos: fix size_t format string
2026-05-27 19:45 [PATCH] drm/exynos: fix size_t format string Arnd Bergmann
@ 2026-05-27 21:03 ` Chen-Yu Tsai
2026-05-28 2:08 ` Claude review: " Claude Code Review Bot
2026-05-28 2:08 ` Claude Code Review Bot
2 siblings, 0 replies; 4+ messages in thread
From: Chen-Yu Tsai @ 2026-05-27 21:03 UTC (permalink / raw)
To: Arnd Bergmann, Inki Dae
Cc: Seung-Woo Kim, Kyungmin Park, David Airlie, Simona Vetter,
Krzysztof Kozlowski, Marek Szyprowski, Arnd Bergmann, Alim Akhtar,
dri-devel, linux-arm-kernel, linux-samsung-soc, linux-kernel
On Wed, May 27, 2026 at 9:45 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The exynos_gem->base.size argument is a size_t rather than an
> unsigned long, so adapt the printk() format string accordingly:
>
> In file included from drivers/gpu/drm/exynos/exynos_drm_gem.c:16:
> drivers/gpu/drm/exynos/exynos_drm_gem.c: In function 'exynos_drm_alloc_buf':
> drivers/gpu/drm/exynos/exynos_drm_gem.c:69:49: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
> 69 | DRM_DEV_DEBUG_KMS(drm_dev_dma_dev(dev), "dma_addr(0x%lx), size(0x%lx)\n",
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 70 | (unsigned long)exynos_gem->dma_addr, exynos_gem->base.size);
> | ~~~~~~~~~~~~~~~~~~~~~
> | |
> | size_t {aka unsigned int}
>
> The dma_addr in the same line is already printed using a cast
> to unsigned long, so change that similarly to use the correct
> %pad format.
>
> Fixes: 11e898373fba ("drm/exynos: Drop exynos_drm_gem.size field")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
I posted the same patch [1] one and a half months ago when the culprit
patch was queued up and I got a report about this from the bots.
Inki hasn't picked up my fix yet.
And it seems the exynos-drm-next stuff was only merged into drm-next
yesterday, now causing the warnings to pop up all over.
ChenYu
[1] https://lore.kernel.org/all/20260408064936.1342321-1-wenst@chromium.org/
> ---
> drivers/gpu/drm/exynos/exynos_drm_gem.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> index 297a93b087cd..8e357f2beb9e 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> @@ -66,8 +66,8 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem, bool kvmap)
> if (kvmap)
> exynos_gem->kvaddr = exynos_gem->cookie;
>
> - DRM_DEV_DEBUG_KMS(drm_dev_dma_dev(dev), "dma_addr(0x%lx), size(0x%lx)\n",
> - (unsigned long)exynos_gem->dma_addr, exynos_gem->base.size);
> + DRM_DEV_DEBUG_KMS(drm_dev_dma_dev(dev), "dma_addr(%pad), size(0x%zx)\n",
> + &exynos_gem->dma_addr, exynos_gem->base.size);
> return 0;
> }
>
> @@ -80,8 +80,8 @@ static void exynos_drm_free_buf(struct exynos_drm_gem *exynos_gem)
> return;
> }
>
> - DRM_DEV_DEBUG_KMS(dev->dev, "dma_addr(0x%lx), size(0x%lx)\n",
> - (unsigned long)exynos_gem->dma_addr, exynos_gem->base.size);
> + DRM_DEV_DEBUG_KMS(dev->dev, "dma_addr(0x%pad), size(0x%zx)\n",
> + &exynos_gem->dma_addr, exynos_gem->base.size);
>
> dma_free_attrs(drm_dev_dma_dev(dev), exynos_gem->base.size, exynos_gem->cookie,
> (dma_addr_t)exynos_gem->dma_addr,
> --
> 2.39.5
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Claude review: drm/exynos: fix size_t format string
2026-05-27 19:45 [PATCH] drm/exynos: fix size_t format string Arnd Bergmann
2026-05-27 21:03 ` Chen-Yu Tsai
@ 2026-05-28 2:08 ` Claude Code Review Bot
2026-05-28 2:08 ` Claude Code Review Bot
2 siblings, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-05-28 2:08 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Correctness of the format changes:**
The two format changes are correct:
1. `%lx` → `%zx` for `exynos_gem->base.size` (which is `size_t`): Correct. `%zx` is the proper portable format specifier for `size_t`.
2. `%lx` with `(unsigned long)` cast → `%pad` with `&` for `exynos_gem->dma_addr` (which is `dma_addr_t`): Correct. `%pad` is the kernel's recommended format for `dma_addr_t` and takes a pointer to the value.
**Minor inconsistency between the two hunks:**
In `exynos_drm_alloc_buf`, the format string is:
```c
"dma_addr(%pad), size(0x%zx)\n"
```
But in `exynos_drm_free_buf`, the format string is:
```c
"dma_addr(0x%pad), size(0x%zx)\n"
```
The `0x` prefix before `%pad` in the second hunk is incorrect — `%pad` already includes the `0x` prefix in its output (it uses `phys_addr_t` formatting which prepends `0x`). This would result in output like `dma_addr(0x0x12345678)` in the free path. The first hunk correctly omits the `0x` prefix.
Looking at the diff more closely:
```
- DRM_DEV_DEBUG_KMS(dev->dev, "dma_addr(0x%lx), size(0x%lx)\n",
- (unsigned long)exynos_gem->dma_addr, exynos_gem->base.size);
+ DRM_DEV_DEBUG_KMS(dev->dev, "dma_addr(0x%pad), size(0x%zx)\n",
+ &exynos_gem->dma_addr, exynos_gem->base.size);
```
The `0x` was left in front of `%pad` in the second hunk but correctly removed in the first hunk. This should be `"dma_addr(%pad), size(0x%zx)\n"` to be consistent and avoid the double-prefix.
**Alignment fix:** The patch also adjusts continuation line alignment from tabs to spaces to match the opening parenthesis, which is a nice cleanup.
**Recommendation:** The `0x%pad` in the second hunk should be changed to just `%pad` to match the first hunk and avoid doubled `0x` output. Otherwise the patch is correct and should be applied.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 4+ messages in thread
* Claude review: drm/exynos: fix size_t format string
2026-05-27 19:45 [PATCH] drm/exynos: fix size_t format string Arnd Bergmann
2026-05-27 21:03 ` Chen-Yu Tsai
2026-05-28 2:08 ` Claude review: " Claude Code Review Bot
@ 2026-05-28 2:08 ` Claude Code Review Bot
2 siblings, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-05-28 2:08 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: drm/exynos: fix size_t format string
Author: Arnd Bergmann <arnd@kernel.org>
Patches: 2
Reviewed: 2026-05-28T12:08:08.345241
---
This is a single-patch fix from Arnd Bergmann addressing a `-Werror=format` build warning/error in the Exynos DRM GEM code. The `exynos_gem->base.size` field is `size_t`, which is `unsigned int` on 32-bit ARM, but was being printed with `%lx` (expects `unsigned long`). The fix changes the format to `%zx` for size and `%pad` for the DMA address. The patch is correct and straightforward, though there is one minor inconsistency worth noting.
**Verdict: Looks good overall, one minor nit.**
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-28 2:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27 19:45 [PATCH] drm/exynos: fix size_t format string Arnd Bergmann
2026-05-27 21:03 ` Chen-Yu Tsai
2026-05-28 2:08 ` Claude review: " Claude Code Review Bot
2026-05-28 2:08 ` Claude Code Review Bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox