From c35125400a829a919717813bf23cd4056c947d6d Mon Sep 17 00:00:00 2001
From: ch3 <ch3@mailbox.org>
Date: Thu, 13 Jun 2019 22:44:33 +0200
Subject: [PATCH] Fix missing variable, types, includes and comments

---
 hw-tests/api-demo/api/api_caller.c     | 1 +
 hw-tests/api-demo/api/api_caller.h     | 3 ++-
 hw-tests/api-demo/api/api_common.h     | 4 +++-
 hw-tests/api-demo/api/api_dispatcher.c | 4 ++++
 hw-tests/api-demo/api/api_dispatcher.h | 1 +
 5 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/hw-tests/api-demo/api/api_caller.c b/hw-tests/api-demo/api/api_caller.c
index ffac1a307..f182fd9e6 100644
--- a/hw-tests/api-demo/api/api_caller.c
+++ b/hw-tests/api-demo/api/api_caller.c
@@ -1,5 +1,6 @@
 void* api_call_start (uint32_t id, void* args, size_t size)
 {
+	int ret;
 	// aquire semaphore
 	ret = SEMA_GetSema (API_CALL_SEMA);
 
diff --git a/hw-tests/api-demo/api/api_caller.h b/hw-tests/api-demo/api/api_caller.h
index 6bb899488..ed1b58f2d 100644
--- a/hw-tests/api-demo/api/api_caller.h
+++ b/hw-tests/api-demo/api/api_caller.h
@@ -1,3 +1,4 @@
 #include "api_common.h"
 
-int api_call (uint32_t id, void *args);
+void* api_call (uint32_t id, void *args, size_t size);
+void* api_call_bother_dispatcher (void* buf);
diff --git a/hw-tests/api-demo/api/api_common.h b/hw-tests/api-demo/api/api_common.h
index dbf7f0c43..338d823b8 100644
--- a/hw-tests/api-demo/api/api_common.h
+++ b/hw-tests/api-demo/api/api_common.h
@@ -1,10 +1,12 @@
+#include <stdint.h>
+
 #define API_CALL_SEMA 0
 
 struct api_call
 {
 	uint32_t id;
 	uint8_t returning;
-	unsigned char *buf;
+	unsigned char buf[1];
 };
 
 static struct api_call **ApiCallSpace = (void*)0x20080001;
diff --git a/hw-tests/api-demo/api/api_dispatcher.c b/hw-tests/api-demo/api/api_dispatcher.c
index 41d3a8745..68fe0bab2 100644
--- a/hw-tests/api-demo/api/api_dispatcher.c
+++ b/hw-tests/api-demo/api/api_dispatcher.c
@@ -6,6 +6,10 @@ api_init (sys_cfg_sema_t *sys_cfg)
 	int ret;
 
 	ret = SEMA_Init (sys_cfg);
+	/* Set the status of the flag to a valid initial state (right before
+	 * api-calls are made) */
 	ApiCallSpace->returning = 1;
+
+	return ret;
 }
 
diff --git a/hw-tests/api-demo/api/api_dispatcher.h b/hw-tests/api-demo/api/api_dispatcher.h
index 69526574b..001e16793 100644
--- a/hw-tests/api-demo/api/api_dispatcher.h
+++ b/hw-tests/api-demo/api/api_dispatcher.h
@@ -1,4 +1,5 @@
 #include "api_common.h"
+#include "mxc_sys.h"
 
 int
 api_init (sys_cfg_sema_t *sys_cfg);
-- 
GitLab