From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gavin.hu@arm.com>
Received: from foss.arm.com (foss.arm.com [217.140.101.70])
 by dpdk.org (Postfix) with ESMTP id 5ACB11B685
 for <dev@dpdk.org>; Wed, 16 May 2018 08:08:32 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C5A611435;
 Tue, 15 May 2018 23:08:31 -0700 (PDT)
Received: from net-arm-c2400_01.shanghai.arm.com
 (net-arm-c2400_01.shanghai.arm.com [10.169.40.174])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 56DCE3F53D;
 Tue, 15 May 2018 23:08:31 -0700 (PDT)
From: Gavin Hu <gavin.hu@arm.com>
To: dev@dpdk.org
Cc: gavin hu <gavin.hu@arm.com>
Date: Wed, 16 May 2018 14:08:01 +0800
Message-Id: <20180516060802.36181-2-gavin.hu@arm.com>
X-Mailer: git-send-email 2.17.0
In-Reply-To: <20180516060802.36181-1-gavin.hu@arm.com>
References: <1526372924-28411-1-git-send-email-gavin.hu@arm.com>
 <20180516060802.36181-1-gavin.hu@arm.com>
Subject: [dpdk-dev] [PATCH v3 2/3] eventdev: fix the clang compiling issue
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 16 May 2018 06:08:32 -0000

From: gavin hu <gavin.hu@arm.com>

This patch fix the clang compiling issue reported on the ARM64
builing host. ev is a pointer in size of 64bit, but the herein
it should be the size of its content.

~/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49: error:
'rte_memcpy' call operates on objects of type 'struct rte_event'
while the size is based on a different type
      'struct rte_event *' [-Werror,-Wsizeof-pointer-memaccess]
                rte_memcpy(ev, &m_data->response_info, sizeof(ev));
~/arm_repo/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49:
note: did you mean to dereference the argument to 'sizeof' (and multiply
it by the number of elements)?
      rte_memcpy(ev, &m_data->response_info, sizeof(ev));

Fixes: 7901eac340 ("eventdev: add crypto adapter implementation")

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
---
 lib/librte_eventdev/rte_event_crypto_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.c b/lib/librte_eventdev/rte_event_crypto_adapter.c
index 831f84248..ba63a87b7 100644
--- a/lib/librte_eventdev/rte_event_crypto_adapter.c
+++ b/lib/librte_eventdev/rte_event_crypto_adapter.c
@@ -527,7 +527,7 @@ eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter,
 			continue;
 		}
 
-		rte_memcpy(ev, &m_data->response_info, sizeof(ev));
+		rte_memcpy(ev, &m_data->response_info, sizeof(*ev));
 		ev->event_ptr = ops[i];
 		ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
 		if (adapter->implicit_release_disabled)
-- 
2.17.0