Thread (30 messages) 30 messages, 6 authors, 2015-02-26

Re: [PATCH net-next 2/7] net: bluetooth: compact struct bt_skb_cb by converting boolean fields to bit fields

From: Eyal Birger <hidden>
Date: 2015-02-26 13:22:33

On Thu, Feb 26, 2015 at 9:30 AM, Shmulik Ladkani
[off-list ref] wrote:
On Thu, 26 Feb 2015 04:10:07 +0200 Eyal Birger [off-list ref] wrote:
quoted
@@ -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;
      __u16 opcode;
      __u16 expect;
-     __u8 force_active;
-     bool req_start;
+     __u8 force_active:1;
+     __u8 incoming:1;
+     __u8 req_start:1;
      u8 req_event;
      hci_req_complete_t req_complete;
      struct l2cap_chan *chan;
There's a:
    bt_cb(skb)->force_active = BT_POWER_FORCE_ACTIVE_ON;
assignment in l2cap_core.c.

No bluetooth expert, no idea if BT_POWER_FORCE_ACTIVE_ON is 1 by definition.
If not, maybe prefer:
    bt_cb(skb)->force_active = !!BT_POWER_FORCE_ACTIVE_ON
I think I can keep force_active as __u8.

Will update on v2.

Thanks!
Besides that,
Reviewed-by: Shmulik Ladkani <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help