From patchwork Wed Feb 6 05:18:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 2101681 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 0878D3FDF1 for ; Wed, 6 Feb 2013 05:18:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751120Ab3BFFSM (ORCPT ); Wed, 6 Feb 2013 00:18:12 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:48474 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895Ab3BFFSL (ORCPT ); Wed, 6 Feb 2013 00:18:11 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MHS003YL9E9PRO0@mailout3.samsung.com> for linux-pci@vger.kernel.org; Wed, 06 Feb 2013 14:18:09 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.50]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id D3.11.03918.097E1115; Wed, 06 Feb 2013 14:18:09 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-a7-5111e790ff52 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 73.11.03918.097E1115; Wed, 06 Feb 2013 14:18:08 +0900 (KST) Received: from DOJG1HAN02 ([12.23.120.99]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MHS00F1F9E8SAG0@mmp2.samsung.com> for linux-pci@vger.kernel.org; Wed, 06 Feb 2013 14:18:08 +0900 (KST) From: Jingoo Han To: 'David Airlie' Cc: dri-devel@lists.freedesktop.org, linux-pci@vger.kernel.org, 'Jingoo Han' Subject: [PATCH] drm/pci: use PCI_EXP_LNKCAP_SLS_2_5GB/5_0GB instead of hardcoded values Date: Wed, 06 Feb 2013 14:18:08 +0900 Message-id: <002b01ce0429$59d7acc0$0d870640$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac4EKVlvOLYPT7wyT9O5l8fFQYJ+qg== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCIsWRmVeSWpSXmKPExsVy+t8zI92JzwUDDZa8ZrQ4O+84mwOjx+dN cgGMUVw2Kak5mWWpRfp2CVwZs/7PZClYyF5x+spSpgbGH6xdjJwcEgImEp1T17FD2GISF+6t Z+ti5OIQEljGKDFpyXXmLkYOsKJtf30h4tMZJW78bGWHcGYwSSxq+w/WzSagJvHly2F2kAYR AVWJaaftQcLMAikSOxpusoHYwgJREq/v9IHZLEAlx97eZAKxeQVsJRZNeM0OYQtK/Jh8jwWi V0ti/c7jTBC2vMTmNW+h7lGXePRXFyQsIqAncWzfQUaIEhGJfS/eMYKcJiHQzC4xdfNVVohd AhLfJh9igeiVldh0gBniX0mJgytusExgFJuFZPMsJJtnIdk8C8mKBYwsqxhFUwuSC4qT0nMN 9YoTc4tL89L1kvNzNzFC4kRqB+PKBotDjAIcjEo8vDf0BAOFWBPLiitzDzFKcDArifAqbAMK 8aYkVlalFuXHF5XmpBYfYkwGOnYis5Rocj4whvNK4g2NjU3MTExNzC1NzU1JE1YS52U89SRA SCA9sSQ1OzW1ILUIZgsTB6dUA+PhSP6p/F3LsieIq26qFLkuv0Rk67b8rP0RBReOX96T52Jt t05VW+1IptRBowOPKhsXLMn9u+ntvUmSPz9vm/BIVlZD5mwWv9bj2XoBR1OnLVTqE2qY9Xzn Vcc+5/s/vhq/vJkQ+Zi9WyJPv/WXrkpKlnWq/cofJ9m8vrzf2s+ffSTBnVHqwl8lluKMREMt 5qLiRAAI5jEG1wIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMIsWRmVeSWpSXmKPExsVy+t9jQd0JzwUDDb5OsrI4O+84mwOjx+dN cgGMUQ2MNhmpiSmpRQqpecn5KZl56bZK3sHxzvGmZgaGuoaWFuZKCnmJuam2Si4+AbpumTlA U5UUyhJzSoFCAYnFxUr6dpgmhIa46VrANEbo+oYEwfUYGaCBhHWMGbP+z2QpWMhecfrKUqYG xh+sXYwcHBICJhLb/vp2MXICmWISF+6tZ+ti5OIQEpjOKHHjZys7hDODSWJR2392kCo2ATWJ L18Os4M0iwioSkw7bQ8SZhZIkdjRcJMNxBYWiJJ4facPzGYBKjn29iYTiM0rYCuxaMJrdghb UOLH5HssEL1aEut3HmeCsOUlNq95ywxxm7rEo7+6IGERAT2JY/sOMkKUiEjse/GOcQKjwCwk k2YhmTQLyaRZSFoWMLKsYhRNLUguKE5KzzXUK07MLS7NS9dLzs/dxAiOwmdSOxhXNlgcYhTg YFTi4b2hJxgoxJpYVlyZe4hRgoNZSYRXYRtQiDclsbIqtSg/vqg0J7X4EGMy0KMTmaVEk/OB CSKvJN7Q2MTMyNLIzMLIxNycNGElcV7GU08ChATSE0tSs1NTC1KLYLYwcXBKNTBq2e+IPb2V WVWZewHjvOZn6nZfy82T53HxKR93n8c0X2IC0ymmyr8LbzH2Bbb97nHUbbXPW5TFsFDGkmnB Ee2+FKtkDoNMwyzbH0+WMl1M95zvvu7XtgWGflxOG8LNIg2CWGcoMlfndsyZZ/z19inFjkQP u6bYQDYXp87F2nuZldTvRjJtUmIpzkg01GIuKk4EAJFdw18GAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Use PCI_EXP_LNKCAP_SLS_2_5GB and PCI_EXP_LNKCAP_SLS_5_0GB instead of hardcoded values for readability. These bit definitions were added by commit 130f1b8 ("PCI: Add PCIe Link Capability link speed and width names") Signed-off-by: Jingoo Han Reviewed-by: Alex Deucher Reviewed-by: Bjorn Helgaas --- drivers/gpu/drm/drm_pci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 754bc96..11c8add 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -504,9 +504,9 @@ int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask) if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_8_0GB) *mask |= DRM_PCIE_SPEED_80; } else { - if (lnkcap & 1) + if (lnkcap & PCI_EXP_LNKCAP_SLS_2_5GB) *mask |= DRM_PCIE_SPEED_25; - if (lnkcap & 2) + if (lnkcap & PCI_EXP_LNKCAP_SLS_5_0GB) *mask |= DRM_PCIE_SPEED_50; }