From: Pavan Nikhilesh <pbhagavat...@marvell.com>

Update rte_lcore_has_role() to return false instead of a
negative value for invalid lcore IDs, removing the need
for callers to pre-validate the ID.

Fixes: b0a1502a277c ("eal: make semantics of lcore role function more 
intuitive")
Cc: sta...@dpdk.org

Suggested-by: Morten Brørup <m...@smartsharesystems.com>
Signed-off-by: Pavan Nikhilesh <pbhagavat...@marvell.com>
---
 lib/eal/common/eal_common_lcore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eal/common/eal_common_lcore.c 
b/lib/eal/common/eal_common_lcore.c
index 294267177d..9dd6c72055 100644
--- a/lib/eal/common/eal_common_lcore.c
+++ b/lib/eal/common/eal_common_lcore.c
@@ -87,7 +87,7 @@ rte_lcore_has_role(unsigned int lcore_id, enum 
rte_lcore_role_t role)
        struct rte_config *cfg = rte_eal_get_configuration();
 
        if (lcore_id >= RTE_MAX_LCORE)
-               return -EINVAL;
+               return 0;
 
        return cfg->lcore_role[lcore_id] == role;
 }
-- 
2.43.0

Reply via email to