From: Julien Grall Date: Fri, 27 Jan 2023 19:05:16 +0000 (+0000) Subject: xen/common: Constify the parameter of _spin_is_locked() X-Git-Tag: 4.18.0-rc1~1063 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=543f426eceded943f76f6a943e057b2917d0e72b;p=xen.git xen/common: Constify the parameter of _spin_is_locked() The lock is not meant to be modified by _spin_is_locked(). So constify it. This is helpful to be able to assert the locked is taken when the underlying structure is const. Signed-off-by: Julien Grall Reviewed-by: Jan Beulich Reviewed-by: Henry Wang Tested-by: Henry Wang #Arm --- diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c index 84996c3fbc..a15f0a2eb6 100644 --- a/xen/common/spinlock.c +++ b/xen/common/spinlock.c @@ -368,7 +368,7 @@ void _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) local_irq_restore(flags); } -int _spin_is_locked(spinlock_t *lock) +int _spin_is_locked(const spinlock_t *lock) { /* * Recursive locks may be locked by another CPU, yet we return diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h index 2fa6ba3654..ca40c71c88 100644 --- a/xen/include/xen/spinlock.h +++ b/xen/include/xen/spinlock.h @@ -185,7 +185,7 @@ void _spin_unlock(spinlock_t *lock); void _spin_unlock_irq(spinlock_t *lock); void _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags); -int _spin_is_locked(spinlock_t *lock); +int _spin_is_locked(const spinlock_t *lock); int _spin_trylock(spinlock_t *lock); void _spin_barrier(spinlock_t *lock);