Skip to content

Commit

Permalink
rfkill: use DEFINE_SPINLOCK() for spinlock
Browse files Browse the repository at this point in the history
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Guobin Huang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
Guobin Huang authored and jmberg-intel committed Apr 8, 2021
1 parent 3cd52c1 commit ed7247f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/rfkill/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module_param_named(master_switch_mode, rfkill_master_switch_mode, uint, 0);
MODULE_PARM_DESC(master_switch_mode,
"SW_RFKILL_ALL ON should: 0=do nothing (only unlock); 1=restore; 2=unblock all");

static spinlock_t rfkill_op_lock;
static DEFINE_SPINLOCK(rfkill_op_lock);
static bool rfkill_op_pending;
static unsigned long rfkill_sw_pending[BITS_TO_LONGS(NUM_RFKILL_TYPES)];
static unsigned long rfkill_sw_state[BITS_TO_LONGS(NUM_RFKILL_TYPES)];
Expand Down Expand Up @@ -330,8 +330,6 @@ int __init rfkill_handler_init(void)
return -EINVAL;
}

spin_lock_init(&rfkill_op_lock);

/* Avoid delay at first schedule */
rfkill_last_scheduled =
jiffies - msecs_to_jiffies(RFKILL_OPS_DELAY) - 1;
Expand Down

0 comments on commit ed7247f

Please sign in to comment.