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/0dd792c5f9d7
branches:  trunk
changeset: 961294:0dd792c5f9d7
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 9699338e790a -r 0dd792c5f9d7 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 @@
 /*
  * 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 @@
        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 @@
                else
                        pm->pm_stats.resident_count++;
        }
-       return (1);
+       return 1;
 }
 
 /*
@@ -266,9 +266,9 @@
        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 @@
         * 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 @@
                pm->pm_ptbl[seg] = (u_int *)pg;
        }
        splx(s);
-       return (kbreak);
+       return kbreak;
 }
 
 /*
@@ -758,7 +758,7 @@
                pm->pm_stats.wired_count++;
        }
        splx(s);
-       return (1);
+       return 1;
 }
 
 static void
@@ -1026,7 +1026,7 @@
                *pap = TTE_PA(pa) | (va & PGOFSET);
        }
        splx(s);
-       return (pa != 0);
+       return pa != 0;
 }
 
 /*
@@ -1338,7 +1338,7 @@
                                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 @@
                if (size <= tlbsize[i]) {
                        *mask = (i << TLB_SIZE_SHFT);
                        *rsiz = tlbsize[i];
-                       return (0);
+                       return 0;
                }
-       return (EINVAL);
+       return EINVAL;
 }
 
 /*
@@ -1470,10 +1470,10 @@
                        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 @@
                                Debugger();
 #endif
 #endif
-                               return (1);
+                               return 1;
                        }
 #ifdef DIAGNOSTIC
                        if (i < tlb_nreserved)
@@ -1592,7 +1592,7 @@
                        tlb_invalidate_entry(i);
                }
        }
-       return (0);
+       return 0;
 }
 
 /*
@@ -1610,7 +1610,7 @@
 #ifdef DIAGNOSTIC
                printf("ctx_alloc: kernel pmap!\n");
 #endif
-               return (0);
+               return 0;
        }
        s = splvm();
 



Home | Main Index | Thread Index | Old Index