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/exec: Remove the index parameter from drm_exec_for_each_locked_obj[_reverse] Date: Mon, 25 May 2026 21:59:34 +1000 Message-ID: In-Reply-To: <20260520101616.41284-2-thomas.hellstrom@linux.intel.com> References: <20260520101616.41284-1-thomas.hellstrom@linux.intel.com> <20260520101616.41284-2-thomas.hellstrom@linux.intel.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Assessment: Good.** This hides the loop index variable from callers by introducing helper macros with `__UNIQUE_ID`-generated variable names. The approach is standard kernel practice for preventing name collisions. The reverse iteration case is correct for `num_objects == 0`: ```c #define __drm_exec_for_each_locked_object_reverse(exec, obj, __index) \ for (unsigned long __index = (exec)->num_objects - 1; \ ((obj) = drm_exec_obj(exec, __index)); --__index) ``` When `num_objects` is 0, `__index` wraps to `ULONG_MAX`, and `drm_exec_obj()` returns NULL immediately. This matches the existing behavior. All call sites are correctly updated, and the removed `unsigned long index` declarations are the only uses. No issues. Minor nit: The `unsigned long` type for `__index` in the `for` init is a C99 declaration-in-for, which is fine since the kernel requires C11+. --- Generated by Claude Code Patch Reviewer