[Intel-gfx] [PATCH v2 1/2] drm/i915: Avoid BIT(max) - 1 and use GENMASK(max - 1, 0)

Chris Wilson chris at chris-wilson.co.uk
Wed Feb 8 13:39:37 UTC 2017


On Wed, Feb 08, 2017 at 03:12:09PM +0200, Joonas Lahtinen wrote:
> "BIT(max) - 1" will overflow when max = 32, and GCC will complain.
> We already have GENMASK for generating the mask, use it!
> 
> v2: Majestic off by one spotted (Chris)
> 
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list