aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-04-09 00:25:13 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-04-09 00:25:13 +0000
commit2e7838ae84c668fcfe9a4385c65d06fbfa1214a0 (patch)
tree9257b76eee97fb720193c9eef54c1d745764d45b
parenta7e1a58554fd84d382975808f2b655426afc90b0 (diff)
vm_phys_early_alloc: mem_index is only used under #ifdef NUMA.
Possibly mem_index should just reuse biggestone since this loop is already reusing biggestsize.
-rw-r--r--sys/vm/vm_phys.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c
index 33c46fe7c481..4e87a90fa154 100644
--- a/sys/vm/vm_phys.c
+++ b/sys/vm/vm_phys.c
@@ -1660,7 +1660,10 @@ vm_phys_early_add_seg(vm_paddr_t start, vm_paddr_t end)
vm_paddr_t
vm_phys_early_alloc(int domain, size_t alloc_size)
{
- int i, mem_index, biggestone;
+#ifdef NUMA
+ int mem_index;
+#endif
+ int i, biggestone;
vm_paddr_t pa, mem_start, mem_end, size, biggestsize, align;
KASSERT(domain == -1 || (domain >= 0 && domain < vm_ndomains),
@@ -1672,10 +1675,10 @@ vm_phys_early_alloc(int domain, size_t alloc_size)
* the phys_avail selection below.
*/
biggestsize = 0;
- mem_index = 0;
mem_start = 0;
mem_end = -1;
#ifdef NUMA
+ mem_index = 0;
if (mem_affinity != NULL) {
for (i = 0;; i++) {
size = mem_affinity[i].end - mem_affinity[i].start;