* [PATCH] drm/exynos/gem: Fix printk specifier for gem_object.size and dma_addr
@ 2026-04-08 6:49 Chen-Yu Tsai
2026-04-12 3:01 ` Claude review: " Claude Code Review Bot
2026-04-12 3:01 ` Claude Code Review Bot
0 siblings, 2 replies; 3+ messages in thread
From: Chen-Yu Tsai @ 2026-04-08 6:49 UTC (permalink / raw)
To: Inki Dae, Seung-Woo Kim, Kyungmin Park, Krzysztof Kozlowski,
Alim Akhtar
Cc: Chen-Yu Tsai, David Airlie, Simona Vetter, dri-devel,
linux-samsung-soc, linux-arm-kernel, linux-kernel,
kernel test robot
In the recent change to use the GEM base object's size field instead of
the exynos_gem object's additional field, the printk format was not
adjusted for the change to size_t type. This causes a new warning on
platforms on which size_t is not unsigned long.
Fix this by using the correct "%zx" type.
While at it, fix the specifier for dma_addr so that the cast to unsigned
long is not longer needed.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604081331.jSJQSVmg-lkp@intel.com/
Fixes: 11e898373fba ("drm/exynos: Drop exynos_drm_gem.size field")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
---
This is only compile tested. Build for ARM 32-bit confirms the warning
is fixed. Sorry for the noise.
The commit hash used in the Fixes tag is the current one seen in
exynos-drm-next.
---
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 d9d42809a1a9..f264e170bc26 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(%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.53.0.1213.gd9a14994de-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Claude review: drm/exynos/gem: Fix printk specifier for gem_object.size and dma_addr
2026-04-08 6:49 [PATCH] drm/exynos/gem: Fix printk specifier for gem_object.size and dma_addr Chen-Yu Tsai
@ 2026-04-12 3:01 ` Claude Code Review Bot
2026-04-12 3:01 ` Claude Code Review Bot
1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 3:01 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: drm/exynos/gem: Fix printk specifier for gem_object.size and dma_addr
Author: Chen-Yu Tsai <wenst@chromium.org>
Patches: 1
Reviewed: 2026-04-12T13:01:45.666653
---
This is a single, straightforward fix patch that corrects printk format specifiers in the Exynos GEM driver. The change was prompted by a kernel test robot build warning after a prior commit (`11e898373fba`) changed the `size` field from `unsigned long` to `size_t` (by switching from `exynos_gem->size` to `exynos_gem->base.size`). On 32-bit ARM, `size_t` is `unsigned int`, not `unsigned long`, so `%lx` produces a warning.
The patch is correct, minimal, and well-motivated. **No issues found.**
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Claude review: drm/exynos/gem: Fix printk specifier for gem_object.size and dma_addr
2026-04-08 6:49 [PATCH] drm/exynos/gem: Fix printk specifier for gem_object.size and dma_addr Chen-Yu Tsai
2026-04-12 3:01 ` Claude review: " Claude Code Review Bot
@ 2026-04-12 3:01 ` Claude Code Review Bot
1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 3:01 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Verdict: Looks good.**
Two changes are made in two call sites (`exynos_drm_alloc_buf` and `exynos_drm_free_buf`):
1. **`size` format: `%lx` → `%zx`** — Correct. `drm_gem_object.size` is `size_t` (confirmed in `include/drm/drm_gem.h:341`), and `%zx` is the proper format specifier for `size_t`. This eliminates the warning on architectures where `size_t != unsigned long` (e.g., 32-bit ARM).
2. **`dma_addr` format: `%lx` with cast → `%pad` by reference** — Correct and an improvement. Per `Documentation/core-api/printk-formats.rst:257`, `%pad` is the canonical kernel format for `dma_addr_t`, and it is passed by reference (hence the `&exynos_gem->dma_addr`). This removes the lossy `(unsigned long)` cast that would truncate the address on 32-bit platforms with 64-bit DMA addresses (e.g., `CONFIG_ARCH_DMA_ADDR_T_64BIT`).
```diff
- 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);
```
Minor note: `%pad` already prints the `0x` prefix (the kernel documentation shows `0x01234567`), so the output format changes slightly from `dma_addr(0x...)` to `dma_addr(0x...)` — this is fine and arguably more correct since it avoids a double `0x` if one was ever added.
The alignment fix (extra space to align under `drm_dev_dma_dev`) is also a nice touch.
**Reviewed-by worthy.** The commit message is clear, references the Fixes tag and the build robot report, and the code change is mechanical and correct.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-12 3:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 6:49 [PATCH] drm/exynos/gem: Fix printk specifier for gem_object.size and dma_addr Chen-Yu Tsai
2026-04-12 3:01 ` Claude review: " Claude Code Review Bot
2026-04-12 3:01 ` 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