git: 3c94280825c7 - main - Silent some warnings for i386 kernel build

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Thu, 06 Jan 2022 06:46:24 UTC
The branch main has been updated by kib:

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

commit 3c94280825c78c0ed00e1dcc704fac8a04f933e3
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-01-06 04:45:49 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-01-06 05:53:04 +0000

    Silent some warnings for i386 kernel build
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 sys/i386/i386/minidump_machdep_base.c | 3 +--
 sys/i386/i386/pmap.c                  | 6 ++----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/sys/i386/i386/minidump_machdep_base.c b/sys/i386/i386/minidump_machdep_base.c
index a3f09228fa2d..ce26e339d2be 100644
--- a/sys/i386/i386/minidump_machdep_base.c
+++ b/sys/i386/i386/minidump_machdep_base.c
@@ -162,7 +162,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state)
 	uint64_t pa;
 	pd_entry_t *pd, pde;
 	pt_entry_t *pt, pte;
-	int j, k;
+	int k;
 	struct minidumphdr mdhdr;
 	struct msgbuf *mbp;
 
@@ -184,7 +184,6 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state)
 		 */
 		ptesize += PAGE_SIZE;
 		pd = IdlePTD;	/* always mapped! */
-		j = va >> PDRSHIFT;
 		pde = pte_load(&pd[va >> PDRSHIFT]);
 		if ((pde & (PG_PS | PG_V)) == (PG_PS | PG_V))  {
 			/* This is an entire 2M page. */
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index f7c0cb6b68ec..4644083b6408 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -619,7 +619,7 @@ static void
 __CONCAT(PMTYPE, bootstrap)(vm_paddr_t firstaddr)
 {
 	vm_offset_t va;
-	pt_entry_t *pte, *unused;
+	pt_entry_t *pte, *unused __unused;
 	struct pcpu *pc;
 	u_long res;
 	int i;
@@ -3493,7 +3493,7 @@ pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va)
 {
 	pd_entry_t newpde;
 	pt_entry_t *firstpte, oldpte, pa, *pte;
-	vm_offset_t oldpteva;
+	vm_offset_t oldpteva __diagused;
 	vm_page_t mpte;
 
 	PMAP_LOCK_ASSERT(pmap, MA_OWNED);
@@ -6252,7 +6252,6 @@ __CONCAT(PMTYPE, sysctl_kmaps)(SYSCTL_HANDLER_ARGS)
 	pd_entry_t pde;
 	pt_entry_t *pt, pte;
 	vm_offset_t sva;
-	vm_paddr_t pa;
 	int error;
 	u_int i, k;
 
@@ -6289,7 +6288,6 @@ __CONCAT(PMTYPE, sysctl_kmaps)(SYSCTL_HANDLER_ARGS)
 			i += NPTEPG;
 			continue;
 		}
-		pa = pde & PG_FRAME;
 		if ((pde & PG_PS) != 0) {
 			sysctl_kmaps_check(sb, &range, sva, pde, 0);
 			range.pdes++;