diff options
author | Ryan Salsamendi <rsalsamendi@hotmail.com> | 2017-07-04 13:57:07 -0700 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2017-07-06 20:19:25 +0000 |
commit | 70c27de57122558a0579ba7fb6517d55ed5bafc1 (patch) | |
tree | 352a8050f11cea44ad565ea8a8ed5d7d6b2bab64 /src/cpu/intel | |
parent | 25dbc17a3612f9b11d451de94b87486e1cabc471 (diff) |
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 <rsalsamendi@hotmail.com>
Reviewed-on: https://review.coreboot.org/20467
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Diffstat (limited to 'src/cpu/intel')
-rw-r--r-- | src/cpu/intel/haswell/haswell.h | 2 |
1 files changed, 1 insertions, 1 deletions
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 |