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/mediatek: simplify mtk_crtc allocation
Date: Tue, 31 Mar 2026 16:46:56 +1000	[thread overview]
Message-ID: <review-patch1-20260331002357.7995-1-rosenp@gmail.com> (raw)
In-Reply-To: <20260331002357.7995-1-rosenp@gmail.com>

Patch Review

**Correctness:**

The change is functionally correct:

1. `struct mtk_ddp_comp **ddp_comp` (a pointer to a heap-allocated array of pointers) is replaced with `struct mtk_ddp_comp *ddp_comp[]` (a flexible array member of pointers). Both yield the same element type (`struct mtk_ddp_comp *`) when indexed, so all ~50 usage sites (`mtk_crtc->ddp_comp[i]`) remain type-correct without changes.

2. The FAM is correctly placed as the last member of `struct mtk_crtc`.

3. The allocation size `struct_size(mtk_crtc, ddp_comp, path_len + (conn_routes ? 1 : 0))` correctly accounts for the extra slot that `conn_routes` may later populate (line 1182: `mtk_crtc->ddp_comp_nr++`), matching the original `devm_kcalloc` count.

4. The struct is only dynamically allocated and accessed via `to_mtk_crtc()` / `container_of()` — never embedded in another struct or stack-allocated — so the FAM constraint is satisfied.

5. The reordering of `mmsys_dev` vs `ddp_comp_nr` assignment is harmless; neither depends on the other.

**Style nit:**

The allocation line is quite long (over 100 characters):
```c
mtk_crtc = devm_kzalloc(dev, struct_size(mtk_crtc, ddp_comp, path_len + (conn_routes ? 1 : 0)), GFP_KERNEL);
```
Consider breaking this across lines, e.g. computing the `num_comp` count into a local variable beforehand or splitting the function arguments, to stay within kernel style (~100 col). Not a blocker.

**No other issues found.** The patch is a clean simplification that removes one allocation and one error path.

---
Generated by Claude Code Patch Reviewer

      parent reply	other threads:[~2026-03-31  6:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31  0:23 [PATCH] drm/mediatek: simplify mtk_crtc allocation Rosen Penev
2026-03-31  6:46 ` Claude review: " Claude Code Review Bot
2026-03-31  6:46 ` 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-20260331002357.7995-1-rosenp@gmail.com \
    --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