DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] kernel/freebsd: fix module build on FreeBSD 14
@ 2023-12-19 11:29 Bruce Richardson
  2023-12-22  8:07 ` Gao, DaxueX
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2023-12-19 11:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

When building nic_uio module on FreeBSD 14, a build error is given in
the DRIVER_MODULE macro:

.../nic_uio.c:84:81: error: too many arguments provided to function-like macro invocation
DRIVER_MODULE(nic_uio, pci, nic_uio_driver, nic_uio_devclass, nic_uio_modevent, 0);
                                                                                ^
On FreeBSD 14, the devclass parameter is dropped from the macro, so we
conditionally compile a different invocation for BSD versions before/
after v14.

Bugzilla Id: 1335

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 kernel/freebsd/nic_uio/nic_uio.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/freebsd/nic_uio/nic_uio.c b/kernel/freebsd/nic_uio/nic_uio.c
index 7a81694c92..0043892870 100644
--- a/kernel/freebsd/nic_uio/nic_uio.c
+++ b/kernel/freebsd/nic_uio/nic_uio.c
@@ -78,10 +78,14 @@ struct pci_bdf {
 	uint32_t function;
 };
 
-static devclass_t nic_uio_devclass;
-
 DEFINE_CLASS_0(nic_uio, nic_uio_driver, nic_uio_methods, sizeof(struct nic_uio_softc));
+
+#if __FreeBSD_version < 1400000
+static devclass_t nic_uio_devclass;
 DRIVER_MODULE(nic_uio, pci, nic_uio_driver, nic_uio_devclass, nic_uio_modevent, 0);
+#else
+DRIVER_MODULE(nic_uio, pci, nic_uio_driver, nic_uio_modevent, 0);
+#endif
 
 static int
 nic_uio_mmap(struct cdev *cdev, vm_ooffset_t offset, vm_paddr_t *paddr,
-- 
2.42.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-31  9:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-19 11:29 [PATCH] kernel/freebsd: fix module build on FreeBSD 14 Bruce Richardson
2023-12-22  8:07 ` Gao, DaxueX
2024-01-31  9:49   ` 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).