Module Name:    src
Committed By:   riastradh
Date:           Sun Jul 16 21:36:40 UTC 2023

Modified Files:
        src/sys/arch/aarch64/aarch64: aarch64_machdep.c trap.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/aarch64/aarch64/trap.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/aarch64/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.69 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.70
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.69	Tue Apr 18 07:53:31 2023
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Sun Jul 16 21:36:40 2023
@@ -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);
 	}
 

Index: src/sys/arch/aarch64/aarch64/trap.c
diff -u src/sys/arch/aarch64/aarch64/trap.c:1.48 src/sys/arch/aarch64/aarch64/trap.c:1.49
--- src/sys/arch/aarch64/aarch64/trap.c:1.48	Sat Feb 25 00:40:22 2023
+++ src/sys/arch/aarch64/aarch64/trap.c	Sun Jul 16 21:36:40 2023
@@ -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);
 }
 

Reply via email to