On Wed, 2017-09-27 at 17:41 +0100, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> > > If we store the platform as a bitmask, and convert the > IS_PLATFORM macro to use it, we allow the compiler to > merge the IS_PLATFORM(a) || IS_PLATFORM(b) || ... checks > into a single conditional. > > As a secondary benefit this saves almost 1k of text: > > text data bss dec hex filename > -1460254 60014 3656 1523924 1740d4 drivers/gpu/drm/i915/i915.ko > +1459260 60026 3656 1522942 173cfe drivers/gpu/drm/i915/i915.ko > > v2: Removed the infamous -1. > > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> > Cc: Jani Nikula <jani.nikula@xxxxxxxxx> <SNIP> > @@ -2986,7 +2987,7 @@ intel_info(const struct drm_i915_private *dev_priv) > #define IS_REVID(p, since, until) \ > (INTEL_REVID(p) >= (since) && INTEL_REVID(p) <= (until)) > > -#define IS_PLATFORM(dev_priv, p) ((dev_priv)->info.platform == (p)) > +#define IS_PLATFORM(dev_priv, p) ((dev_priv)->info.platform_mask & BIT(p)) || BUILD_BUG_ON_ZERO(__builtin_constant_p(p)) To enforce it? Regards, Joonas -- Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx