Skip to content

drivers: clock_control_nrf: Prevent break from becoming dead code #90594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

anangl
Copy link
Member

@anangl anangl commented May 26, 2025

When both NRF_CLOCK_HAS_XO_TUNE and NRF_CLOCK_HAS_PLL evaluate to 0, one break statement can end up not associated with any case and become dead code. Refactor a bit the related switch to avoid such situation.

Fixes #90556.

When both NRF_CLOCK_HAS_XO_TUNE and NRF_CLOCK_HAS_PLL evaluate to 0,
one break statement can end up not associated with any case and become
dead code. Refactor a bit the related switch to avoid such situation.

Signed-off-by: Andrzej Głąbek <[email protected]>
@anangl anangl requested review from kl-cruz and nika-nordic May 26, 2025 11:10
@anangl anangl added the Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. label May 26, 2025
Copy link

@kartben kartben merged commit 77a7cb3 into zephyrproject-rtos:main Jun 12, 2025
30 checks passed
@anangl anangl deleted the prevent_stray_break_in_clock_control_nrf branch June 12, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Clock Control platform: nRF Nordic nRFx Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Coverity CID: 516219] Structurally dead code in drivers/clock_control/clock_control_nrf.c
4 participants