eventdev: fix build with clang on ARM
authorGavin Hu <gavin.hu@arm.com>
Thu, 17 May 2018 02:46:09 +0000 (10:46 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 20 May 2018 22:55:50 +0000 (00:55 +0200)
This patch fix the clang compiling issue reported on the ARM64
builing hosts. ev is a pointer in size of 64bit, but herein
it should be the size of its content.

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));
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>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
lib/librte_eventdev/rte_event_crypto_adapter.c

index 831f842..ba63a87 100644 (file)
@@ -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)