From e5a7890dc00ac0b158498db92008f7c0b5970eac Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 19 Jun 2024 12:01:54 -0400 Subject: [PATCH] zfs: Use a statement expression to implement SET_ERROR() This way we can avoid making assumptions about the SDT probe implementation. No functional change intended. This was submitted upstream as https://github.com/openzfs/zfs/pull/16284 MFC after: 1 week --- sys/contrib/openzfs/include/os/freebsd/spl/sys/sdt.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/sdt.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/sdt.h index 2daa6de1af08..74e03fd5b956 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/sdt.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/sdt.h @@ -31,13 +31,14 @@ #include_next #ifdef KDTRACE_HOOKS -/* CSTYLED */ +/* BEGIN CSTYLED */ SDT_PROBE_DECLARE(sdt, , , set__error); -#define SET_ERROR(err) \ - ((sdt_sdt___set__error->id ? \ - (*sdt_probe_func)(sdt_sdt___set__error->id, \ - (uintptr_t)err, 0, 0, 0, 0) : 0), err) +#define SET_ERROR(err) ({ \ + SDT_PROBE1(sdt, , , set__error, (uintptr_t)err); \ + err; \ +}) +/* END CSTYLED */ #else #define SET_ERROR(err) (err) #endif