Skip to content

Commit 6368c23

Browse files
ebirgerdavem330
authored andcommitted
net: bluetooth: compact struct bt_skb_cb by converting boolean fields to bit fields
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 49a6fe0 commit 6368c23

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

include/net/bluetooth/bluetooth.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,11 @@ typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status, u16 opcode);
277277

278278
struct bt_skb_cb {
279279
__u8 pkt_type;
280-
__u8 incoming;
280+
__u8 force_active;
281281
__u16 opcode;
282282
__u16 expect;
283-
__u8 force_active;
284-
bool req_start;
283+
__u8 incoming:1;
284+
__u8 req_start:1;
285285
u8 req_event;
286286
hci_req_complete_t req_complete;
287287
struct l2cap_chan *chan;

net/bluetooth/hci_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3517,7 +3517,7 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen,
35173517
/* Stand-alone HCI commands must be flagged as
35183518
* single-command requests.
35193519
*/
3520-
bt_cb(skb)->req_start = true;
3520+
bt_cb(skb)->req_start = 1;
35213521

35223522
skb_queue_tail(&hdev->cmd_q, skb);
35233523
queue_work(hdev->workqueue, &hdev->cmd_work);

net/bluetooth/hci_request.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen,
116116
}
117117

118118
if (skb_queue_empty(&req->cmd_q))
119-
bt_cb(skb)->req_start = true;
119+
bt_cb(skb)->req_start = 1;
120120

121121
bt_cb(skb)->req_event = event;
122122

net/bluetooth/hci_sock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
965965
/* Stand-alone HCI commands must be flagged as
966966
* single-command requests.
967967
*/
968-
bt_cb(skb)->req_start = true;
968+
bt_cb(skb)->req_start = 1;
969969

970970
skb_queue_tail(&hdev->cmd_q, skb);
971971
queue_work(hdev->workqueue, &hdev->cmd_work);

0 commit comments

Comments
 (0)