Re: git: d6eabdac2ef4 - main - dpaa2: fix build without WITNESS
- In reply to: Gleb Smirnoff : "git: d6eabdac2ef4 - main - dpaa2: fix build without WITNESS"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 21 Oct 2022 20:49:43 UTC
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 <glebius@FreeBSD.org>
> AuthorDate: 2022-10-18 05:38:40 +0000
> Commit: Gleb Smirnoff <glebius@FreeBSD.org>
> 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