[PATCH libevdev] Add unlikely() macro

Hans de Goede hdegoede at redhat.com
Tue Mar 4 23:40:05 PST 2014


Hi

On 03/05/2014 04:21 AM, Peter Hutterer wrote:
> Taken from systemd.
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Looks good.

Reviewed-by: Hans de Goede <hdegoede at redhat.com>

> ---
> This slots in before this 5-patch series.
> 
>  libevdev/libevdev-util.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libevdev/libevdev-util.h b/libevdev/libevdev-util.h
> index 227363c..ddcf5e3 100644
> --- a/libevdev/libevdev-util.h
> +++ b/libevdev/libevdev-util.h
> @@ -28,6 +28,8 @@
>  #include <string.h>
>  #include "libevdev-int.h"
>  
> +#define unlikely(x) (__builtin_expect(!!(x),0))
> +
>  static inline bool
>  startswith(const char *str, size_t len, const char *prefix, size_t plen)
>  {
> 


More information about the Input-tools mailing list