Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Oct 2021 18:41:41 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 3b5331dd8d41 - main - uipc_shm: silent warnings about write-only variables in largepage code
Message-ID:  <202110211841.19LIffSI010447@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=3b5331dd8d413807cf1d6cb26630ccf9028168e6

commit 3b5331dd8d413807cf1d6cb26630ccf9028168e6
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-10-21 17:46:36 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
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"));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110211841.19LIffSI010447>