[Intel-gfx] drivers/gpu/drm/i915/i915_reg.h:90:shift-overflow problem ?

David Binderman linuxdev.baldrick at gmail.com
Mon May 30 10:32:59 UTC 2016


Hello there,

drivers/gpu/drm/i915/i915_reg.h:90:28: warning: result of β€˜65535 <<
20’ requires 37 bits to represent, but β€˜int’ only has 32 bits
[-Wshift-overflow=]

Source code is

#define   BSM_MASK (0xFFFF << 20)

Maybe better code

#define   BSM_MASK (((unsigned long) 0xFFFF) << 20)


Regards

David Binderman


More information about the Intel-gfx mailing list