From patchwork Fri Jul 30 06:22:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenji Kaneshige X-Patchwork-Id: 115410 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 o6U6Mni2010153 for ; Fri, 30 Jul 2010 06:23:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755208Ab0G3GWs (ORCPT ); Fri, 30 Jul 2010 02:22:48 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:55499 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755171Ab0G3GWs (ORCPT ); Fri, 30 Jul 2010 02:22:48 -0400 Received: from m1.gw.fujitsu.co.jp ([10.0.50.71]) by fgwmail5.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o6U6MlXx025424 (envelope-from kaneshige.kenji@jp.fujitsu.com); Fri, 30 Jul 2010 15:22:47 +0900 Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id D2A2745DE54; Fri, 30 Jul 2010 15:22:46 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 96E8E45DE50; Fri, 30 Jul 2010 15:22:46 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 78E3F1DB8055; Fri, 30 Jul 2010 15:22:46 +0900 (JST) Received: from m105.s.css.fujitsu.com (m105.s.css.fujitsu.com [10.249.87.105]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 243001DB804E; Fri, 30 Jul 2010 15:22:46 +0900 (JST) Received: from m105.css.fujitsu.com (m105 [127.0.0.1]) by m105.s.css.fujitsu.com (Postfix) with ESMTP id E53BF5E8001; Fri, 30 Jul 2010 15:22:45 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.102.21]) by m105.s.css.fujitsu.com (Postfix) with ESMTP id 6590C5D8001; Fri, 30 Jul 2010 15:22:45 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from KANE-LIFEBOOK[10.124.102.21] by KANE-LIFEBOOK (FujitsuOutboundMailChecker v1.3.1/9992[10.124.102.21]); Fri, 30 Jul 2010 15:22:23 +0900 (JST) Message-ID: <4C526F96.2090409@jp.fujitsu.com> Date: Fri, 30 Jul 2010 15:22:14 +0900 From: Kenji Kaneshige User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 MIME-Version: 1.0 To: "Rafael J. Wysocki" CC: Jesse Barnes , Len Brown , ACPI Devel Maling List , linux-pm@lists.linux-foundation.org, linux-pci@vger.kernel.org, Matthew Garrett , Hidetoshi Seto Subject: [PATCH 3/6] ACPI/PCI: optimize checks in acpi_pci_osc_control_set() References: <201007282323.56351.rjw@sisk.pl> <20100728144358.5e2c12ce@virtuousgeek.org> <4C510B90.9070302@jp.fujitsu.com> <201007291745.39285.rjw@sisk.pl> <4C526A85.3070902@jp.fujitsu.com> <4C526E3E.3000600@jp.fujitsu.com> In-Reply-To: <4C526E3E.3000600@jp.fujitsu.com> 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]); Fri, 30 Jul 2010 06:23:03 +0000 (UTC) Index: linux-2.6.35-rc6/drivers/acpi/pci_root.c =================================================================== --- linux-2.6.35-rc6.orig/drivers/acpi/pci_root.c +++ linux-2.6.35-rc6/drivers/acpi/pci_root.c @@ -388,10 +388,6 @@ acpi_status acpi_pci_osc_control_set(acp acpi_handle tmp; struct acpi_pci_root *root; - status = acpi_get_handle(handle, "_OSC", &tmp); - if (ACPI_FAILURE(status)) - return status; - control_req = (flags & OSC_PCI_CONTROL_MASKS); if (!control_req) return AE_TYPE; @@ -400,6 +396,10 @@ acpi_status acpi_pci_osc_control_set(acp if (!root) return AE_NOT_EXIST; + status = acpi_get_handle(handle, "_OSC", &tmp); + if (ACPI_FAILURE(status)) + return status; + mutex_lock(&osc_lock); /* No need to evaluate _OSC if the control was already granted. */ if ((root->osc_control_set & control_req) == control_req)