public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
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	[thread overview]
Message-ID: <review-patch1-20260522090129.9385-1-tvrtko.ursulin@igalia.com> (raw)
In-Reply-To: <20260522090129.9385-1-tvrtko.ursulin@igalia.com>

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

  reply	other threads:[~2026-05-25  9:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22  9:01 [PATCH] drm/sched: Fix clang build warning in kunit tests Tvrtko Ursulin
2026-05-25  9:09 ` Claude Code Review Bot [this message]
2026-05-25  9:09 ` Claude review: " Claude Code Review Bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=review-patch1-20260522090129.9385-1-tvrtko.ursulin@igalia.com \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox