public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/exynos: fix size_t format string
Date: Thu, 28 May 2026 12:08:08 +1000	[thread overview]
Message-ID: <review-patch1-20260527194525.45762-1-arnd@kernel.org> (raw)
In-Reply-To: <20260527194525.45762-1-arnd@kernel.org>

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

      parent reply	other threads:[~2026-05-28  2:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=review-patch1-20260527194525.45762-1-arnd@kernel.org \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox