* [PATCH] drm/print: add DRM_DEV_WARN macro
@ 2019-11-12 17:09 Wambui Karuga
2019-11-12 18:27 ` Daniel Vetter
0 siblings, 1 reply; 3+ messages in thread
From: Wambui Karuga @ 2019-11-12 17:09 UTC (permalink / raw)
To: maarten.lankhorst, mripard, sean, airlied, daniel; +Cc: dri-devel, linux-kernel
Add the DRM_DEV_WARN helper macro for printing warnings
that use device pointers in their log output format.
DRM_DEV_WARN can replace the use of dev_warn in such cases.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
include/drm/drm_print.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index 5b8049992c24..6ddf91c0cb29 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -329,6 +329,15 @@ void drm_err(const char *format, ...);
#define DRM_WARN_ONCE(fmt, ...) \
_DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__)
+/**
+ * Warning output.
+ *
+ * @dev: device pointer
+ * @fmt: printf() like format string.
+ */
+#define DRM_DEV_WARN(dev, fmt, ...) \
+ drm_dev_printk(dev, KERN_WARNING, fmt, ##__VA_ARGS__)
+
/**
* Error output.
*
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/print: add DRM_DEV_WARN macro
2019-11-12 17:09 [PATCH] drm/print: add DRM_DEV_WARN macro Wambui Karuga
@ 2019-11-12 18:27 ` Daniel Vetter
2019-11-13 4:38 ` Wambui Karuga
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2019-11-12 18:27 UTC (permalink / raw)
To: Wambui Karuga
Cc: maarten.lankhorst, mripard, sean, airlied, daniel, dri-devel,
linux-kernel
On Tue, Nov 12, 2019 at 08:09:09PM +0300, Wambui Karuga wrote:
> Add the DRM_DEV_WARN helper macro for printing warnings
> that use device pointers in their log output format.
> DRM_DEV_WARN can replace the use of dev_warn in such cases.
>
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Can you pls include this in the patch to add the first user with rockchip?
Otherwise always a bit awkward when we add functions without callers.
lgtm otherwise.
-Daniel
> ---
> include/drm/drm_print.h | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index 5b8049992c24..6ddf91c0cb29 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -329,6 +329,15 @@ void drm_err(const char *format, ...);
> #define DRM_WARN_ONCE(fmt, ...) \
> _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__)
>
> +/**
> + * Warning output.
> + *
> + * @dev: device pointer
> + * @fmt: printf() like format string.
> + */
> +#define DRM_DEV_WARN(dev, fmt, ...) \
> + drm_dev_printk(dev, KERN_WARNING, fmt, ##__VA_ARGS__)
> +
> /**
> * Error output.
> *
> --
> 2.17.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/print: add DRM_DEV_WARN macro
2019-11-12 18:27 ` Daniel Vetter
@ 2019-11-13 4:38 ` Wambui Karuga
0 siblings, 0 replies; 3+ messages in thread
From: Wambui Karuga @ 2019-11-13 4:38 UTC (permalink / raw)
To: Wambui Karuga, maarten.lankhorst, mripard, sean, airlied,
dri-devel, linux-kernel
Cc: daniel
On Tue, 12 Nov 2019, Daniel Vetter wrote:
> On Tue, Nov 12, 2019 at 08:09:09PM +0300, Wambui Karuga wrote:
>> Add the DRM_DEV_WARN helper macro for printing warnings
>> that use device pointers in their log output format.
>> DRM_DEV_WARN can replace the use of dev_warn in such cases.
>>
>> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
>
> Can you pls include this in the patch to add the first user with rockchip?
> Otherwise always a bit awkward when we add functions without callers.
>
Okay, I'll send that as well.
Thought it'd be better to get this accepted first.
wambui
> lgtm otherwise.
> -Daniel
>
>> ---
>> include/drm/drm_print.h | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
>> index 5b8049992c24..6ddf91c0cb29 100644
>> --- a/include/drm/drm_print.h
>> +++ b/include/drm/drm_print.h
>> @@ -329,6 +329,15 @@ void drm_err(const char *format, ...);
>> #define DRM_WARN_ONCE(fmt, ...) \
>> _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__)
>>
>> +/**
>> + * Warning output.
>> + *
>> + * @dev: device pointer
>> + * @fmt: printf() like format string.
>> + */
>> +#define DRM_DEV_WARN(dev, fmt, ...) \
>> + drm_dev_printk(dev, KERN_WARNING, fmt, ##__VA_ARGS__)
>> +
>> /**
>> * Error output.
>> *
>> --
>> 2.17.1
>>
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-13 4:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-12 17:09 [PATCH] drm/print: add DRM_DEV_WARN macro Wambui Karuga
2019-11-12 18:27 ` Daniel Vetter
2019-11-13 4:38 ` Wambui Karuga
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).