From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH] pci: fix build on FreeBSD Date: Thu, 30 Jul 2015 15:41:33 +0200 Message-ID: <1438263693-24165-1-git-send-email-thomas.monjalon@6wind.com> Cc: dev@dpdk.org To: Stephen Hemminger Return-path: Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by dpdk.org (Postfix) with ESMTP id 22123C644 for ; Thu, 30 Jul 2015 15:42:59 +0200 (CEST) Received: by wibud3 with SMTP id ud3so69051887wib.0 for ; Thu, 30 Jul 2015 06:42:59 -0700 (PDT) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Build log: lib/librte_eal/bsdapp/eal/eal_pci.c:462:9: error: incompatible integer to pointer conversion passing 'u_int32_t' (aka 'unsigned int') to parameter of type 'void *' It is fixed by passing the pointer of pi.pi_data to memcpy. By the way, it seems strange that pi_data is initialized twice: .pi_data = *(u_int32_t *)buf memcpy(&pi.pi_data, buf, len); Signed-off-by: Thomas Monjalon --- lib/librte_eal/bsdapp/eal/eal_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index ff56cd3..6fa0d08 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -459,7 +459,7 @@ int rte_eal_pci_write_config(const struct rte_pci_device *dev, goto error; } - memcpy(pi.pi_data, buf, len); + memcpy(&pi.pi_data, buf, len); fd = open("/dev/pci", O_RDONLY); if (fd < 0) { -- 2.4.2