From nobody Thu Oct 21 18:41:41 2021 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 BD6E518174E3; Thu, 21 Oct 2021 18:41:43 +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 4HZxCV6bYvz3sFq; Thu, 21 Oct 2021 18:41:41 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 5D31620256; Thu, 21 Oct 2021 18:41:41 +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 19LIfffP010448; Thu, 21 Oct 2021 18:41:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LIffSI010447; Thu, 21 Oct 2021 18:41:41 GMT (envelope-from git) Date: Thu, 21 Oct 2021 18:41:41 GMT Message-Id: <202110211841.19LIffSI010447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3b5331dd8d41 - main - uipc_shm: silent warnings about write-only variables in largepage code 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b5331dd8d413807cf1d6cb26630ccf9028168e6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3b5331dd8d413807cf1d6cb26630ccf9028168e6 commit 3b5331dd8d413807cf1d6cb26630ccf9028168e6 Author: Konstantin Belousov AuthorDate: 2021-10-21 17:46:36 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-21 18:40:46 +0000 uipc_shm: silent warnings about write-only variables in largepage code In shm_largepage_phys_populate(), the result from vm_page_grab() is only needed for assertion. In shm_dotruncate_largepage(), there is a commented-out prototype code for managed largepages. The oldobjsz is saved for its sake, so mark the variable as __unused directly. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/uipc_shm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 14d808bfc166..6fb083498e18 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -267,7 +267,7 @@ static int shm_largepage_phys_populate(vm_object_t object, vm_pindex_t pidx, int fault_type, vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) { - vm_page_t m; + vm_page_t m __diagused; int psind; psind = object->un_pager.phys.data_val; @@ -751,7 +751,8 @@ shm_dotruncate_largepage(struct shmfd *shmfd, off_t length, void *rl_cookie) { vm_object_t object; vm_page_t m; - vm_pindex_t newobjsz, oldobjsz; + vm_pindex_t newobjsz; + vm_pindex_t oldobjsz __unused; int aflags, error, i, psind, try; KASSERT(length >= 0, ("shm_dotruncate: length < 0"));