[PATCH 3/7] Kernel: cobalt: workaround of BUILD_BUG_ON error on v4.18

roman.stratiienko at globallogic.com roman.stratiienko at globallogic.com
Tue Mar 5 15:45:17 CET 2019


From: Roman Stratiienko <roman.stratiienko at globallogic.com>

After kernel v4.18 commit 4a0772cf0674
("tracing: Prevent further users of zero size static arrays in trace events")
creating zero length arrays will force compile-time error

Signed-off-by: Roman Stratiienko <roman.stratiienko at globallogic.com>
---
 kernel/cobalt/trace/cobalt-posix.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cobalt/trace/cobalt-posix.h b/kernel/cobalt/trace/cobalt-posix.h
index 77392e725..3a87cc610 100644
--- a/kernel/cobalt/trace/cobalt-posix.h
+++ b/kernel/cobalt/trace/cobalt-posix.h
@@ -266,7 +266,7 @@ DECLARE_EVENT_CLASS(cobalt_void,
 	TP_PROTO(int dummy),
 	TP_ARGS(dummy),
 	TP_STRUCT__entry(
-		__array(char, dummy, 0)
+		__array(char, dummy, 1)
 	),
 	TP_fast_assign(
 		(void)dummy;
-- 
2.17.1




More information about the Xenomai mailing list