Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2695884pxx; Sun, 1 Nov 2020 06:54:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1WiEhHLheudOmGvUCpJdU83SoDfKqAPYGWlisXN/usWVMexqYnt3eeBoi24zMTOHSLd/9 X-Received: by 2002:a17:906:4e41:: with SMTP id g1mr10615566ejw.47.1604242442163; Sun, 01 Nov 2020 06:54:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604242442; cv=none; d=google.com; s=arc-20160816; b=BIjZUAOn8xC31vPZ6FQgl13cFZMlq6TNvR8z2RPiN2kmuJ13XeXZS3eYch7wISOnPE 0W345RlaG3JJbeFSzqZUOKvUbevzMBDkdpaElWthVZpTacm/anKwwbXlKXnA8q6hz3NS wZxy4E7asKV+eMJlHMMEgiOc+xlcWfZYq+zoNJaFnpmg4HOw3Gamh4GiQfKFprBD5yKc XaC7Wbt52GdS8gUkg7YEmFD4vA7AncaFW6YSfAWEpAGCx8dYgwQcS4/Bnsr2MVLIcnBO UMdXe+E1G4/BxYLgRA7O3Ijebh7ZcQo0sShDVmNtz5Yz2o8OL/+1/hyfrYL4PfdDCEIn Aclw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WDz5iZ7ScqUpsOhTQpFWUX1eJGf0gqLfwcAH1gDLhKk=; b=IkmBOcmgpmITZ5kg6XJicQU4Y6bpV2znjkl5Gz5qQWPFIBv1iQd/gtR7Ymz0XOTwgG 14E5d/NkYJ0ZOIeJENcrbJNzQPucdyM8saw/uKhLI9BJ/DyxxCO+3JqgjVSYC0ogoyvV ACqlbiaULZuaEgqlUd45Gx0VvrB04e2xiiWbTfyZNvH10ZYEzP9GBuTHe28UJbKKomWe fV5SlUvRndpa/s3sZeGl8znr4T3sialo17qYtKEK5AxhVVzwr/t+qi7ANFp6gXAKoeY5 P5RSBGlZouHx4pxYaAIYztFzvXKrYXd017Tfw3LcITshyV0C2uw5B/feGOH4ETDFRy5m UQ0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SGIO4h4i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o22si8792553ejj.86.2020.11.01.06.53.38; Sun, 01 Nov 2020 06:54:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SGIO4h4i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbgKAOwK (ORCPT + 99 others); Sun, 1 Nov 2020 09:52:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726458AbgKAOwJ (ORCPT ); Sun, 1 Nov 2020 09:52:09 -0500 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70178C0617A6; Sun, 1 Nov 2020 06:52:09 -0800 (PST) Received: by mail-pj1-x1041.google.com with SMTP id m17so1960967pjz.3; Sun, 01 Nov 2020 06:52:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WDz5iZ7ScqUpsOhTQpFWUX1eJGf0gqLfwcAH1gDLhKk=; b=SGIO4h4iravRi2aPjBFdvDhvj8pQlGCnea3mZTKLfxO2XtXlRU4wWdef5CSmwlAxV7 fZu8o4fh61hzgzWi1+c//2pM8/mqGz/e0nrpuDz9cQHkhtXQsvFQp0TM8+zNbBpgxTel q9I7JVvNxjoXmusZurWxx7m5tD1F3Mtp2SmEukDsBInadw1gllYNjZQ6HIdFFiKdP6Bl XQuHaKnaTPZQyIe+d0gs7EL8UlCXDUoFlSwTAq8frpZ3yKBtVCOfbkCvKzwb2tJPt9bj FS3sOU8ht8kllUYpaqtTDuOqHIsbqXcuLWxdSONGqzPLThuxKQxLJofFbvuQFGy1+dwh kyLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WDz5iZ7ScqUpsOhTQpFWUX1eJGf0gqLfwcAH1gDLhKk=; b=RHChll8LwalRGRbRJXs9u+KEELUtF4bd4MstNwAoPjB+X6qkDpspTnARGfwDApAYtw OGtGYFES/+aVMChLpTLJAj88044zbKJ6CfYo9m5tcRuf1IVdNGLojvxBklt0fPJ2PlY9 HDdszoDdSZGcDdVka2YY/WHwy1KUsxuOpCJyc+gmVtaA+UeYi05s1Mbr/FFndfqQGnVb DMpt3BN8O3SETX3s9RwyBYZkYJm/a7QLx8ZiTkFJk47KEb5I8a+DdViu4WObsbLsjpnB QxE5PPhJWURDpIppPS+Dnq+7GHpaGl8R89JsaHRt1J4+epZp/y1O0UNvs9MUtfg0KLPl RMAQ== X-Gm-Message-State: AOAM531PzuXMyX5/0wynUz7mLv99PKd6e8jvLBB3JhU8nb5XH0D92Atf PgZIY8kY1kRnfN6OHgcmPA== X-Received: by 2002:a17:90b:e8c:: with SMTP id fv12mr5987572pjb.196.1604242328948; Sun, 01 Nov 2020 06:52:08 -0800 (PST) Received: from localhost.localdomain (59-125-13-244.HINET-IP.hinet.net. [59.125.13.244]) by smtp.gmail.com with ESMTPSA id h10sm10370939pgj.69.2020.11.01.06.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Nov 2020 06:52:08 -0800 (PST) From: Peilin Ye To: Daniel Vetter Cc: Sam Ravnborg , Thomas Zimmermann , Greg Kroah-Hartman , Bartlomiej Zolnierkiewicz , Jiri Slaby , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Peilin Ye Subject: [PATCH] fbcon: Replace printk() with pr_*() Date: Sun, 1 Nov 2020 09:49:04 -0500 Message-Id: <20201101144904.1522611-1-yepeilin.cs@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201101094718.GD1166694@ravnborg.org> References: <20201101094718.GD1166694@ravnborg.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 Signed-off-by: Peilin Ye --- 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