git: a9e0f316b3da - main - kern/intr: redeclare intr_setaffinity()'s third arg constant

From: Warner Losh <imp_at_FreeBSD.org>
Date: Thu, 09 May 2024 23:20:46 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=a9e0f316b3da4144c654cf77542bc5c51632e896

commit a9e0f316b3da4144c654cf77542bc5c51632e896
Author:     Elliott Mitchell <ehem+freebsd@m5p.com>
AuthorDate: 2024-05-09 23:04:35 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-05-09 23:14:35 +0000

    kern/intr: redeclare intr_setaffinity()'s third arg constant
    
    This matches reality and allows removal of a __DECONST().
    
    Fixes: 4c72d075a57 ("LinuxKPI: const argument to irq_set_affinity_hint()")
    Fixes: 9b33b154b53 ("Add support to cpuset for binding hardware interrupts")
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1126
---
 sys/compat/linuxkpi/common/include/linux/interrupt.h | 2 +-
 sys/kern/kern_intr.c                                 | 4 ++--
 sys/sys/interrupt.h                                  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/interrupt.h b/sys/compat/linuxkpi/common/include/linux/interrupt.h
index d5f9a0ae7a47..dfd9816da8be 100644
--- a/sys/compat/linuxkpi/common/include/linux/interrupt.h
+++ b/sys/compat/linuxkpi/common/include/linux/interrupt.h
@@ -133,7 +133,7 @@ irq_set_affinity_hint(int vector, const cpumask_t *mask)
 	int error;
 
 	if (mask != NULL)
-		error = intr_setaffinity(vector, CPU_WHICH_IRQ, __DECONST(cpumask_t *, mask));
+		error = intr_setaffinity(vector, CPU_WHICH_IRQ, mask);
 	else
 		error = intr_setaffinity(vector, CPU_WHICH_IRQ, cpuset_root);
 
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index 928bfabb5c61..9073e0d7af01 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -443,10 +443,10 @@ intr_lookup(int irq)
 }
 
 int
-intr_setaffinity(int irq, int mode, void *m)
+intr_setaffinity(int irq, int mode, const void *m)
 {
 	struct intr_event *ie;
-	cpuset_t *mask;
+	const cpuset_t *mask;
 	int cpu, n;
 
 	mask = m;
diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h
index f3c67e43d428..899d65e386e0 100644
--- a/sys/sys/interrupt.h
+++ b/sys/sys/interrupt.h
@@ -188,7 +188,7 @@ int	intr_event_suspend_handler(void *cookie);
 int	intr_event_resume_handler(void *cookie);
 int	intr_getaffinity(int irq, int mode, void *mask);
 void	*intr_handler_source(void *cookie);
-int	intr_setaffinity(int irq, int mode, void *mask);
+int	intr_setaffinity(int irq, int mode, const void *mask);
 void	_intr_drain(int irq);  /* LinuxKPI only. */
 int	swi_add(struct intr_event **eventp, const char *name,
 	    driver_intr_t handler, void *arg, int pri, enum intr_type flags,