From patchwork Tue Jul 20 22:18:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 113094 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6KMJHSo009402 for ; Tue, 20 Jul 2010 22:19:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761862Ab0GTWTQ (ORCPT ); Tue, 20 Jul 2010 18:19:16 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:40604 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761867Ab0GTWTP (ORCPT ); Tue, 20 Jul 2010 18:19:15 -0400 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id o6KMIaCZ014184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Jul 2010 15:18:37 -0700 Received: from localhost.localdomain (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id o6KMIa6I020966; Tue, 20 Jul 2010 15:18:36 -0700 Message-Id: <201007202218.o6KMIa6I020966@imap1.linux-foundation.org> Subject: [patch 2/2] gcc-4.6: acpi: fix unused but set variables in ACPI To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, akpm@linux-foundation.org, andi@firstfloor.org, ak@linux.intel.com From: akpm@linux-foundation.org Date: Tue, 20 Jul 2010 15:18:36 -0700 MIME-Version: 1.0 X-Spam-Status: No, hits=-3.496 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 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 (demeter.kernel.org [140.211.167.41]); Tue, 20 Jul 2010 22:19:17 +0000 (UTC) diff -puN drivers/acpi/acpica/utmutex.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi drivers/acpi/acpica/utmutex.c --- a/drivers/acpi/acpica/utmutex.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi +++ a/drivers/acpi/acpica/utmutex.c @@ -279,13 +279,10 @@ acpi_status acpi_ut_acquire_mutex(acpi_m acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id) { - acpi_thread_id this_thread_id; - ACPI_FUNCTION_NAME(ut_release_mutex); - this_thread_id = acpi_os_get_thread_id(); ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Thread %p releasing Mutex [%s]\n", - ACPI_CAST_PTR(void, this_thread_id), + ACPI_CAST_PTR(void, acpi_os_get_thread_id()), acpi_ut_get_mutex_name(mutex_id))); if (mutex_id > ACPI_MAX_MUTEX) { diff -puN drivers/acpi/numa.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi drivers/acpi/numa.c --- a/drivers/acpi/numa.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi +++ a/drivers/acpi/numa.c @@ -255,12 +255,10 @@ acpi_parse_memory_affinity(struct acpi_s static int __init acpi_parse_srat(struct acpi_table_header *table) { - struct acpi_table_srat *srat; - if (!table) return -EINVAL; - srat = (struct acpi_table_srat *)table; + /* Real work done in acpi_table_parse_srat below. */ return 0; } diff -puN drivers/acpi/osl.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi drivers/acpi/osl.c --- a/drivers/acpi/osl.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi +++ a/drivers/acpi/osl.c @@ -141,15 +141,14 @@ static struct osi_linux { static void __init acpi_request_region (struct acpi_generic_address *addr, unsigned int length, char *desc) { - struct resource *res; - if (!addr->address || !length) return; + /* Resources are never freed */ if (addr->space_id == ACPI_ADR_SPACE_SYSTEM_IO) - res = request_region(addr->address, length, desc); + request_region(addr->address, length, desc); else if (addr->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) - res = request_mem_region(addr->address, length, desc); + request_mem_region(addr->address, length, desc); } static int __init acpi_reserve_resources(void) diff -puN drivers/acpi/power.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi drivers/acpi/power.c --- a/drivers/acpi/power.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi +++ a/drivers/acpi/power.c @@ -553,8 +553,6 @@ static int acpi_power_seq_show(struct se int result = 0, state; struct acpi_power_resource *resource = NULL; struct list_head *node, *next; - struct acpi_power_reference *ref; - resource = seq->private; @@ -579,10 +577,8 @@ static int acpi_power_seq_show(struct se } mutex_lock(&resource->resource_lock); - list_for_each_safe(node, next, &resource->reference) { - ref = container_of(node, struct acpi_power_reference, node); + list_for_each_safe(node, next, &resource->reference) count++; - } mutex_unlock(&resource->resource_lock); seq_printf(seq, "system level: S%d\n" diff -puN drivers/acpi/processor_idle.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi drivers/acpi/processor_idle.c --- a/drivers/acpi/processor_idle.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi +++ a/drivers/acpi/processor_idle.c @@ -798,13 +798,12 @@ static inline void acpi_idle_do_entry(st } else if (cx->entry_method == ACPI_CSTATE_HALT) { acpi_safe_halt(); } else { - int unused; /* IO port based C-state */ inb(cx->address); /* Dummy wait op - must do something useless after P_LVL2 read because chipsets cannot guarantee that STPCLK# signal gets asserted in time to freeze execution properly. */ - unused = inl(acpi_gbl_FADT.xpm_timer_block.address); + inl(acpi_gbl_FADT.xpm_timer_block.address); } start_critical_timings(); } diff -puN drivers/acpi/processor_thermal.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi drivers/acpi/processor_thermal.c --- a/drivers/acpi/processor_thermal.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi +++ a/drivers/acpi/processor_thermal.c @@ -506,6 +506,8 @@ static ssize_t acpi_processor_write_limi } result = acpi_processor_apply_limit(pr); + if (result < 0) + return result; return count; } diff -puN drivers/acpi/video.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi drivers/acpi/video.c --- a/drivers/acpi/video.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi +++ a/drivers/acpi/video.c @@ -2140,7 +2140,7 @@ acpi_video_bus_get_devices(struct acpi_v status = acpi_video_bus_get_one_device(dev, video); if (ACPI_FAILURE(status)) { printk(KERN_WARNING PREFIX - "Cant attach device"); + "Cant attach device\n"); continue; } } @@ -2150,19 +2150,19 @@ acpi_video_bus_get_devices(struct acpi_v static int acpi_video_bus_put_one_device(struct acpi_video_device *device) { acpi_status status; - struct acpi_video_bus *video; - if (!device || !device->video) return -ENOENT; - video = device->video; - acpi_video_device_remove_fs(device->dev); status = acpi_remove_notify_handler(device->dev->handle, ACPI_DEVICE_NOTIFY, acpi_video_device_notify); + if (ACPI_FAILURE(status)) { + printk(KERN_WARNING PREFIX + "Cant remove video notify handler\n"); + } if (device->backlight) { sysfs_remove_link(&device->backlight->dev.kobj, "device"); backlight_device_unregister(device->backlight); diff -puN drivers/ata/libata-acpi.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi drivers/ata/libata-acpi.c --- a/drivers/ata/libata-acpi.c~gcc-46-acpi-fix-unused-but-set-variables-in-acpi +++ a/drivers/ata/libata-acpi.c @@ -145,12 +145,6 @@ static void ata_acpi_handle_hotplug(stru struct ata_eh_info *ehi = &ap->link.eh_info; int wait = 0; unsigned long flags; - acpi_handle handle; - - if (dev) - handle = dev->acpi_handle; - else - handle = ap->acpi_handle; spin_lock_irqsave(ap->lock, flags); /*