netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eyal Birger <eyal.birger@gmail.com>
To: davem@davemloft.net
Cc: willemb@google.com, edumazet@google.com,
	shmulik.ladkani@gmail.com, linux-bluetooth@vger.kernel.org,
	marcel@holtmann.org, netdev@vger.kernel.org,
	Eyal Birger <eyal.birger@gmail.com>
Subject: [PATCH net-next v2 2/7] net: bluetooth: compact struct bt_skb_cb by converting boolean fields to bit fields
Date: Thu, 26 Feb 2015 21:06:59 +0200	[thread overview]
Message-ID: <1424977624-649-3-git-send-email-eyal.birger@gmail.com> (raw)
In-Reply-To: <1424977624-649-1-git-send-email-eyal.birger@gmail.com>

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>
---
 include/net/bluetooth/bluetooth.h | 6 +++---
 net/bluetooth/hci_core.c          | 2 +-
 net/bluetooth/hci_request.c       | 2 +-
 net/bluetooth/hci_sock.c          | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 0989366..4500bf8 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -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;
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 85a0655..80f40e8 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -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);
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index db2f45a..f857e76 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -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;
 
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index f003818..37198fb 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -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);
-- 
2.1.4

  parent reply	other threads:[~2015-02-26 19:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26 19:06 [PATCH net-next v2 0/7] net: move skb->dropcount to skb->cb[] Eyal Birger
2015-02-26 19:06 ` [PATCH net-next v2 1/7] net: bluetooth: compact struct bt_skb_cb by inlining struct hci_req_ctrl Eyal Birger
2015-02-26 19:06 ` Eyal Birger [this message]
2015-02-26 19:07 ` [PATCH net-next v2 3/7] net: rxrpc: change call to sock_recv_ts_and_drops() on rxrpc recvmsg to sock_recv_timestamp() Eyal Birger
2015-02-26 19:07 ` [PATCH net-next v2 5/7] net: use common macro for assering skb->cb[] available size in protocol families Eyal Birger
     [not found] ` <1424977624-649-1-git-send-email-eyal.birger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-02-26 19:07   ` [PATCH net-next v2 4/7] net: packet: use skb->dev as storage for skb orig len instead of skb->cb[] Eyal Birger
2015-02-28 19:21     ` David Miller
     [not found]       ` <20150228.142135.470339626705046722.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2015-02-28 19:39         ` Eyal Birger
2015-02-28 20:08           ` David Miller
     [not found]             ` <20150228.150830.1726900309943339124.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2015-02-28 20:38               ` Eyal Birger
2015-02-28 21:00                 ` David Miller
2015-03-01  5:09                   ` Eyal Birger
     [not found]                     ` <CAHsH6Gv8Dh3RQ0V7KURcca9bzZGY0FwiqGj-mP9oKA_Vv72nUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-01  5:31                       ` David Miller
     [not found]                         ` <20150301.003143.1281961486875434872.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2015-03-01  5:35                           ` Eyal Birger
2015-02-26 19:07   ` [PATCH net-next v2 6/7] net: add common accessor for setting dropcount on packets Eyal Birger
2015-02-26 19:07 ` [PATCH net-next v2 7/7] net: move skb->dropcount to skb->cb[] Eyal Birger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424977624-649-3-git-send-email-eyal.birger@gmail.com \
    --to=eyal.birger@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    --cc=shmulik.ladkani@gmail.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).