Commit 292a753d authored by Michal Kazior's avatar Michal Kazior Committed by Kalle Valo

ath10k: clean up num_peers locking

The var was supposed to be protected by data_lock
but it wasn't so in all instances. It's actually
not necessary to have a spinlock protected
num_peers so drop it.

All instances of num_peers are already within
conf_mutex sections so use that.
Signed-off-by: default avatarMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent a52c0282
...@@ -564,7 +564,7 @@ struct ath10k { ...@@ -564,7 +564,7 @@ struct ath10k {
struct list_head peers; struct list_head peers;
wait_queue_head_t peer_mapping_wq; wait_queue_head_t peer_mapping_wq;
/* number of created peers; protected by data_lock */ /* protected by conf_mutex */
int num_peers; int num_peers;
struct work_struct offchan_tx_work; struct work_struct offchan_tx_work;
......
...@@ -368,9 +368,8 @@ static int ath10k_peer_create(struct ath10k *ar, u32 vdev_id, const u8 *addr) ...@@ -368,9 +368,8 @@ static int ath10k_peer_create(struct ath10k *ar, u32 vdev_id, const u8 *addr)
addr, vdev_id, ret); addr, vdev_id, ret);
return ret; return ret;
} }
spin_lock_bh(&ar->data_lock);
ar->num_peers++; ar->num_peers++;
spin_unlock_bh(&ar->data_lock);
return 0; return 0;
} }
...@@ -461,9 +460,7 @@ static int ath10k_peer_delete(struct ath10k *ar, u32 vdev_id, const u8 *addr) ...@@ -461,9 +460,7 @@ static int ath10k_peer_delete(struct ath10k *ar, u32 vdev_id, const u8 *addr)
if (ret) if (ret)
return ret; return ret;
spin_lock_bh(&ar->data_lock);
ar->num_peers--; ar->num_peers--;
spin_unlock_bh(&ar->data_lock);
return 0; return 0;
} }
...@@ -500,8 +497,9 @@ static void ath10k_peer_cleanup_all(struct ath10k *ar) ...@@ -500,8 +497,9 @@ static void ath10k_peer_cleanup_all(struct ath10k *ar)
list_del(&peer->list); list_del(&peer->list);
kfree(peer); kfree(peer);
} }
ar->num_peers = 0;
spin_unlock_bh(&ar->data_lock); spin_unlock_bh(&ar->data_lock);
ar->num_peers = 0;
} }
/************************/ /************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment