Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: avoid "possible bad bitmask?" warning

Recent versions of gcc say this:

include/drm/i915_drm.h:96:34: warning: result of ‘65535 << 20’
requires 37 bits to represent, but ‘int’ only has 32 bits
[-Wshift-overflow=]

Reported-by: David Binderman <linuxdev.baldrick@gmail.com>
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Cc: Dave Airlie <airlied@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1470764110-23855-1-git-send-email-david.s.gordon@intel.com

authored by

Dave Gordon and committed by
Daniel Vetter
aac440ff 1426f715

+1 -1
+1 -1
include/drm/i915_drm.h
··· 93 93 #define I845_TSEG_SIZE_1M (3 << 1) 94 94 95 95 #define INTEL_BSM 0x5c 96 - #define INTEL_BSM_MASK (0xFFFF << 20) 96 + #define INTEL_BSM_MASK (-(1u << 20)) 97 97 98 98 #endif /* _I915_DRM_H_ */