Skip to content

Commit 14cce09

Browse files
markjdbtonyhutter
authored andcommitted
FreeBSD: Use a statement expression to implement SET_ERROR() (#16284)
This way we can avoid making assumptions about the SDT probe implementation. No functional change intended. Signed-off-by: Mark Johnston <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Rob Norris <[email protected]> Reviewed-by: Tino Reichardt <[email protected]> Reviewed-by: Tony Hutter <[email protected]>
1 parent 9835255 commit 14cce09

File tree

1 file changed

+6
-5
lines changed
  • include/os/freebsd/spl/sys

1 file changed

+6
-5
lines changed

include/os/freebsd/spl/sys/sdt.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@
3131

3232
#include_next <sys/sdt.h>
3333
#ifdef KDTRACE_HOOKS
34-
/* CSTYLED */
34+
/* BEGIN CSTYLED */
3535
SDT_PROBE_DECLARE(sdt, , , set__error);
3636

37-
#define SET_ERROR(err) \
38-
((sdt_sdt___set__error->id ? \
39-
(*sdt_probe_func)(sdt_sdt___set__error->id, \
40-
(uintptr_t)err, 0, 0, 0, 0) : 0), err)
37+
#define SET_ERROR(err) ({ \
38+
SDT_PROBE1(sdt, , , set__error, (uintptr_t)err); \
39+
err; \
40+
})
41+
/* END CSTYLED */
4142
#else
4243
#define SET_ERROR(err) (err)
4344
#endif

0 commit comments

Comments
 (0)