Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/aarch64/aarch64 Sprinkle some const



details:   https://anonhg.NetBSD.org/src/rev/1b040139ffc5
branches:  trunk
changeset: 990608:1b040139ffc5
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Oct 31 07:56:55 2021 +0000

description:
Sprinkle some const

diffstat:

 sys/arch/aarch64/aarch64/cpufunc.c |  24 ++++++++++--------------
 1 files changed, 10 insertions(+), 14 deletions(-)

diffs (74 lines):

diff -r 2e46c31b9f9b -r 1b040139ffc5 sys/arch/aarch64/aarch64/cpufunc.c
--- a/sys/arch/aarch64/aarch64/cpufunc.c        Sun Oct 31 05:31:12 2021 +0000
+++ b/sys/arch/aarch64/aarch64/cpufunc.c        Sun Oct 31 07:56:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.c,v 1.30 2021/10/23 06:48:31 skrll Exp $       */
+/*     $NetBSD: cpufunc.c,v 1.31 2021/10/31 07:56:55 skrll Exp $       */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -30,7 +30,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.30 2021/10/23 06:48:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.31 2021/10/31 07:56:55 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -313,11 +313,10 @@
 void
 aarch64_printcacheinfo(device_t dev)
 {
-       struct aarch64_cache_info *cinfo;
+       struct cpu_info * const ci = curcpu();
+       struct aarch64_cache_info * const cinfo = ci->ci_cacheinfo;
        int level;
 
-       cinfo = curcpu()->ci_cacheinfo;
-
        for (level = 0; level < MAX_CACHE_LEVEL; level++)
                if (prt_cache(dev, cinfo, level) < 0)
                        break;
@@ -382,11 +381,10 @@
 void
 aarch64_dcache_wbinv_all(void)
 {
-       struct aarch64_cache_info *cinfo;
+       struct cpu_info * const ci = curcpu();
+       struct aarch64_cache_info * const cinfo = ci->ci_cacheinfo;
        int level;
 
-       cinfo = curcpu()->ci_cacheinfo;
-
        for (level = 0; level < MAX_CACHE_LEVEL; level++) {
                if (cinfo[level].cacheable == CACHE_CACHEABLE_NONE)
                        break;
@@ -400,11 +398,10 @@
 void
 aarch64_dcache_inv_all(void)
 {
-       struct aarch64_cache_info *cinfo;
+       struct cpu_info * const ci = curcpu();
+       struct aarch64_cache_info * const cinfo = ci->ci_cacheinfo;
        int level;
 
-       cinfo = curcpu()->ci_cacheinfo;
-
        for (level = 0; level < MAX_CACHE_LEVEL; level++) {
                if (cinfo[level].cacheable == CACHE_CACHEABLE_NONE)
                        break;
@@ -418,11 +415,10 @@
 void
 aarch64_dcache_wb_all(void)
 {
-       struct aarch64_cache_info *cinfo;
+       struct cpu_info * const ci = curcpu();
+       struct aarch64_cache_info * const cinfo = ci->ci_cacheinfo;
        int level;
 
-       cinfo = curcpu()->ci_cacheinfo;
-
        for (level = 0; level < MAX_CACHE_LEVEL; level++) {
                if (cinfo[level].cacheable == CACHE_CACHEABLE_NONE)
                        break;



Home | Main Index | Thread Index | Old Index