[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen/events: fix build



commit 53bacb86f496fdb11560d9e3b361bca7de60d268
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Wed Nov 11 08:56:21 2020 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Nov 11 08:56:21 2020 +0100

    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 <jgross@xxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/common/event_channel.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

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);
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.