amd/common/block/acpi/pm_state: fix comparison in get_index_bit
In the case of passing 32 as limit the code returned -1, but should have continued, since 32 is a valid value here. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I6ca341841bad62abcb4ea26a350c539813a29de7 Reviewed-on: https://review.coreboot.org/c/coreboot/+/50243 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
parent
585f4d46cc
commit
404aea866c
|
@ -13,7 +13,7 @@ static int get_index_bit(uint32_t value, uint16_t limit)
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
uint32_t t;
|
uint32_t t;
|
||||||
|
|
||||||
if (limit >= TOTAL_BITS(uint32_t))
|
if (limit > TOTAL_BITS(uint32_t))
|
||||||
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 */
|
||||||
|
|
Loading…
Reference in New Issue