git: 4c72d075a57e - main - LinuxKPI: const argument to irq_set_affinity_hint()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Sun, 05 Feb 2023 20:48:37 UTC
The branch main has been updated by bz:

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

commit 4c72d075a57e9a3215639aede16df4df29e1c1da
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-01-28 16:15:19 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-02-05 20:46:59 +0000

    LinuxKPI: const argument to irq_set_affinity_hint()
    
    irq_set_affinity_hint() takes a const mask argument and some drivers
    pass it in as such where earlier implementations were more lenient.
    Deal with it and __DECONST() the argument when passed to intr_setaffinity().
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
    Differential Revision: https://reviews.freebsd.org/D38242
---
 sys/compat/linuxkpi/common/include/linux/interrupt.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/interrupt.h b/sys/compat/linuxkpi/common/include/linux/interrupt.h
index 769d0834d98d..f7915863525d 100644
--- a/sys/compat/linuxkpi/common/include/linux/interrupt.h
+++ b/sys/compat/linuxkpi/common/include/linux/interrupt.h
@@ -128,12 +128,12 @@ devm_free_irq(struct device *xdev, unsigned int irq, void *p)
 }
 
 static inline int
-irq_set_affinity_hint(int vector, cpumask_t *mask)
+irq_set_affinity_hint(int vector, const cpumask_t *mask)
 {
 	int error;
 
 	if (mask != NULL)
-		error = intr_setaffinity(vector, CPU_WHICH_IRQ, mask);
+		error = intr_setaffinity(vector, CPU_WHICH_IRQ, __DECONST(cpumask_t *, mask));
 	else
 		error = intr_setaffinity(vector, CPU_WHICH_IRQ, cpuset_root);