linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Andrey Rahmatullin <wrar@wrar.name>
Cc: ACPI Devel Mailing List <linux-acpi@vger.kernel.org>,
	linux-pm@lists.linux-foundation.org,
	Steven Rostedt <rostedt@goodmis.org>
Subject: [RFT][PATCH 3/4] ACPI / PM: Shorten variable name in acpi_pm_device_sleep_state()
Date: Sat, 26 May 2012 23:21:04 +0200	[thread overview]
Message-ID: <201205262321.04574.rjw@sisk.pl> (raw)
In-Reply-To: <201205262316.30096.rjw@sisk.pl>

From: Rafael J. Wysocki <rjw@sisk.pl>

Save a couple of code lines by using a more concise name for the
variable representing the ACPI method to evaluate.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/acpi/sleep.c |   14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Index: linux/drivers/acpi/sleep.c
===================================================================
--- linux.orig/drivers/acpi/sleep.c
+++ linux/drivers/acpi/sleep.c
@@ -697,7 +697,7 @@ int acpi_pm_device_sleep_state(struct de
 {
 	acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
 	struct acpi_device *adev;
-	char acpi_method[] = "_SxD";
+	char method[] = "_SxD";
 	unsigned long long d_min, d_max;
 
 	if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) {
@@ -705,7 +705,7 @@ int acpi_pm_device_sleep_state(struct de
 		return -ENODEV;
 	}
 
-	acpi_method[2] = '0' + acpi_target_sleep_state;
+	method[2] = '0' + acpi_target_sleep_state;
 	/*
 	 * If the sleep state is S0, we will return D3, but if the device has
 	 * _S0W, we will use the value from _S0W
@@ -722,7 +722,7 @@ int acpi_pm_device_sleep_state(struct de
 	 * provided -- that's our fault recovery, we ignore retval.
 	 */
 	if (acpi_target_sleep_state > ACPI_STATE_S0)
-		acpi_evaluate_integer(handle, acpi_method, NULL, &d_min);
+		acpi_evaluate_integer(handle, method, NULL, &d_min);
 
 	/*
 	 * If _PRW says we can wake up the system from the target sleep state,
@@ -736,17 +736,15 @@ int acpi_pm_device_sleep_state(struct de
 	     adev->wakeup.sleep_state >= acpi_target_sleep_state)) {
 		acpi_status status;
 
-		acpi_method[3] = 'W';
-		status = acpi_evaluate_integer(handle, acpi_method, NULL,
-						&d_max);
+		method[3] = 'W';
+		status = acpi_evaluate_integer(handle, method, NULL, &d_max);
 		if (ACPI_FAILURE(status)) {
 			if (acpi_target_sleep_state != ACPI_STATE_S0 ||
 			    status != AE_NOT_FOUND)
 				d_max = d_min;
 		} else if (d_max < d_min) {
 			/* Warn the user of the broken DSDT */
-			printk(KERN_WARNING "ACPI: Wrong value from %s\n",
-				acpi_method);
+			pr_warning("ACPI: Wrong value from %s\n", method);
 			/* Sanitize it */
 			d_min = d_max;
 		}

  parent reply	other threads:[~2012-05-26 21:21 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.44L0.1205252157430.24286-100000@saphir.localdomain>
     [not found] ` <1338005001.13348.279.camel@gandalf.stny.rr.com>
     [not found]   ` <201205262227.47442.rjw@sisk.pl>
2012-05-26 21:16     ` [RFT] PCI changes related to wakeup (was: Re: ehci_hcd related S3 lockup on ASUS laptops, again) Rafael J. Wysocki
2012-05-26 21:19       ` [RFT][PATCH 1/4] ACPI / PM: Make acpi_pm_device_sleep_state() follow the specification Rafael J. Wysocki
2012-05-26 21:20       ` [RFT][PATCH 2/4] PCI / PM: Make platform choose target low-power states of more devices Rafael J. Wysocki
2012-05-26 21:21       ` Rafael J. Wysocki [this message]
2012-05-26 21:21       ` [RFT][PATCH 4/4] ACPI / PM: Fix interactions between _SxD and _SxW Rafael J. Wysocki
2012-05-26 21:47       ` [RFT] PCI changes related to wakeup (was: Re: ehci_hcd related S3 lockup on ASUS laptops, again) Andrey Rahmatullin
2012-05-26 22:06         ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Rafael J. Wysocki
2012-05-26 22:36           ` [RFT] PCI changes related to wakeup (was: " Andrey Rahmatullin
2012-05-26 22:40             ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Alan Stern
2012-05-26 22:59               ` [RFT] PCI changes related to wakeup (was: " Rafael J. Wysocki
2012-05-29 14:23                 ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Alan Stern
2012-05-29 17:29                   ` Rafael J. Wysocki
2012-05-29 18:50                     ` Alan Stern
2012-05-29 19:16                       ` Rafael J. Wysocki
2012-05-31 21:07                         ` Alan Stern
2012-05-31 21:29                           ` Rafael J. Wysocki
2012-06-01 15:13                             ` Alan Stern
2012-06-01 15:50                               ` Steven Rostedt
2012-06-01 15:59                                 ` [RFT] PCI changes related to wakeup (was: " Alan Stern
2012-06-01 17:01                                   ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Steven Rostedt
2012-06-01 17:17                                     ` [RFT] PCI changes related to wakeup (was: " Alan Stern
2012-06-01 17:23                                       ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Steven Rostedt
2012-06-01 16:01                                 ` [RFT] PCI changes related to wakeup (was: " Andrey Rahmatullin
2012-06-01 16:33                                   ` Alan Stern
2012-05-31 22:02                           ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Dâniel Fraga
2012-06-01 14:55                             ` Alan Stern
2012-05-31 22:25                           ` Andrey Rahmatullin
2012-06-13  9:22                           ` Rafael J. Wysocki
2012-06-13 14:21                             ` [RFT] PCI changes related to wakeup (was: " Alan Stern
2012-05-27 16:41             ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Alan Stern
2012-05-27 21:17               ` Andrey Rahmatullin
2012-05-28 20:13                 ` [RFT] PCI changes related to wakeup (was: " Rafael J. Wysocki
2012-05-29  7:48                   ` Andrey Rahmatullin
2012-05-29 17:30                     ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Rafael J. Wysocki
2012-05-29 22:39                   ` [RFT] PCI changes related to wakeup (was: " Steven Rostedt

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=201205262321.04574.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rostedt@goodmis.org \
    --cc=wrar@wrar.name \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).