]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/i915/power: fix size for for_each_set_bit() in abox iteration
authorJani Nikula <jani.nikula@intel.com>
Fri, 5 Sep 2025 10:41:49 +0000 (13:41 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 8 Sep 2025 09:56:29 +0000 (12:56 +0300)
commit7ea3baa6efe4bb93d11e1c0e6528b1468d7debf6
tree4413c927939f254543ec7eefafa1985ca5ec51e0
parent90d8aad11f613e13e1eddc35c0225cce9e54ba94
drm/i915/power: fix size for for_each_set_bit() in abox iteration

for_each_set_bit() expects size to be in bits, not bytes. The abox mask
iteration uses bytes, but it works by coincidence, because the local
variable holding the mask is unsigned long, and the mask only ever has
bit 2 as the highest bit. Using a smaller type could lead to subtle and
very hard to track bugs.

Fixes: 62afef2811e4 ("drm/i915/rkl: RKL uses ABOX0 for pixel transfers")
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: stable@vger.kernel.org # v5.9+
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20250905104149.1144751-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_display_power.c