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/mediatek: simplify mtk_crtc allocation Date: Tue, 31 Mar 2026 16:46:56 +1000 Message-ID: In-Reply-To: <20260331002357.7995-1-rosenp@gmail.com> References: <20260331002357.7995-1-rosenp@gmail.com> <20260331002357.7995-1-rosenp@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:** 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 a= rray 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]`) re= main 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_ro= utes ? 1 : 0))` correctly accounts for the extra slot that `conn_routes` ma= y later populate (line 1182: `mtk_crtc->ddp_comp_nr++`), matching the origi= nal `devm_kcalloc` count. 4. The struct is only dynamically allocated and accessed via `to_mtk_crtc()= ` / `container_of()` =E2=80=94 never embedded in another struct or stack-al= located =E2=80=94 so the FAM constraint is satisfied. 5. The reordering of `mmsys_dev` vs `ddp_comp_nr` assignment is harmless; n= either depends on the other. **Style nit:** The allocation line is quite long (over 100 characters): ```c mtk_crtc =3D 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 in= to 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