From: 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 Return-path: Content-language: ko Sender: linux-pci-owner@vger.kernel.org To: 'David Airlie' Cc: dri-devel@lists.freedesktop.org, linux-pci@vger.kernel.org, 'Jingoo Han' List-Id: dri-devel@lists.freedesktop.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 --- 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; } -- 1.7.2.5