drm/pci: use PCI_EXP_LNKCAP_SLS_2_5GB/5_0GB instead of hardcoded values
Subsystems (3)
PATCH 1/1 drm/pci: use PCI_EXP_LNKCAP_SLS_2_5GB/5_0GB instead of hardcoded values
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")
--- drivers/gpu/drm/drm_pci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_pci.c +2 -2
@@ -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 ; }
Signature · 1 line
1.7.2.5
Quoted 6 lines · Jingoo Han
Use
PCI_EXP_LNKCAP_SLS_2_5GBandPCI_EXP_LNKCAP_SLS_5_0GBinstead 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 <[email protected]>
Quoted 28 lines
--- drivers/gpu/drm/drm_pci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_pci.c +2
-3@@ -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
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 9 lines · Alex Deucher
Quoted 6 lines · Jingoo Han
Use
PCI_EXP_LNKCAP_SLS_2_5GBandPCI_EXP_LNKCAP_SLS_5_0GBinstead 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 <[email protected]>Reviewed-by Alex Deucher <[email protected]>
I posted the same patch last month, along with two other patches that fix the reporting for pre-r3.0 devices and simplify the code a bit:
http://marc.info/?l=linux-pci&m=135732663513525&w=2 http://marc.info/?l=linux-pci&m=135732713413779&w=2 http://marc.info/?l=linux-pci&m=135732666213542&w=2
I don't know the status of any of these; I'm expecting Dave to do whatever he thinks is best.
Quoted 33 lines
Quoted 25 lines
--- drivers/gpu/drm/drm_pci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_pci.c +2
-3@@ -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
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thursday, February 07, 2013 2:08 AM, Bjorn Helgaas wrote
Quoted 12 lines · Alex Deucher
Quoted 9 lines · Jingoo Han
Quoted 6 lines
Use
PCI_EXP_LNKCAP_SLS_2_5GBandPCI_EXP_LNKCAP_SLS_5_0GBinstead 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 <[email protected]>Reviewed-by Alex Deucher <[email protected]>
Quoted 8 lines
Reviewed-by Bjorn Helgaas <[email protected]>I posted the same patch last month, along with two other patches that fix the reporting for pre-r3.0 devices and simplify the code a bit:
http://marc.info/?l=linux-pci&m=135732663513525&w=2 http://marc.info/?l=linux-pci&m=135732713413779&w=2 http://marc.info/?l=linux-pci&m=135732666213542&w=2
Oh, I missed your patch.
I think that my patch will be abandoned.
Best regards,
Jingoo Han
Quoted 27 lines
I don't know the status of any of these; I'm expecting Dave to do whatever he thinks is best.
Quoted 23 lines
Quoted 23 lines
--- drivers/gpu/drm/drm_pci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_pci.c +2
-3@@ -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