Commit cfa806f059801dbe7e435745eb2e187c8bfe1e7f
Committed by
Len Brown
1 parent
43d9f87b79
Exists in
master
and in
39 other branches
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>
Showing 7 changed files with 11 additions and 26 deletions Side-by-side Diff
drivers/acpi/acpica/utmutex.c
... | ... | @@ -279,13 +279,10 @@ |
279 | 279 | |
280 | 280 | acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id) |
281 | 281 | { |
282 | - acpi_thread_id this_thread_id; | |
283 | - | |
284 | 282 | ACPI_FUNCTION_NAME(ut_release_mutex); |
285 | 283 | |
286 | - this_thread_id = acpi_os_get_thread_id(); | |
287 | 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 | 286 | acpi_ut_get_mutex_name(mutex_id))); |
290 | 287 | |
291 | 288 | if (mutex_id > ACPI_MAX_MUTEX) { |
drivers/acpi/numa.c
... | ... | @@ -255,12 +255,10 @@ |
255 | 255 | |
256 | 256 | static int __init acpi_parse_srat(struct acpi_table_header *table) |
257 | 257 | { |
258 | - struct acpi_table_srat *srat; | |
259 | - | |
260 | 258 | if (!table) |
261 | 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 | 263 | return 0; |
266 | 264 | } |
drivers/acpi/osl.c
... | ... | @@ -141,15 +141,14 @@ |
141 | 141 | static void __init acpi_request_region (struct acpi_generic_address *addr, |
142 | 142 | unsigned int length, char *desc) |
143 | 143 | { |
144 | - struct resource *res; | |
145 | - | |
146 | 144 | if (!addr->address || !length) |
147 | 145 | return; |
148 | 146 | |
147 | + /* Resources are never freed */ | |
149 | 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 | 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 | |
155 | 154 | static int __init acpi_reserve_resources(void) |
drivers/acpi/power.c
drivers/acpi/processor_idle.c
... | ... | @@ -722,13 +722,12 @@ |
722 | 722 | } else if (cx->entry_method == ACPI_CSTATE_HALT) { |
723 | 723 | acpi_safe_halt(); |
724 | 724 | } else { |
725 | - int unused; | |
726 | 725 | /* IO port based C-state */ |
727 | 726 | inb(cx->address); |
728 | 727 | /* Dummy wait op - must do something useless after P_LVL2 read |
729 | 728 | because chipsets cannot guarantee that STPCLK# signal |
730 | 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 | 732 | start_critical_timings(); |
734 | 733 | } |
drivers/acpi/video.c
... | ... | @@ -2167,7 +2167,7 @@ |
2167 | 2167 | status = acpi_video_bus_get_one_device(dev, video); |
2168 | 2168 | if (ACPI_FAILURE(status)) { |
2169 | 2169 | printk(KERN_WARNING PREFIX |
2170 | - "Cant attach device"); | |
2170 | + "Cant attach device\n"); | |
2171 | 2171 | continue; |
2172 | 2172 | } |
2173 | 2173 | } |
2174 | 2174 | |
2175 | 2175 | |
2176 | 2176 | |
... | ... | @@ -2177,19 +2177,19 @@ |
2177 | 2177 | static int acpi_video_bus_put_one_device(struct acpi_video_device *device) |
2178 | 2178 | { |
2179 | 2179 | acpi_status status; |
2180 | - struct acpi_video_bus *video; | |
2181 | 2180 | |
2182 | - | |
2183 | 2181 | if (!device || !device->video) |
2184 | 2182 | return -ENOENT; |
2185 | 2183 | |
2186 | - video = device->video; | |
2187 | - | |
2188 | 2184 | acpi_video_device_remove_fs(device->dev); |
2189 | 2185 | |
2190 | 2186 | status = acpi_remove_notify_handler(device->dev->handle, |
2191 | 2187 | ACPI_DEVICE_NOTIFY, |
2192 | 2188 | acpi_video_device_notify); |
2189 | + if (ACPI_FAILURE(status)) { | |
2190 | + printk(KERN_WARNING PREFIX | |
2191 | + "Cant remove video notify handler\n"); | |
2192 | + } | |
2193 | 2193 | if (device->backlight) { |
2194 | 2194 | sysfs_remove_link(&device->backlight->dev.kobj, "device"); |
2195 | 2195 | backlight_device_unregister(device->backlight); |
drivers/ata/libata-acpi.c
... | ... | @@ -145,12 +145,6 @@ |
145 | 145 | struct ata_eh_info *ehi = &ap->link.eh_info; |
146 | 146 | int wait = 0; |
147 | 147 | unsigned long flags; |
148 | - acpi_handle handle; | |
149 | - | |
150 | - if (dev) | |
151 | - handle = dev->acpi_handle; | |
152 | - else | |
153 | - handle = ap->acpi_handle; | |
154 | 148 | |
155 | 149 | spin_lock_irqsave(ap->lock, flags); |
156 | 150 | /* |