Skip to content

Commit

Permalink
FreeBSD: Use a statement expression to implement SET_ERROR()
Browse files Browse the repository at this point in the history
This way we can avoid making assumptions about the SDT probe
implementation.  No functional change intended.

Signed-off-by: Mark Johnston <markj@FreeBSD.org>
  • Loading branch information
markjdb committed Jun 19, 2024
1 parent c98295e commit d8dccdb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/os/freebsd/spl/sys/sdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@
/* 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) ({ \

Check failure on line 37 in include/os/freebsd/spl/sys/sdt.h

View workflow job for this annotation

GitHub Actions / checkstyle

missing space before left brace
SDT_PROBE1(sdt, , , set__error, (uintptr_t)err); \

Check failure on line 38 in include/os/freebsd/spl/sys/sdt.h

View workflow job for this annotation

GitHub Actions / checkstyle

comma or semicolon preceded by blank
err; \
})

#else
#define SET_ERROR(err) (err)
#endif
Expand Down

0 comments on commit d8dccdb

Please sign in to comment.