From: Andy Green Date: Thu, 17 May 2018 13:49:47 +0000 (+0800) Subject: net: explicit cast of multicast bit clearing X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=beb4076567441bb6f936f99f442c2a8de911bb3c;hp=c779ebdca0e4765158bd1eaa6f65c9d714605fae;p=dpdk.git 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 --- 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 */ }