From patchwork Mon Sep 13 19:47:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 175652 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8DJt8B3019883 for ; Mon, 13 Sep 2010 19:55:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755211Ab0IMTs1 (ORCPT ); Mon, 13 Sep 2010 15:48:27 -0400 Received: from mail.perches.com ([173.55.12.10]:1867 "EHLO mail.perches.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755162Ab0IMTsY (ORCPT ); Mon, 13 Sep 2010 15:48:24 -0400 Received: from Joe-Laptop.home (unknown [192.168.1.162]) by mail.perches.com (Postfix) with ESMTP id A84102436D; Mon, 13 Sep 2010 12:48:22 -0700 (PDT) From: Joe Perches To: linux-kernel@vger.kernel.org Cc: Len Brown , linux-acpi@vger.kernel.org Subject: [PATCH 03/25] drivers/acpi: Use static const char arrays Date: Mon, 13 Sep 2010 12:47:41 -0700 Message-Id: <586912c51cea49db9bb042a9badae0bbe8cba529.1284406638.git.joe@perches.com> X-Mailer: git-send-email 1.7.3.rc1 In-Reply-To: References: Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 13 Sep 2010 19:55:09 +0000 (UTC) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index cf82989..566b1cdd 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -567,7 +567,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p) { acpi_handle handle = DEVICE_ACPI_HANDLE(dev); struct acpi_device *adev; - char acpi_method[] = "_SxD"; + char acpi_method[sizeof("_SxD")]; unsigned long long d_min, d_max; if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) { @@ -575,7 +575,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p) return -ENODEV; } - acpi_method[2] = '0' + acpi_target_sleep_state; + sprintf(acpi_method, "_S%cD", '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