On Thu, Mar 27, 2025 at 3:53 PM Bruce Richardson
<bruce.richard...@intel.com> wrote:
>
> When building on FreeBSD, errors are reported in the base code by the
> lock checker (-Wthread-safety). For example:
>
> ../drivers/net/intel/ixgbe/base/ixgbe_osdep.c:42:1: error: mutex 
> 'lock->mutex' is still held at the end of function 
> [-Werror,-Wthread-safety-analysis]
>    42 | }
>       | ^
>
> These errors are due to the checker not recognising the lock wrapper
> functions. We can avoid these errors by converting these functions into
> macros.
>
> Fixes: 30b19d1b5c43 ("net/ixgbe/base: add definitions for E610")
> Cc: sta...@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richard...@intel.com>

This is the best solution, given that FreeBSD pthread is instrumented
with clang thread safety annotations.

As a sidenote, I don't see much value with the remaining
malloc/calloc/free wrappers in this osdep.c file.
I suspect this makes some other annotations non working.


-- 
David Marchand

Reply via email to