From: Andy Green Date: Fri, 18 May 2018 13:02:38 +0000 (+0800) Subject: ethdev: explicit cast of queue count return X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=45d1be93b9020dfe9c1f3e81822621580312dcc3;p=dpdk.git ethdev: explicit cast of queue count return GCC 8.1 produces a warning: rte_ethdev.h: In function 'rte_eth_rx_queue_count': rte_ethdev.h:3882:10: warning: conversion to 'int' from 'uint32_t' {aka 'unsigned int'} may change the sign of the result [-Wsign-conversion] return (*dev->dev_ops->rx_queue_count)(dev, queue_id); ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 33cf6be04d60 ("ethdev: add sanity checks to functions") Cc: stable@dpdk.org Signed-off-by: Andy Green --- diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index f8815e9949..d52c1bed9c 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -3874,7 +3874,7 @@ rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id) if (queue_id >= dev->data->nb_rx_queues) return -EINVAL; - return (*dev->dev_ops->rx_queue_count)(dev, queue_id); + return (int)(*dev->dev_ops->rx_queue_count)(dev, queue_id); } /**