From e5aa0ab79635bf295ec576794ab45fa35e2d9a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Mon, 2 Jan 2023 14:29:53 +0100 Subject: [PATCH] drivers: nrf_rtc_timer: Check channel bit when handling force_isr_mask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing masking against `BIT(chan)` when handling a forced ISR to avoid unnecessary processing of multiple channels instead of just the one that actually requires it. Signed-off-by: Andrzej Głąbek --- drivers/timer/nrf_rtc_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/timer/nrf_rtc_timer.c b/drivers/timer/nrf_rtc_timer.c index 6599a8c3b95..878197904b6 100644 --- a/drivers/timer/nrf_rtc_timer.c +++ b/drivers/timer/nrf_rtc_timer.c @@ -428,7 +428,7 @@ static bool channel_processing_check_and_clear(int32_t chan) /* The processing of channel can be caused by CC match * or be forced. */ - result = atomic_and(&force_isr_mask, ~BIT(chan)) || + result = (atomic_and(&force_isr_mask, ~BIT(chan)) & BIT(chan)) || event_check(chan); if (result) {