From b90406b9f7340466cbda287cd7454fae68868348 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sat, 12 May 2018 10:00:27 +0800 Subject: [PATCH] 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 --- 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 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; } -- 2.20.1