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/sched: Fix clang build warning in kunit tests Date: Mon, 25 May 2026 19:09:07 +1000 Message-ID: In-Reply-To: <20260522090129.9385-1-tvrtko.ursulin@igalia.com> References: <20260522090129.9385-1-tvrtko.ursulin@igalia.com> <20260522090129.9385-1-tvrtko.ursulin@igalia.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Correctness: Good.** The macro `KUNIT_CASE_PARAM_ATTR` expands `.attr = attributes` directly into a struct initializer (line 224 of `include/kunit/test.h`). When `attributes` is a named `const` variable, GCC accepts it but clang rejects it because it's not a compile-time constant expression per the C standard. Replacing with a compound literal `{ .speed = KUNIT_SPEED_SLOW }` is the standard-conforming fix. **Consistency: Good.** The existing callers in the tree already use this pattern: - `drivers/gpu/drm/xe/tests/xe_bo.c:622`: `{.speed = KUNIT_SPEED_SLOW}` - `fs/ext4/mballoc-test.c:990`: `{ .speed = KUNIT_SPEED_SLOW }` The patch matches the style with designated initializer and spaces inside braces, consistent with the ext4 usage. **Completeness: Good.** Both instances in the file (`drm_sched_scheduler_two_clients_tests` and `drm_sched_scheduler_many_clients_tests`) are fixed, and the now-unused `static const` variables are removed. **Commit message: Good.** Clearly explains the problem with the LKP bot error output, references the fix approach ("compound literal as other tests do"), and has appropriate tags (Reported-by, Closes, Fixes, Cc). **Minor note:** The `cs35l56-shared-test.c:857` caller uses `{ KUNIT_SPEED_SLOW }` (positional initializer) rather than `{ .speed = KUNIT_SPEED_SLOW }` (designated initializer). The designated initializer form used in this patch is preferable as it's more explicit and resilient to struct layout changes. **No issues found.** Clean, minimal fix. --- Generated by Claude Code Patch Reviewer