diff options
author | Christoph Muellner <cmuellner@linux.com> | 2021-04-06 03:53:53 +0200 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2021-04-09 18:39:50 +0530 |
commit | d0e406fa44a108210d29b26281777206961cd772 (patch) | |
tree | 9e67e54afd10612d2e157fa2e5143e4f8008f2ec /include | |
parent | d4a94ea471451f0a24e02e2e7ebf869bb4f7dbf4 (diff) |
include: sbi: Allow direct initialization via SPIN_LOCK_INIT()
The current implementation of SPIN_LOCK_INIT() provides the spinlock
to be initialized as reference. This does not allow a direct
initialization of the spinlock object at the creation site.
Let's pass the spinlock directly instead (like Linux does as well)
and adjust all users of the macro (in fact there is only one user).
Signed-off-by: Christoph Muellner <cmuellner@linux.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sbi/riscv_locks.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/sbi/riscv_locks.h b/include/sbi/riscv_locks.h index 55da7c0..faa9676 100644 --- a/include/sbi/riscv_locks.h +++ b/include/sbi/riscv_locks.h @@ -16,7 +16,7 @@ typedef struct { #define __RISCV_SPIN_UNLOCKED 0 -#define SPIN_LOCK_INIT(_lptr) (_lptr)->lock = __RISCV_SPIN_UNLOCKED +#define SPIN_LOCK_INIT(x) (x).lock = __RISCV_SPIN_UNLOCKED #define SPIN_LOCK_INITIALIZER \ { \ |