From 373769f1030fd4f5f350229c5bfd177945caae98 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Wed, 10 Feb 2021 18:57:04 +0100 Subject: soc/amd/common/block/acpi/pm_state: don't rely on undefined behavior Change-Id: I5a76a38f8d84666f6b9c0bfffecca064fa82d593 Found-by: Coverity CID 1445994 Signed-off-by: Felix Held Reviewed-on: https://review.coreboot.org/c/coreboot/+/50492 Tested-by: build bot (Jenkins) Reviewed-by: Marshall Dawson --- src/soc/amd/common/block/acpi/pm_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/soc/amd/common') diff --git a/src/soc/amd/common/block/acpi/pm_state.c b/src/soc/amd/common/block/acpi/pm_state.c index ea22ec564a..643cb0267b 100644 --- a/src/soc/amd/common/block/acpi/pm_state.c +++ b/src/soc/amd/common/block/acpi/pm_state.c @@ -18,7 +18,7 @@ static int get_index_bit(uint32_t value, uint16_t limit) return -1; /* get a mask of valid bits. Ex limit = 3, set bits 0-2 */ - t = (1 << limit) - 1; + t = (1ULL << limit) - 1; if ((value & t) == 0) return -1; t = 1; -- cgit v1.2.3