summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2020-05-09 10:18:28 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2020-05-09 10:18:28 +0000
commit7062ca77493452d4c5896a9992e50e4c31cd050d (patch)
treeb8c7a69b2efc6ea3a8b7e8f896f92293082c3e81 /sys
parent50864dc3f16bb0982838fcd8dc5c31f575992a73 (diff)
Initialize the srp_ref in the non-MP version of srp_enter
Silences an uninitialized warning in net/art.c "reasonable" jmatthew@, ok mpi@
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/srp.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/sys/srp.h b/sys/sys/srp.h
index a22e940daa0..c2f40ab44bc 100644
--- a/sys/sys/srp.h
+++ b/sys/sys/srp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: srp.h,v 1.14 2019/03/31 14:03:40 mpi Exp $ */
+/* $OpenBSD: srp.h,v 1.15 2020/05/09 10:18:27 jca Exp $ */
/*
* Copyright (c) 2014 Jonathan Matthew <jmatthew@openbsd.org>
@@ -96,11 +96,18 @@ void *srp_enter(struct srp_ref *, struct srp *);
void *srp_follow(struct srp_ref *, struct srp *);
void srp_leave(struct srp_ref *);
#else /* MULTIPROCESSOR */
+
+static inline void *
+srp_enter(struct srp_ref *sr, struct srp *srp)
+{
+ sr->hz = NULL;
+ return srp->ref;
+}
+
#define srp_swap(_srp, _v) srp_swap_locked((_srp), (_v))
#define srp_update(_gc, _srp, _v) srp_update_locked((_gc), (_srp), (_v))
#define srp_finalize(_v, _wchan) ((void)0)
-#define srp_enter(_sr, _srp) ((_srp)->ref)
-#define srp_follow(_sr, _srp) ((_srp)->ref)
+#define srp_follow(_sr, _srp) srp_enter(_sr, _srp)
#define srp_leave(_sr) do { } while (0)
#endif /* MULTIPROCESSOR */