From f3ed268ec6da13cb7a9e858eba128444ee904544 Mon Sep 17 00:00:00 2001 From: Karl Fessel Date: Thu, 3 Nov 2022 16:20:56 +0100 Subject: [PATCH] sys/pm_layered: move (un)block assert for minor speedup --- sys/pm_layered/pm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/pm_layered/pm.c b/sys/pm_layered/pm.c index 3822205143e0..ca0368997b91 100644 --- a/sys/pm_layered/pm.c +++ b/sys/pm_layered/pm.c @@ -77,22 +77,20 @@ void pm_set_lowest(void) void pm_block(unsigned mode) { - assert(pm_blocker.blockers[mode] != 255); - DEBUG("[pm_layered] pm_block(%d)\n", mode); unsigned state = irq_disable(); + assert(pm_blocker.blockers[mode] != 255); pm_blocker.blockers[mode]++; irq_restore(state); } void pm_unblock(unsigned mode) { - assert(pm_blocker.blockers[mode] > 0); - DEBUG("[pm_layered] pm_unblock(%d)\n", mode); unsigned state = irq_disable(); + assert(pm_blocker.blockers[mode] > 0); pm_blocker.blockers[mode]--; irq_restore(state); }