kernel/smp: Avoid casting spinlocks, which are structures.
The lock entry is the first thing in the struct, so this is a no-op change, but it is safer to do in case of changes, of course. Spinlocks have been structures for quite a long time, so this was probably just missed in the conversion.
This commit is contained in:
parent
ba3ee26af0
commit
8be37ed439
@ -182,7 +182,7 @@ CPUSet::IsEmpty() const
|
||||
static inline bool
|
||||
try_acquire_spinlock_inline(spinlock* lock)
|
||||
{
|
||||
return atomic_get_and_set((int32*)lock, 1) == 0;
|
||||
return atomic_get_and_set(&lock->lock, 1) == 0;
|
||||
}
|
||||
|
||||
|
||||
@ -198,7 +198,7 @@ acquire_spinlock_inline(spinlock* lock)
|
||||
static inline void
|
||||
release_spinlock_inline(spinlock* lock)
|
||||
{
|
||||
atomic_set((int32*)lock, 0);
|
||||
atomic_set(&lock->lock, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -330,7 +330,7 @@ try_acquire_spinlock(spinlock* lock)
|
||||
if (atomic_add(&lock->lock, 1) != 0)
|
||||
return false;
|
||||
#else
|
||||
if (atomic_get_and_set((int32*)lock, 1) != 0)
|
||||
if (atomic_get_and_set(&lock->lock, 1) != 0)
|
||||
return false;
|
||||
|
||||
# if DEBUG_SPINLOCKS
|
||||
|
Loading…
Reference in New Issue
Block a user