Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/arm32 More KNF
details: https://anonhg.NetBSD.org/src/rev/750523e8fbc8
branches: trunk
changeset: 968965:750523e8fbc8
user: skrll <skrll%NetBSD.org@localhost>
date: Sun Feb 02 08:56:29 2020 +0000
description:
More KNF
diffstat:
sys/arch/arm/arm32/pmap.c | 90 +++++++++++++++++++++++-----------------------
1 files changed, 45 insertions(+), 45 deletions(-)
diffs (truncated from 328 to 300 lines):
diff -r 7b18f416f988 -r 750523e8fbc8 sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Sun Feb 02 08:19:15 2020 +0000
+++ b/sys/arch/arm/arm32/pmap.c Sun Feb 02 08:56:29 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.386 2020/02/02 08:19:15 skrll Exp $ */
+/* $NetBSD: pmap.c,v 1.387 2020/02/02 08:56:29 skrll Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
@@ -198,7 +198,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.386 2020/02/02 08:19:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.387 2020/02/02 08:56:29 skrll Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -1109,7 +1109,7 @@
break;
}
- return (pv);
+ return pv;
}
/*
@@ -1226,7 +1226,7 @@
KASSERT(!PV_IS_KENTRY_P(set_mask));
if ((npv = pmap_find_pv(md, pm, va)) == NULL)
- return (0);
+ return 0;
NPDEBUG(PDB_PVDUMP,
printf("pmap_modify_pv: pm %p, md %p, clr 0x%x, set 0x%x, flags 0x%x\n", pm, md, clr_mask, set_mask, npv->pv_flags));
@@ -1300,7 +1300,7 @@
PMAPCOUNT(remappings);
- return (oflags);
+ return oflags;
}
@@ -1505,9 +1505,9 @@
if ((l2 = pm->pm_l2[L2_IDX(l1slot)]) == NULL ||
(l2b = &l2->l2_bucket[L2_BUCKET(l1slot)])->l2b_kva == NULL)
- return (NULL);
-
- return (l2b);
+ return NULL;
+
+ return l2b;
}
/*
@@ -1535,7 +1535,7 @@
* Need to allocate a new l2_dtable.
*/
if ((l2 = pmap_alloc_l2_dtable()) == NULL)
- return (NULL);
+ return NULL;
/*
* Link it into the parent pmap
@@ -1565,7 +1565,7 @@
pm->pm_l2[L2_IDX(l1slot)] = NULL;
pmap_free_l2_dtable(l2);
}
- return (NULL);
+ return NULL;
}
l2->l2_occupancy++;
@@ -1586,7 +1586,7 @@
#endif
}
- return (l2b);
+ return l2b;
}
/*
@@ -1740,7 +1740,7 @@
memset(v, 0, L2_TABLE_SIZE_REAL);
PTE_SYNC_RANGE(v, L2_TABLE_SIZE_REAL / sizeof(pt_entry_t));
- return (0);
+ return 0;
}
static int
@@ -1748,7 +1748,7 @@
{
memset(v, 0, sizeof(struct l2_dtable));
- return (0);
+ return 0;
}
static int
@@ -1756,7 +1756,7 @@
{
memset(v, 0, sizeof(struct pmap));
- return (0);
+ return 0;
}
static void
@@ -1835,7 +1835,7 @@
if (md->urw_mappings)
uidx |= 2;
- return (pmap_vac_flags[uidx][kidx]);
+ return pmap_vac_flags[uidx][kidx];
}
static inline void
@@ -3049,7 +3049,7 @@
pmap_pinit(pm);
- return (pm);
+ return pm;
}
u_int
@@ -3279,7 +3279,7 @@
pmap_free_l2_bucket(pm, l2b, 0);
UVMHIST_LOG(maphist, " <-- done (ENOMEM)",
0, 0, 0, 0);
- return (ENOMEM);
+ return ENOMEM;
}
}
@@ -3434,7 +3434,7 @@
free_pv:
if (new_pv)
pool_put(&pmap_pv_pool, new_pv);
- return (error);
+ return error;
}
/*
@@ -4784,7 +4784,7 @@
out:
pmap_release_pmap_lock(pm);
- return (rv);
+ return rv;
}
/*
@@ -5816,13 +5816,13 @@
pa = pv.pv_pa;
#else
if (uvm_page_physget(&pa) == false)
- return (1);
+ return 1;
#endif /* PMAP_STEAL_MEMORY */
} else {
struct vm_page *pg;
pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_USERESERVE);
if (pg == NULL)
- return (1);
+ return 1;
pa = VM_PAGE_TO_PHYS(pg);
/*
* This new page must not have any mappings. Enter it via
@@ -5848,7 +5848,7 @@
KDASSERT((opte & L2_S_CACHE_MASK) == pte_l2_s_cache_mode_pt);
#endif
memset((void *)va, 0, PAGE_SIZE);
- return (0);
+ return 0;
}
/*
@@ -5877,7 +5877,7 @@
* Need to allocate a backing page
*/
if (pmap_grow_map(nva, NULL))
- return (NULL);
+ return NULL;
}
l2 = (struct l2_dtable *)nva;
@@ -5889,7 +5889,7 @@
* Map in another page to cover it.
*/
if (pmap_grow_map(nva & ~PGOFSET, NULL))
- return (NULL);
+ return NULL;
}
pmap_kernel_l2dtable_kva = nva;
@@ -5919,7 +5919,7 @@
* Need to allocate a backing page
*/
if (pmap_grow_map(nva, &pmap_kernel_l2ptp_phys))
- return (NULL);
+ return NULL;
PTE_SYNC_RANGE(ptep, PAGE_SIZE / sizeof(pt_entry_t));
}
@@ -5932,7 +5932,7 @@
pmap_kernel_l2ptp_phys += L2_TABLE_SIZE_REAL;
}
- return (l2b);
+ return l2b;
}
vaddr_t
@@ -6006,7 +6006,7 @@
splx(s);
out:
- return (pmap_curmaxkvaddr);
+ return pmap_curmaxkvaddr;
}
/************************ Utility routines ****************************/
@@ -6466,7 +6466,7 @@
va += PAGE_SIZE;
}
- return (rv);
+ return rv;
#endif
}
@@ -6540,12 +6540,12 @@
void *rv;
if (pmap_initialized)
- return (pool_page_alloc(pp, flags));
+ return pool_page_alloc(pp, flags);
if (free_bootstrap_pages) {
rv = free_bootstrap_pages;
free_bootstrap_pages = *((void **)rv);
- return (rv);
+ return rv;
}
KASSERT(kernel_map != NULL);
@@ -6554,7 +6554,7 @@
KASSERT(new_page > last_bootstrap_page);
last_bootstrap_page = new_page;
- return ((void *)new_page);
+ return (void *)new_page;
}
static void
@@ -6738,9 +6738,9 @@
SLIST_FOREACH(pv, &kernel_pt_list, pv_list) {
if (pv->pv_pa == (pa & ~PGOFSET))
- return (pv->pv_va | (pa & PGOFSET));
- }
- return (0);
+ return pv->pv_va | (pa & PGOFSET);
+ }
+ return 0;
}
/*
@@ -6986,7 +6986,7 @@
resid -= PAGE_SIZE;
}
VPRINTF("\n");
- return (size);
+ return size;
}
/*
@@ -7060,7 +7060,7 @@
int i;
if (pmap_devmap_table == NULL)
- return (NULL);
+ return NULL;
endpa = (uint64_t)pa + (uint64_t)(size - 1);
@@ -7068,10 +7068,10 @@
if (pa >= pmap_devmap_table[i].pd_pa &&
endpa <= (uint64_t)pmap_devmap_table[i].pd_pa +
(uint64_t)(pmap_devmap_table[i].pd_size - 1))
- return (&pmap_devmap_table[i]);
- }
-
- return (NULL);
+ return &pmap_devmap_table[i];
Home |
Main Index |
Thread Index |
Old Index