From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id 882041CCEC for ; Sat, 12 May 2018 04:00:31 +0200 (CEST) From: Andy Green To: dev@dpdk.org Date: Sat, 12 May 2018 10:00:27 +0800 Message-ID: <152609042788.121661.16333710243796218948.stgit@localhost.localdomain> In-Reply-To: <152609021699.121661.5295227351721865436.stgit@localhost.localdomain> References: <152609021699.121661.5295227351721865436.stgit@localhost.localdomain> User-Agent: StGit/unknown-version Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [PATCH v3 21/24] rte_ethdev.h: explicit cast for truncation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2018 02:00:31 -0000 /projects/lagopus/src/dpdk/build/include/rte_ethdev.h: In function 'rte_eth_tx_buffer_flush': /projects/lagopus/src/dpdk/build/include/rte_ethdev.h:4248:55: warning: conversion from 'int' to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion] buffer->error_callback(&buffer->pkts[sent], to_send - sent, Signed-off-by: Andy Green --- lib/librte_ethdev/rte_ethdev.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 2487e1d2d..2cb5fe3be 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -4245,8 +4245,9 @@ rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id, /* All packets sent, or to be dealt with by callback below */ if (unlikely(sent != to_send)) - buffer->error_callback(&buffer->pkts[sent], to_send - sent, - buffer->error_userdata); + buffer->error_callback(&buffer->pkts[sent], + (uint16_t)(to_send - sent), + buffer->error_userdata); return sent; }