Hello there,
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=]
Source code is
#define INTEL_BSM_MASK (0xFFFF << 20)
Maybe something like
#define INTEL_BSM_MASK (0xFFFFUL<< 20)
might be better.
Regards
David Binderman
On Mon, Aug 08, 2016 at 10:31:32AM +0100, David Binderman wrote:
Hello there,
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=]
Source code is
#define INTEL_BSM_MASK (0xFFFF << 20)
Maybe something like
#define INTEL_BSM_MASK (0xFFFFUL<< 20)
might be better.
Yup. Care to bake this into a patch (with s-o-b and everything per Documentation/SubmittingPatches) so I can apply it? -Daniel
Regards
David Binderman _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Hello there,
On 8 August 2016 at 10:40, Daniel Vetter daniel@ffwll.ch wrote:
Care to bake this into a patch
No thanks, but I am happy for someone else to invent a patch.
Regards
David Binderman
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 --- include/drm/i915_drm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index b1755f8..4e1b274 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -93,6 +93,6 @@ extern bool i915_gpu_turbo_disable(void); #define I845_TSEG_SIZE_1M (3 << 1)
#define INTEL_BSM 0x5c -#define INTEL_BSM_MASK (0xFFFF << 20) +#define INTEL_BSM_MASK (-(1u << 20))
#endif /* _I915_DRM_H_ */
On Tue, Aug 09, 2016 at 06:35:10PM +0100, Dave Gordon wrote:
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
include/drm/i915_drm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index b1755f8..4e1b274 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -93,6 +93,6 @@ extern bool i915_gpu_turbo_disable(void); #define I845_TSEG_SIZE_1M (3 << 1)
#define INTEL_BSM 0x5c -#define INTEL_BSM_MASK (0xFFFF << 20) +#define INTEL_BSM_MASK (-(1u << 20))
Reviewed-by: Chris Wilson chris@chris-wilson.co.uk -Chris
On Tue, Aug 9, 2016 at 9:53 PM, Chris Wilson chris@chris-wilson.co.uk wrote:
On Tue, Aug 09, 2016 at 06:35:10PM +0100, Dave Gordon wrote:
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
include/drm/i915_drm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index b1755f8..4e1b274 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -93,6 +93,6 @@ extern bool i915_gpu_turbo_disable(void); #define I845_TSEG_SIZE_1M (3 << 1)
#define INTEL_BSM 0x5c -#define INTEL_BSM_MASK (0xFFFF << 20) +#define INTEL_BSM_MASK (-(1u << 20))
Reviewed-by: Chris Wilson chris@chris-wilson.co.uk
And applied, thanks. -Daniel
On 8 August 2016 at 19:40, Daniel Vetter daniel@ffwll.ch wrote:
On Mon, Aug 08, 2016 at 10:31:32AM +0100, David Binderman wrote:
Hello there,
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=]
Source code is
#define INTEL_BSM_MASK (0xFFFF << 20)
Maybe something like
#define INTEL_BSM_MASK (0xFFFFUL<< 20)
might be better.
Yup. Care to bake this into a patch (with s-o-b and everything per Documentation/SubmittingPatches) so I can apply it?
Why would you want to apply a clearly incorrect patch :-)
INTEL_BSM_MASK is used in one place, on a 32-bit number
I'm not sure what it needs to be, but a 64-bit number it doesn't.
Dave.
On 09/08/16 03:59, Dave Airlie wrote:
On 8 August 2016 at 19:40, Daniel Vetter daniel@ffwll.ch wrote:
On Mon, Aug 08, 2016 at 10:31:32AM +0100, David Binderman wrote:
Hello there,
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=]
Source code is
#define INTEL_BSM_MASK (0xFFFF << 20)
Maybe something like
#define INTEL_BSM_MASK (0xFFFFUL<< 20)
might be better.
Yup. Care to bake this into a patch (with s-o-b and everything per Documentation/SubmittingPatches) so I can apply it?
Why would you want to apply a clearly incorrect patch :-)
INTEL_BSM_MASK is used in one place, on a 32-bit number
I'm not sure what it needs to be, but a 64-bit number it doesn't.
Dave.
I found two uses, but in both cases it's masking a value read from a 32-bit PCI register, so it can just be (-(1 << 20)).
.Dave.
dri-devel@lists.freedesktop.org