All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hanjun Guo <guohanjun@huawei.com>
To: <linux-acpi@vger.kernel.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Hanjun Guo <guohanjun@huawei.com>
Subject: [PATCH 16/18] ACPI: sbs: Unify the message printing
Date: Wed, 2 Jun 2021 16:54:38 +0800	[thread overview]
Message-ID: <1622624080-56025-17-git-send-email-guohanjun@huawei.com> (raw)
In-Reply-To: <1622624080-56025-1-git-send-email-guohanjun@huawei.com>

Using pr_fmt() and pr_*() macros to unify the message printing.

While at it, fix the obvious coding style issue when scanning
the code.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
 drivers/acpi/sbs.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 3b0b6dd..4938010 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -7,6 +7,8 @@
  *  Copyright (c) 2005 Rich Townsend <rhdt@bartol.udel.edu>
  */
 
+#define pr_fmt(fmt) "ACPI: " fmt
+
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/module.h>
@@ -23,8 +25,6 @@
 
 #include "sbshc.h"
 
-#define PREFIX "ACPI: "
-
 #define ACPI_SBS_CLASS			"sbs"
 #define ACPI_AC_CLASS			"ac_adapter"
 #define ACPI_SBS_DEVICE_NAME		"Smart Battery System"
@@ -544,7 +544,7 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
 		goto end;
 	battery->have_sysfs_alarm = 1;
       end:
-	printk(KERN_INFO PREFIX "%s [%s]: Battery Slot [%s] (battery %s)\n",
+	pr_info("%s [%s]: Battery Slot [%s] (battery %s)\n",
 	       ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device),
 	       battery->name, battery->present ? "present" : "absent");
 	return result;
@@ -577,10 +577,10 @@ static int acpi_charger_add(struct acpi_sbs *sbs)
 		result = PTR_ERR(sbs->charger);
 		sbs->charger = NULL;
 	}
-	printk(KERN_INFO PREFIX "%s [%s]: AC Adapter [%s] (%s)\n",
+	pr_info("%s [%s]: AC Adapter [%s] (%s)\n",
 	       ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device),
 	       ACPI_AC_DIR_NAME, sbs->charger_present ? "on-line" : "off-line");
-      end:
+end:
 	return result;
 }
 
@@ -658,7 +658,7 @@ static int acpi_sbs_add(struct acpi_device *device)
 		acpi_battery_add(sbs, 0);
 
 	acpi_smbus_register_callback(sbs->hc, acpi_sbs_callback, sbs);
-      end:
+end:
 	if (result)
 		acpi_sbs_remove(device);
 	return result;
-- 
1.7.12.4


  parent reply	other threads:[~2021-06-02  9:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02  8:54 [PATCH 00/18] ACPI: Further cleanups for message printing Hanjun Guo
2021-06-02  8:54 ` [PATCH 01/18] ACPI: cmos_rtc: Using pr_fmt() and remove PREFIX Hanjun Guo
2021-06-02  8:54 ` [PATCH 02/18] ACPI: blacklist: Unify the message printing Hanjun Guo
2021-06-02  8:54 ` [PATCH 03/18] ACPI: bus: Use pr_*() macros to replace printk() Hanjun Guo
2021-06-02  8:54 ` [PATCH 04/18] ACPI: event: " Hanjun Guo
2021-06-02  8:54 ` [PATCH 05/18] ACPI: glue: Clean up the printing messages Hanjun Guo
2021-06-02  8:54 ` [PATCH 06/18] ACPI: nvs: Unify the message printing Hanjun Guo
2021-06-02  8:54 ` [PATCH 07/18] ACPI: osl: Remove the duplicated PREFIX for " Hanjun Guo
2021-06-02  8:54 ` [PATCH 08/18] ACPI: pci_root: Unify the " Hanjun Guo
2021-06-02  8:54 ` [PATCH 09/18] ACPI: processor_thermal: Remove unused PREFIX for printing Hanjun Guo
2021-06-02  8:54 ` [PATCH 10/18] ACPI: processor_perflib: Cleanup print messages Hanjun Guo
2021-06-02  8:54 ` [PATCH 11/18] ACPI: processor_throttling: Cleanup the printing messages Hanjun Guo
2021-06-02  8:54 ` [PATCH 12/18] ACPI: reboot: Unify the message printing Hanjun Guo
2021-06-02  8:54 ` [PATCH 13/18] ACPI: sysfs: Cleanup " Hanjun Guo
2021-06-02  8:54 ` [PATCH 14/18] ACPI: sbshc: Unify the " Hanjun Guo
2021-06-02  8:54 ` [PATCH 15/18] ACPI: scan: Unify the log " Hanjun Guo
2021-06-02  8:54 ` Hanjun Guo [this message]
2021-06-02  8:54 ` [PATCH 17/18] ACPI: sleep: Unify the " Hanjun Guo
2021-06-02  8:54 ` [PATCH 18/18] ACPI: Remove the macro PREFIX "ACPI: " Hanjun Guo
2021-06-07 13:38 ` [PATCH 00/18] ACPI: Further cleanups for message printing Rafael J. Wysocki

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=1622624080-56025-17-git-send-email-guohanjun@huawei.com \
    --to=guohanjun@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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: link
Be 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.