Thank you for your contribution! Sashiko AI review found 3 potential issue(s) 
to consider:
- [Medium] Replacing `pr_err()` and `pr_debug()` with `drm_err(NULL, ...)` and 
`drm_dbg(NULL, ...)` in mock selftests pollutes the kernel log with `(NULL 
device *)` boilerplate.
- [Low] Incorrect indentation on `err = expect_pfn_sgtable(...);`.
- [Low] Renaming the `ignored` parameter to `arg` without using it reduces code 
clarity.
--

--- Patch [1]: [PATCH v2 1/8] drm/i915/selftests: Use drm_* prints in mock 
selftests ---
commit bac5b0f26375c24916b2bc63bce26e485e392abc
Author: Krzysztof Karas <[email protected]>

    drm/i915/selftests: Use drm_* prints in mock selftests

This commit replaces generic pr_* prints with drm_* versions in the mock
selftests to be more device context aware.

> diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c 
> b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> index 6a305322e30db..462704e575f5b 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
[ ... ]
> @@ -107,7 +109,7 @@ static int test_dag(void *arg)
>               return -ENOMEM;
>  
>       if (i915_sw_fence_await_sw_fence_gfp(A, A, GFP_KERNEL) != -EINVAL) {
> -             pr_err("recursive cycle not detected (AA)\n");
> +             drm_err(NULL, "recursive cycle not detected (AA)\n");

[Severity: Medium]
Will passing NULL to drm_err() here and elsewhere result in the log being
polluted with "(NULL device *)" boilerplate? Since mock selftests typically
run without a real device context, does using drm_err(NULL, ...) actually
provide the context mentioned in the commit message, or does it just
degrade the log output formatting?

[ ... ]
> diff --git a/drivers/gpu/drm/i915/selftests/scatterlist.c 
> b/drivers/gpu/drm/i915/selftests/scatterlist.c
> index 7e59591bbed6c..d8fbe5a8060b6 100644
> --- a/drivers/gpu/drm/i915/selftests/scatterlist.c
> +++ b/drivers/gpu/drm/i915/selftests/scatterlist.c
[ ... ]
> @@ -275,7 +281,7 @@ static const npages_fn_t npages_funcs[] = {
>       NULL,
>  };
>  
> -static int igt_sg_alloc(void *ignored)
> +static int igt_sg_alloc(void *arg)

[Severity: Low]
This isn't a bug, but renaming the parameter from "ignored" to "arg" makes
it less obvious that the parameter is intentionally unused. Is there a
reason this was changed?

[ ... ]
> @@ -305,7 +311,7 @@ static int igt_sg_alloc(void *ignored)
>  
>                               prandom_seed_state(&prng,
>                                                  i915_selftest.random_seed);
> -                             err = expect_pfn_sgtable(&pt, *npages, &prng,
> +                                     err = expect_pfn_sgtable(&pt, *npages, 
> &prng,

[Severity: Low]
This isn't a bug, but it looks like this line was accidentally indented
with an extra tab, causing it to misalign with the surrounding code.

>                                                        "sg_alloc_table",
>                                                        end_time);
>                               sg_free_table(&pt.st);

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to