SHA256
1
0
forked from pool/dpdk
dpdk/0001-enic-fix-Type-punning-and-strict-aliasing-warning.patch

40 lines
1.2 KiB
Diff
Raw Normal View History

From 3b16535193326c44209bb54b3a0f9ac3c258c8f8 Mon Sep 17 00:00:00 2001
From: Nirmoy Das <ndas@suse.de>
Date: Mon, 11 Apr 2016 15:01:06 +0200
Subject: [PATCH] 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 33a3f87e2..35769e0ba 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -436,6 +436,8 @@ 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 *)&eth_dev->data->dev_link;
+ uint64_t *link_ptr = (uint64_t *)&link;
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return;
@@ -443,9 +445,9 @@ static void enicpmd_dev_stop(struct rte_eth_dev *eth_dev)
ENICPMD_FUNC_TRACE();
enic_disable(enic);
memset(&link, 0, sizeof(link));
- rte_atomic64_cmpset((uint64_t *)&eth_dev->data->dev_link,
- *(uint64_t *)&eth_dev->data->dev_link,
- *(uint64_t *)&link);
+ rte_atomic64_cmpset(dev_link_ptr,
+ *dev_link_ptr,
+ *link_ptr);
}
/*
--
2.15.1