From beb4076567441bb6f936f99f442c2a8de911bb3c Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 17 May 2018 21:49:47 +0800 Subject: [PATCH] net: explicit cast of multicast bit clearing GCC 8.1 warned: rte_ether.h:213:13: warning: conversion from 'int' to 'uint8_t' {aka 'unsigned char'} may change value [-Wconversion] addr[0] &= ~ETHER_GROUP_ADDR; Fixes: 7ef007291004 ("ethdev: random MAC address") Cc: stable@dpdk.org Signed-off-by: Andy Green Acked-by: Bruce Richardson --- lib/librte_net/rte_ether.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h index 27c9195944..bee2b34f09 100644 --- a/lib/librte_net/rte_ether.h +++ b/lib/librte_net/rte_ether.h @@ -210,7 +210,7 @@ static inline void eth_random_addr(uint8_t *addr) uint8_t *p = (uint8_t *)&rand; rte_memcpy(addr, p, ETHER_ADDR_LEN); - addr[0] &= ~ETHER_GROUP_ADDR; /* clear multicast bit */ + addr[0] &= (uint8_t)~ETHER_GROUP_ADDR; /* clear multicast bit */ addr[0] |= ETHER_LOCAL_ADMIN_ADDR; /* set local assignment bit */ } -- 2.20.1