diff mbox series

[093/120] fbdev: Add fb_warn_once() variant that only prints a warning once

Message ID 5dd47e9805a123aa9bea3c8c3cadfab24e25c29d.1567326213.git.noring@nocrew.org (mailing list archive)
State RFC
Headers show
Series Linux for the PlayStation 2 | expand

Commit Message

Fredrik Noring Sept. 1, 2019, 4:25 p.m. UTC
fb_warn_once() is a variant of fb_warn(), to print a warning only once.

Signed-off-by: Fredrik Noring <noring@nocrew.org>
---
 include/linux/fb.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Philippe Mathieu-Daudé Sept. 1, 2019, 11:12 p.m. UTC | #1
On 9/1/19 6:25 PM, Fredrik Noring wrote:
> fb_warn_once() is a variant of fb_warn(), to print a warning only once.
> 
> Signed-off-by: Fredrik Noring <noring@nocrew.org>
> ---
>  include/linux/fb.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 303771264644..19f5118e34ea 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -818,6 +818,8 @@ extern int fb_find_mode(struct fb_var_screeninfo *var,
>  	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_warn_once(fb_info, fmt, ...)					\
> +	pr_warn_once("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, ...)					\
> 

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
diff mbox series

Patch

diff --git a/include/linux/fb.h b/include/linux/fb.h
index 303771264644..19f5118e34ea 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -818,6 +818,8 @@  extern int fb_find_mode(struct fb_var_screeninfo *var,
 	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_warn_once(fb_info, fmt, ...)					\
+	pr_warn_once("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, ...)					\