From patchwork Fri May 11 02:00:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Green X-Patchwork-Id: 39809 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 261B21C188; Fri, 11 May 2018 04:00:45 +0200 (CEST) Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id E023C1C18D for ; Fri, 11 May 2018 04:00:43 +0200 (CEST) From: Andy Green To: dev@dpdk.org Date: Fri, 11 May 2018 10:00:40 +0800 Message-ID: <152600404014.54839.8395217882113729570.stgit@localhost.localdomain> In-Reply-To: <152600382101.54839.18392182958431211001.stgit@localhost.localdomain> References: <152600382101.54839.18392182958431211001.stgit@localhost.localdomain> User-Agent: StGit/unknown-version Subject: [dpdk-dev] [PATCH v2 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" /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; }