Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc/ibm4xx Style fixes:
details: https://anonhg.NetBSD.org/src/rev/46781b75d8de
branches: trunk
changeset: 378497:46781b75d8de
user: rin <rin%NetBSD.org@localhost>
date: Wed Apr 14 23:45:11 2021 +0000
description:
Style fixes:
- Add "static inline" to pte_enter(), to match with its declaration.
- Remove parentheses from return.
- Use NULL instead of 0 for pointer initialization.
No binary changes.
diffstat:
sys/arch/powerpc/ibm4xx/pmap.c | 38 +++++++++++++++++++-------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diffs (154 lines):
diff -r 4a0fdc731daf -r 46781b75d8de sys/arch/powerpc/ibm4xx/pmap.c
--- a/sys/arch/powerpc/ibm4xx/pmap.c Wed Apr 14 22:08:28 2021 +0000
+++ b/sys/arch/powerpc/ibm4xx/pmap.c Wed Apr 14 23:45:11 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.96 2021/03/30 03:15:53 rin Exp $ */
+/* $NetBSD: pmap.c,v 1.97 2021/04/14 23:45:11 rin Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.96 2021/03/30 03:15:53 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.97 2021/04/14 23:45:11 rin Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -226,7 +226,7 @@ pa_to_attr(paddr_t pa)
/*
* Insert PTE into page table.
*/
-int
+static inline int
pte_enter(struct pmap *pm, vaddr_t va, u_int pte)
{
int seg = STIDX(va);
@@ -236,7 +236,7 @@ pte_enter(struct pmap *pm, vaddr_t va, u
if (!pm->pm_ptbl[seg]) {
/* Don't allocate a page to clear a non-existent mapping. */
if (!pte)
- return (0);
+ return 0;
/* Allocate a page XXXX this will sleep! */
pm->pm_ptbl[seg] =
(uint *)uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
@@ -253,7 +253,7 @@ pte_enter(struct pmap *pm, vaddr_t va, u
else
pm->pm_stats.resident_count++;
}
- return (1);
+ return 1;
}
/*
@@ -266,9 +266,9 @@ pte_find(struct pmap *pm, vaddr_t va)
int ptn = PTIDX(va);
if (pm->pm_ptbl[seg])
- return (&pm->pm_ptbl[seg][ptn]);
+ return &pm->pm_ptbl[seg][ptn];
- return (NULL);
+ return NULL;
}
/*
@@ -293,7 +293,7 @@ pmap_bootstrap(u_int kernelstart, u_int
* Initialize kernel page table.
*/
for (i = 0; i < STSZ; i++) {
- pmap_kernel()->pm_ptbl[i] = 0;
+ pmap_kernel()->pm_ptbl[i] = NULL;
}
ctxbusy[0] = ctxbusy[1] = pmap_kernel();
@@ -565,7 +565,7 @@ pmap_growkernel(vaddr_t maxkvaddr)
pm->pm_ptbl[seg] = (u_int *)pg;
}
splx(s);
- return (kbreak);
+ return kbreak;
}
/*
@@ -758,7 +758,7 @@ pmap_enter_pv(struct pmap *pm, vaddr_t v
pm->pm_stats.wired_count++;
}
splx(s);
- return (1);
+ return 1;
}
static void
@@ -1026,7 +1026,7 @@ pmap_extract(struct pmap *pm, vaddr_t va
*pap = TTE_PA(pa) | (va & PGOFSET);
}
splx(s);
- return (pa != 0);
+ return pa != 0;
}
/*
@@ -1338,7 +1338,7 @@ ppc4xx_tlb_find_victim(void)
tlb_info[tlbnext].ti_flags = flags;
} else {
/* Found it! */
- return (tlbnext);
+ return tlbnext;
}
} else {
tlb_info[tlbnext].ti_flags = (flags & ~TLBF_REF);
@@ -1428,9 +1428,9 @@ ppc4xx_tlb_size_mask(size_t size, int *m
if (size <= tlbsize[i]) {
*mask = (i << TLB_SIZE_SHFT);
*rsiz = tlbsize[i];
- return (0);
+ return 0;
}
- return (EINVAL);
+ return EINVAL;
}
/*
@@ -1470,10 +1470,10 @@ ppc4xx_tlb_mapiodev(paddr_t base, psize_
continue;
va = (hi & TLB_EPN_MASK) + (base & (sz - 1)); /* sz = 2^n */
- return (void *)(va);
+ return (void *)va;
}
- return (NULL);
+ return NULL;
}
/*
@@ -1579,7 +1579,7 @@ ctx_flush(int cnum)
Debugger();
#endif
#endif
- return (1);
+ return 1;
}
#ifdef DIAGNOSTIC
if (i < tlb_nreserved)
@@ -1592,7 +1592,7 @@ ctx_flush(int cnum)
tlb_invalidate_entry(i);
}
}
- return (0);
+ return 0;
}
/*
@@ -1610,7 +1610,7 @@ ctx_alloc(struct pmap *pm)
#ifdef DIAGNOSTIC
printf("ctx_alloc: kernel pmap!\n");
#endif
- return (0);
+ return 0;
}
s = splvm();
Home |
Main Index |
Thread Index |
Old Index