[PATCH v5 1/4] drm: two more (drm_)printk() wrapper macros

2016-09-06 Thread Sean Paul
On Fri, Aug 26, 2016 at 1:50 PM, 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 simple macros for
> the additional levels. We don't provide _DEV_ or _ONCE or RATELIMITED
> versions yet as it seems unlikely that they'll be as useful.
>
> v2:
> Fix whitespace, missing ## (Eric Engestrom)
> v5:
> Much simplified after underlying functions were reworked.
>
> Signed-off-by: Dave Gordon 
> Previously-Reviewed-by: Eric Engestrom  (v2)
> Cc: Eric Engestrom 
> Cc: dri-devel at lists.freedesktop.org
> ---
>  include/drm/drmP.h | 9 +++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 94eb138..cd52624 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -168,6 +168,13 @@ void drm_printk(const char *level, unsigned int category,
>  /** \name Macros to make printk easier */
>  /*@{*/
>
> +#define DRM_INFO(fmt, ...) \
> +   drm_printk(KERN_INFO, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
> +#define DRM_NOTE(fmt, ...) \
> +   drm_printk(KERN_NOTICE, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
> +#define DRM_WARN(fmt, ...) \
> +   drm_printk(KERN_WARNING, DRM_UT_NONE, __func__, "", fmt, 
> ##__VA_ARGS__)

I think you should add the _DEV_ variants of these (and once this is
done, perhaps DRM_INFO should go back where it came from).

Sean

> +
>  /**
>   * Error output.
>   *
> @@ -202,8 +209,6 @@ void drm_printk(const char *level, unsigned int category,
>  #define DRM_DEV_INFO(dev, fmt, ...)\
> drm_dev_printk(dev, KERN_INFO, DRM_UT_NONE, __func__, "", fmt,  \
>##__VA_ARGS__)
> -#define DRM_INFO(fmt, ...) \
> -   drm_printk(KERN_INFO, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
>
>  #define DRM_DEV_INFO_ONCE(dev, fmt, ...)   \
>  ({ \
> --
> 1.9.1
>
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v5 1/4] drm: two more (drm_)printk() wrapper macros

2016-08-30 Thread Eric Engestrom
On Fri, Aug 26, 2016 at 06:50:56PM +0100, 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 simple macros for
> the additional levels. We don't provide _DEV_ or _ONCE or RATELIMITED
> versions yet as it seems unlikely that they'll be as useful.
> 
> v2:
> Fix whitespace, missing ## (Eric Engestrom)
> v5:
> Much simplified after underlying functions were reworked.
> 
> Signed-off-by: Dave Gordon 
> Previously-Reviewed-by: Eric Engestrom  (v2)

My r-b still stands on the v5 (and I really like the simplification!)
Thanks for CC'ing me on the updates :)

Cheers,
  Eric

> Cc: Eric Engestrom 
> Cc: dri-devel at lists.freedesktop.org
> ---
>  include/drm/drmP.h | 9 +++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 94eb138..cd52624 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -168,6 +168,13 @@ void drm_printk(const char *level, unsigned int category,
>  /** \name Macros to make printk easier */
>  /*@{*/
>  
> +#define DRM_INFO(fmt, ...)   \
> + drm_printk(KERN_INFO, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
> +#define DRM_NOTE(fmt, ...)   \
> + drm_printk(KERN_NOTICE, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
> +#define DRM_WARN(fmt, ...)   \
> + drm_printk(KERN_WARNING, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
> +
>  /**
>   * Error output.
>   *
> @@ -202,8 +209,6 @@ void drm_printk(const char *level, unsigned int category,
>  #define DRM_DEV_INFO(dev, fmt, ...)  \
>   drm_dev_printk(dev, KERN_INFO, DRM_UT_NONE, __func__, "", fmt,  \
>  ##__VA_ARGS__)
> -#define DRM_INFO(fmt, ...)   \
> - drm_printk(KERN_INFO, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
>  
>  #define DRM_DEV_INFO_ONCE(dev, fmt, ...) \
>  ({   \
> -- 
> 1.9.1
> 


[PATCH v5 1/4] drm: two more (drm_)printk() wrapper macros

2016-08-26 Thread Chris Wilson
On Fri, Aug 26, 2016 at 06:50:56PM +0100, 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 simple macros for
> the additional levels. We don't provide _DEV_ or _ONCE or RATELIMITED
> versions yet as it seems unlikely that they'll be as useful.
> 
> v2:
> Fix whitespace, missing ## (Eric Engestrom)
> v5:
> Much simplified after underlying functions were reworked.
> 
> Signed-off-by: Dave Gordon 
> Previously-Reviewed-by: Eric Engestrom  (v2)
> Cc: Eric Engestrom 
> Cc: dri-devel at lists.freedesktop.org

Reviewed-by: Chris Wilson 
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


[PATCH v5 1/4] drm: two more (drm_)printk() wrapper macros

2016-08-26 Thread 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 simple macros for
the additional levels. We don't provide _DEV_ or _ONCE or RATELIMITED
versions yet as it seems unlikely that they'll be as useful.

v2:
Fix whitespace, missing ## (Eric Engestrom)
v5:
Much simplified after underlying functions were reworked.

Signed-off-by: Dave Gordon 
Previously-Reviewed-by: Eric Engestrom  (v2)
Cc: Eric Engestrom 
Cc: dri-devel at lists.freedesktop.org
---
 include/drm/drmP.h | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 94eb138..cd52624 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -168,6 +168,13 @@ void drm_printk(const char *level, unsigned int category,
 /** \name Macros to make printk easier */
 /*@{*/

+#define DRM_INFO(fmt, ...) \
+   drm_printk(KERN_INFO, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
+#define DRM_NOTE(fmt, ...) \
+   drm_printk(KERN_NOTICE, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
+#define DRM_WARN(fmt, ...) \
+   drm_printk(KERN_WARNING, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
+
 /**
  * Error output.
  *
@@ -202,8 +209,6 @@ void drm_printk(const char *level, unsigned int category,
 #define DRM_DEV_INFO(dev, fmt, ...)\
drm_dev_printk(dev, KERN_INFO, DRM_UT_NONE, __func__, "", fmt,  \
   ##__VA_ARGS__)
-#define DRM_INFO(fmt, ...) \
-   drm_printk(KERN_INFO, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)

 #define DRM_DEV_INFO_ONCE(dev, fmt, ...)   \
 ({ \
-- 
1.9.1