laforge has uploaded this change for review.

View Change

kernel 6.4 API change in DEFINE_SEMAPHORE

This works around build failures with kernel >= v6.4-rc1 where
the DEFINE_SEMAPHORE macro is adjusted in upstream kernel commit
48380368dec14859723b9e3fbd43e042638d9a76

Change-Id: I752c903c8a0345af6e51a996d064c9d629578ab4
---
M include/dahdi/kernel.h
1 file changed, 19 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/dahdi-linux refs/changes/81/33181/1
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index 778c2b2..08375f2 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -1551,10 +1551,16 @@
#define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED
#endif

+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
#ifndef DEFINE_SEMAPHORE
#define DEFINE_SEMAPHORE(name) \
struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
#endif
+#else /* 6.4.0, speficcally 48380368dec14859723b9e3fbd43e042638d9a76 */
+#undef DEFINE_SEMAPHORE
+#define DEFINE_SEMAPHORE(name) \
+ struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
+#endif

#ifndef DEFINE_MUTEX
struct mutex {

To view, visit change 33181. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: dahdi-linux
Gerrit-Branch: master
Gerrit-Change-Id: I752c903c8a0345af6e51a996d064c9d629578ab4
Gerrit-Change-Number: 33181
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge@osmocom.org>
Gerrit-MessageType: newchange