Thank you for your contribution! Sashiko AI review found 2 potential issue(s) 
to consider:
- [Low] Redundant custom OOM logging
- [Low] Incomplete implementation of mode creation failure logging
--

commit 918b658b4d8223239a11b91ab8f874692e392821
Author: Jan Niedziolka <[email protected]>

gpu/drm: Add drm_notice logging when drm_mode_create fails

This commit adds drm_notice() prints to drm_cvt_mode(), drm_gtf_mode_complex(),
and drm_mode_duplicate() to log when drm_mode_create() fails and returns NULL.

> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 049d77e75ddda..fc6d974e3948d 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -646,8 +646,10 @@ struct drm_display_mode *drm_cvt_mode(struct drm_device 
> *dev, int hdisplay,
>        * return directly
>        */
>       drm_mode = drm_mode_create();
> -     if (!drm_mode)
> +     if (!drm_mode) {
> +             drm_notice(dev, "Failed to create a new display mode\n");
>               return NULL;
> +     }

[Severity: Low]
Is this custom error logging redundant?

Since drm_mode_create() relies on memory allocation (via kzalloc_obj()), the
kernel's memory allocation subsystem will already report OOM conditions with a
backtrace. Adding custom error messages for memory allocation failures
can cause unnecessary kernel binary bloat and log spam.

[Severity: Low]
If the intent is to log mode creation failures consistently, did this miss
drm_analog_tv_mode()?

It takes a dev parameter and calls drm_mode_create() in the same file, but
was not updated by this patch:

drivers/gpu/drm/drm_modes.c:drm_analog_tv_mode() {
        ...
        mode = drm_mode_create();
        if (!mode)
                return NULL;
        ...
}

[ ... ]

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

Reply via email to