eal: explicit cast of core id when getting index
authorAndy Green <andy@warmcat.com>
Sat, 12 May 2018 01:59:07 +0000 (09:59 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 13 May 2018 20:45:12 +0000 (22:45 +0200)
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 <andy@warmcat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
lib/librte_eal/common/include/rte_lcore.h

index 1a2f37e..6e09d91 100644 (file)
@@ -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;
 }