]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Avoid BIT(max) - 1 and use GENMASK(max - 1, 0)
authorJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Wed, 8 Feb 2017 13:12:09 +0000 (15:12 +0200)
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Wed, 8 Feb 2017 15:22:00 +0000 (17:22 +0200)
commit7d4eccdfb7db8a243e9b08cb45bf4420e143b3d0
treea2db24065313d5907e5179baad66ab3ef5948d33
parent98fc5ad3b871e91db5f5b49740d938f89d4d31c5
drm/i915: Avoid BIT(max) - 1 and use GENMASK(max - 1, 0)

"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@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/intel_device_info.c
drivers/gpu/drm/i915/intel_fbdev.c
drivers/gpu/drm/i915/intel_runtime_pm.c