From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260523012824.81043-1-jmclemore.lkml@gmail.com> References: <20260523012824.81043-1-jmclemore.lkml@gmail.com> <20260523012824.81043-1-jmclemore.lkml@gmail.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Correctness: Good.** The transformation is faithful to the original helpe= r implementation: Original in `drm_simple_kms_helper.c`: ```c static const struct drm_encoder_funcs drm_simple_encoder_funcs_cleanup =3D { .destroy =3D 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 =3D { .destroy =3D drm_encoder_cleanup, }; ... drm_encoder_init(drm, &sor->output.encoder, &tegra_sor_encoder_funcs_cleanu= p, encoder, NULL); ``` This is a correct 1:1 translation. **Nit 1 =E2=80=94 Naming convention.** The struct is named `tegra_sor_encod= er_funcs_cleanup`, which appends `_cleanup` to emphasize that the only op i= s `.destroy =3D drm_encoder_cleanup`. This mirrors the internal naming in `= drm_simple_kms_helper.c`, but the more conventional name in DRM drivers wou= ld be simply `tegra_sor_encoder_funcs`. The `_cleanup` suffix is slightly u= nusual for a `drm_encoder_funcs` struct name and could be confusing (it rea= ds like a cleanup function rather than a funcs table). That said, this is s= ubjective and minor. **Nit 2 =E2=80=94 Line length.** The replacement call: ```c drm_encoder_init(drm, &sor->output.encoder, &tegra_sor_encoder_funcs_cleanu= p, 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 fun= ction calls. Consider wrapping it for consistency with the surrounding styl= e, e.g.: ```c drm_encoder_init(drm, &sor->output.encoder, &tegra_sor_encoder_funcs_cleanup, encoder, NULL); ``` **Note =E2=80=94 unchecked return value.** Both `drm_simple_encoder_init()`= (before) and `drm_encoder_init()` (after) return `int`, and neither is che= cked. This is a pre-existing issue in the tegra driver (same pattern in `hd= mi.c`, `rgb.c`, `dsi.c`) and not something this patch needs to fix, but wor= th 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 n= aming and line-length adjustments.** --- Generated by Claude Code Patch Reviewer