From b9bc2571bebf05f9a295e80a66226064ef41b020 Mon Sep 17 00:00:00 2001 From: Ryan Salsamendi Date: Tue, 4 Jul 2017 13:35:06 -0700 Subject: northbridge/intel/haswell: Fix undefined behavior Fix undefined behavior found by clang's -Wshift-sign-overflow, grep, 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: Id1ed2252ce3ed052730dd10b24c453c34c2ab4ff Signed-off-by: Ryan Salsamendi Reviewed-on: https://review.coreboot.org/20465 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/northbridge/intel/haswell/early_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/northbridge/intel/haswell/early_init.c') diff --git a/src/northbridge/intel/haswell/early_init.c b/src/northbridge/intel/haswell/early_init.c index f4263394ad..a2b0f7fb88 100644 --- a/src/northbridge/intel/haswell/early_init.c +++ b/src/northbridge/intel/haswell/early_init.c @@ -81,7 +81,7 @@ static void haswell_setup_graphics(void) /* GPU RC6 workaround for sighting 366252 */ reg32 = MCHBAR32(0x5d14); - reg32 |= (1 << 31); + reg32 |= (1UL << 31); MCHBAR32(0x5d14) = reg32; /* VLW */ -- cgit v1.2.3