Skip to content

Commit

Permalink
[nrf fromtree] drivers: clock_control: nrf: hfxo: Remove redundad code
Browse files Browse the repository at this point in the history
There were redundant code in full_irq_lock(), full_irq_unlock()
functions that supposed to be used when ZLI IRQs are disabled.
These functions are compiled in only when CONFIG_ZERO_LATENCY_IRQS
is set, hence the non-ZLI execution path was never included
in final binaries.

Signed-off-by: Piotr Pryga <[email protected]>
(cherry picked from commit 233095c3f452c05683f0410140e737d89567d927)
Signed-off-by: Piotr Pryga <[email protected]>
  • Loading branch information
ppryga-nordic authored and jukkar committed Dec 19, 2024
1 parent 6e09b7a commit 10a6bd0
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions drivers/clock_control/clock_control_nrf2_hfxo.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,15 @@ static uint32_t full_irq_lock(void)
{
uint32_t mcu_critical_state;

if (IS_ENABLED(CONFIG_ZERO_LATENCY_IRQS)) {
mcu_critical_state = __get_PRIMASK();
__disable_irq();
} else {
mcu_critical_state = irq_lock();
}
mcu_critical_state = __get_PRIMASK();
__disable_irq();

return mcu_critical_state;
}

static void full_irq_unlock(uint32_t mcu_critical_state)
{
if (IS_ENABLED(CONFIG_ZERO_LATENCY_IRQS)) {
__set_PRIMASK(mcu_critical_state);
} else {
irq_unlock(mcu_critical_state);
}
__set_PRIMASK(mcu_critical_state);
}
#endif /* CONFIG_ZERO_LATENCY_IRQS */

Expand Down

0 comments on commit 10a6bd0

Please sign in to comment.