diff mbox

[03/25] drivers/acpi: Use static const char arrays

Message ID 586912c51cea49db9bb042a9badae0bbe8cba529.1284406638.git.joe@perches.com (mailing list archive)
State New, archived
Headers show

Commit Message

Joe Perches Sept. 13, 2010, 7:47 p.m. UTC
None
diff mbox

Patch

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