From: Juergen Gross Date: Wed, 11 Nov 2020 07:56:21 +0000 (+0100) Subject: xen/events: fix build X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~1415 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=53bacb86f496fdb11560d9e3b361bca7de60d268;p=xen.git xen/events: fix build Commit 5f2df45ead7c1195 ("xen/evtchn: rework per event channel lock") introduced a build failure for NDEBUG builds. Fixes: 5f2df45ead7c1195 ("xen/evtchn: rework per event channel lock") Signed-off-by: Juergen Gross Signed-off-by: Jan Beulich --- diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index eacd96b92f..54b2e2550e 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -61,13 +61,24 @@ static inline void evtchn_write_lock(struct evtchn *evtchn) { write_lock(&evtchn->lock); +#ifndef NDEBUG evtchn->old_state = evtchn->state; +#endif +} + +static inline unsigned int old_state(const struct evtchn *evtchn) +{ +#ifndef NDEBUG + return evtchn->old_state; +#else + return ECS_RESERVED; /* Just to allow things to build. */ +#endif } static inline void evtchn_write_unlock(struct evtchn *evtchn) { /* Enforce lock discipline. */ - ASSERT(evtchn->old_state == ECS_FREE || evtchn->old_state == ECS_UNBOUND || + ASSERT(old_state(evtchn) == ECS_FREE || old_state(evtchn) == ECS_UNBOUND || evtchn->state == ECS_FREE || evtchn->state == ECS_UNBOUND); write_unlock(&evtchn->lock);