From 8b7d703c5d892060c663697c74e30e2ee91362a8 Mon Sep 17 00:00:00 2001 From: Nirmoy Das Date: Mon, 11 Apr 2016 15:01:06 +0200 Subject: [PATCH 1/2] enic: fix "Type-punning and strict-aliasing" warning Inspired by http://pkgs.fedoraproject.org/cgit/rpms/dpdk.git/tree/dpdk-2.2-punning.patch --- drivers/net/enic/enic_ethdev.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 6bea940..d0214b6 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -372,13 +372,15 @@ static void enicpmd_dev_stop(struct rte_eth_dev *eth_dev) { struct rte_eth_link link; struct enic *enic = pmd_priv(eth_dev); + uint64_t *dev_link_ptr = (uint64_t *)ð_dev->data->dev_link; + uint64_t *link_ptr = (uint64_t *)&link; ENICPMD_FUNC_TRACE(); enic_disable(enic); memset(&link, 0, sizeof(link)); - rte_atomic64_cmpset((uint64_t *)ð_dev->data->dev_link, - *(uint64_t *)ð_dev->data->dev_link, - *(uint64_t *)&link); + rte_atomic64_cmpset(dev_link_ptr, + *dev_link_ptr, + *link_ptr); } /* -- 2.6.2