Thread (29 messages) flat view 29 messages, 6 authors, 2016-01-13

Re: [PATCH v3 06/12] eal: pci: vfio: add rd/wr func for pci bar space

From: Bruce Richardson <hidden>
Date: 2016-01-13 14:47:37

On Thu, Jan 07, 2016 at 10:19:25AM -0800, Stephen Hemminger wrote:
On Thu,  7 Jan 2016 22:03:03 +0530
Santosh Shukla [off-list ref] wrote:
quoted
 
+int rte_eal_pci_read_bar(const struct rte_pci_device *device __rte_unused,
+			 void *buf __rte_unused,
+			 size_t len __rte_unused,
+			 off_t offset __rte_unused,
+			 int bar_idx __rte_unused)
+{
+#ifdef VFIO_PRESENT
+	const struct rte_intr_handle *intr_handle = &device->intr_handle;
+	return pci_vfio_read_bar(intr_handle, buf, len, offset, bar_idx);
+#else
+	return 0; /* UIO's not applicable */
+#endif
+}
It seems wrong to declare all the parameters as unused but then use them.
Maybe there is a way to have a macro for USED(x) in the #else case
There is RTE_SET_USED() in rte_common.h.
I'd prefer that macro used than the option of duplicating the entire function
which really pads out the code.

/Bruce
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help