eal: explicit cast of builtin for bsf32
authorAndy Green <andy@warmcat.com>
Sat, 12 May 2018 01:58:57 +0000 (09:58 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 13 May 2018 20:45:05 +0000 (22:45 +0200)
commit54a93341ccaaf3665352ddad0807cf3ed40c36f9
tree287d8e8d8c8d945c25d349e096c669e8dc6c4e70
parent4c80789430d617d7ed3159d80041919fdddb6cd7
eal: explicit cast of builtin for bsf32

rte_common.h:416:9:
warning: conversion to 'uint32_t' {aka 'unsigned int'} from
'int' may change the sign of the result [-Wsign-conversion]
  return __builtin_ctz(v);
         ^~~~~~~~~~~~~~~~

The builtin is defined to return int, but we want to
return it as uint32_t.  Its only defined valid return
values are positive integers or zero, which is OK for
uint32_t.  So just add an explicit cast.

Fixes: 03f6bced5bba ("eal: use intrinsic function")
Cc: stable@dpdk.org
Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
lib/librte_eal/common/include/rte_common.h