summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2021-06-24 21:32:25 +0800
committerGitHub <[email protected]>2021-06-24 21:32:25 +0800
commitfcb0a47328a3178d02b3bc0a83bd9e84818e08b7 (patch)
treea5b4c1a2ba77c13a603ecfe4dc5d30b97ec198cf
parent2341ba037b86cc6b75d9934b5b34d400aca31291 (diff)
parent5d4260ab6df4faa1d829e164ffb95aeabd9aa4e5 (diff)
Merge pull request #4819 from whj4674672/pm
[pm] index should be less than PM_MODLUE_MAX_ID
-rw-r--r--components/drivers/pm/pm.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/components/drivers/pm/pm.c b/components/drivers/pm/pm.c
index 80ed101498..cf488a9ce1 100644
--- a/components/drivers/pm/pm.c
+++ b/components/drivers/pm/pm.c
@@ -836,12 +836,10 @@ rt_uint32_t rt_pm_module_get_status(void)
rt_uint32_t req_status = 0x00;
pm = &_pm;
- for (index = 0; index < 32; index ++)
+ for (index = 0; index < PM_MODULE_MAX_ID; index ++)
{
if (pm->module_status[index].req_status == 0x01)
req_status |= 1<<index;
- if (index >= PM_MODULE_MAX_ID)
- break;
}
return req_status;