From: Andy Green Date: Sat, 12 May 2018 01:59:07 +0000 (+0800) Subject: eal: explicit cast of core id when getting index X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ef3c7b50ff39a37a93ecea47481d392d8fcb2936;p=dpdk.git 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 --- 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; }