From nobody Fri Jul 4 13:28:53 2025 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 4bYZGZ3Zz5z614ws; Fri, 04 Jul 2025 13:28:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bYZGZ04Snz3M8q; Fri, 04 Jul 2025 13:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635734; 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=xi/hjeVrn8IEP1dywqkPIP20tDfszmXVsktJUEquUTU=; b=ua0nJzPH2QYwWJXjwq4RHPfPgashqgVP3ITUMTZJVZVTp3tNymcF4oCj4PP6a+CCpb9gHr dR/pbtzsEF56p+9imgb1y4mu6U8nRTRfPQKfN1gls9GsgQLSi/ZXafj7tvLIRXB4l2fqDp iFh8TBP2uEVePYFSVV3Z+r8ObZLVXQg4YfpkEG7rcqyS4lm3UL6JVScPMRgImu1/6J5wdq Q/Win2w6di/ojGZMcPMg5nJA3caOW7pxZ/8VbaOPc4RrHsxgInTcIJVA7WqaVBtZ3UflDa GsL0/4INIUZhKPbatz8BXo7Z+3Qqx/CbyE9V8TYeI4D1Bf0nbND6un9rgL6kFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635734; 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=xi/hjeVrn8IEP1dywqkPIP20tDfszmXVsktJUEquUTU=; b=npoWVRmf4n08cvPktHW/3jZcUuWGOWp7Z46RPvRFwfTtzF+zC2zTgTNdE6mA71SebtJ0gg bCLbxi5WlPfmscU3E9O83UZkgcN39jXe3zAkA8eP8TLksGsgZsy2zMIB9Vz1MQ3RoqtDG7 tbBxuD9qLDFRo7rgIhvVVDDu5vXdbqqafzfnDr25GjYWvV3JcK/Eqg/Nk8bhDrpubGY4Lr iZYVEdz417Tc4lImakDdB7pI5wgr2oqLx/bCfisP3QJC4LUp2nLNXG6Xi6Tam2OZvO4pmg ZGJWltRY9oY4aiHUmejw+0N10y+r+eXUudHtqmwNWfwouhNwUeCN6d3nlcontw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635734; a=rsa-sha256; cv=none; b=c57QjcMG2Ai8ySoj7Ja+PQl1emh8fS6cfVZDqqpG8JVeo2KXtpnLaijECGgQ5Xd67VPTXr Kj0bv9FH/VYI6/Q86K5WDoDomG9ip66VDtQMCo1gah5O/uDkrPP9YZD9t6VeVVf2HuIKwj ArOvG19eT6JzGmAjmCkTAHogZu1Jr07ISfniSxAo/C95OI0t/Wz1ZBg3X4NdoxOiCnxFAT KbXM9nY5lQt5VcIN7JX/NgWY7bHJowTD41d1/FtlQGBwZ58NlwV8EIe5JDGiwPRBBQ5a3A /rXYtRkuEkNE1OknDjtQIalrwlLgVQOMRnysWmx/WbznP7fYqG5ScajGLFueUA== 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 4bYZGY6jyBzsQg; Fri, 04 Jul 2025 13:28:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 564DSrAk006095; Fri, 4 Jul 2025 13:28:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSrTT006091; Fri, 4 Jul 2025 13:28:53 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:53 GMT Message-Id: <202507041328.564DSrTT006091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: f3289f252854 - stable/14 - virtio_p9fs: Fix some style issues 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f3289f2528549160afa09fca09b141cbb7f36c32 Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=f3289f2528549160afa09fca09b141cbb7f36c32 commit f3289f2528549160afa09fca09b141cbb7f36c32 Author: Mark Johnston AuthorDate: 2024-10-25 17:50:43 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:06 +0000 virtio_p9fs: Fix some style issues - Remove superfluous newlines. - Use bool literals. - Replace an unneeded SYSINIT with static initialization. No functional change intended. Sponsored by: Klara, Inc. (cherry picked from commit b9500cbd38967686a801b1ed3ab1dd5b5b5571fb) --- sys/dev/virtio/p9fs/virtio_p9fs.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c index f7bc3f00fe6a..43d5c0d9d6ba 100644 --- a/sys/dev/virtio/p9fs/virtio_p9fs.c +++ b/sys/dev/virtio/p9fs/virtio_p9fs.c @@ -74,30 +74,20 @@ struct vt9p_softc { }; /* Global channel list, Each channel will correspond to a mount point */ -static STAILQ_HEAD( ,vt9p_softc) global_chan_list; +static STAILQ_HEAD( ,vt9p_softc) global_chan_list = + STAILQ_HEAD_INITIALIZER(global_chan_list); struct mtx global_chan_list_mtx; +MTX_SYSINIT(global_chan_list_mtx, &global_chan_list_mtx, "9pglobal", MTX_DEF); static struct virtio_feature_desc virtio_9p_feature_desc[] = { { VIRTIO_9PNET_F_MOUNT_TAG, "9PMountTag" }, { 0, NULL } }; -static void -global_chan_list_init(void) -{ - - mtx_init(&global_chan_list_mtx, "9pglobal", - NULL, MTX_DEF); - STAILQ_INIT(&global_chan_list); -} -SYSINIT(global_chan_list_init, SI_SUB_KLD, SI_ORDER_FIRST, - global_chan_list_init, NULL); - /* We don't currently allow canceling of virtio requests */ static int vt9p_cancel(void *handle, struct p9_req_t *req) { - return (1); } @@ -108,7 +98,6 @@ SYSCTL_NODE(_vfs, OID_AUTO, 9p, CTLFLAG_RW, 0, "9P File System Protocol"); * ack from the host, before exiting */ static unsigned int vt9p_ackmaxidle = 120; - SYSCTL_UINT(_vfs_9p, OID_AUTO, ackmaxidle, CTLFLAG_RW, &vt9p_ackmaxidle, 0, "Maximum time request thread waits for ack from host"); @@ -369,20 +358,16 @@ vt9p_attach(device_t dev) /* We expect one virtqueue, for requests. */ error = vt9p_alloc_virtqueue(chan); - if (error != 0) { P9_DEBUG(ERROR, "%s: Allocating the virtqueue failed \n", __func__); goto out; } - error = virtio_setup_intr(dev, INTR_TYPE_MISC|INTR_MPSAFE); - if (error != 0) { P9_DEBUG(ERROR, "%s: Cannot setup virtqueue interrupt\n", __func__); goto out; } error = virtqueue_enable_intr(chan->vt9p_vq); - if (error != 0) { P9_DEBUG(ERROR, "%s: Cannot enable virtqueue interrupt\n", __func__); goto out; @@ -436,7 +421,7 @@ vt9p_create(const char *mount_tag, void **handlep) /* If we dont have one, for now bail out.*/ if (chan) { *handlep = (void *)chan; - chan->busy = TRUE; + chan->busy = true; } else { P9_DEBUG(TRANS, "%s: No Global channel with mount_tag=%s\n", __func__, mount_tag); @@ -450,7 +435,8 @@ static void vt9p_close(void *handle) { struct vt9p_softc *chan = handle; - chan->busy = FALSE; + + chan->busy = false; } static struct p9_trans_module vt9p_trans = {