Skip to content

Conversation

yongxu-wang15
Copy link
Contributor

Limit the loop to the smaller of nvic_iser_nb and
GPC_CPU_CTRL_CMC_IRQ_WAKEUP_MASK_COUNT to ensure safe access.


/* IRQs enabled at NVIC level become GPC wake sources */
for (uint32_t idx = 0; idx < nvic_iser_nb; idx++) {
for (uint32_t idx = 0; idx < GPC_CPU_CTRL_CMC_IRQ_WAKEUP_MASK_COUNT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (uint32_t idx = 0; idx < GPC_CPU_CTRL_CMC_IRQ_WAKEUP_MASK_COUNT
for (uint32_t idx = 0; idx < MIN(GPC_CPU_CTRL_CMC_IRQ_WAKEUP_MASK_COUNT, nic_iser_nb; idx++) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, done

Limit the loop to the smaller of nvic_iser_nb and
GPC_CPU_CTRL_CMC_IRQ_WAKEUP_MASK_COUNT to ensure safe access.

Signed-off-by: Yongxu Wang <[email protected]>
@yongxu-wang15 yongxu-wang15 force-pushed the NXP-imx943-fixed-cxx-test-build-issue branch from 2bdf78c to ed626f9 Compare October 9, 2025 06:49
Copy link

sonarqubecloud bot commented Oct 9, 2025

@kartben kartben merged commit 60d8b2f into zephyrproject-rtos:main Oct 13, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants