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/amd/display: Deduplicate DCN DDC register assignment Date: Sun, 22 Mar 2026 03:15:10 +1000 Message-ID: In-Reply-To: <20260321015654.105059-1-guilhermeivob@gmail.com> References: <20260321015654.105059-1-guilhermeivob@gmail.com> <20260321015654.105059-1-guilhermeivob@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 **Critical: Wrong parameter types =E2=80=94 will not compile** In `hw_factory_dcn_ddc.h:14-15`, the helper declares: ```c const struct ddc_shift *shift, const struct ddc_mask *mask) ``` The types `struct ddc_shift` and `struct ddc_mask` **do not exist** anywher= e in the kernel tree. The correct type for both is `struct ddc_sh_mask`, as= defined in `ddc_regs.h:130` and used by all the caller arrays (e.g. `hw_fa= ctory_dcn20.c:137`): ```c static const struct ddc_sh_mask ddc_shift[] =3D { ... }; static const struct ddc_sh_mask ddc_mask[] =3D { ... }; ``` And the `hw_ddc` struct (`hw_ddc.h:34-35`) stores them as: ```c const struct ddc_sh_mask *shifts; const struct ddc_sh_mask *masks; ``` The fix is to change both parameters to `const struct ddc_sh_mask *`. **Minor: Copyright year** The new header (`hw_factory_dcn_ddc.h:4`) says `Copyright 2024` but this is= new code written in 2026. Should be `2026`. **Minor: Missing include guard for dependencies** The new header `hw_factory_dcn_ddc.h` uses `struct hw_gpio_pin`, `struct dd= c_registers`, `struct hw_ddc`, `HW_DDC_FROM_BASE`, `GPIO_ID_DDC_DATA`, `GPI= O_ID_DDC_CLOCK`, and `ASSERT_CRITICAL` without including any headers. It re= lies entirely on the including `.c` file having already included the right = headers in the right order. This is fragile =E2=80=94 a comment at the top = noting the required includes, or explicit includes, would be more robust. T= his is a pre-existing pattern in the codebase though, so it's not a blocker. **Design: `static inline` in a header** Using `static inline` is reasonable for this small helper. Each translation= unit gets its own copy, but the function is small enough that the compiler= will inline it, so there's no code size penalty. **Correctness of the transformation (modulo the type bug)** The logic in the helper faithfully reproduces the original `switch`/assignm= ent pattern from all 6 files. The `en` index, the `ASSERT_CRITICAL(false)` = default case, and the shift/mask assignment after the switch are all preser= ved correctly. **Summary:** Fix the `struct ddc_shift`/`struct ddc_mask` =E2=86=92 `struct= ddc_sh_mask` type error, update the copyright year, and this is a clean, c= orrect deduplication patch. --- Generated by Claude Code Patch Reviewer