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/panel: novatek-nt36672a: Inline panel init sequences
Date: Mon, 18 May 2026 15:58:44 +1000	[thread overview]
Message-ID: <review-patch1-20260518034252.16337-1-chintanlike@gmail.com> (raw)
In-Reply-To: <20260518034252.16337-1-chintanlike@gmail.com>

Patch Review

**Positive aspects:**

- Correct use of `mipi_dsi_dcs_write_var_seq_multi()` for loop bodies where the command byte is a runtime variable. The `_var_` variant uses stack-allocated `const u8 d[]` instead of `static const u8 d[]`, which is necessary when the initializer contains non-constant expressions:
  ```c
  for (reg = 0x02; reg <= 0x10; reg++)
      mipi_dsi_dcs_write_var_seq_multi(dsi_ctx, reg, 0x40);
  ```

- All 12 loop compressions faithfully represent the original contiguous register ranges with no registers added or dropped. Spot-checked ranges like `0x5B–0x6F` (value 0x50, 21 registers), `0x8B–0x9F` (value 0x80, 21 registers), and `0xE5–0xF6` (value 0x40, 18 registers) all match the original table entries exactly.

- The `u8 reg` loop variable is safe — the maximum loop bound is `0xF6` (246), so the post-increment never wraps around 255.

- NULL checks on function pointers in `prepare`/`unprepare` are good defensive practice, even though the single panel descriptor always provides all three.

- The `on_cmds_2` (5 entries) and `off_cmds` (4 entries) tables are converted 1:1 with no loops, which is correct since those sequences have no repeating patterns.

**Minor nits (non-blocking):**

1. **Naming: `off_init` is slightly misleading.** The function runs during `unprepare` (display shutdown), not initialization. The original field was `off_cmds` which was more semantically neutral. Consider `off_cmds_fn` or `unprepare_cmds` or just `off` to avoid the implication that "init" means startup:
   ```c
   void (*off_init)(struct mipi_dsi_multi_context *dsi_ctx);
   ```
   This is a style nit — the commit message and context make the intent clear.

2. **Gaps between individual writes could also use brief comments.** The original data tables made the register gaps (0x3C, 0x3E, 0xA1, 0xA3–A5, etc.) visible implicitly through the numbering. In the new inline form, a reader might wonder whether those gaps were intentional or accidental. A comment like `/* 0x3C, 0x3E intentionally skipped */` at the relevant gaps could help, but this is entirely optional.

3. **Commit message mentions `mipi_dsi_dcs_write_var_seq_multi()` but doesn't explain why it's needed instead of `mipi_dsi_dcs_write_seq_multi()`.** A one-liner noting "the `_var_` variant is required when the command byte comes from a variable, as the `_seq_` variant uses `static const` arrays" would help future readers of the git log understand the distinction.

**Verdict:** The patch is correct and ready to merge. The refactoring is faithful, the macro usage is appropriate, and the code is cleaner as a result. The nits above are optional improvements.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-18  5:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18  3:42 [PATCH v2] drm/panel: novatek-nt36672a: Inline panel init sequences Chintan Patel
2026-05-18  5:58 ` Claude Code Review Bot [this message]
2026-05-18  5:58 ` Claude review: " Claude Code Review Bot

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-20260518034252.16337-1-chintanlike@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