From 884a4e5a35f3aabd804f74b9e6f31a25eda5be7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C3=85berg?= Date: Wed, 20 Mar 2024 20:39:51 +0100 Subject: [PATCH] arch: Fix assert logic for installing shared interrupt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With this commit, it is now allowed to register any ISR and arg combination for the same IRQ, except the case when the exact same ISR-arg combination is already registered. The previous assert logic had a restriction where the same ISR could not be registered multiple times with different arguments. Signed-off-by: Martin Ã…berg --- arch/common/shared_irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/common/shared_irq.c b/arch/common/shared_irq.c index b4226ba72057fa..56c8d0cbc7d6b5 100644 --- a/arch/common/shared_irq.c +++ b/arch/common/shared_irq.c @@ -92,8 +92,8 @@ void z_isr_install(unsigned int irq, void (*routine)(const void *), for (i = 0; i < shared_entry->client_num; i++) { client = &shared_entry->clients[i]; - __ASSERT(client->isr != routine && client->arg != param, - "trying to register duplicate ISR/arg pair"); + __ASSERT((client->isr == routine && client->arg == param) == false, + "ISR/arg combination is already registered"); } shared_entry->clients[shared_entry->client_num].isr = routine;