diff mbox series

[-next] net/bluetooth: make use of the helper macro LIST_HEAD()

Message ID 20240827095500.3913638-1-lihongbo22@huawei.com
State New
Headers show
Series [-next] net/bluetooth: make use of the helper macro LIST_HEAD() | expand

Commit Message

Hongbo Li Aug. 27, 2024, 9:55 a.m. UTC
list_head can be initialized automatically with LIST_HEAD()
instead of calling INIT_LIST_HEAD(). Here we can simplify
the code.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
---
 net/bluetooth/6lowpan.c | 8 ++------
 net/bluetooth/msft.c    | 4 +---
 2 files changed, 3 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 50cfec8ccac4..e4b2fb771da3 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -988,9 +988,7 @@  static void disconnect_all_peers(void)
 {
 	struct lowpan_btle_dev *entry;
 	struct lowpan_peer *peer, *tmp_peer, *new_peer;
-	struct list_head peers;
-
-	INIT_LIST_HEAD(&peers);
+	LIST_HEAD(peers);
 
 	/* We make a separate list of peers as the close_cb() will
 	 * modify the device peers list so it is better not to mess
@@ -1182,9 +1180,7 @@  static const struct file_operations lowpan_control_fops = {
 static void disconnect_devices(void)
 {
 	struct lowpan_btle_dev *entry, *tmp, *new_dev;
-	struct list_head devices;
-
-	INIT_LIST_HEAD(&devices);
+	LIST_HEAD(devices);
 
 	/* We make a separate list of devices because the unregister_netdev()
 	 * will call device_event() which will also want to modify the same
diff --git a/net/bluetooth/msft.c b/net/bluetooth/msft.c
index 5a8ccc491b14..917de240df25 100644
--- a/net/bluetooth/msft.c
+++ b/net/bluetooth/msft.c
@@ -305,10 +305,8 @@  static void msft_remove_addr_filters_sync(struct hci_dev *hdev, u8 handle)
 	struct msft_monitor_addr_filter_data *address_filter, *n;
 	struct msft_cp_le_cancel_monitor_advertisement cp;
 	struct msft_data *msft = hdev->msft_data;
-	struct list_head head;
 	struct sk_buff *skb;
-
-	INIT_LIST_HEAD(&head);
+	LIST_HEAD(head);
 
 	/* Cancel all corresponding address monitors */
 	mutex_lock(&msft->filter_lock);