summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_request.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-11-05 09:31:40 +0200
committerMarcel Holtmann <marcel@holtmann.org>2015-11-19 17:50:27 +0100
commit44d271377479c4d4fe7f2d07d188656684773fbd (patch)
tree0fad2880c4becec52d10825c5b4d951b38233d5f /net/bluetooth/hci_request.c
parent5fcc86bd2695d4ccad2d87cb424f4c01a4e544f3 (diff)
downloadop-kernel-dev-44d271377479c4d4fe7f2d07d188656684773fbd.zip
op-kernel-dev-44d271377479c4d4fe7f2d07d188656684773fbd.tar.gz
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>
Diffstat (limited to 'net/bluetooth/hci_request.c')
-rw-r--r--net/bluetooth/hci_request.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index bdb17099..5ba27c3 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -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;
OpenPOWER on IntegriCloud