Fix unused variable warning in mmu_radix.c

With clang 15, the following -Werror warning is produced:

    sys/powerpc/aim/mmu_radix.c:5409:22: error: variable 'freed' set but not used [-Werror,-Wunused-but-set-variable]
            int allfree, field, freed, idx;
                                ^

The 'freed' variable is only used when PV_STATS is defined. Ensure it is
only declared and set in that case.

MFC after:	3 days
This commit is contained in:
Dimitry Andric 2022-08-15 20:42:51 +02:00
parent fb203abd9d
commit 3446738e8d

View File

@ -5406,7 +5406,10 @@ mmu_radix_remove_pages(pmap_t pmap)
struct rwlock *lock;
int64_t bit;
uint64_t inuse, bitmask;
int allfree, field, freed, idx;
int allfree, field, idx;
#ifdef PV_STATS
int freed;
#endif
boolean_t superpage;
vm_paddr_t pa;
@ -5425,7 +5428,9 @@ mmu_radix_remove_pages(pmap_t pmap)
PMAP_LOCK(pmap);
TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) {
allfree = 1;
#ifdef PV_STATS
freed = 0;
#endif
for (field = 0; field < _NPCM; field++) {
inuse = ~pc->pc_map[field] & pc_freemask[field];
while (inuse != 0) {
@ -5542,7 +5547,9 @@ mmu_radix_remove_pages(pmap_t pmap)
}
}
pmap_unuse_pt(pmap, pv->pv_va, ptel3e, &free);
#ifdef PV_STATS
freed++;
#endif
}
}
PV_STAT(atomic_add_long(&pv_entry_frees, freed));