* [dpdk-dev] [PATCH] pci: fix build on FreeBSD
@ 2015-07-30 13:41 Thomas Monjalon
2015-08-03 15:49 ` Thomas Monjalon
2015-08-03 15:51 ` Thomas Monjalon
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Monjalon @ 2015-07-30 13:41 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: 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 <thomas.monjalon@6wind.com>
---
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] pci: fix build on FreeBSD
2015-07-30 13:41 [dpdk-dev] [PATCH] pci: fix build on FreeBSD Thomas Monjalon
@ 2015-08-03 15:49 ` Thomas Monjalon
2015-08-03 15:51 ` Thomas Monjalon
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2015-08-03 15:49 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
Stephen,
> By the way, it seems strange that pi_data is initialized twice:
> .pi_data = *(u_int32_t *)buf
> memcpy(&pi.pi_data, buf, len);
Please, could you explain why there are 2 initializations of pi_data
in lib/librte_eal/bsdapp/eal/eal_pci.c?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] pci: fix build on FreeBSD
2015-07-30 13:41 [dpdk-dev] [PATCH] pci: fix build on FreeBSD Thomas Monjalon
2015-08-03 15:49 ` Thomas Monjalon
@ 2015-08-03 15:51 ` Thomas Monjalon
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2015-08-03 15:51 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
2015-07-30 15:41, Thomas Monjalon:
> 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 <thomas.monjalon@6wind.com>
Applied
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-03 15:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-30 13:41 [dpdk-dev] [PATCH] pci: fix build on FreeBSD Thomas Monjalon
2015-08-03 15:49 ` Thomas Monjalon
2015-08-03 15:51 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).