Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/aarch64/include Remove unnecessary casts



details:   https://anonhg.NetBSD.org/src/rev/57216a87bd8d
branches:  trunk
changeset: 946602:57216a87bd8d
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Dec 04 08:29:11 2020 +0000

description:
Remove unnecessary casts

diffstat:

 sys/arch/aarch64/include/cpufunc.h |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (46 lines):

diff -r 7773732fe665 -r 57216a87bd8d sys/arch/aarch64/include/cpufunc.h
--- a/sys/arch/aarch64/include/cpufunc.h        Fri Dec 04 08:24:41 2020 +0000
+++ b/sys/arch/aarch64/include/cpufunc.h        Fri Dec 04 08:29:11 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.h,v 1.18 2020/08/03 06:30:00 ryo Exp $ */
+/*     $NetBSD: cpufunc.h,v 1.19 2020/12/04 08:29:11 skrll Exp $       */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -191,7 +191,7 @@
 {
        uint64_t addrtop, tbi;
 
-       addrtop = (uint64_t)va & AARCH64_ADDRTOP_TAG;
+       addrtop = va & AARCH64_ADDRTOP_TAG;
        tbi = addrtop ? TCR_TBI1 : TCR_TBI0;
        if (reg_tcr_el1_read() & tbi) {
                if (addrtop == 0) {
@@ -206,7 +206,7 @@
                return AARCH64_ADDRSPACE_UPPER;
        }
 
-       addrtop = (uint64_t)va & AARCH64_ADDRTOP_MSB;
+       addrtop = va & AARCH64_ADDRTOP_MSB;
        if (addrtop == 0) {
                /* lower address, and TBI0 disabled */
                if ((va & AARCH64_ADDRESS_TAGPAC_MASK) != 0)
@@ -224,15 +224,15 @@
 {
        uint64_t addrtop, tbi;
 
-       addrtop = (uint64_t)va & AARCH64_ADDRTOP_TAG;
+       addrtop = va & AARCH64_ADDRTOP_TAG;
        tbi = addrtop ? TCR_TBI1 : TCR_TBI0;
        if (reg_tcr_el1_read() & tbi) {
                if (addrtop == 0) {
                        /* lower address, and TBI0 enabled */
-                       return (uint64_t)va & ~AARCH64_ADDRESS_TAG_MASK;
+                       return va & ~AARCH64_ADDRESS_TAG_MASK;
                }
                /* upper address, and TBI1 enabled */
-               return (uint64_t)va | AARCH64_ADDRESS_TAG_MASK;
+               return va | AARCH64_ADDRESS_TAG_MASK;
        }
 
        /* TBI[01] is disabled, nothing to do */



Home | Main Index | Thread Index | Old Index