File 0001-enic-fix-Type-punning-and-strict-aliasing-warning.patch of Package dpdk
40
1
From 3b16535193326c44209bb54b3a0f9ac3c258c8f8 Mon Sep 17 00:00:00 2001
2
From: Nirmoy Das <ndas@suse.de>
3
Date: Mon, 11 Apr 2016 15:01:06 +0200
4
Subject: [PATCH] enic: fix "Type-punning and strict-aliasing" warning
5
6
Inspired by http://pkgs.fedoraproject.org/cgit/rpms/dpdk.git/tree/dpdk-2.2-punning.patch
7
---
8
drivers/net/enic/enic_ethdev.c | 8 +++++---
9
1 file changed, 5 insertions(+), 3 deletions(-)
10
11
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
12
index 33a3f87e2..35769e0ba 100644
13
--- a/drivers/net/enic/enic_ethdev.c
14
+++ b/drivers/net/enic/enic_ethdev.c
15
16
{
17
struct rte_eth_link link;
18
struct enic *enic = pmd_priv(eth_dev);
19
+ uint64_t *dev_link_ptr = (uint64_t *)ð_dev->data->dev_link;
20
+ uint64_t *link_ptr = (uint64_t *)&link;
21
22
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
23
return;
24
25
ENICPMD_FUNC_TRACE();
26
enic_disable(enic);
27
memset(&link, 0, sizeof(link));
28
- rte_atomic64_cmpset((uint64_t *)ð_dev->data->dev_link,
29
- *(uint64_t *)ð_dev->data->dev_link,
30
- *(uint64_t *)&link);
31
+ rte_atomic64_cmpset(dev_link_ptr,
32
+ *dev_link_ptr,
33
+ *link_ptr);
34
}
35
36
/*
37
--
38
2.15.1
39
40