On Tue, 18 Oct 2022, Gleb Smirnoff wrote:

The branch main has been updated by glebius:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d6eabdac2ef444b62aba186c793fbd5d4226b157

commit d6eabdac2ef444b62aba186c793fbd5d4226b157
Author:     Gleb Smirnoff <[email protected]>
AuthorDate: 2022-10-18 05:38:40 +0000
Commit:     Gleb Smirnoff <[email protected]>
CommitDate: 2022-10-18 05:38:40 +0000

   dpaa2: fix build without WITNESS

   Using mutex(9) requires including <sys/lock.h> per manual page.  With
   WITNESS the header was cryptically included via dpaa_ni.h -> mbuf.h.

Secondary path (without WITNESS) while this still doesn't break without
the fix but with the fixed mbuf.h:

dpaa2_io.c includes sys/bus.h which includes sys/systm.h which includes
sys/pcpu.h which includes sys/_lock.h which defines LOCK_DEBUG which
then prevents the #error in any of the locking implementations to
trigger.

This is why arm64's GENERIC-NODEBUG doesn't barf.

I would argue the #errors in the locking implementations are close to
useless these days (also value assumed on LOCK_DEBUG sometimes before
the first check whether it is defined at all).

Thanks for catching the general problem; there's more fish to be fried!


---
sys/dev/dpaa2/dpaa2_io.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/sys/dev/dpaa2/dpaa2_io.c b/sys/dev/dpaa2/dpaa2_io.c
index 14b5fa31cbc9..e2b7992bfdb6 100644
--- a/sys/dev/dpaa2/dpaa2_io.c
+++ b/sys/dev/dpaa2/dpaa2_io.c
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
#include <sys/rman.h>
#include <sys/module.h>
#include <sys/malloc.h>
+#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/_cpuset.h>
#include <sys/cpuset.h>


--
Bjoern A. Zeeb                                                     r15:7

Reply via email to