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 aarch64: Omit needless xcfunc_t cas...



details:   https://anonhg.NetBSD.org/src/rev/e3904e6c1741
branches:  trunk
changeset: 377546:e3904e6c1741
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jul 16 21:36:40 2023 +0000

description:
aarch64: Omit needless xcfunc_t casts by using xcfunc_t correctly.

No functional change intended, except for avoiding possible undefined
behaviour that could have made demons come flying out your nose.

diffstat:

 sys/arch/aarch64/aarch64/aarch64_machdep.c |  13 ++++++-------
 sys/arch/aarch64/aarch64/trap.c            |  13 +++++--------
 2 files changed, 11 insertions(+), 15 deletions(-)

diffs (105 lines):

diff -r 83c56d4eef41 -r e3904e6c1741 sys/arch/aarch64/aarch64/aarch64_machdep.c
--- a/sys/arch/aarch64/aarch64/aarch64_machdep.c        Sun Jul 16 19:55:43 2023 +0000
+++ b/sys/arch/aarch64/aarch64/aarch64_machdep.c        Sun Jul 16 21:36:40 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.69 2023/04/18 07:53:31 skrll Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.70 2023/07/16 21:36:40 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.69 2023/04/18 07:53:31 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.70 2023/07/16 21:36:40 riastradh Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_cpuoptions.h"
@@ -454,18 +454,17 @@ initarm_common(vaddr_t kvm_base, vsize_t
 /*
  * machine dependent system variables.
  */
-static xcfunc_t
+static void
 set_user_tagged_address(void *arg1, void *arg2)
 {
        uint64_t enable = PTRTOUINT64(arg1);
        uint64_t tcr = reg_tcr_el1_read();
+
        if (enable)
                tcr |= TCR_TBI0;
        else
                tcr &= ~TCR_TBI0;
        reg_tcr_el1_write(tcr);
-
-       return 0;
 }
 
 static int
@@ -487,8 +486,8 @@ sysctl_machdep_tagged_address(SYSCTLFN_A
                return EINVAL;
 
        if (cur != val) {
-               uint64_t where = xc_broadcast(0,
-                   (xcfunc_t)set_user_tagged_address, UINT64TOPTR(val), NULL);
+               uint64_t where = xc_broadcast(0, set_user_tagged_address,
+                   UINT64TOPTR(val), NULL);
                xc_wait(where);
        }
 
diff -r 83c56d4eef41 -r e3904e6c1741 sys/arch/aarch64/aarch64/trap.c
--- a/sys/arch/aarch64/aarch64/trap.c   Sun Jul 16 19:55:43 2023 +0000
+++ b/sys/arch/aarch64/aarch64/trap.c   Sun Jul 16 21:36:40 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.48 2023/02/25 00:40:22 riastradh Exp $ */
+/* $NetBSD: trap.c,v 1.49 2023/07/16 21:36:40 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.48 2023/02/25 00:40:22 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.49 2023/07/16 21:36:40 riastradh Exp $");
 
 #include "opt_arm_intr_impl.h"
 #include "opt_compat_netbsd32.h"
@@ -274,7 +274,7 @@ trap_el1h_sync(struct trapframe *tf)
        (CTR_EL0_DIC | CTR_EL0_IDC | CTR_EL0_DMIN_LINE | CTR_EL0_IMIN_LINE)
 uint64_t ctr_el0_usr __read_mostly;
 
-static xcfunc_t
+static void
 configure_cpu_traps0(void *arg1, void *arg2)
 {
        struct cpu_info * const ci = curcpu();
@@ -307,7 +307,7 @@ configure_cpu_traps0(void *arg1, void *a
                goto need_ctr_trap;
 #endif
 
-       return 0;
+       return;
 
  need_ctr_trap:
        evcnt_attach_dynamic(&ci->ci_uct_trap, EVCNT_TYPE_MISC, NULL,
@@ -317,8 +317,6 @@ configure_cpu_traps0(void *arg1, void *a
        sctlr = reg_sctlr_el1_read();
        sctlr &= ~SCTLR_UCT;
        reg_sctlr_el1_write(sctlr);
-
-       return 0;
 }
 
 void
@@ -374,8 +372,7 @@ configure_cpu_traps(void)
                }
        }
 
-       where = xc_broadcast(0,
-           (xcfunc_t)configure_cpu_traps0, NULL, NULL);
+       where = xc_broadcast(0, configure_cpu_traps0, NULL, NULL);
        xc_wait(where);
 }
 



Home | Main Index | Thread Index | Old Index