From 5d09d48050db8cd25d49a52141cd8b956f36e6f7 Mon Sep 17 00:00:00 2001 From: Ryan Salsamendi Date: Tue, 4 Jul 2017 13:53:00 -0700 Subject: drivers/intel/gma: Fix undefined behavior Fix undefined behavior found by clang's -Wshift-sign-overflow, find, and source inspection. Left shifting an int where the right operand is >= the width of the type is undefined. Add UL suffix since it's safe for unsigned types. Change-Id: I5240a19647c8ad59f64925f3e1c199446a886d2d Signed-off-by: Ryan Salsamendi Reviewed-on: https://review.coreboot.org/20466 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/drivers/intel/gma/opregion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/drivers/intel/gma/opregion.h') diff --git a/src/drivers/intel/gma/opregion.h b/src/drivers/intel/gma/opregion.h index 3f943805fb..eebea58b5a 100644 --- a/src/drivers/intel/gma/opregion.h +++ b/src/drivers/intel/gma/opregion.h @@ -168,7 +168,7 @@ typedef struct { #define IGD_BACKLIGHT_BRIGHTNESS 0xff #define IGD_INITIAL_BRIGHTNESS 0x64 -#define IGD_FIELD_VALID (1 << 31) +#define IGD_FIELD_VALID (1UL << 31) #define IGD_WORD_FIELD_VALID (1 << 15) #define IGD_PFIT_STRETCH 6 -- cgit v1.2.3