From nobody Fri Oct 25 18:19:57 2024 X-Original-To: dev-commits-src-main@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 4XZrfj4yTXz5b1T7; Fri, 25 Oct 2024 18:19:57 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XZrfj3Jcgz4Xv1; Fri, 25 Oct 2024 18:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729880397; 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=0rAaDFXe9/OZMWyqaAVU4YYud+/mMbpf/P3hYc38Lmk=; b=sX3/036EH2s7bizH83G78KFAq0gXIQg1+X8vsyDsF/cv1i5+PYlnFglxiqtIn0d5pzvE+H 6DME0n63rcDD4VLbSrF/7tK/UF5vznXC/rLi2+zFfjQ+fGZ7Rbn/MQgijtV0SAiHXDigLN gqqYrSgg8vwxklSCT/uJkj2KKVXrwEuN4PEr/FIazF5d6G1/GmwGESD08L7AMEgKOP9iKN 2xU2D5joXJQjjYNR3/Rvme/7qt4PeVH87Mso5M4mKy/bNLG4z4/6jPjSoLEFm9cdgPcDv2 8j+K3dxdhdXnDTLHVMbQoXQn26WByJZA/mYa+Z5IMRPyiyfykgk0U/aB4rHVzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729880397; 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=0rAaDFXe9/OZMWyqaAVU4YYud+/mMbpf/P3hYc38Lmk=; b=e0cpSxPGpxqTpgbrefxY5DSPZjTO8KVzlZAvChJYxu+Jyk3M6enJg67hLsW1LELUAQI7+5 PeEQgOly4/LJo7wJagadC2NEeqadsApvxyNr3tP6ETk+zAsXYuks02qeMpRv0n4a4uTid+ w+XaWvFtavOGL380RrulzXeQe0FeypOb/AJJK7aTyFHdMRczpL3ZnVcE93PnP7sL18MMsB Y3lcp12i4VdEJ7L6WVRhcsYPrJTXox9Sf/zTujWxkcmzcngBbJL4WNGTF9yXNMhgQdOPAQ Qa65VXXrvWMw4zVbr3viJQuYla4kVuz6pSuk4W2AFnirp8DXFC/bNP5Ob0nSyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729880397; a=rsa-sha256; cv=none; b=BKqtnaHPvIZ0FdV0aqwD0YDSVO96CyHWfO5hnjh6xWEoW5TTeB3wvNR0KiWi2sQ81xsB2X yCw6ZhZPXVjOXL9AjZBpeWShnxQL8Ywq/bgPNKGP+5hkJc4tuER4FbQiZ5tD48YF/sf80p nq8mC4Uhnk9VP7hBnWFAXo07Rl59bRPOXtaxtEGCIYwRgbPZ4ys+lej5f2bUzpZTogVI5/ +WWGipKdKpnbXgi7b8H2T41HnTU+/PHHuM93gBEPpeFgnvlsQW58yrdE8jQ6NHDfPy1G7j uXC2p5q4gicmiQc6KRSZNsHk3PYjF/lgoS+xfs0+FZN2M4HlBj5OEBacmE28Yg== 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 4XZrfj2vqgzcWm; Fri, 25 Oct 2024 18:19:57 +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 49PIJvsr087239; Fri, 25 Oct 2024 18:19:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49PIJvet087236; Fri, 25 Oct 2024 18:19:57 GMT (envelope-from git) Date: Fri, 25 Oct 2024 18:19:57 GMT Message-Id: <202410251819.49PIJvet087236@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b9500cbd3896 - main - virtio_p9fs: Fix some style issues List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9500cbd38967686a801b1ed3ab1dd5b5b5571fb Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b9500cbd38967686a801b1ed3ab1dd5b5b5571fb commit b9500cbd38967686a801b1ed3ab1dd5b5b5571fb Author: Mark Johnston AuthorDate: 2024-10-25 17:50:43 +0000 Commit: Mark Johnston CommitDate: 2024-10-25 17:50:43 +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. --- 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 3600e0ea09c9..cdcd9c125dbb 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 = {