]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: bluetooth: compact struct bt_skb_cb by converting boolean fields to bit fields
authorEyal Birger <eyal.birger@gmail.com>
Sun, 1 Mar 2015 12:58:26 +0000 (14:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Mar 2015 05:19:29 +0000 (00:19 -0500)
Convert boolean fields incoming and req_start to bit fields and move
force_active in order save space in bt_skb_cb in an effort to use
a portion of skb->cb[] for storing skb->dropcount.

Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/bluetooth/bluetooth.h
net/bluetooth/hci_core.c
net/bluetooth/hci_request.c
net/bluetooth/hci_sock.c

index 09893668e6ea5f5c873c1b6e5c9ddc2c3ab95e2c..4500bf88ff55c7ca65f8752fb8d5d7fa750c371c 100644 (file)
@@ -277,11 +277,11 @@ typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status, u16 opcode);
 
 struct bt_skb_cb {
        __u8 pkt_type;
-       __u8 incoming;
+       __u8 force_active;
        __u16 opcode;
        __u16 expect;
-       __u8 force_active;
-       bool req_start;
+       __u8 incoming:1;
+       __u8 req_start:1;
        u8 req_event;
        hci_req_complete_t req_complete;
        struct l2cap_chan *chan;
index 85a0655c41232a0feb524530f735cf80c8201014..80f40e859d7de80b704039e609c341e6a237cdff 100644 (file)
@@ -3517,7 +3517,7 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen,
        /* Stand-alone HCI commands must be flagged as
         * single-command requests.
         */
-       bt_cb(skb)->req_start = true;
+       bt_cb(skb)->req_start = 1;
 
        skb_queue_tail(&hdev->cmd_q, skb);
        queue_work(hdev->workqueue, &hdev->cmd_work);
index db2f45a516e91d4e07b67932a38b52841f8e6016..f857e765e0810de2a9bfbe9f41a877c196ba399a 100644 (file)
@@ -116,7 +116,7 @@ void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen,
        }
 
        if (skb_queue_empty(&req->cmd_q))
-               bt_cb(skb)->req_start = true;
+               bt_cb(skb)->req_start = 1;
 
        bt_cb(skb)->req_event = event;
 
index f0038189a73efd89ca305499c6aff05585d76720..37198fb99ffeed0e054b99cb5c01e36416122ea5 100644 (file)
@@ -965,7 +965,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
                        /* Stand-alone HCI commands must be flagged as
                         * single-command requests.
                         */
-                       bt_cb(skb)->req_start = true;
+                       bt_cb(skb)->req_start = 1;
 
                        skb_queue_tail(&hdev->cmd_q, skb);
                        queue_work(hdev->workqueue, &hdev->cmd_work);