All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jan Niedziolka" <j.niedziolka@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/3] gpu/drm: Add drm_notice logging when drm_mode_create fails
Date: Mon, 06 Jul 2026 13:58:46 +0000	[thread overview]
Message-ID: <20260706135847.410C51F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260706134515.3369960-4-j.niedziolka@samsung.com>

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 <j.niedziolka@samsung.com>

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/20260706134515.3369960-1-j.niedziolka@samsung.com?part=3

      reply	other threads:[~2026-07-06 13:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260706134549eucas1p20eedf2d3287d95687eaaa8a201679083@eucas1p2.samsung.com>
2026-07-06 13:34 ` [PATCH 0/3] drm: Remove unused *drm parameter Jan Niedziolka
2026-07-06 13:34   ` [PATCH 1/3] gpu/drm: Remove unused *dev parameter from drm_mode_destroy function Jan Niedziolka
2026-07-06 13:55     ` sashiko-bot
2026-07-06 13:34   ` [PATCH 2/3] gpu/drm: Remove unused 'drm device *dev' parameter from drm_mode_create() Jan Niedziolka
2026-07-06 13:57     ` sashiko-bot
2026-07-06 13:34   ` [PATCH 3/3] gpu/drm: Add drm_notice logging when drm_mode_create fails Jan Niedziolka
2026-07-06 13:58     ` sashiko-bot [this message]

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=20260706135847.410C51F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=j.niedziolka@samsung.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.