From nobody Thu Feb 24 17:58:01 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 6651F19C8D97; Thu, 24 Feb 2022 17:58:01 +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 4K4LGx2Q0cz3ngc; Thu, 24 Feb 2022 17:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645725481; 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=n23Y3IJ9VGa0pjd7pqNcCsQRKdFL6T85965tdqQF+K4=; b=buImDzIHjt6CmCgA9HFxfFAwmx5iyZuQb+oa2vPTTPpXOEnvQCvGXPxxdI7yG0xSOTUJD5 Pe4fKwDNmLakU1bskIPXOJJch2cUbTCCSI2vftaRLWgaeDi5Vq07R0jro+Wkk1BPW93ptH M4oNJ+XhZS42Bu5bGII52vmi990wX94rK1DGrpWoeuT4OBnce8OnuOzt5w/bQczI2vkS9k BIi3A/e4wq6RF3gtn2Z7hBULW+DW+LsUmPiFHP9+M6U7btz7UhN8Mnas8FD1avA4UXNl9g fML+Pb7Mn41F2TtmUS9PrF1SQbi2Iw2tnTHBKCF9Tps4dixPDbtan5vgMdZjTQ== 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 27AD0108F1; Thu, 24 Feb 2022 17:58:01 +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 21OHw1ej034096; Thu, 24 Feb 2022 17:58:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21OHw15H034095; Thu, 24 Feb 2022 17:58:01 GMT (envelope-from git) Date: Thu, 24 Feb 2022 17:58:01 GMT Message-Id: <202202241758.21OHw15H034095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2bfdc1ee9b1f - main - cons: Use bool for boolean variables 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2bfdc1ee9b1ff244753fa4b163e15f1de774944c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645725481; 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=n23Y3IJ9VGa0pjd7pqNcCsQRKdFL6T85965tdqQF+K4=; b=WkDfKA56OqejjW/bTU7TFNq0sffXnkFAk2D2zjmRXgid4FSXaW3GkPau5KT+EalsSd27fx +76ZZJ/CgdsH8S3u7TTBzc7/5PnqAJ2dadqZm3Jp8Ypkzxg9g7QMt83kGyGWVv/tfNQENM 8kxJEYVkca7jPC/hd0NA8kDeyht3NlEylQ4W8m8baC6qzf4lp3C1VJNVkEqc3dnqO4Xqvr 5aCmnEqJliyUji2As/tnRb9+q8flDrkqOgoIMu/FzuhvwvUbYHdWuduJwwmLqpHVfAs7ag OJVL6ipD2TGZ9BDGEkmgoK49nC2l7voe708qpvYcDkh/p9fPaKBC/XyvM2vnmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645725481; a=rsa-sha256; cv=none; b=JvWX2DNYbhZrKJGOMTPI61DgJXPjke6xOFPEouhWyLeI0Fg8x097QsuylHzbYrMpyjhB4X 451lQfrDWf3m3DwzwCy5FE1qOXnycPJHn8xEluxTZiK4HTgAJiCXgibmpA/Ux9P2bNlEJ0 whEe+oZOqWfBt0UNA0NFxxdFhDIFx5ZGdiB/RmPRsk7ET5AHWVlZZ6o00/jS6eQ4dD5MvZ JXnYn3Zl9qpGLY+Uv8M7Z56nvduw2FrJCdQsaGUn5ViYI0sTTXf7OuK5Uly9Erf4TQArHJ H0ISiHp7E3xJ1IcJgxWbYZGV07EyfU4H2fUY/iN+PY6le3Y1sTlgI4kaC26OtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2bfdc1ee9b1ff244753fa4b163e15f1de774944c commit 2bfdc1ee9b1ff244753fa4b163e15f1de774944c Author: Warner Losh AuthorDate: 2022-02-24 17:57:03 +0000 Commit: Warner Losh CommitDate: 2022-02-24 17:58:07 +0000 cons: Use bool for boolean variables MFC After: 3 days Sponsored by: Netflix --- sys/kern/kern_cons.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c index d33811f1e3c8..06adbcc69348 100644 --- a/sys/kern/kern_cons.c +++ b/sys/kern/kern_cons.c @@ -101,7 +101,7 @@ SYSCTL_INT(_kern, OID_AUTO, consmute, CTLFLAG_RW, &cn_mute, 0, static char *consbuf; /* buffer used by `consmsgbuf' */ static struct callout conscallout; /* callout for outputting to constty */ struct msgbuf consmsgbuf; /* message buffer for console tty */ -static u_char console_pausing; /* pause after each line during probe */ +static bool console_pausing; /* pause after each line during probe */ static const char console_pausestr[] = ""; struct tty *constty; /* pointer to console "window" tty */ @@ -183,7 +183,7 @@ cninit(void) cnadd(best_cn); } if (boothowto & RB_PAUSE) - console_pausing = 1; + console_pausing = true; /* * Make the best console the preferred console. */ @@ -200,7 +200,7 @@ cninit(void) void cninit_finish() { - console_pausing = 0; + console_pausing = false; } /* add a new physical console to back the virtual console */ @@ -321,7 +321,8 @@ sysctl_kern_console(SYSCTL_HANDLER_ARGS) struct cn_device *cnd; struct consdev *cp, **list; char *p; - int delete, error; + bool delete; + int error; struct sbuf *sb; sb = sbuf_new(NULL, NULL, CNDEVPATHMAX * 2, SBUF_AUTOEXTEND | @@ -342,9 +343,9 @@ sysctl_kern_console(SYSCTL_HANDLER_ARGS) if (error == 0 && req->newptr != NULL) { p = sbuf_data(sb); error = ENXIO; - delete = 0; + delete = false; if (*p == '-') { - delete = 1; + delete = true; p++; } SET_FOREACH(list, cons_set) { @@ -525,7 +526,7 @@ cnputc(int c) cnputc(*cp); cngrab(); if (cngetc() == '.') - console_pausing = 0; + console_pausing = false; cnungrab(); cnputc('\r'); for (cp = console_pausestr; *cp != '\0'; cp++) @@ -538,7 +539,7 @@ void cnputsn(const char *p, size_t n) { size_t i; - int unlock_reqd = 0; + bool unlock_reqd = false; if (mtx_initialized(&cnputs_mtx)) { /* @@ -549,7 +550,7 @@ cnputsn(const char *p, size_t n) if (mtx_owned(&cnputs_mtx)) return; mtx_lock_spin(&cnputs_mtx); - unlock_reqd = 1; + unlock_reqd = true; } for (i = 0; i < n; i++)