[PATCH 2/2] boilerplate: drop likely/unlikely annotations

Jan Kiszka jan.kiszka at siemens.com
Fri Dec 11 07:43:41 CET 2020


On 04.12.20 12:43, Philippe Gerum wrote:
> From: Philippe Gerum <rpm at xenomai.org>
> 
> We have no more in-tree users of these. Besides, let's assume that the
> CPU's branch predictor always has better clues than we might have when
> assessing the likeliness of a condition.
> 
> Bonus: this clears a recurring source of namespace clashes with C++
> frameworks like Boost.
> 
> Signed-off-by: Philippe Gerum <rpm at xenomai.org>
> ---
>  include/boilerplate/compiler.h | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/include/boilerplate/compiler.h b/include/boilerplate/compiler.h
> index 94b9f8cad..263af6b0c 100644
> --- a/include/boilerplate/compiler.h
> +++ b/include/boilerplate/compiler.h
> @@ -29,11 +29,6 @@
>  #define __stringify_1(x...)	#x
>  #define __stringify(x...)	__stringify_1(x)
>  
> -#ifndef likely
> -#define likely(x)	__builtin_expect(!!(x), 1)
> -#define unlikely(x)	__builtin_expect(!!(x), 0)
> -#endif
> -
>  #ifndef __noreturn
>  #define __noreturn	__attribute__((__noreturn__))
>  #endif
> 

Thanks, both applied.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux



More information about the Xenomai mailing list