summaryrefslogtreecommitdiff
path: root/kern/mutex/mutex_adaptive.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-01-29 00:52:40 +0100
committerRichard Braun <rbraun@sceen.net>2018-01-29 01:12:05 +0100
commitbc6e853d4b27055056eebfd871aaf0fc60405b0f (patch)
tree9860d545d88a627fcea3309efea89cb27779aaf9 /kern/mutex/mutex_adaptive.c
parent3ec2193d8538beec5d961d11d67f568d8d3f6cd8 (diff)
Fix undefined behavior in conditional macro replacement
See C11 6.10.3 ยง11 : If there are sequences of preprocessing tokens within the list of arguments that would otherwise act as preprocessing directives, the behavior is undefined.
Diffstat (limited to 'kern/mutex/mutex_adaptive.c')
-rw-r--r--kern/mutex/mutex_adaptive.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kern/mutex/mutex_adaptive.c b/kern/mutex/mutex_adaptive.c
index bda54532..db92f9d5 100644
--- a/kern/mutex/mutex_adaptive.c
+++ b/kern/mutex/mutex_adaptive.c
@@ -333,9 +333,14 @@ mutex_adaptive_setup(void)
return 0;
}
-INIT_OP_DEFINE(mutex_adaptive_setup,
- INIT_OP_DEP(mutex_adaptive_bootstrap, true),
#ifdef CONFIG_MUTEX_DEBUG
+#define MUTEX_ADAPTIVE_DEBUG_INIT_OP_DEPS \
INIT_OP_DEP(syscnt_setup, true),
+#else /* CONFIG_MUTEX_DEBUG */
+#define MUTEX_ADAPTIVE_DEBUG_INIT_OP_DEPS
#endif /* CONFIG_MUTEX_DEBUG */
+
+INIT_OP_DEFINE(mutex_adaptive_setup,
+ INIT_OP_DEP(mutex_adaptive_bootstrap, true),
+ MUTEX_ADAPTIVE_DEBUG_INIT_OP_DEPS
);