[Intel-gfx] [PATCH 2/2] drm/i915: reduce PCI ID duplication in IS_IRONLAKE_M()

Jani Nikula jani.nikula at intel.com
Wed Dec 7 22:10:27 UTC 2016


Reduce PCI ID duplication by replacing direct PCI ID check with
INTEL_IRONLAKE && IS_MOBILE() check.

It's slightly less optimal, but clarity and single point of truth win.

Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index ee1726b28b82..a15161007109 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2618,7 +2618,8 @@ intel_info(const struct drm_i915_private *dev_priv)
 #define IS_G4X(dev_priv)	(IS_G45(dev_priv) || IS_GM45(dev_priv))
 #define IS_PINEVIEW(dev_priv)	((dev_priv)->info.platform == INTEL_PINEVIEW)
 #define IS_G33(dev_priv)	((dev_priv)->info.platform == INTEL_G33)
-#define IS_IRONLAKE_M(dev_priv)	(INTEL_DEVID(dev_priv) == 0x0046)
+#define IS_IRONLAKE_M(dev_priv)	((dev_priv)->info.platform == INTEL_IRONLAKE && \
+				 IS_MOBILE(dev_priv))
 #define IS_IVYBRIDGE(dev_priv)	((dev_priv)->info.platform == INTEL_IVYBRIDGE)
 #define IS_IVB_GT1(dev_priv)	(INTEL_DEVID(dev_priv) == 0x0156 || \
 				 INTEL_DEVID(dev_priv) == 0x0152 || \
-- 
2.1.4



More information about the Intel-gfx mailing list