kernel/freebsd: fix module build on FreeBSD 14
PATCH 1/1 kernel/freebsd: fix module build on FreeBSD 14
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
--- kernel/freebsd/nic_uio/nic_uio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
kernel/freebsd/nic_uio/nic_uio.c +6 -2
@@ -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,
Signature · 1 line
2.42.0
Quoted 17 lines
-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Tuesday, December 19, 2023 7:30 PM
To: [email protected]
Cc: Richardson, Bruce <[email protected]>
Subject: [PATCH] kernel/freebsd: fix module build on FreeBSD 14When building
nic_uiomodule on FreeBSD 14, a build error is given in theDRIVER_MODULEmacro:
.../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.
Quoted 3 lines
Bugzilla Id: 1335
Signed-off-by Bruce Richardson <[email protected]>
Thomas Monjalon
AppliedQuoted 11 lines
Quoted 11 lines
When building
nic_uiomodule on FreeBSD 14, a build error is given in theDRIVER_MODULEmacro:
.../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
Id -> ID
Quoted 3 lines
Quoted 2 lines
Signed-off-by Bruce Richardson <[email protected]>Tested-by Daxue Gao <[email protected]>
+Cc: [email protected]
Applied, thanks.