linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] Bluetooth: Move bt_accept_enqueue() call to l2cap_sock.c
@ 2012-05-28 21:16 Gustavo Padovan
  2012-05-28 21:16 ` [PATCH 2/5] Bluetooth: Remove parent socket usage from l2cap_core.c Gustavo Padovan
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Gustavo Padovan @ 2012-05-28 21:16 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Gustavo Padovan

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

bt_accept_enqueue() can be easily placed at the end of
l2cap_sock_new_connection_cb().
There is no problem in moving to bt_accept_enqueue() to an earlier point
in the code, bt_accept_enqueue() only adds the sk to the it parents queue
basically.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 net/bluetooth/l2cap_core.c |    4 ----
 net/bluetooth/l2cap_sock.c |    2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 6f30d1d..09f4bee 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1167,8 +1167,6 @@ static void l2cap_le_conn_ready(struct l2cap_conn *conn)
 	bacpy(&bt_sk(sk)->src, conn->src);
 	bacpy(&bt_sk(sk)->dst, conn->dst);
 
-	bt_accept_enqueue(parent, sk);
-
 	l2cap_chan_add(conn, chan);
 
 	l2cap_chan_ready(chan);
@@ -3360,8 +3358,6 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
 	chan->psm  = psm;
 	chan->dcid = scid;
 
-	bt_accept_enqueue(parent, sk);
-
 	__l2cap_chan_add(conn, chan);
 
 	dcid = chan->scid;
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index d856cc8..942986e 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -910,6 +910,8 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan)
 
 	l2cap_sock_init(sk, parent);
 
+	bt_accept_enqueue(parent, sk);
+
 	return l2cap_pi(sk)->chan;
 }
 
-- 
1.7.10.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-05-30  7:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-28 21:16 [PATCH 1/5] Bluetooth: Move bt_accept_enqueue() call to l2cap_sock.c Gustavo Padovan
2012-05-28 21:16 ` [PATCH 2/5] Bluetooth: Remove parent socket usage from l2cap_core.c Gustavo Padovan
2012-05-28 21:16 ` [PATCH 3/5] Bluetooth: Do not check if teardown exists Gustavo Padovan
2012-05-29  7:11   ` [PATCH] Bluetooth: Do not check func ready existence Andrei Emeltchenko
2012-05-29 15:23     ` Gustavo Padovan
2012-05-30  6:55       ` Andrei Emeltchenko
2012-05-30  7:17         ` Gustavo Padovan
2012-05-28 21:16 ` [PATCH 4/5] Bluetooth: Create DEFER_SETUP flag in conf_state Gustavo Padovan
2012-05-28 21:16 ` [PATCH 5/5] Bluetooth: Add chan->ops->defer() Gustavo Padovan

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).