trivial: formatting for style compliance
Signed-off-by: Axel Heider <axelheider@gmx.de>
diff --git a/libsel4sync/CMakeLists.txt b/libsel4sync/CMakeLists.txt
index 5faf9cb..611e0f4 100644
--- a/libsel4sync/CMakeLists.txt
+++ b/libsel4sync/CMakeLists.txt
@@ -19,5 +19,21 @@
list(SORT deps)
add_library(sel4sync STATIC EXCLUDE_FROM_ALL ${deps})
-target_include_directories(sel4sync PUBLIC include)
-target_link_libraries(sel4sync muslc sel4 sel4vka platsupport utils sel4_autoconf)
+
+target_include_directories(
+ sel4sync
+ PUBLIC
+ include
+)
+
+target_link_libraries(
+ sel4sync
+ PUBLIC
+ muslc
+ sel4
+ sel4vka
+ platsupport
+ utils
+ sel4_
+ autoconf
+)
diff --git a/libsel4sync/include/sync/bin_sem.h b/libsel4sync/include/sync/bin_sem.h
index 43bd52b..e24ff06 100644
--- a/libsel4sync/include/sync/bin_sem.h
+++ b/libsel4sync/include/sync/bin_sem.h
@@ -30,7 +30,8 @@
* @param notification A notification object to use for the lock.
* @param value The initial value for the semaphore. Must be 0 or 1.
* @return 0 on success, an error code on failure. */
-static inline int sync_bin_sem_init(sync_bin_sem_t *sem, seL4_CPtr notification, int value) {
+static inline int sync_bin_sem_init(sync_bin_sem_t *sem, seL4_CPtr notification, int value)
+{
if (sem == NULL) {
ZF_LOGE("Semaphore passed to sync_bin_sem_init was NULL");
return -1;
@@ -54,7 +55,8 @@
/* Wait on a binary semaphore
* @param sem An initialised semaphore to acquire.
* @return 0 on success, an error code on failure. */
-static inline int sync_bin_sem_wait(sync_bin_sem_t *sem) {
+static inline int sync_bin_sem_wait(sync_bin_sem_t *sem)
+{
if (sem == NULL) {
ZF_LOGE("Semaphore passed to sync_bin_sem_wait was NULL");
return -1;
@@ -65,7 +67,8 @@
/* Signal a binary semaphore
* @param sem An initialised semaphore to release.
* @return 0 on success, an error code on failure. */
-static inline int sync_bin_sem_post(sync_bin_sem_t *sem) {
+static inline int sync_bin_sem_post(sync_bin_sem_t *sem)
+{
if (sem == NULL) {
ZF_LOGE("Semaphore passed to sync_bin_sem_post was NULL");
return -1;
@@ -78,7 +81,8 @@
* @param sem A semaphore object to initialise.
* @param value The initial value for the semaphore. Must be 0 or 1.
* @return 0 on success, an error code on failure. */
-static inline int sync_bin_sem_new(vka_t *vka, sync_bin_sem_t *sem, int value) {
+static inline int sync_bin_sem_new(vka_t *vka, sync_bin_sem_t *sem, int value)
+{
if (sem == NULL) {
ZF_LOGE("Semaphore passed to sync_bin_sem_new was NULL");
return -1;
@@ -100,7 +104,8 @@
* @param vka A VKA instance used to deallocate the notification object.
* @param sem A semaphore object initialised by sync_bin_sem_new.
* @return 0 on success, an error code on failure. */
-static inline int sync_bin_sem_destroy(vka_t *vka, sync_bin_sem_t *sem) {
+static inline int sync_bin_sem_destroy(vka_t *vka, sync_bin_sem_t *sem)
+{
if (sem == NULL) {
ZF_LOGE("Semaphore passed to sync_bin_sem_destroy was NULL");
return -1;
diff --git a/libsel4sync/include/sync/sem.h b/libsel4sync/include/sync/sem.h
index 3fe5e6e..f96c3b2 100644
--- a/libsel4sync/include/sync/sem.h
+++ b/libsel4sync/include/sync/sem.h
@@ -30,7 +30,8 @@
* @param notification An endpoint to use for the lock.
* @param value An initial value for the semaphore.
* @return 0 on success, an error code on failure. */
-static inline int sync_sem_init(sync_sem_t *sem, seL4_CPtr ep, int value) {
+static inline int sync_sem_init(sync_sem_t *sem, seL4_CPtr ep, int value)
+{
if (sem == NULL) {
ZF_LOGE("Semaphore passed to sync_sem_init was NULL");
return -1;
@@ -48,7 +49,8 @@
/* Wait on a semaphore
* @param sem An initialised semaphore to acquire.
* @return 0 on success, an error code on failure. */
-static inline int sync_sem_wait(sync_sem_t *sem) {
+static inline int sync_sem_wait(sync_sem_t *sem)
+{
if (sem == NULL) {
ZF_LOGE("Semaphore passed to sync_sem_wait was NULL");
return -1;
@@ -60,7 +62,8 @@
* i.e. check the semaphore value in a loop
* @param sem An initialised semaphore to acquire.
* @return 0 on success, an error code on failure. */
-static inline int sync_sem_trywait(sync_sem_t *sem) {
+static inline int sync_sem_trywait(sync_sem_t *sem)
+{
if (sem == NULL) {
ZF_LOGE("Semaphore passed to sync_sem_trywait was NULL");
return -1;
@@ -71,7 +74,8 @@
/* Signal a binary semaphore
* @param sem An initialised semaphore to release.
* @return 0 on success, an error code on failure. */
-static inline int sync_sem_post(sync_sem_t *sem) {
+static inline int sync_sem_post(sync_sem_t *sem)
+{
if (sem == NULL) {
ZF_LOGE("Semaphore passed to sync_sem_post was NULL");
return -1;
@@ -84,7 +88,8 @@
* @param sem A semaphore object to initialise.
* @param value An initial value for the semaphore.
* @return 0 on success, an error code on failure. */
-static inline int sync_sem_new(vka_t *vka, sync_sem_t *sem, int value) {
+static inline int sync_sem_new(vka_t *vka, sync_sem_t *sem, int value)
+{
if (sem == NULL) {
ZF_LOGE("Semaphore passed to sync_sem_new was NULL");
return -1;
@@ -102,7 +107,8 @@
* @param vka A VKA instance used to deallocate the endpoint.
* @param sem A semaphore object initialised by sync_sem_new.
* @return 0 on success, an error code on failure. */
-static inline int sync_sem_destroy(vka_t *vka, sync_sem_t *sem) {
+static inline int sync_sem_destroy(vka_t *vka, sync_sem_t *sem)
+{
if (sem == NULL) {
ZF_LOGE("Semaphore passed to sync_sem_destroy was NULL");
return -1;
diff --git a/libsel4sync/src/recursive_mutex.c b/libsel4sync/src/recursive_mutex.c
index 9d6e2cc..f82838f 100644
--- a/libsel4sync/src/recursive_mutex.c
+++ b/libsel4sync/src/recursive_mutex.c
@@ -18,11 +18,13 @@
#include <sel4/sel4.h>
-static void *thread_id(void) {
- return (void*)seL4_GetIPCBuffer();
+static void *thread_id(void)
+{
+ return (void *)seL4_GetIPCBuffer();
}
-int sync_recursive_mutex_init(sync_recursive_mutex_t *mutex, seL4_CPtr notification) {
+int sync_recursive_mutex_init(sync_recursive_mutex_t *mutex, seL4_CPtr notification)
+{
if (mutex == NULL) {
ZF_LOGE("Mutex passed to sync_recursive_mutex_init is NULL");
return -1;
@@ -41,7 +43,8 @@
return 0;
}
-int sync_recursive_mutex_lock(sync_recursive_mutex_t *mutex) {
+int sync_recursive_mutex_lock(sync_recursive_mutex_t *mutex)
+{
if (mutex == NULL) {
ZF_LOGE("Mutex passed to sync_recursive_mutex_lock is NULL");
return -1;
@@ -65,7 +68,8 @@
return 0;
}
-int sync_recursive_mutex_unlock(sync_recursive_mutex_t *mutex) {
+int sync_recursive_mutex_unlock(sync_recursive_mutex_t *mutex)
+{
if (mutex == NULL) {
ZF_LOGE("Mutex passed to sync_recursive_mutex_lock is NULL");
return -1;
@@ -81,7 +85,8 @@
return 0;
}
-int sync_recursive_mutex_new(vka_t *vka, sync_recursive_mutex_t *mutex) {
+int sync_recursive_mutex_new(vka_t *vka, sync_recursive_mutex_t *mutex)
+{
int error = vka_alloc_notification(vka, &(mutex->notification));
if (error != 0) {
@@ -91,7 +96,8 @@
}
}
-int sync_recursive_mutex_destroy(vka_t *vka, sync_recursive_mutex_t *mutex) {
+int sync_recursive_mutex_destroy(vka_t *vka, sync_recursive_mutex_t *mutex)
+{
vka_free_object(vka, &(mutex->notification));
return 0;
}