Bluetooth: Compress the size of struct hci_ctrl

We can reduce the size of the hci_ctrl struct by converting
'bool req_start' to 'u8 req_flags' and making the two function
pointers a union (since only one is ever set at a time).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
Johan Hedberg
2015-11-05 09:31:40 +02:00
committed by Marcel Holtmann
parent 5fcc86bd26
commit 44d2713774
4 changed files with 23 additions and 14 deletions

View File

@@ -56,8 +56,12 @@ static int req_run(struct hci_request *req, hci_req_complete_t complete,
return -ENODATA;
skb = skb_peek_tail(&req->cmd_q);
bt_cb(skb)->hci.req_complete = complete;
bt_cb(skb)->hci.req_complete_skb = complete_skb;
if (complete) {
bt_cb(skb)->hci.req_complete = complete;
} else if (complete_skb) {
bt_cb(skb)->hci.req_complete_skb = complete_skb;
bt_cb(skb)->hci.req_flags |= HCI_REQ_SKB;
}
spin_lock_irqsave(&hdev->cmd_q.lock, flags);
skb_queue_splice_tail(&req->cmd_q, &hdev->cmd_q);
@@ -128,7 +132,7 @@ void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen,
}
if (skb_queue_empty(&req->cmd_q))
bt_cb(skb)->hci.req_start = true;
bt_cb(skb)->hci.req_flags |= HCI_REQ_START;
bt_cb(skb)->hci.req_event = event;