@@ -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
@@ -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);
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(-)