ethdev: explicit cast of buffered Tx number
authorAndy Green <andy@warmcat.com>
Sat, 12 May 2018 02:00:27 +0000 (10:00 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 13 May 2018 20:45:29 +0000 (22:45 +0200)
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 <andy@warmcat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
lib/librte_ethdev/rte_ethdev.h

index 7ccf4ba..49c2ebb 100644 (file)
@@ -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;
 }