git: fe9e99ff9c9d - stable/13 - systm.h: change pause from #define to inline function

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Mon, 17 Oct 2022 20:41:24 UTC
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=fe9e99ff9c9d9028dccb1bb1537af46beabcb691

commit fe9e99ff9c9d9028dccb1bb1537af46beabcb691
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-09-08 00:04:42 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-10-17 20:37:02 +0000

    systm.h: change pause from #define to inline function
    
    There are drivers are using (*pause)(x, y) function pointers and depending
    on how "pause" is used it gets replaced by pause_sbt causing compile time
    failures.
    Given "pause" is a generic enough name change it from a #define to an
    inline function to avoid replacements where it should not.
    
    Reviewed by:    kib
    Differential Revision: https://reviews.freebsd.org/D36489
    
    (cherry picked from commit 7ea1cac248574ed06c7823ffbfb9a60157240e57)
---
 sys/sys/systm.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index b2b84d0fc722..bccf88573991 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -428,8 +428,11 @@ int	msleep_spin_sbt(const void * _Nonnull chan, struct mtx *mtx,
 	    0, C_HARDCLOCK)
 int	pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr,
 	    int flags);
-#define	pause(wmesg, timo)						\
-	pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK)
+static __inline int
+pause(const char *wmesg, int timo)
+{
+	return (pause_sbt(wmesg, tick_sbt * timo, 0, C_HARDCLOCK));
+}
 #define	pause_sig(wmesg, timo)						\
 	pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK | C_CATCH)
 #define	tsleep(chan, pri, wmesg, timo)					\