All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Luben Tuikov <ltuikov89@gmail.com>
Cc: Direct Rendering Infrastructure - Development
	<dri-devel@lists.freedesktop.org>,
	Luben Tuikov <ltuikov89@gmail.com>
Subject: Re: [PATCH] drm/print: Handle NULL drm device in __drm_printk()
Date: Fri, 17 Nov 2023 12:44:11 +0200	[thread overview]
Message-ID: <87o7fspslg.fsf@intel.com> (raw)
In-Reply-To: <20231117035427.68125-2-ltuikov89@gmail.com>

On Thu, 16 Nov 2023, Luben Tuikov <ltuikov89@gmail.com> wrote:
> drm_{err,warn,...}() use __drm_printk() which takes a drm device pointer and
> uses the embedded device pointer to print the device. This facility handles
> NULL device pointer, but not NULL drm device pointer. This patch makes
> __drm_printk() also handle a NULL drm device pointer. The printed output is
> identical to if drm->dev had been NULL.
>
> Signed-off-by: Luben Tuikov <ltuikov89@gmail.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  include/drm/drm_print.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index a93a387f8a1a15..dd4883df876a6d 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__)
>  
>  
>  #define drm_info(drm, fmt, ...)					\
>
> base-commit: 3b434a3445fff3149128db0169da864d67057325

-- 
Jani Nikula, Intel

      reply	other threads:[~2023-11-17 10:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17  3:54 [PATCH] drm/print: Handle NULL drm device in __drm_printk() Luben Tuikov
2023-11-17 10:44 ` Jani Nikula [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=87o7fspslg.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --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.