From: Thomas Monjalon Date: Thu, 30 Jul 2015 13:41:33 +0000 (+0200) Subject: pci: fix build on FreeBSD X-Git-Tag: spdx-start~8565 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3fc36d76ab26c8bd669bc06ee98abffa282aca15;p=dpdk.git pci: fix build on FreeBSD 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 --- diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index ff56cd32b1..6fa0d0884e 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) {