From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/tegra: sor: Remove usage of drm_simple_encoder_init()
Date: Mon, 25 May 2026 18:06:52 +1000 [thread overview]
Message-ID: <review-patch1-20260523012824.81043-1-jmclemore.lkml@gmail.com> (raw)
In-Reply-To: <20260523012824.81043-1-jmclemore.lkml@gmail.com>
Patch Review
**Correctness: Good.** The transformation is faithful to the original helper implementation:
Original in `drm_simple_kms_helper.c`:
```c
static const struct drm_encoder_funcs drm_simple_encoder_funcs_cleanup = {
.destroy = drm_encoder_cleanup,
};
int drm_simple_encoder_init(...) {
return drm_encoder_init(dev, encoder,
&drm_simple_encoder_funcs_cleanup,
encoder_type, NULL);
}
```
New code in `sor.c`:
```c
static const struct drm_encoder_funcs tegra_sor_encoder_funcs_cleanup = {
.destroy = drm_encoder_cleanup,
};
...
drm_encoder_init(drm, &sor->output.encoder, &tegra_sor_encoder_funcs_cleanup, encoder, NULL);
```
This is a correct 1:1 translation.
**Nit 1 — Naming convention.** The struct is named `tegra_sor_encoder_funcs_cleanup`, which appends `_cleanup` to emphasize that the only op is `.destroy = drm_encoder_cleanup`. This mirrors the internal naming in `drm_simple_kms_helper.c`, but the more conventional name in DRM drivers would be simply `tegra_sor_encoder_funcs`. The `_cleanup` suffix is slightly unusual for a `drm_encoder_funcs` struct name and could be confusing (it reads like a cleanup function rather than a funcs table). That said, this is subjective and minor.
**Nit 2 — Line length.** The replacement call:
```c
drm_encoder_init(drm, &sor->output.encoder, &tegra_sor_encoder_funcs_cleanup, encoder, NULL);
```
is 88 characters, which exceeds the preferred 80-column limit. The existing tegra code is not strict about 80 columns but does generally wrap long function calls. Consider wrapping it for consistency with the surrounding style, e.g.:
```c
drm_encoder_init(drm, &sor->output.encoder,
&tegra_sor_encoder_funcs_cleanup,
encoder, NULL);
```
**Note — unchecked return value.** Both `drm_simple_encoder_init()` (before) and `drm_encoder_init()` (after) return `int`, and neither is checked. This is a pre-existing issue in the tegra driver (same pattern in `hdmi.c`, `rgb.c`, `dsi.c`) and not something this patch needs to fix, but worth noting. The todo.rst task is specifically about removing the `drm_simple_encoder_init` wrapper, not fixing error handling.
**Overall: Patch is correct and suitable for merging, optionally with the naming and line-length adjustments.**
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-25 8:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-23 1:26 [PATCH] drm/tegra: sor: Remove usage of drm_simple_encoder_init() Jacob McLemore
2026-05-25 8:06 ` Claude Code Review Bot [this message]
2026-05-25 8:06 ` 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-20260523012824.81043-1-jmclemore.lkml@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