From 0d9b360b42d39d211d62f0c213aae9e7cf3f2924 Mon Sep 17 00:00:00 2001 From: Ryan Salsamendi Date: Fri, 30 Jun 2017 17:15:57 -0700 Subject: southbridge/intel/lynxpoint: Fix undefined behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix reports found by undefined behavior sanitizer. 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: I755b3c80a8d1b6cb6b6e5f411c6691e5dd17c266 Signed-off-by: Ryan Salsamendi Reviewed-on: https://review.coreboot.org/20443 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paul Menzel --- src/southbridge/intel/lynxpoint/lpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/southbridge/intel/lynxpoint/lpc.c') diff --git a/src/southbridge/intel/lynxpoint/lpc.c b/src/southbridge/intel/lynxpoint/lpc.c index d295c888f8..6c4acd8c04 100644 --- a/src/southbridge/intel/lynxpoint/lpc.c +++ b/src/southbridge/intel/lynxpoint/lpc.c @@ -429,7 +429,7 @@ static void enable_clock_gating(device_t dev) reg32 = RCBA32(CG); reg32 |= (1 << 22); // HDA Dynamic - reg32 |= (1 << 31); // LPC Dynamic + reg32 |= (1UL << 31); // LPC Dynamic reg32 |= (1 << 16); // PCIe Dynamic reg32 |= (1 << 27); // HPET Dynamic reg32 |= (1 << 28); // GPIO Dynamic -- cgit v1.2.3