From nobody Fri Sep 09 11:58:47 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MPDzW4L70z4cTL9; Fri, 9 Sep 2022 11:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MPDzW3vt8z3YDV; Fri, 9 Sep 2022 11:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662724727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d25zZNw+QkoEFIcDGS/M2/8FI1w4JT2DX7Ql8bjkuew=; b=FaPssDgvdRrKOzPL0i2FmWZ/IB3LOaMk9Si13UNtp4NhboY2t9utKeJeZRlRkm3Lf42yV5 XFK/JHYCRcchdPXeGRLr8za4Mr9/p9e+5sp308dU2nzukXqUZUpFT3wv4KCTsx+IUW0QG3 5fpRLc3MvzfyHZkCK1IQDZFk1jfWFo5gul9T7vmFVwmjXO4qcDtoFTe6PCz/Rx8isUdQPs jMNmow1EU1WjrDuJmc+cMxg4dc9nUxhxXjdgG3nbxarcEOC/1gs4P3pSe3ZtJtBuRwz5G9 G4O+Q3vEu9iRoe33Tv+XUWMMDh3VSb6AncteBMsv7BJgZO8zjRaFyXd92Ku3ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MPDzW2sfpz1Bqc; Fri, 9 Sep 2022 11:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 289Bwlhf044718; Fri, 9 Sep 2022 11:58:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 289BwlV9044717; Fri, 9 Sep 2022 11:58:47 GMT (envelope-from git) Date: Fri, 9 Sep 2022 11:58:47 GMT Message-Id: <202209091158.289BwlV9044717@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 7ea1cac24857 - main - systm.h: change pause from #define to inline function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ea1cac248574ed06c7823ffbfb9a60157240e57 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662724727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d25zZNw+QkoEFIcDGS/M2/8FI1w4JT2DX7Ql8bjkuew=; b=OhmhC8G9Y3iCgkyloPvJhMGmi/h1aU6vANjPtxNOnwqKDK1sAyL1KSzBZvwh2rxj9LdMUI f+DeUDgSlVzBFOZxWinkAVHZPsbIKPzQqWHFeZfdUCB+LJkSI/27ve4PHex86hv0WARamv gb8m+GS8CP7e9M2IN3UMOg+45o8Opcy0AnGsCGog76/dN6/LNnlBFvODSfJmeSO1kTm+ri 4YFbI6iQd9NWnJ8vOMFubX6EDqiZKov1OwWbr+9HC/liDAecbRfarJBLe6tqEqfT+9o4eo 5OsCUKAQFyIsG7MNWSlpGeXlVq8P1zmBivGTj7M+0031xNUtJs3k3KBSLrcjjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662724727; a=rsa-sha256; cv=none; b=ceQM97jRsuHotE/d7bgcGQb3+nJ0KndQtJNAglW6tXjTW8URMhpn4wPahGm/1Fi6/OoqxS JlE6dGAbNm9/yHwHRwHYJSJ7DufgLMIlmT3/W4B7Pt3KiuucUvB8g2VRe3RRZWL90Zg3/9 7lscOX74BtUzSGy2eCNS6C/jU/74kusv9e5R5Mv264ERuYxBgavOdFYs7UJwkp5CgjK25B ykP992eWPK5LN2Q4ZOWhXewbfRZhKPsxF4CyByuGw9mTTh+jhU5zDH50LzH7TlcsSsE9PT dBDH1KVuPQ3BZgi158x5vb+Cnf1INymlpH5IOKG7qxhJDaxHlHOWvv9ud5A5uQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7ea1cac248574ed06c7823ffbfb9a60157240e57 commit 7ea1cac248574ed06c7823ffbfb9a60157240e57 Author: Bjoern A. Zeeb AuthorDate: 2022-09-08 00:04:42 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-09-09 11:54:59 +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. MFC after: 2 weeks Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D36489 --- 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 52ee592e9e4a..9673d7e93ab5 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -448,8 +448,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) \