spin_lock_check has different signatures

Anup Patel Anup.Patel at wdc.com
Wed May 12 15:31:55 BST 2021



> -----Original Message-----
> From: opensbi <opensbi-bounces at lists.infradead.org> On Behalf Of Daniel
> Schaefer
> Sent: 12 May 2021 16:37
> To: opensbi at lists.infradead.org
> Cc: Chang, Abner (HPS SW/FW Technologist) <abner.chang at hpe.com>
> Subject: spin_lock_check has different signatures
> 
> Hi,
> 
> spin_lock_check has different signatures in the C and in the H file.
> 
> See lib/sbi/riscv_locks.c
> 
> bool spin_lock_check(spinlock_t *lock)
> 
> and include/sbi/riscv_locks.h
> 
> int spin_lock_check(spinlock_t *lock);
> 
> Some related functions also seem to return a value that should be boolean
> but are not.
> Especially spin_lock_unlocked returns an int and is used as return value for
> spin_lock_check.
> 
> So spin_lock_check and spin_lock_unlocked should return bool.
> spin_trylock probably also.

Yes, good catch. This seems to be missed out in the patch reviews.

Please go ahead and send patch to fix this.

Regards,
Anup



More information about the opensbi mailing list