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: Suppress intentional warning backtraces in scaling unit tests Date: Sat, 16 May 2026 10:56:14 +1000 Message-ID: In-Reply-To: <20260514-kunit_add_support-v11-3-b36a530a6d8f@redhat.com> References: <20260514-kunit_add_support-v11-0-b36a530a6d8f@redhat.com> <20260514-kunit_add_support-v11-3-b36a530a6d8f@redhat.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Overall: Good practical demonstration.** **Wrapping non-warning cases in suppression is harmless but unnecessary:** ```c + kunit_warning_suppress(test) { + scaling_factor =3D 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 =3D=3D 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 alter= native would be to conditionally wrap only the `-EINVAL` cases, but the cur= rent 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 =3D INT_MIN; ``` The v10 changelog explains this was added to avoid "potentially uninitializ= ed" 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 ` for `INT_MIN`:** Correct =E2=80=94 `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, fai= ling the count expectation. Skipping only the warning-expected parameterize= d cases is the right behavior. --- Generated by Claude Code Patch Reviewer