aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2010-07-20 18:18:36 -0400
committerLen Brown <len.brown@intel.com>2010-08-15 00:53:08 -0400
commitcfa806f059801dbe7e435745eb2e187c8bfe1e7f (patch)
tree9c99026f29b863ca0541699e45349b8fa40ea93a /drivers/acpi
parent43d9f87b79804f2d75d9d8a81c862b179f055a15 (diff)
gcc-4.6: ACPI: fix unused but set variables in ACPI
Some minor improvements in error handling, but overall it was mostly dead code. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpica/utmutex.c5
-rw-r--r--drivers/acpi/numa.c4
-rw-r--r--drivers/acpi/osl.c7
-rw-r--r--drivers/acpi/power.c2
-rw-r--r--drivers/acpi/processor_idle.c3
-rw-r--r--drivers/acpi/video.c10
6 files changed, 11 insertions, 20 deletions
diff --git a/drivers/acpi/acpica/utmutex.c b/drivers/acpi/acpica/utmutex.c
index 058b3df48271..f5cca3a1300c 100644
--- a/drivers/acpi/acpica/utmutex.c
+++ b/drivers/acpi/acpica/utmutex.c
@@ -279,13 +279,10 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
279 279
280acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id) 280acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
281{ 281{
282 acpi_thread_id this_thread_id;
283
284 ACPI_FUNCTION_NAME(ut_release_mutex); 282 ACPI_FUNCTION_NAME(ut_release_mutex);
285 283
286 this_thread_id = acpi_os_get_thread_id();
287 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Thread %p releasing Mutex [%s]\n", 284 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Thread %p releasing Mutex [%s]\n",
288 ACPI_CAST_PTR(void, this_thread_id), 285 ACPI_CAST_PTR(void, acpi_os_get_thread_id()),
289 acpi_ut_get_mutex_name(mutex_id))); 286 acpi_ut_get_mutex_name(mutex_id)));
290 287
291 if (mutex_id > ACPI_MAX_MUTEX) { 288 if (mutex_id > ACPI_MAX_MUTEX) {
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index b0337d314604..5718566e00f9 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -255,12 +255,10 @@ acpi_parse_memory_affinity(struct acpi_subtable_header * header,
255 255
256static int __init acpi_parse_srat(struct acpi_table_header *table) 256static int __init acpi_parse_srat(struct acpi_table_header *table)
257{ 257{
258 struct acpi_table_srat *srat;
259
260 if (!table) 258 if (!table)
261 return -EINVAL; 259 return -EINVAL;
262 260
263 srat = (struct acpi_table_srat *)table; 261 /* Real work done in acpi_table_parse_srat below. */
264 262
265 return 0; 263 return 0;
266} 264}
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 44bddc5bc6ad..03017b1eb38b 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -141,15 +141,14 @@ static struct osi_linux {
141static void __init acpi_request_region (struct acpi_generic_address *addr, 141static void __init acpi_request_region (struct acpi_generic_address *addr,
142 unsigned int length, char *desc) 142 unsigned int length, char *desc)
143{ 143{
144 struct resource *res;
145
146 if (!addr->address || !length) 144 if (!addr->address || !length)
147 return; 145 return;
148 146
147 /* Resources are never freed */
149 if (addr->space_id == ACPI_ADR_SPACE_SYSTEM_IO) 148 if (addr->space_id == ACPI_ADR_SPACE_SYSTEM_IO)
150 res = request_region(addr->address, length, desc); 149 request_region(addr->address, length, desc);
151 else if (addr->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) 150 else if (addr->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
152 res = request_mem_region(addr->address, length, desc); 151 request_mem_region(addr->address, length, desc);
153} 152}
154 153
155static int __init acpi_reserve_resources(void) 154static int __init acpi_reserve_resources(void)
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 4fe5018fd6ab..cf073aa0709b 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -242,8 +242,6 @@ static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev)
242 acpi_status status = AE_OK; 242 acpi_status status = AE_OK;
243 struct acpi_power_resource *resource = NULL; 243 struct acpi_power_resource *resource = NULL;
244 struct list_head *node, *next; 244 struct list_head *node, *next;
245 struct acpi_power_reference *ref;
246
247 245
248 result = acpi_power_get_context(handle, &resource); 246 result = acpi_power_get_context(handle, &resource);
249 if (result) 247 if (result)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 5cbc0cb73e2c..07bc74d8356e 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -722,13 +722,12 @@ static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx)
722 } else if (cx->entry_method == ACPI_CSTATE_HALT) { 722 } else if (cx->entry_method == ACPI_CSTATE_HALT) {
723 acpi_safe_halt(); 723 acpi_safe_halt();
724 } else { 724 } else {
725 int unused;
726 /* IO port based C-state */ 725 /* IO port based C-state */
727 inb(cx->address); 726 inb(cx->address);
728 /* Dummy wait op - must do something useless after P_LVL2 read 727 /* Dummy wait op - must do something useless after P_LVL2 read
729 because chipsets cannot guarantee that STPCLK# signal 728 because chipsets cannot guarantee that STPCLK# signal
730 gets asserted in time to freeze execution properly. */ 729 gets asserted in time to freeze execution properly. */
731 unused = inl(acpi_gbl_FADT.xpm_timer_block.address); 730 inl(acpi_gbl_FADT.xpm_timer_block.address);
732 } 731 }
733 start_critical_timings(); 732 start_critical_timings();
734} 733}
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 909ae7bf3b93..67dec0c675aa 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -2167,7 +2167,7 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
2167 status = acpi_video_bus_get_one_device(dev, video); 2167 status = acpi_video_bus_get_one_device(dev, video);
2168 if (ACPI_FAILURE(status)) { 2168 if (ACPI_FAILURE(status)) {
2169 printk(KERN_WARNING PREFIX 2169 printk(KERN_WARNING PREFIX
2170 "Cant attach device"); 2170 "Cant attach device\n");
2171 continue; 2171 continue;
2172 } 2172 }
2173 } 2173 }
@@ -2177,19 +2177,19 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
2177static int acpi_video_bus_put_one_device(struct acpi_video_device *device) 2177static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
2178{ 2178{
2179 acpi_status status; 2179 acpi_status status;
2180 struct acpi_video_bus *video;
2181
2182 2180
2183 if (!device || !device->video) 2181 if (!device || !device->video)
2184 return -ENOENT; 2182 return -ENOENT;
2185 2183
2186 video = device->video;
2187
2188 acpi_video_device_remove_fs(device->dev); 2184 acpi_video_device_remove_fs(device->dev);
2189 2185
2190 status = acpi_remove_notify_handler(device->dev->handle, 2186 status = acpi_remove_notify_handler(device->dev->handle,
2191 ACPI_DEVICE_NOTIFY, 2187 ACPI_DEVICE_NOTIFY,
2192 acpi_video_device_notify); 2188 acpi_video_device_notify);
2189 if (ACPI_FAILURE(status)) {
2190 printk(KERN_WARNING PREFIX
2191 "Cant remove video notify handler\n");
2192 }
2193 if (device->backlight) { 2193 if (device->backlight) {
2194 sysfs_remove_link(&device->backlight->dev.kobj, "device"); 2194 sysfs_remove_link(&device->backlight->dev.kobj, "device");
2195 backlight_device_unregister(device->backlight); 2195 backlight_device_unregister(device->backlight);