summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-02-02 23:46:25 +0100
committerFelix Held <felix-coreboot@felixheld.de>2021-02-04 00:10:02 +0000
commit404aea866ce60af9f8756f0698dcd8293c0e81bf (patch)
treee4e5ca84c1c64cdf979229841b1cff04ba4e3e02 /src/soc/amd
parent585f4d46cca95d8b8219d21e0af5fb487827318a (diff)
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>
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/common/block/acpi/pm_state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/soc/amd/common/block/acpi/pm_state.c b/src/soc/amd/common/block/acpi/pm_state.c
index a0097185dc..05bb927826 100644
--- a/src/soc/amd/common/block/acpi/pm_state.c
+++ b/src/soc/amd/common/block/acpi/pm_state.c
@@ -13,7 +13,7 @@ static int get_index_bit(uint32_t value, uint16_t limit)
uint16_t i;
uint32_t t;
- if (limit >= TOTAL_BITS(uint32_t))
+ if (limit > TOTAL_BITS(uint32_t))
return -1;
/* get a mask of valid bits. Ex limit = 3, set bits 0-2 */