diff mbox

[1/2] framebuffer: Add fb_<level> convenience logging macros

Message ID 0926c7a34ac51c4cbb67debd0d883f41891e75d9.1379640011.git.joe@perches.com (mailing list archive)
State New, archived
Headers show

Commit Message

Joe Perches Sept. 20, 2013, 1:35 a.m. UTC
Add fb_<level> convenience macros for emitting the
"fb%d: ", struct fb_info->node value.

Neatens and shortens the code a bit.

Signed-off-by: Joe Perches <joe@perches.com>
---
 include/linux/fb.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Joe Perches Oct. 13, 2013, 5:39 p.m. UTC | #1
On Thu, 2013-09-19 at 18:35 -0700, Joe Perches wrote:
> Add fb_<level> convenience macros for emitting the
> "fb%d: ", struct fb_info->node value.
> 
> Neatens and shortens the code a bit.

ping?

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomi Valkeinen Oct. 29, 2013, 10:56 a.m. UTC | #2
On 20/09/13 04:35, Joe Perches wrote:
> Add fb_<level> convenience macros for emitting the
> "fb%d: ", struct fb_info->node value.
> 
> Neatens and shortens the code a bit.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  include/linux/fb.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index ffac70a..70c4836 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -792,4 +792,16 @@ extern int fb_find_mode(struct fb_var_screeninfo *var,
>  			const struct fb_videomode *default_mode,
>  			unsigned int default_bpp);
>  
> +/* Convenience logging macros */
> +#define fb_err(fb_info, fmt, ...)					\
> +	pr_err("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)
> +#define fb_notice(info, fmt, ...)					\
> +	pr_notice("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)
> +#define fb_warn(fb_info, fmt, ...)					\
> +	pr_warn("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)
> +#define fb_info(fb_info, fmt, ...)					\
> +	pr_info("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)
> +#define fb_dbg(fb_info, fmt, ...)					\
> +	pr_debug("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)
> +
>  #endif /* _LINUX_FB_H */
> 

Thanks, queued this and the next one for 3.13.

 Tomi
diff mbox

Patch

diff --git a/include/linux/fb.h b/include/linux/fb.h
index ffac70a..70c4836 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -792,4 +792,16 @@  extern int fb_find_mode(struct fb_var_screeninfo *var,
 			const struct fb_videomode *default_mode,
 			unsigned int default_bpp);
 
+/* Convenience logging macros */
+#define fb_err(fb_info, fmt, ...)					\
+	pr_err("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)
+#define fb_notice(info, fmt, ...)					\
+	pr_notice("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)
+#define fb_warn(fb_info, fmt, ...)					\
+	pr_warn("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)
+#define fb_info(fb_info, fmt, ...)					\
+	pr_info("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)
+#define fb_dbg(fb_info, fmt, ...)					\
+	pr_debug("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)
+
 #endif /* _LINUX_FB_H */