From ef3c7b50ff39a37a93ecea47481d392d8fcb2936 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sat, 12 May 2018 09:59:07 +0800 Subject: [PATCH] eal: explicit cast of core id when getting index rte_lcore.h: In function 'rte_lcore_index': 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 Reviewed-by: Stephen Hemminger --- lib/librte_eal/common/include/rte_lcore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h index 1a2f37eaa4..6e09d9181c 100644 --- a/lib/librte_eal/common/include/rte_lcore.h +++ b/lib/librte_eal/common/include/rte_lcore.h @@ -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; } -- 2.20.1