All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Luben Tuikov <ltuikov89@gmail.com>,
	Direct Rendering Infrastructure - Development
	<dri-devel@lists.freedesktop.org>,
	Danilo Krummrich <dakr@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH] drm/sched: Define pr_fmt() for DRM using pr_*()
Date: Wed, 15 Nov 2023 10:24:21 +0200	[thread overview]
Message-ID: <871qcrs9u2.fsf@intel.com> (raw)
In-Reply-To: <fcec4d24-41d6-4897-bc2a-9ea7d3b4afd5@gmail.com>

On Tue, 14 Nov 2023, Luben Tuikov <ltuikov89@gmail.com> wrote:
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index a93a387f8a1a15..ce784118e4f762 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -453,7 +453,7 @@ void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev,
>  
>  /* Helper for struct drm_device based logging. */
>  #define __drm_printk(drm, level, type, fmt, ...)                       \
> -       dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
> +       dev_##level##type(drm ? (drm)->dev : NULL, "[drm] " fmt, ##__VA_ARGS__)

I think that would be an improvement that stands on its own merits.

Please also wrap the first drm in parens (drm).

> The output would be similar to that if drm->dev were NULL.

Yes. I don't know how people will feel about intentionally using
drm_err(NULL, ...) all over the place, but that's another matter. ;)

BR,
Jani.


-- 
Jani Nikula, Intel

  reply	other threads:[~2023-11-15  8:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10  0:27 [PATCH] drm/sched: Define pr_fmt() for DRM using pr_*() Luben Tuikov
2023-11-10  0:58 ` Danilo Krummrich
2023-11-10 12:40 ` Jani Nikula
2023-11-10 12:44   ` Jani Nikula
2023-11-10 13:58   ` Luben Tuikov
2023-11-14  1:04   ` Luben Tuikov
2023-11-14 12:20     ` Jani Nikula
2023-11-14 23:57       ` Luben Tuikov
2023-11-15  8:24         ` Jani Nikula [this message]
2023-11-17  3:22           ` Luben Tuikov

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=871qcrs9u2.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=dakr@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ltuikov89@gmail.com \
    /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.