From 70c27de57122558a0579ba7fb6517d55ed5bafc1 Mon Sep 17 00:00:00 2001 From: Ryan Salsamendi Date: Tue, 4 Jul 2017 13:57:07 -0700 Subject: cpu/intel/haswell: Fix undefined behavior Fix undefined behavior found by clang's -Wshift-sign-overflow. 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: Ieacf83d052bf4abfad639ef8e592bd8de17d16e6 Signed-off-by: Ryan Salsamendi Reviewed-on: https://review.coreboot.org/20467 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth Reviewed-by: Nico Huber Reviewed-by: Philipp Deppenwiese --- src/cpu/intel/haswell/haswell.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/cpu/intel/haswell/haswell.h b/src/cpu/intel/haswell/haswell.h index 608c5b5908..6612509e49 100644 --- a/src/cpu/intel/haswell/haswell.h +++ b/src/cpu/intel/haswell/haswell.h @@ -112,7 +112,7 @@ /* PCODE MMIO communications live in the MCHBAR. */ #define BIOS_MAILBOX_INTERFACE 0x5da4 -#define MAILBOX_RUN_BUSY (1 << 31) +#define MAILBOX_RUN_BUSY (1UL << 31) #define MAILBOX_BIOS_CMD_READ_PCS 1 #define MAILBOX_BIOS_CMD_WRITE_PCS 2 #define MAILBOX_BIOS_CMD_READ_CALIBRATION 0x509 -- cgit v1.2.3