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

Jan Kiszka jan.kiszka at siemens.com
Tue Mar 5 19:00:33 CET 2019


On 05.03.19 15:45, roman.stratiienko--- via Xenomai wrote:
> 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)

Let's just do "__field(int, dummy)" at this chance.

I'll have to adjust some tracing patch as well that is currently in next.

>   	),
>   	TP_fast_assign(
>   		(void)dummy;
> 

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux



More information about the Xenomai mailing list