From: Andy Green Date: Sat, 12 May 2018 02:00:27 +0000 (+0800) Subject: ethdev: explicit cast of buffered Tx number X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b90406b9f7340466cbda287cd7454fae68868348;p=dpdk.git ethdev: explicit cast of buffered Tx number In function 'rte_eth_tx_buffer_flush': 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, Fixes: d6c99e62c852 ("ethdev: add buffered Tx") Cc: stable@dpdk.org Signed-off-by: Andy Green Reviewed-by: Stephen Hemminger --- diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 7ccf4bae6c..49c2ebbd59 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -4240,8 +4240,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; }