Bluetooth: Remove unneeded recv_event variable
authorJohan Hedberg <johan.hedberg@intel.com>
Thu, 2 Apr 2015 10:41:10 +0000 (13:41 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 2 Apr 2015 14:09:27 +0000 (16:09 +0200)
Now that the synchronous HCI requests use the new API and a new private
variable the recv_evt member of hci_dev is no-longer needed. This patch
removes it.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_core.c
net/bluetooth/hci_event.c

index 257ac04c00e16eccf1881c9acb9588a90404c15c..4cefee0b63301bbe76333fbf7019cd1135ba1bc8 100644 (file)
@@ -326,7 +326,6 @@ struct hci_dev {
        struct sk_buff_head     raw_q;
        struct sk_buff_head     cmd_q;
 
-       struct sk_buff          *recv_evt;
        struct sk_buff          *sent_cmd;
        struct sk_buff          *reassembly[NUM_REASSEMBLY];
 
index 5cbb0957edc7ebd2ae36d04df1f3a09479935931..6192f6e3242ff5745df94f43f9d2973ce6298a47 100644 (file)
@@ -1690,9 +1690,6 @@ static int hci_dev_do_close(struct hci_dev *hdev)
                hdev->sent_cmd = NULL;
        }
 
-       kfree_skb(hdev->recv_evt);
-       hdev->recv_evt = NULL;
-
        /* After this point our queues are empty
         * and no tasks are scheduled. */
        hdev->close(hdev);
index 7c69eb3629b78d394c6356080eb8a7e907b45751..dc9547c11c4503f0a7f7e14864b64b8443aefc9e 100644 (file)
@@ -5052,18 +5052,6 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
        u8 status = 0, event = hdr->evt;
        u16 opcode = HCI_OP_NOP;
 
-       hci_dev_lock(hdev);
-
-       /* Received events are (currently) only needed when a request is
-        * ongoing so avoid unnecessary memory allocation.
-        */
-       if (hci_req_pending(hdev)) {
-               kfree_skb(hdev->recv_evt);
-               hdev->recv_evt = skb_clone(skb, GFP_KERNEL);
-       }
-
-       hci_dev_unlock(hdev);
-
        if (hdev->sent_cmd && bt_cb(hdev->sent_cmd)->req.event == event) {
                struct hci_command_hdr *cmd_hdr = (void *) hdev->sent_cmd->data;
                opcode = __le16_to_cpu(cmd_hdr->opcode);