[PATCH 3/4] cobalt/kernel: fix compile error for incompatible pointer type

Jan Kiszka jan.kiszka at siemens.com
Fri Sep 18 15:05:28 CEST 2020


<no commit message>

On 18.09.20 08:32, Fino Meng wrote:
> Signed-off-by: Fino Meng <fino.meng at linux.intel.com>
> Signed-off-by: Mingliang Hu <mingliang.hu at intel.com>
> ---
>   include/cobalt/kernel/stat.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/cobalt/kernel/stat.h b/include/cobalt/kernel/stat.h
> index b857cd19f..be529ad72 100644
> --- a/include/cobalt/kernel/stat.h
> +++ b/include/cobalt/kernel/stat.h
> @@ -58,7 +58,7 @@ do { \
>   #define xnstat_exectime_set_current(sched, new_account) \
>   ({ \
>   	xnstat_exectime_t *__prev; \
> -	__prev = (xnstat_exectime_t *)atomic_long_xchg(&(sched)->current_account, (long)(new_account)); \
> +	__prev = (xnstat_exectime_t *)atomic_long_xchg((atomic_long_t *)&(sched)->current_account, (long)(new_account)); \

Which upstream change made this necessary? Was the issue hidden behind 
too relaxed compiler warnings, or was there a real type change? If the 
latter, why is that cast OK?

Jan

>   	__prev; \
>   })
>   
> 

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



More information about the Xenomai mailing list