git: cb20a74ca063 - main - vm: add macro to mark arguments used when NUMA is defined

From: Stephen J. Kiernan <stevek_at_FreeBSD.org>
Date: Tue, 09 Apr 2024 14:24:59 UTC
The branch main has been updated by stevek:

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

commit cb20a74ca06381e96c41cb4495d633710cc6cb79
Author:     Stephen J. Kiernan <stevek@FreeBSD.org>
AuthorDate: 2024-04-03 21:05:24 +0000
Commit:     Stephen J. Kiernan <stevek@FreeBSD.org>
CommitDate: 2024-04-09 14:23:47 +0000

    vm: add macro to mark arguments used when NUMA is defined
    
    This fixes compiler warnings when -Wunused-arguments is enabled and
    not quieted.
    
    Reviewed by:    kib, markj
    Obtained from:  Juniper Networks, Inc.
    Differential Revision:  https://reviews.freebsd.org/D44623
---
 sys/vm/vm.h      |  6 ++++++
 sys/vm/vm_page.h |  2 +-
 sys/vm/vm_phys.c | 13 +++++--------
 sys/vm/vm_phys.h |  2 +-
 4 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/sys/vm/vm.h b/sys/vm/vm.h
index 499a504e3328..5fac6b3f2e78 100644
--- a/sys/vm/vm.h
+++ b/sys/vm/vm.h
@@ -154,6 +154,12 @@ struct kva_md_info {
 #define	SWAP_RESERVE_RLIMIT_ON		(1 << 1)
 #define	SWAP_RESERVE_ALLOW_NONWIRED	(1 << 2)
 
+#ifdef NUMA
+#define	__numa_used
+#else
+#define	__numa_used	__unused
+#endif
+
 #ifdef _KERNEL
 struct ucred;
 
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h
index 37cb1374b9f6..221f58b8fb04 100644
--- a/sys/vm/vm_page.h
+++ b/sys/vm/vm_page.h
@@ -1005,7 +1005,7 @@ vm_page_none_valid(vm_page_t m)
 }
 
 static inline int
-vm_page_domain(vm_page_t m)
+vm_page_domain(vm_page_t m __numa_used)
 {
 #ifdef NUMA
 	int domn, segind;
diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c
index 8c15f107c2f9..66ad9c13dceb 100644
--- a/sys/vm/vm_phys.c
+++ b/sys/vm/vm_phys.c
@@ -226,7 +226,8 @@ vm_phys_fictitious_cmp(struct vm_phys_fictitious_seg *p1,
 }
 
 int
-vm_phys_domain_match(int prefer, vm_paddr_t low, vm_paddr_t high)
+vm_phys_domain_match(int prefer __numa_used, vm_paddr_t low __numa_used,
+    vm_paddr_t high __numa_used)
 {
 #ifdef NUMA
 	domainset_t mask;
@@ -330,7 +331,7 @@ sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS)
  * Return affinity, or -1 if there's no affinity information.
  */
 int
-vm_phys_mem_affinity(int f, int t)
+vm_phys_mem_affinity(int f __numa_used, int t __numa_used)
 {
 
 #ifdef NUMA
@@ -629,8 +630,8 @@ vm_phys_init(void)
  * Invoked by platform-dependent code prior to vm_phys_init().
  */
 void
-vm_phys_register_domains(int ndomains, struct mem_affinity *affinity,
-    int *locality)
+vm_phys_register_domains(int ndomains __numa_used,
+    struct mem_affinity *affinity __numa_used, int *locality __numa_used)
 {
 #ifdef NUMA
 	int i;
@@ -651,10 +652,6 @@ vm_phys_register_domains(int ndomains, struct mem_affinity *affinity,
 
 	for (i = 0; i < vm_ndomains; i++)
 		DOMAINSET_SET(i, &all_domains);
-#else
-	(void)ndomains;
-	(void)affinity;
-	(void)locality;
 #endif
 }
 
diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h
index f3a41785b1b5..1f502ad745c4 100644
--- a/sys/vm/vm_phys.h
+++ b/sys/vm/vm_phys.h
@@ -89,7 +89,7 @@ vm_paddr_t vm_phys_avail_size(int i);
 bool vm_phys_is_dumpable(vm_paddr_t pa);
 
 static inline int
-vm_phys_domain(vm_paddr_t pa)
+vm_phys_domain(vm_paddr_t pa __numa_used)
 {
 #ifdef NUMA
 	int i;