Module Name:    src
Committed By:   rin
Date:           Wed Apr 14 23:45:11 UTC 2021

Modified Files:
        src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/powerpc/ibm4xx/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.96 src/sys/arch/powerpc/ibm4xx/pmap.c:1.97
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.96	Tue Mar 30 03:15:53 2021
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Wed Apr 14 23:45:11 2021
@@ -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();
 

Reply via email to