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/amdgpu: optimize psp_copy_fw()
Date: Tue, 26 May 2026 07:30:33 +1000	[thread overview]
Message-ID: <review-patch1-e16b3b7bba06c6c9b4f0577b23b25cf0f5045fda.1779697857.git.christophe.jaillet@wanadoo.fr> (raw)
In-Reply-To: <e16b3b7bba06c6c9b4f0577b23b25cf0f5045fda.1779697857.git.christophe.jaillet@wanadoo.fr>

Patch Review

**Correctness: OK**

The original code:
```c
memset(psp->fw_pri_buf, 0, PSP_1_MEG);
memcpy(psp->fw_pri_buf, start_addr, bin_size);
```

is replaced with:
```c
memcpy_and_pad(psp->fw_pri_buf, PSP_1_MEG, start_addr, bin_size, 0);
```

The `memcpy_and_pad` implementation (`lib/string_helpers.c:1004`) does:
```c
if (dest_len > count) {
    memcpy(dest, src, count);
    memset(dest + count, pad, dest_len - count);
} else {
    memcpy(dest, src, dest_len);
}
```

The guard at line 4583 ensures `bin_size <= PSP_1_MEG`, so `memcpy_and_pad` will either copy `bin_size` bytes then zero-pad the remainder (when `bin_size < PSP_1_MEG`), or copy exactly `PSP_1_MEG` bytes (when equal). Both cases are semantically identical to the original. The arguments are mapped correctly: `dest=fw_pri_buf`, `dest_len=PSP_1_MEG`, `src=start_addr`, `count=bin_size`, `pad=0`.

**Nits (commit message only):**

- "1 Mo" should be "1 MB" (Mo is the French abbreviation for megaoctet).
- "the partially re-written" should be "then partially re-written".

These are cosmetic commit message issues; the code change itself is clean and correct.

---
Generated by Claude Code Patch Reviewer

      parent reply	other threads:[~2026-05-25 21:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25  8:31 [PATCH] drm/amdgpu: optimize psp_copy_fw() Christophe JAILLET
2026-05-25 21:30 ` Claude review: " Claude Code Review Bot
2026-05-25 21:30 ` 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-e16b3b7bba06c6c9b4f0577b23b25cf0f5045fda.1779697857.git.christophe.jaillet@wanadoo.fr \
    --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