]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: fix shift warning
authorArnd Bergmann <arnd@arndb.de>
Sun, 3 Jan 2021 13:51:44 +0000 (14:51 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sun, 3 Jan 2021 14:12:48 +0000 (14:12 +0000)
commit684ee1119411bb33d76ac47d1e7b7970d009c80a
treeddd3dbe7792c07855c72d641d1bd92725d51767b
parentfc731ced4baa4c6b1609caa29761525cc0e39c1f
drm/i915: fix shift warning

Randconfig builds on 32-bit machines show lots of warnings for
the i915 driver for passing a 32-bit value into __const_hweight64():

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:2584:9: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
        return hweight64(VDBOX_MASK(&i915->gt));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/bitops/const_hweight.h:29:49: note: expanded from macro 'hweight64'
 #define hweight64(w) (__builtin_constant_p(w) ? __const_hweight64(w) : __arch_hweight64(w))

Change it to hweight_long() to avoid the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20210103135158.3591442-1-arnd@kernel.org
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c