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 17/18] ACPI: sleep: Unify the message printing
Date: Wed, 2 Jun 2021 16:54:39 +0800	[thread overview]
Message-ID: <1622624080-56025-18-git-send-email-guohanjun@huawei.com> (raw)
In-Reply-To: <1622624080-56025-1-git-send-email-guohanjun@huawei.com>

Intoduce pr_fmt() and use pr_*() macros to replace printk(), also
remove all the PREFIX for pr_*() calls to generate a unified format
string for prefix.

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

diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index df38657..7560c99 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -8,6 +8,8 @@
  * Copyright (c) 2003 Open Source Development Lab
  */
 
+#define pr_fmt(fmt) "ACPI: " fmt
+
 #include <linux/delay.h>
 #include <linux/irq.h>
 #include <linux/dmi.h>
@@ -41,7 +43,7 @@ static void acpi_sleep_tts_switch(u32 acpi_state)
 		 * OS can't evaluate the _TTS object correctly. Some warning
 		 * message will be printed. But it won't break anything.
 		 */
-		printk(KERN_NOTICE "Failure in evaluating _TTS object\n");
+		pr_notice("Failure in evaluating _TTS object\n");
 	}
 }
 
@@ -73,8 +75,7 @@ static int acpi_sleep_prepare(u32 acpi_state)
 	}
 	ACPI_FLUSH_CPU_CACHE();
 #endif
-	printk(KERN_INFO PREFIX "Preparing to enter system sleep state S%d\n",
-		acpi_state);
+	pr_info("Preparing to enter system sleep state S%d\n", acpi_state);
 	acpi_enable_wakeup_devices(acpi_state);
 	acpi_enter_sleep_state_prep(acpi_state);
 	return 0;
@@ -459,8 +460,7 @@ static void acpi_pm_finish(void)
 	if (acpi_state == ACPI_STATE_S0)
 		return;
 
-	printk(KERN_INFO PREFIX "Waking up from system sleep state S%d\n",
-		acpi_state);
+	pr_info("Waking up from system sleep state S%d\n", acpi_state);
 	acpi_disable_wakeup_devices(acpi_state);
 	acpi_leave_sleep_state(acpi_state);
 
@@ -581,7 +581,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
 		error = acpi_suspend_lowlevel();
 		if (error)
 			return error;
-		pr_info(PREFIX "Low-level resume complete\n");
+		pr_info("Low-level resume complete\n");
 		pm_set_resume_via_firmware();
 		break;
 	}
@@ -921,7 +921,7 @@ static void acpi_hibernation_leave(void)
 	acpi_leave_sleep_state_prep(ACPI_STATE_S4);
 	/* Check the hardware signature */
 	if (facs && s4_hardware_signature != facs->hardware_signature)
-		pr_crit("ACPI: Hardware changed while hibernated, success doubtful!\n");
+		pr_crit("Hardware changed while hibernated, success doubtful!\n");
 	/* Restore the NVS memory area */
 	suspend_nvs_restore();
 	/* Allow EC transactions to happen. */
@@ -1029,7 +1029,7 @@ static void acpi_power_off_prepare(void)
 static void acpi_power_off(void)
 {
 	/* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
-	printk(KERN_DEBUG "%s called\n", __func__);
+	pr_debug("%s called\n", __func__);
 	local_irq_disable();
 	acpi_enter_sleep_state(ACPI_STATE_S5);
 }
@@ -1061,7 +1061,7 @@ int __init acpi_sleep_init(void)
 		if (sleep_states[i])
 			pos += sprintf(pos, " S%d", i);
 	}
-	pr_info(PREFIX "(supports%s)\n", supported);
+	pr_info("(supports%s)\n", supported);
 
 	/*
 	 * Register the tts_notifier to reboot notifier list so that the _TTS
-- 
1.7.12.4


  parent reply	other threads:[~2021-06-02  9:07 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 ` [PATCH 16/18] ACPI: sbs: Unify the " Hanjun Guo
2021-06-02  8:54 ` Hanjun Guo [this message]
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-18-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.