git: a56881d3e942 - main - riscv: Use __diagused for variables only used in KASSERT().

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 13 Apr 2022 23:10:06 UTC
The branch main has been updated by jhb:

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

commit a56881d3e942b46e3bfb01199000c3cac25ccff2
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-13 23:08:23 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-13 23:08:23 +0000

    riscv: Use __diagused for variables only used in KASSERT().
---
 sys/riscv/riscv/pmap.c |  8 ++++----
 sys/riscv/riscv/sbi.c  | 10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c
index 287fab9720dd..076e26230eb9 100644
--- a/sys/riscv/riscv/pmap.c
+++ b/sys/riscv/riscv/pmap.c
@@ -511,7 +511,7 @@ pmap_early_page_idx(vm_offset_t l1pt, vm_offset_t va, u_int *l1_slot,
     u_int *l2_slot)
 {
 	pt_entry_t *l2;
-	pd_entry_t *l1;
+	pd_entry_t *l1 __diagused;
 
 	l1 = (pd_entry_t *)l1pt;
 	*l1_slot = (va >> L1_SHIFT) & Ln_ADDR_MASK;
@@ -2158,7 +2158,7 @@ pmap_pv_insert_l2(pmap_t pmap, vm_offset_t va, pd_entry_t l2e, u_int flags,
 static void
 pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va)
 {
-	pt_entry_t newl2, oldl2;
+	pt_entry_t newl2, oldl2 __diagused;
 	vm_page_t ml3;
 	vm_paddr_t ml3pa;
 
@@ -2422,7 +2422,7 @@ pmap_remove_all(vm_page_t m)
 	struct md_page *pvh;
 	pmap_t pmap;
 	pt_entry_t *l3, l3e;
-	pd_entry_t *l2, l2e;
+	pd_entry_t *l2, l2e __diagused;
 	pv_entry_t pv;
 	vm_offset_t va;
 
@@ -4730,7 +4730,7 @@ pmap_map_io_transient(vm_page_t page[], vm_offset_t vaddr[], int count,
 {
 	vm_paddr_t paddr;
 	boolean_t needs_mapping;
-	int error, i;
+	int error __diagused, i;
 
 	/*
 	 * Allocate any KVA space that we need, this is done in a separate
diff --git a/sys/riscv/riscv/sbi.c b/sys/riscv/riscv/sbi.c
index 6897fce9cad3..c4b6da5887f7 100644
--- a/sys/riscv/riscv/sbi.c
+++ b/sys/riscv/riscv/sbi.c
@@ -155,7 +155,7 @@ sbi_print_version(void)
 void
 sbi_set_timer(uint64_t val)
 {
-	struct sbi_ret ret;
+	struct sbi_ret ret __diagused;
 
 	/* Use the TIME legacy replacement extension, if available. */
 	if (has_time_extension) {
@@ -169,7 +169,7 @@ sbi_set_timer(uint64_t val)
 void
 sbi_send_ipi(const u_long *hart_mask)
 {
-	struct sbi_ret ret;
+	struct sbi_ret ret __diagused;
 
 	/* Use the IPI legacy replacement extension, if available. */
 	if (has_ipi_extension) {
@@ -184,7 +184,7 @@ sbi_send_ipi(const u_long *hart_mask)
 void
 sbi_remote_fence_i(const u_long *hart_mask)
 {
-	struct sbi_ret ret;
+	struct sbi_ret ret __diagused;
 
 	/* Use the RFENCE legacy replacement extension, if available. */
 	if (has_rfnc_extension) {
@@ -199,7 +199,7 @@ sbi_remote_fence_i(const u_long *hart_mask)
 void
 sbi_remote_sfence_vma(const u_long *hart_mask, u_long start, u_long size)
 {
-	struct sbi_ret ret;
+	struct sbi_ret ret __diagused;
 
 	/* Use the RFENCE legacy replacement extension, if available. */
 	if (has_rfnc_extension) {
@@ -216,7 +216,7 @@ void
 sbi_remote_sfence_vma_asid(const u_long *hart_mask, u_long start, u_long size,
     u_long asid)
 {
-	struct sbi_ret ret;
+	struct sbi_ret ret __diagused;
 
 	/* Use the RFENCE legacy replacement extension, if available. */
 	if (has_rfnc_extension) {