From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm: Suppress intentional warning backtraces in scaling unit tests
Date: Sat, 16 May 2026 10:56:14 +1000 [thread overview]
Message-ID: <review-patch3-20260514-kunit_add_support-v11-3-b36a530a6d8f@redhat.com> (raw)
In-Reply-To: <20260514-kunit_add_support-v11-3-b36a530a6d8f@redhat.com>
Patch Review
**Overall: Good practical demonstration.**
**Wrapping non-warning cases in suppression is harmless but unnecessary:**
```c
+ kunit_warning_suppress(test) {
+ scaling_factor = drm_rect_calc_hscale(¶ms->src, ¶ms->dst,
+ params->min_range,
+ params->max_range);
+ KUNIT_EXPECT_SUPPRESSED_WARNING_COUNT(test, expected_warnings);
+ }
```
When `expected_warnings == 0` (the non-error cases), the entire call is wrapped in a suppression block unnecessarily. This adds trivial overhead (kzalloc, list add/remove) for the non-warning parameterized cases. An alternative would be to conditionally wrap only the `-EINVAL` cases, but the current approach is simpler and more readable, and the overhead is negligible for tests. This is a reasonable trade-off.
**`INT_MIN` initialization:**
```c
+ int scaling_factor = INT_MIN;
```
The v10 changelog explains this was added to avoid "potentially uninitialized" warnings. This works but is defensive coding since `scaling_factor` is always assigned inside the block before the `KUNIT_EXPECT_EQ`. Still, it's harmless and the compiler might not see through the `for`-loop-based macro.
**`#include <linux/limits.h>` for `INT_MIN`:** Correct — `INT_MIN` is defined there.
**CONFIG_BUG skip is correct:**
```c
+ if (expected_warnings && !IS_ENABLED(CONFIG_BUG))
+ kunit_skip(test, "requires CONFIG_BUG");
```
Without `CONFIG_BUG`, WARN_ON becomes a no-op and the count would be 0, failing the count expectation. Skipping only the warning-expected parameterized cases is the right behavior.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-16 0:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 11:06 [PATCH v11 0/4] kunit: Add support for suppressing warning backtraces Albert Esteve
2026-05-14 11:06 ` [PATCH v11 1/4] bug/kunit: Core " Albert Esteve
2026-05-15 7:58 ` Albert Esteve
2026-05-16 0:56 ` Claude review: " Claude Code Review Bot
2026-05-14 11:06 ` [PATCH v11 2/4] kunit: Add backtrace suppression self-tests Albert Esteve
2026-05-15 8:30 ` Albert Esteve
2026-05-16 0:56 ` Claude review: " Claude Code Review Bot
2026-05-14 11:06 ` [PATCH v11 3/4] drm: Suppress intentional warning backtraces in scaling unit tests Albert Esteve
2026-05-16 0:56 ` Claude Code Review Bot [this message]
2026-05-14 11:06 ` [PATCH v11 4/4] kunit: Add documentation for warning backtrace suppression API Albert Esteve
2026-05-16 0:56 ` Claude review: " Claude Code Review Bot
2026-05-16 0:56 ` Claude review: kunit: Add support for suppressing warning backtraces Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-05-15 12:29 [PATCH v13 0/4] " Albert Esteve
2026-05-15 12:29 ` [PATCH v13 3/4] drm: Suppress intentional warning backtraces in scaling unit tests Albert Esteve
2026-05-15 23:18 ` Claude review: " Claude Code Review Bot
2026-05-15 8:52 [PATCH v12 0/4] kunit: Add support for suppressing warning backtraces Albert Esteve
2026-05-15 8:52 ` [PATCH v12 3/4] drm: Suppress intentional warning backtraces in scaling unit tests Albert Esteve
2026-05-15 23:36 ` Claude review: " Claude Code Review Bot
2026-05-13 7:30 [PATCH v10 0/4] kunit: Add support for suppressing warning backtraces Albert Esteve
2026-05-13 7:30 ` [PATCH v10 3/4] drm: Suppress intentional warning backtraces in scaling unit tests Albert Esteve
2026-05-16 2:29 ` Claude review: " Claude Code Review Bot
2026-05-04 7:41 [PATCH v8 0/4] kunit: Add support for suppressing warning backtraces Albert Esteve
2026-05-04 7:41 ` [PATCH v8 3/4] drm: Suppress intentional warning backtraces in scaling unit tests Albert Esteve
2026-05-04 22:33 ` Claude review: " Claude Code Review Bot
2026-04-20 12:28 [PATCH v7 0/5] kunit: Add support for suppressing warning backtraces Albert Esteve
2026-04-20 12:28 ` [PATCH v7 4/5] drm: Suppress intentional warning backtraces in scaling unit tests Albert Esteve
2026-04-22 23:52 ` 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-patch3-20260514-kunit_add_support-v11-3-b36a530a6d8f@redhat.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