mac80211_hwsim: use DEFINE_SPINLOCK() for spinlock
spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Guobin Huang <huangguobin4@huawei.com> Link: https://lore.kernel.org/r/1616839160-6654-1-git-send-email-huangguobin4@huawei.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
ed7247f309
commit
30a70d18e8
|
@ -596,7 +596,7 @@ static const struct nl80211_vendor_cmd_info mac80211_hwsim_vendor_events[] = {
|
||||||
{ .vendor_id = OUI_QCA, .subcmd = 1 },
|
{ .vendor_id = OUI_QCA, .subcmd = 1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
static spinlock_t hwsim_radio_lock;
|
static DEFINE_SPINLOCK(hwsim_radio_lock);
|
||||||
static LIST_HEAD(hwsim_radios);
|
static LIST_HEAD(hwsim_radios);
|
||||||
static struct rhashtable hwsim_radios_rht;
|
static struct rhashtable hwsim_radios_rht;
|
||||||
static int hwsim_radio_idx;
|
static int hwsim_radio_idx;
|
||||||
|
@ -763,7 +763,7 @@ static const struct nla_policy hwsim_genl_policy[HWSIM_ATTR_MAX + 1] = {
|
||||||
/* MAC80211_HWSIM virtio queues */
|
/* MAC80211_HWSIM virtio queues */
|
||||||
static struct virtqueue *hwsim_vqs[HWSIM_NUM_VQS];
|
static struct virtqueue *hwsim_vqs[HWSIM_NUM_VQS];
|
||||||
static bool hwsim_virtio_enabled;
|
static bool hwsim_virtio_enabled;
|
||||||
static spinlock_t hwsim_virtio_lock;
|
static DEFINE_SPINLOCK(hwsim_virtio_lock);
|
||||||
|
|
||||||
static void hwsim_virtio_rx_work(struct work_struct *work);
|
static void hwsim_virtio_rx_work(struct work_struct *work);
|
||||||
static DECLARE_WORK(hwsim_virtio_rx, hwsim_virtio_rx_work);
|
static DECLARE_WORK(hwsim_virtio_rx, hwsim_virtio_rx_work);
|
||||||
|
@ -4410,8 +4410,6 @@ static struct virtio_driver virtio_hwsim = {
|
||||||
|
|
||||||
static int hwsim_register_virtio_driver(void)
|
static int hwsim_register_virtio_driver(void)
|
||||||
{
|
{
|
||||||
spin_lock_init(&hwsim_virtio_lock);
|
|
||||||
|
|
||||||
return register_virtio_driver(&virtio_hwsim);
|
return register_virtio_driver(&virtio_hwsim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4440,8 +4438,6 @@ static int __init init_mac80211_hwsim(void)
|
||||||
if (channels < 1)
|
if (channels < 1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
spin_lock_init(&hwsim_radio_lock);
|
|
||||||
|
|
||||||
err = rhashtable_init(&hwsim_radios_rht, &hwsim_rht_params);
|
err = rhashtable_init(&hwsim_radios_rht, &hwsim_rht_params);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
Loading…
Reference in New Issue