[Skiboot] [PATCH 08/33] Add "ffs" inline function

Michael Neuling mikey at neuling.org
Wed Jul 6 17:17:33 AEST 2016


On Sat, 2016-06-25 at 08:47 +1000, Benjamin Herrenschmidt wrote:
> Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>

Acked-by: Michael Neuling <mikey at neuling.org>

> ---
>  libc/include/string.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libc/include/string.h b/libc/include/string.h
> index 96b26fa..890ffc2 100644
> --- a/libc/include/string.h
> +++ b/libc/include/string.h
> @@ -35,4 +35,9 @@ void *memcpy(void *dest, const void *src, size_t n);
>  void *memmove(void *dest, const void *src, size_t n);
>  int memcmp(const void *s1, const void *s2, size_t n);
>  
> +static inline int ffs(unsigned long val)
> +{
> +	return __builtin_ffs(val);
> +}
> +
>  #endif


More information about the Skiboot mailing list