From patchwork Wed May 13 03:20:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenji Kaneshige X-Patchwork-Id: 23477 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4D3LWEk018719 for ; Wed, 13 May 2009 03:21:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753004AbZEMDVJ (ORCPT ); Tue, 12 May 2009 23:21:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755117AbZEMDVJ (ORCPT ); Tue, 12 May 2009 23:21:09 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:40496 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753004AbZEMDVH (ORCPT ); Tue, 12 May 2009 23:21:07 -0400 Received: from mt1.gw.fujitsu.co.jp ([10.0.50.74]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id n4D3L8vU031426 for (envelope-from kaneshige.kenji@jp.fujitsu.com); Wed, 13 May 2009 12:21:08 +0900 Received: from smail (m4 [127.0.0.1]) by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 0A95945DE52 for ; Wed, 13 May 2009 12:21:08 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94]) by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id DA33945DE51 for ; Wed, 13 May 2009 12:21:07 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id B2D841DB803A for ; Wed, 13 May 2009 12:21:07 +0900 (JST) Received: from ml13.s.css.fujitsu.com (ml13.s.css.fujitsu.com [10.249.87.103]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 5E92A1DB803C for ; Wed, 13 May 2009 12:21:07 +0900 (JST) Received: from ml13.css.fujitsu.com (ml13 [127.0.0.1]) by ml13.s.css.fujitsu.com (Postfix) with ESMTP id 34C95FD000D; Wed, 13 May 2009 12:21:07 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.100.137]) by ml13.s.css.fujitsu.com (Postfix) with ESMTP id C308CFD0008; Wed, 13 May 2009 12:21:06 +0900 (JST) Message-ID: <4A0A3C90.4070702@jp.fujitsu.com> Date: Wed, 13 May 2009 12:20:48 +0900 From: Kenji Kaneshige User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: "linux-pci@vger.kernel.org" , Jesse Barnes CC: "Zhang, Yanmin" , "Li, Shaohua" Subject: [PATCH 10/14] PCI ASPM: cleanup pcie_aspm_get_cap_device References: <4A0A3A24.5030501@jp.fujitsu.com> In-Reply-To: <4A0A3A24.5030501@jp.fujitsu.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Minor cleanup for pcie_aspm_get_cap_device(). Signed-off-by: Kenji Kaneshige --- drivers/pci/pcie/aspm.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: 20090508/drivers/pci/pcie/aspm.c =================================================================== --- 20090508.orig/drivers/pci/pcie/aspm.c +++ 20090508/drivers/pci/pcie/aspm.c @@ -292,19 +292,18 @@ static unsigned int calc_L1_latency(unsi } static void pcie_aspm_get_cap_device(struct pci_dev *pdev, u32 *state, - unsigned int *l0s, unsigned int *l1, unsigned int *enabled) + u32 *l0s, u32 *l1, u32 *enabled) { int pos; u16 reg16; - u32 reg32; - unsigned int latency; + u32 reg32, latency; *l0s = *l1 = *enabled = 0; pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); pci_read_config_dword(pdev, pos + PCI_EXP_LNKCAP, ®32); *state = (reg32 & PCI_EXP_LNKCAP_ASPMS) >> 10; if (*state != PCIE_LINK_STATE_L0S && - *state != (PCIE_LINK_STATE_L1|PCIE_LINK_STATE_L0S)) + *state != (PCIE_LINK_STATE_L1 | PCIE_LINK_STATE_L0S)) *state = 0; if (*state == 0) return; @@ -316,7 +315,7 @@ static void pcie_aspm_get_cap_device(str *l1 = calc_L1_latency(latency, 0); } pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, ®16); - *enabled = reg16 & (PCIE_LINK_STATE_L0S|PCIE_LINK_STATE_L1); + *enabled = reg16 & (PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); } static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist)