From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v3 36/40] rte_ethdev.h: explicit cast for return type Date: Thu, 10 May 2018 12:18:41 -0700 Message-ID: <20180510121841.42ed97fd@xeon-e3> References: <152591991920.119328.14523975619615362920.stgit@localhost.localdomain> <152592056030.119328.10575471783991783458.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Andy Green Return-path: Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by dpdk.org (Postfix) with ESMTP id 34CB81BB3D for ; Thu, 10 May 2018 21:18:45 +0200 (CEST) Received: by mail-pg0-f65.google.com with SMTP id g20-v6so1375563pgv.1 for ; Thu, 10 May 2018 12:18:45 -0700 (PDT) In-Reply-To: <152592056030.119328.10575471783991783458.stgit@localhost.localdomain> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, 10 May 2018 10:49:20 +0800 Andy Green wrote: > /projects/lagopus/src/dpdk/build/include/rte_ethdev.h:3860: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); > > Signed-off-by: Andy Green > --- > lib/librte_ethdev/rte_ethdev.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h > index 2487e1d2d..c84dc44b8 100644 > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -3857,7 +3857,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); > } > > /** > Why not change rx_queue_count to int to allow drivers to return an error?