[dpdk-dev,v3,05/24] lib/librte_eal: explicit cast for signed change
Checks
Commit Message
/projects/lagopus/src/dpdk/build/include/rte_lcore.h:
In function 'rte_lcore_index':
/projects/lagopus/src/dpdk/build/include/rte_lcore.h:122:14:
warning: conversion to 'int' from 'unsigned int' may change
the sign of the result [-Wsign-conversion]
lcore_id = rte_lcore_id();
Signed-off-by: Andy Green <andy@warmcat.com>
---
lib/librte_eal/common/include/rte_lcore.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
12/05/2018 03:59, Andy Green:
> /projects/lagopus/src/dpdk/build/include/rte_lcore.h:
> In function 'rte_lcore_index':
> /projects/lagopus/src/dpdk/build/include/rte_lcore.h:122:14:
> warning: conversion to 'int' from 'unsigned int' may change
> the sign of the result [-Wsign-conversion]
> lcore_id = rte_lcore_id();
Fixes: 5583037a7950 ("eal: get relative core index")
Cc: stable@dpdk.org
> Signed-off-by: Andy Green <andy@warmcat.com>
Applied, thanks
@@ -119,7 +119,7 @@ rte_lcore_index(int lcore_id)
if (lcore_id >= RTE_MAX_LCORE)
return -1;
if (lcore_id < 0)
- lcore_id = rte_lcore_id();
+ lcore_id = (int)rte_lcore_id();
return lcore_config[lcore_id].core_index;
}