Commit c0e1e056 authored by Adam Wujek's avatar Adam Wujek 💬

userspace/libwr: add printout to assert_init macro

--Move assert_init macro to libwr/wrs-msg.h
--Add printout to assert_init macro to know which function fails.
--Remove assert_init macro duplication from rsw_hal/hal_main.c
--Remove #include <libwr/shw_io.h> from libwr/shw_io.h (no need to include file
from itself)
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 1c1b97ff
......@@ -25,11 +25,8 @@
#include <stdint.h>
#include <libwr/shw_io.h>
#include <libwr/pio.h>
#define assert_init(proc) { int ret; if((ret = proc) < 0) return ret; }
/**
* List of type of IO.
*/
......
......@@ -54,4 +54,12 @@ extern void __wrs_msg(int level, const char *func, int line,
#define pr_info(...) wrs_msg(LOG_INFO, __VA_ARGS__)
#define pr_debug(...) wrs_msg(LOG_DEBUG, __VA_ARGS__)
#define assert_init(proc) { \
int ret = proc; \
if (ret < 0) { \
pr_error("Error in function "#proc" ret = %d\n", ret); \
return ret; \
} \
}
#endif /* __WRS_MSG_H__ */
......@@ -23,8 +23,6 @@
#define MAX_CLEANUP_CALLBACKS 16
#define assert_init(proc) { int ret; if((ret = proc) < 0) return ret; }
static int daemon_mode = 0;
static hal_cleanup_callback_t cleanup_cb[MAX_CLEANUP_CALLBACKS];
struct hal_shmem_header *hal_shmem;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment