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 12:29:14 +1000 Message-ID: In-Reply-To: <20260513-kunit_add_support-v10-3-e379d206c8cd@redhat.com> References: <20260513-kunit_add_support-v10-0-e379d206c8cd@redhat.com> <20260513-kunit_add_support-v10-3-e379d206c8cd@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 **Clean practical demonstration.** The changes wrap `drm_rect_calc_hscale()= ` and `drm_rect_calc_vscale()` calls in `kunit_warning_suppress()` blocks: ```c int expected_warnings =3D params->expected_scaling_factor =3D=3D -EINVAL; int scaling_factor =3D INT_MIN; 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); } ``` The `expected_warnings` calculation (`=3D=3D -EINVAL` yields 0 or 1) correc= tly maps the error cases to expected warning counts. Initializing `scaling_= factor =3D INT_MIN` ensures a clearly wrong value if the suppression block = is somehow skipped (e.g., allocation failure causes `kunit_start_suppress_w= arning()` to return NULL =E2=86=92 loop body never executes). In that case = the subsequent `KUNIT_EXPECT_EQ(test, scaling_factor, ...)` would fail, whi= ch is the right behavior. The `#include ` for `INT_MIN` is correct. **Note:** The suppression wraps *all* parameterized test iterations, not ju= st the `-EINVAL` ones. For non-error cases, `expected_warnings` is 0, so th= e `KUNIT_EXPECT_SUPPRESSED_WARNING_COUNT` check verifies no spurious warnin= gs. This is a nice property. --- Generated by Claude Code Patch Reviewer