* [PATCH v4 1/4] drm: extra printk() wrapper macros [not found] <1471540645-17106-1-git-send-email-david.s.gordon@intel.com> @ 2016-08-18 17:17 ` Dave Gordon 2016-08-19 12:56 ` Tvrtko Ursulin 0 siblings, 1 reply; 6+ messages in thread From: Dave Gordon @ 2016-08-18 17:17 UTC (permalink / raw) To: intel-gfx; +Cc: dri-devel We had only DRM_INFO() and DRM_ERROR(), whereas the underlying printk() provides several other useful intermediate levels such as NOTICE and WARNING. So this patch fills out the set by providing both regular and once-only macros for each of the levels INFO, NOTICE, and WARNING, using a common underlying macro that does all the token-pasting. DRM_ERROR is unchanged, as it's not just a printk wrapper. v2: Fix whitespace, missing ## (Eric Engestrom) Signed-off-by: Dave Gordon <david.s.gordon@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Cc: dri-devel@lists.freedesktop.org --- include/drm/drmP.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index f8e87fd..734e4fb 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -163,6 +163,26 @@ void drm_err(const char *format, ...); /** \name Macros to make printk easier */ /*@{*/ +#define _DRM_PRINTK(once, level, fmt, ...) \ + do { \ + printk##once(KERN_##level "[" DRM_NAME "] " fmt, \ + ##__VA_ARGS__); \ + } while (0) + +#define DRM_INFO(fmt, ...) \ + _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__) +#define DRM_NOTE(fmt, ...) \ + _DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__) +#define DRM_WARN(fmt, ...) \ + _DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__) + +#define DRM_INFO_ONCE(fmt, ...) \ + _DRM_PRINTK(_once, INFO, fmt, ##__VA_ARGS__) +#define DRM_NOTE_ONCE(fmt, ...) \ + _DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__) +#define DRM_WARN_ONCE(fmt, ...) \ + _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__) + /** * Error output. * @@ -188,12 +208,6 @@ void drm_err(const char *format, ...); drm_err(fmt, ##__VA_ARGS__); \ }) -#define DRM_INFO(fmt, ...) \ - printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) - -#define DRM_INFO_ONCE(fmt, ...) \ - printk_once(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) - /** * Debug output. * -- 1.9.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v4 1/4] drm: extra printk() wrapper macros 2016-08-18 17:17 ` [PATCH v4 1/4] drm: extra printk() wrapper macros Dave Gordon @ 2016-08-19 12:56 ` Tvrtko Ursulin 2016-08-19 21:00 ` Dave Airlie 0 siblings, 1 reply; 6+ messages in thread From: Tvrtko Ursulin @ 2016-08-19 12:56 UTC (permalink / raw) To: Dave Gordon, intel-gfx, Dave Airlie, Daniel Vetter; +Cc: dri-devel Hi Dave, Daniel, We had this i915 series with a single DRM core patch (reviewed) ready for a while - just waiting for an ack to merge it via i915 trees. Can we proceed with merging it? Regards, Tvrtko On 18/08/16 18:17, Dave Gordon wrote: > We had only DRM_INFO() and DRM_ERROR(), whereas the underlying printk() > provides several other useful intermediate levels such as NOTICE and > WARNING. So this patch fills out the set by providing both regular and > once-only macros for each of the levels INFO, NOTICE, and WARNING, using > a common underlying macro that does all the token-pasting. > > DRM_ERROR is unchanged, as it's not just a printk wrapper. > > v2: > Fix whitespace, missing ## (Eric Engestrom) > > Signed-off-by: Dave Gordon <david.s.gordon@intel.com> > Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> > Cc: dri-devel@lists.freedesktop.org > --- > include/drm/drmP.h | 26 ++++++++++++++++++++------ > 1 file changed, 20 insertions(+), 6 deletions(-) > > diff --git a/include/drm/drmP.h b/include/drm/drmP.h > index f8e87fd..734e4fb 100644 > --- a/include/drm/drmP.h > +++ b/include/drm/drmP.h > @@ -163,6 +163,26 @@ void drm_err(const char *format, ...); > /** \name Macros to make printk easier */ > /*@{*/ > > +#define _DRM_PRINTK(once, level, fmt, ...) \ > + do { \ > + printk##once(KERN_##level "[" DRM_NAME "] " fmt, \ > + ##__VA_ARGS__); \ > + } while (0) > + > +#define DRM_INFO(fmt, ...) \ > + _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__) > +#define DRM_NOTE(fmt, ...) \ > + _DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__) > +#define DRM_WARN(fmt, ...) \ > + _DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__) > + > +#define DRM_INFO_ONCE(fmt, ...) \ > + _DRM_PRINTK(_once, INFO, fmt, ##__VA_ARGS__) > +#define DRM_NOTE_ONCE(fmt, ...) \ > + _DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__) > +#define DRM_WARN_ONCE(fmt, ...) \ > + _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__) > + > /** > * Error output. > * > @@ -188,12 +208,6 @@ void drm_err(const char *format, ...); > drm_err(fmt, ##__VA_ARGS__); \ > }) > > -#define DRM_INFO(fmt, ...) \ > - printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) > - > -#define DRM_INFO_ONCE(fmt, ...) \ > - printk_once(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) > - > /** > * Debug output. > * > _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v4 1/4] drm: extra printk() wrapper macros 2016-08-19 12:56 ` Tvrtko Ursulin @ 2016-08-19 21:00 ` Dave Airlie 0 siblings, 0 replies; 6+ messages in thread From: Dave Airlie @ 2016-08-19 21:00 UTC (permalink / raw) To: Tvrtko Ursulin; +Cc: intel-gfx@lists.freedesktop.org, dri-devel > > Can we proceed with merging it? I'm pretty sure I acked this on irc a week or so agao, Acked-by: Dave Airlie <airlied@redhat.com> Dave. _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <1470934863-19286-1-git-send-email-david.s.gordon@intel.com>]
* [PATCH v4 1/4] drm: extra printk() wrapper macros [not found] <1470934863-19286-1-git-send-email-david.s.gordon@intel.com> @ 2016-08-11 17:01 ` Dave Gordon 0 siblings, 0 replies; 6+ messages in thread From: Dave Gordon @ 2016-08-11 17:01 UTC (permalink / raw) To: intel-gfx; +Cc: dri-devel We had only DRM_INFO() and DRM_ERROR(), whereas the underlying printk() provides several other useful intermediate levels such as NOTICE and WARNING. So this patch fills out the set by providing both regular and once-only macros for each of the levels INFO, NOTICE, and WARNING, using a common underlying macro that does all the token-pasting. DRM_ERROR is unchanged, as it's not just a printk wrapper. v2: Fix whitespace, missing ## (Eric Engestrom) Signed-off-by: Dave Gordon <david.s.gordon@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Cc: dri-devel@lists.freedesktop.org --- include/drm/drmP.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index f8e87fd..734e4fb 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -163,6 +163,26 @@ void drm_err(const char *format, ...); /** \name Macros to make printk easier */ /*@{*/ +#define _DRM_PRINTK(once, level, fmt, ...) \ + do { \ + printk##once(KERN_##level "[" DRM_NAME "] " fmt, \ + ##__VA_ARGS__); \ + } while (0) + +#define DRM_INFO(fmt, ...) \ + _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__) +#define DRM_NOTE(fmt, ...) \ + _DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__) +#define DRM_WARN(fmt, ...) \ + _DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__) + +#define DRM_INFO_ONCE(fmt, ...) \ + _DRM_PRINTK(_once, INFO, fmt, ##__VA_ARGS__) +#define DRM_NOTE_ONCE(fmt, ...) \ + _DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__) +#define DRM_WARN_ONCE(fmt, ...) \ + _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__) + /** * Error output. * @@ -188,12 +208,6 @@ void drm_err(const char *format, ...); drm_err(fmt, ##__VA_ARGS__); \ }) -#define DRM_INFO(fmt, ...) \ - printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) - -#define DRM_INFO_ONCE(fmt, ...) \ - printk_once(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) - /** * Debug output. * -- 1.9.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply related [flat|nested] 6+ messages in thread
[parent not found: <1470914075-19097-1-git-send-email-david.s.gordon@intel.com>]
* [PATCH v4 1/4] drm: extra printk() wrapper macros [not found] <1470914075-19097-1-git-send-email-david.s.gordon@intel.com> @ 2016-08-11 11:14 ` Dave Gordon 0 siblings, 0 replies; 6+ messages in thread From: Dave Gordon @ 2016-08-11 11:14 UTC (permalink / raw) To: intel-gfx; +Cc: Tvrtko Ursulin, dri-devel, Dave Gordon We had only DRM_INFO() and DRM_ERROR(), whereas the underlying printk() provides several other useful intermediate levels such as NOTICE and WARNING. So this patch fills out the set by providing both regular and once-only macros for each of the levels INFO, NOTICE, and WARNING, using a common underlying macro that does all the token-pasting. DRM_ERROR is unchanged, as it's not just a printk wrapper. v2: Fix whitespace, missing ## (Eric Engestrom) Signed-off-by: Dave Gordon <david.s.gordon@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Cc: dri-devel@lists.freedesktop.org --- include/drm/drmP.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 856c174..c9f168a 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -163,6 +163,26 @@ void drm_err(const char *format, ...); /** \name Macros to make printk easier */ /*@{*/ +#define _DRM_PRINTK(once, level, fmt, ...) \ + do { \ + printk##once(KERN_##level "[" DRM_NAME "] " fmt, \ + ##__VA_ARGS__); \ + } while (0) + +#define DRM_INFO(fmt, ...) \ + _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__) +#define DRM_NOTE(fmt, ...) \ + _DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__) +#define DRM_WARN(fmt, ...) \ + _DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__) + +#define DRM_INFO_ONCE(fmt, ...) \ + _DRM_PRINTK(_once, INFO, fmt, ##__VA_ARGS__) +#define DRM_NOTE_ONCE(fmt, ...) \ + _DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__) +#define DRM_WARN_ONCE(fmt, ...) \ + _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__) + /** * Error output. * @@ -188,12 +208,6 @@ void drm_err(const char *format, ...); drm_err(fmt, ##__VA_ARGS__); \ }) -#define DRM_INFO(fmt, ...) \ - printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) - -#define DRM_INFO_ONCE(fmt, ...) \ - printk_once(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) - /** * Debug output. * -- 1.9.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 6+ messages in thread
[parent not found: <1470842020-12948-1-git-send-email-david.s.gordon@intel.com>]
* [PATCH v4 1/4] drm: extra printk() wrapper macros [not found] <1470842020-12948-1-git-send-email-david.s.gordon@intel.com> @ 2016-08-10 15:13 ` Dave Gordon 0 siblings, 0 replies; 6+ messages in thread From: Dave Gordon @ 2016-08-10 15:13 UTC (permalink / raw) To: intel-gfx; +Cc: Tvrtko Ursulin, dri-devel, Dave Gordon We had only DRM_INFO() and DRM_ERROR(), whereas the underlying printk() provides several other useful intermediate levels such as NOTICE and WARNING. So this patch fills out the set by providing both regular and once-only macros for each of the levels INFO, NOTICE, and WARNING, using a common underlying macro that does all the token-pasting. DRM_ERROR is unchanged, as it's not just a printk wrapper. v2: Fix whitespace, missing ## (Eric Engestrom) Signed-off-by: Dave Gordon <david.s.gordon@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Cc: dri-devel@lists.freedesktop.org --- include/drm/drmP.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 856c174..c9f168a 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -163,6 +163,26 @@ void drm_err(const char *format, ...); /** \name Macros to make printk easier */ /*@{*/ +#define _DRM_PRINTK(once, level, fmt, ...) \ + do { \ + printk##once(KERN_##level "[" DRM_NAME "] " fmt, \ + ##__VA_ARGS__); \ + } while (0) + +#define DRM_INFO(fmt, ...) \ + _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__) +#define DRM_NOTE(fmt, ...) \ + _DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__) +#define DRM_WARN(fmt, ...) \ + _DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__) + +#define DRM_INFO_ONCE(fmt, ...) \ + _DRM_PRINTK(_once, INFO, fmt, ##__VA_ARGS__) +#define DRM_NOTE_ONCE(fmt, ...) \ + _DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__) +#define DRM_WARN_ONCE(fmt, ...) \ + _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__) + /** * Error output. * @@ -188,12 +208,6 @@ void drm_err(const char *format, ...); drm_err(fmt, ##__VA_ARGS__); \ }) -#define DRM_INFO(fmt, ...) \ - printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) - -#define DRM_INFO_ONCE(fmt, ...) \ - printk_once(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) - /** * Debug output. * -- 1.9.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-08-19 21:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1471540645-17106-1-git-send-email-david.s.gordon@intel.com>
2016-08-18 17:17 ` [PATCH v4 1/4] drm: extra printk() wrapper macros Dave Gordon
2016-08-19 12:56 ` Tvrtko Ursulin
2016-08-19 21:00 ` Dave Airlie
[not found] <1470934863-19286-1-git-send-email-david.s.gordon@intel.com>
2016-08-11 17:01 ` Dave Gordon
[not found] <1470914075-19097-1-git-send-email-david.s.gordon@intel.com>
2016-08-11 11:14 ` Dave Gordon
[not found] <1470842020-12948-1-git-send-email-david.s.gordon@intel.com>
2016-08-10 15:13 ` Dave Gordon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox