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: use READ_ONCE() in psr_su_set_dsc_slice_height() Date: Tue, 26 May 2026 07:36:07 +1000 Message-ID: In-Reply-To: References: X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Overall Series Review Subject: drm/amd/display: use READ_ONCE() in psr_su_set_dsc_slice_height() Author: Dan Carpenter Patches: 1 Reviewed: 2026-05-26T07:36:07.237075 --- This is a single patch from Dan Carpenter addressing a static checker warni= ng about a potential divide-by-zero in `psr_su_set_dsc_slice_height()`. The= original code checked `stream->timing.dsc_cfg.num_slices_v` for zero twice= =E2=80=94 once in the early-return guard and again before the division =E2= =80=94 suggesting a possible race. The patch consolidates both checks into = one, using `READ_ONCE()` to snapshot the value. The patch is **reasonable but the race-condition narrative is questionable*= *. The function operates on a `dc_stream_state` that is typically set up du= ring mode-set and not concurrently modified. If there were a genuine race o= n `num_slices_v`, `READ_ONCE()` on that single field wouldn't be sufficient= =E2=80=94 the neighboring fields (`v_addressable`, `v_border_top`, `v_bord= er_bottom`) read from the same `stream->timing` could also be stale or torn= . A real TOCTOU here would need broader locking or a full structure snapsho= t, not just `READ_ONCE()` on one field. That said, the patch does fix the static checker warning, eliminates the re= dundant check, and the resulting code is marginally cleaner. It's a low-ris= k cleanup. --- Generated by Claude Code Patch Reviewer