Bluetooth: Remove unneeded zero init
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Fri, 31 Aug 2012 13:39:28 +0000 (16:39 +0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Sat, 8 Sep 2012 19:53:48 +0000 (16:53 -0300)
hdev is allocated with kzalloc so zero initialization is not needed.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_core.c

index 1bbc1091748ce3c6cfb6c0944551a8935bd53ae5..fa807a3fd23b8acefc16c5d706e8a8a1d76347e3 100644 (file)
@@ -428,15 +428,6 @@ static inline bool hci_conn_ssp_enabled(struct hci_conn *conn)
               test_bit(HCI_CONN_SSP_ENABLED, &conn->flags);
 }
 
-static inline void hci_conn_hash_init(struct hci_dev *hdev)
-{
-       struct hci_conn_hash *h = &hdev->conn_hash;
-       INIT_LIST_HEAD(&h->list);
-       h->acl_num = 0;
-       h->sco_num = 0;
-       h->le_num = 0;
-}
-
 static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
 {
        struct hci_conn_hash *h = &hdev->conn_hash;
index fa974a19d365e78031cc53977871a1e2b8df2016..86abe721f4846d703f9bf267dc33c4b81c790444 100644 (file)
@@ -1652,6 +1652,7 @@ struct hci_dev *hci_alloc_dev(void)
        INIT_LIST_HEAD(&hdev->link_keys);
        INIT_LIST_HEAD(&hdev->long_term_keys);
        INIT_LIST_HEAD(&hdev->remote_oob_data);
+       INIT_LIST_HEAD(&hdev->conn_hash.list);
 
        INIT_WORK(&hdev->rx_work, hci_rx_work);
        INIT_WORK(&hdev->cmd_work, hci_cmd_work);
@@ -1674,7 +1675,6 @@ struct hci_dev *hci_alloc_dev(void)
 
        hci_init_sysfs(hdev);
        discovery_init(hdev);
-       hci_conn_hash_init(hdev);
 
        return hdev;
 }