git: 52526922ac3b - main - vm_phys_init: Quiet unused but set warnings about npages.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 18 Apr 2022 19:08:56 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=52526922ac3b4350fa8cc9767657a95787e200bb
commit 52526922ac3b4350fa8cc9767657a95787e200bb
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-18 19:06:14 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-18 19:06:14 +0000
vm_phys_init: Quiet unused but set warnings about npages.
npages is used in two optional cases:
- to conditionally create a separate DMA32 free list
- to index vm_page_array for VM_PHYSSEG_SPARSE
Add in more #ifdef's around npages statements.
Reviewed by: alc, markj
Differential Revision: https://reviews.freebsd.org/D34887
---
sys/vm/vm_phys.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c
index 4e87a90fa154..a7ff4f14691e 100644
--- a/sys/vm/vm_phys.c
+++ b/sys/vm/vm_phys.c
@@ -487,7 +487,9 @@ vm_phys_init(void)
{
struct vm_freelist *fl;
struct vm_phys_seg *end_seg, *prev_seg, *seg, *tmp_seg;
+#if defined(VM_DMA32_NPAGES_THRESHOLD) || defined(VM_PHYSSEG_SPARSE)
u_long npages;
+#endif
int dom, flind, freelist, oind, pind, segind;
/*
@@ -497,7 +499,9 @@ vm_phys_init(void)
* Initially, the entries of vm_freelist_to_flind[] are set to either
* 0 or 1 to indicate which free lists should be created.
*/
+#ifdef VM_DMA32_NPAGES_THRESHOLD
npages = 0;
+#endif
for (segind = vm_phys_nsegs - 1; segind >= 0; segind--) {
seg = &vm_phys_segs[segind];
#ifdef VM_FREELIST_LOWMEM
@@ -520,7 +524,9 @@ vm_phys_init(void)
else
#endif
{
+#ifdef VM_DMA32_NPAGES_THRESHOLD
npages += atop(seg->end - seg->start);
+#endif
vm_freelist_to_flind[VM_FREELIST_DEFAULT] = 1;
}
}