From: Peilin Ye <yepeilin.cs@gmail.com> To: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Sam Ravnborg <sam@ravnborg.org>, Thomas Zimmermann <tzimmermann@suse.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>, Jiri Slaby <jirislaby@kernel.org>, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Peilin Ye <yepeilin.cs@gmail.com> Subject: [PATCH] fbcon: Replace printk() with pr_*() Date: Sun, 1 Nov 2020 09:49:04 -0500 [thread overview] Message-ID: <20201101144904.1522611-1-yepeilin.cs@gmail.com> (raw) In-Reply-To: <20201101094718.GD1166694@ravnborg.org> Replace printk() with pr_err(), pr_warn() and pr_info(). Do not split long strings, for easier grepping. Use `__func__` whenever applicable. fbcon_prepare_logo() has more than one callers, use "fbcon_prepare_logo:" instead of "fbcon_init:", for less confusion. Suggested-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com> --- drivers/video/fbdev/core/fbcon.c | 42 +++++++++++++------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index cef437817b0d..a3e87ab0e523 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -659,8 +659,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, if (logo_lines > vc->vc_bottom) { logo_shown = FBCON_LOGO_CANSHOW; - printk(KERN_INFO - "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n"); + pr_info("%s: disable boot-logo (boot-logo bigger than screen).\n", __func__); } else { logo_shown = FBCON_LOGO_DRAW; vc->vc_top = logo_lines; @@ -785,9 +784,8 @@ static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info *oldinfo, ret = newinfo->fbops->fb_set_par(newinfo); if (ret) - printk(KERN_ERR "con2fb_release_oldinfo: " - "detected unhandled fb_set_par error, " - "error code %d\n", ret); + pr_err("%s: detected unhandled fb_set_par error, error code %d\n", + __func__, ret); } } @@ -806,9 +804,8 @@ static void con2fb_init_display(struct vc_data *vc, struct fb_info *info, ret = info->fbops->fb_set_par(info); if (ret) - printk(KERN_ERR "con2fb_init_display: detected " - "unhandled fb_set_par error, " - "error code %d\n", ret); + pr_err("%s: detected unhandled fb_set_par error, error code %d\n", + __func__, ret); } ops->flags |= FBCON_FLAGS_INIT; @@ -1137,9 +1134,8 @@ static void fbcon_init(struct vc_data *vc, int init) ret = info->fbops->fb_set_par(info); if (ret) - printk(KERN_ERR "fbcon_init: detected " - "unhandled fb_set_par error, " - "error code %d\n", ret); + pr_err("%s: detected unhandled fb_set_par error, error code %d\n", + __func__, ret); } ops->flags |= FBCON_FLAGS_INIT; @@ -2126,9 +2122,8 @@ static int fbcon_switch(struct vc_data *vc) ret = info->fbops->fb_set_par(info); if (ret) - printk(KERN_ERR "fbcon_switch: detected " - "unhandled fb_set_par error, " - "error code %d\n", ret); + pr_err("%s: detected unhandled fb_set_par error, error code %d\n", + __func__, ret); } if (old_info != info) @@ -2899,9 +2894,8 @@ void fbcon_remap_all(struct fb_info *info) set_con2fb_map(i, idx, 0); if (con_is_bound(&fb_con)) { - printk(KERN_INFO "fbcon: Remapping primary device, " - "fb%i, to tty %i-%i\n", idx, - first_fb_vc + 1, last_fb_vc + 1); + pr_info("fbcon: Remapping primary device, fb%i, to tty %i-%i\n", + idx, first_fb_vc + 1, last_fb_vc + 1); info_idx = idx; } console_unlock(); @@ -2914,17 +2908,16 @@ static void fbcon_select_primary(struct fb_info *info) fb_is_primary_device(info)) { int i; - printk(KERN_INFO "fbcon: %s (fb%i) is primary device\n", - info->fix.id, info->node); + pr_info("fbcon: %s (fb%i) is primary device\n", + info->fix.id, info->node); primary_device = info->node; for (i = first_fb_vc; i <= last_fb_vc; i++) con2fb_map_boot[i] = primary_device; if (con_is_bound(&fb_con)) { - printk(KERN_INFO "fbcon: Remapping primary device, " - "fb%i, to tty %i-%i\n", info->node, - first_fb_vc + 1, last_fb_vc + 1); + pr_info("fbcon: Remapping primary device, fb%i, to tty %i-%i\n", + info->node, first_fb_vc + 1, last_fb_vc + 1); info_idx = primary_device; } } @@ -3394,9 +3387,8 @@ void __init fb_console_init(void) "fbcon"); if (IS_ERR(fbcon_device)) { - printk(KERN_WARNING "Unable to create device " - "for fbcon; errno = %ld\n", - PTR_ERR(fbcon_device)); + pr_warn("Unable to create device for fbcon; errno = %ld\n", + PTR_ERR(fbcon_device)); fbcon_device = NULL; } else fbcon_init_device(); -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: Peilin Ye <yepeilin.cs@gmail.com> To: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: linux-fbdev@vger.kernel.org, Sam Ravnborg <sam@ravnborg.org>, Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann <tzimmermann@suse.de>, Jiri Slaby <jirislaby@kernel.org>, Peilin Ye <yepeilin.cs@gmail.com> Subject: [PATCH] fbcon: Replace printk() with pr_*() Date: Sun, 1 Nov 2020 09:49:04 -0500 [thread overview] Message-ID: <20201101144904.1522611-1-yepeilin.cs@gmail.com> (raw) In-Reply-To: <20201101094718.GD1166694@ravnborg.org> Replace printk() with pr_err(), pr_warn() and pr_info(). Do not split long strings, for easier grepping. Use `__func__` whenever applicable. fbcon_prepare_logo() has more than one callers, use "fbcon_prepare_logo:" instead of "fbcon_init:", for less confusion. Suggested-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com> --- drivers/video/fbdev/core/fbcon.c | 42 +++++++++++++------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index cef437817b0d..a3e87ab0e523 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -659,8 +659,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, if (logo_lines > vc->vc_bottom) { logo_shown = FBCON_LOGO_CANSHOW; - printk(KERN_INFO - "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n"); + pr_info("%s: disable boot-logo (boot-logo bigger than screen).\n", __func__); } else { logo_shown = FBCON_LOGO_DRAW; vc->vc_top = logo_lines; @@ -785,9 +784,8 @@ static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info *oldinfo, ret = newinfo->fbops->fb_set_par(newinfo); if (ret) - printk(KERN_ERR "con2fb_release_oldinfo: " - "detected unhandled fb_set_par error, " - "error code %d\n", ret); + pr_err("%s: detected unhandled fb_set_par error, error code %d\n", + __func__, ret); } } @@ -806,9 +804,8 @@ static void con2fb_init_display(struct vc_data *vc, struct fb_info *info, ret = info->fbops->fb_set_par(info); if (ret) - printk(KERN_ERR "con2fb_init_display: detected " - "unhandled fb_set_par error, " - "error code %d\n", ret); + pr_err("%s: detected unhandled fb_set_par error, error code %d\n", + __func__, ret); } ops->flags |= FBCON_FLAGS_INIT; @@ -1137,9 +1134,8 @@ static void fbcon_init(struct vc_data *vc, int init) ret = info->fbops->fb_set_par(info); if (ret) - printk(KERN_ERR "fbcon_init: detected " - "unhandled fb_set_par error, " - "error code %d\n", ret); + pr_err("%s: detected unhandled fb_set_par error, error code %d\n", + __func__, ret); } ops->flags |= FBCON_FLAGS_INIT; @@ -2126,9 +2122,8 @@ static int fbcon_switch(struct vc_data *vc) ret = info->fbops->fb_set_par(info); if (ret) - printk(KERN_ERR "fbcon_switch: detected " - "unhandled fb_set_par error, " - "error code %d\n", ret); + pr_err("%s: detected unhandled fb_set_par error, error code %d\n", + __func__, ret); } if (old_info != info) @@ -2899,9 +2894,8 @@ void fbcon_remap_all(struct fb_info *info) set_con2fb_map(i, idx, 0); if (con_is_bound(&fb_con)) { - printk(KERN_INFO "fbcon: Remapping primary device, " - "fb%i, to tty %i-%i\n", idx, - first_fb_vc + 1, last_fb_vc + 1); + pr_info("fbcon: Remapping primary device, fb%i, to tty %i-%i\n", + idx, first_fb_vc + 1, last_fb_vc + 1); info_idx = idx; } console_unlock(); @@ -2914,17 +2908,16 @@ static void fbcon_select_primary(struct fb_info *info) fb_is_primary_device(info)) { int i; - printk(KERN_INFO "fbcon: %s (fb%i) is primary device\n", - info->fix.id, info->node); + pr_info("fbcon: %s (fb%i) is primary device\n", + info->fix.id, info->node); primary_device = info->node; for (i = first_fb_vc; i <= last_fb_vc; i++) con2fb_map_boot[i] = primary_device; if (con_is_bound(&fb_con)) { - printk(KERN_INFO "fbcon: Remapping primary device, " - "fb%i, to tty %i-%i\n", info->node, - first_fb_vc + 1, last_fb_vc + 1); + pr_info("fbcon: Remapping primary device, fb%i, to tty %i-%i\n", + info->node, first_fb_vc + 1, last_fb_vc + 1); info_idx = primary_device; } } @@ -3394,9 +3387,8 @@ void __init fb_console_init(void) "fbcon"); if (IS_ERR(fbcon_device)) { - printk(KERN_WARNING "Unable to create device " - "for fbcon; errno = %ld\n", - PTR_ERR(fbcon_device)); + pr_warn("Unable to create device for fbcon; errno = %ld\n", + PTR_ERR(fbcon_device)); fbcon_device = NULL; } else fbcon_init_device(); -- 2.25.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-11-01 14:52 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-21 12:15 [PATCH] video/fbdev/core: Mark debug-only variable as __maybe_unused Thomas Zimmermann 2020-10-21 12:15 ` Thomas Zimmermann 2020-11-01 9:47 ` Sam Ravnborg 2020-11-01 9:47 ` Sam Ravnborg 2020-11-01 10:09 ` Peilin Ye 2020-11-01 10:09 ` Peilin Ye 2020-11-01 14:49 ` Peilin Ye [this message] 2020-11-01 14:49 ` [PATCH] fbcon: Replace printk() with pr_*() Peilin Ye 2020-11-01 15:41 ` Greg Kroah-Hartman 2020-11-01 15:41 ` Greg Kroah-Hartman 2020-11-01 16:08 ` Peilin Ye 2020-11-01 16:08 ` Peilin Ye
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20201101144904.1522611-1-yepeilin.cs@gmail.com \ --to=yepeilin.cs@gmail.com \ --cc=b.zolnierkie@samsung.com \ --cc=daniel.vetter@ffwll.ch \ --cc=dri-devel@lists.freedesktop.org \ --cc=gregkh@linuxfoundation.org \ --cc=jirislaby@kernel.org \ --cc=linux-fbdev@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=sam@ravnborg.org \ --cc=tzimmermann@suse.de \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.