All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
To: rjw@rjwysocki.net, lenb@kernel.org, linux-acpi@vger.kernel.org
Cc: andriy.shevchenko@linux.intel.com,
	Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
Subject: [PATCH 3/4] ACPI / battery: use specialized print macros
Date: Fri, 12 Jan 2018 15:58:46 +0200	[thread overview]
Message-ID: <20180112135847.14989-4-dmitry.rozhkov@linux.intel.com> (raw)
In-Reply-To: <20180112135847.14989-1-dmitry.rozhkov@linux.intel.com>

The kernel provides specialized macros for printing
info and warning messages which make the code shorter.

Use the specialized macros instead of bare printk()'s.

Also format one user visible string literal into a searchable one
line string.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
---
 drivers/acpi/battery.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index e2c3ec690af1..36c525bc38ba 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -554,8 +554,7 @@ static int acpi_battery_get_state(struct acpi_battery *battery)
 		battery->rate_now != ACPI_BATTERY_VALUE_UNKNOWN &&
 		(s16)(battery->rate_now) < 0) {
 		battery->rate_now = abs((s16)battery->rate_now);
-		printk_once(KERN_WARNING FW_BUG
-			    "battery: (dis)charge rate invalid.\n");
+		pr_warn_once(FW_BUG "battery: (dis)charge rate invalid.\n");
 	}
 
 	if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags)
@@ -1056,8 +1055,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
 	struct proc_dir_entry *entry = NULL;
 	int i;
 
-	printk(KERN_WARNING PREFIX "Deprecated procfs I/F for battery is loaded,"
-			" please retry with CONFIG_ACPI_PROCFS_POWER cleared\n");
+	pr_warning(PREFIX "Deprecated procfs I/F for battery is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared\n");
 	if (!acpi_device_dir(device)) {
 		acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
 						     acpi_battery_dir);
@@ -1269,7 +1267,7 @@ static int acpi_battery_add(struct acpi_device *device)
 	}
 #endif
 
-	printk(KERN_INFO PREFIX "%s Slot [%s] (battery %s)\n",
+	pr_info(PREFIX "%s Slot [%s] (battery %s)\n",
 		ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device),
 		device->status.battery_present ? "present" : "absent");
 
-- 
2.13.6


  parent reply	other threads:[~2018-01-12 13:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 13:58 cleanups for acpi/battery.c Dmitry Rozhkov
2018-01-12 13:58 ` [PATCH 1/4] ACPI / battery: drop inclusion of init.h Dmitry Rozhkov
2018-01-12 13:58 ` [PATCH 2/4] ACPI / battery: reorder headers alphabetically Dmitry Rozhkov
2018-01-12 13:58 ` Dmitry Rozhkov [this message]
2018-01-12 18:52   ` [PATCH 3/4] ACPI / battery: use specialized print macros Andy Shevchenko
2018-01-12 13:58 ` [PATCH 4/4] ACPI / battery: get rid of negations in conditions Dmitry Rozhkov

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=20180112135847.14989-4-dmitry.rozhkov@linux.intel.com \
    --to=dmitry.rozhkov@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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.