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 <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/50492 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
This commit is contained in:
@@ -18,7 +18,7 @@ static int get_index_bit(uint32_t value, uint16_t limit)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* get a mask of valid bits. Ex limit = 3, set bits 0-2 */
|
/* 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)
|
if ((value & t) == 0)
|
||||||
return -1;
|
return -1;
|
||||||
t = 1;
|
t = 1;
|
||||||
|
Reference in New Issue
Block a user