Linux bluetooth development
 help / color / mirror / Atom feed
From: "Gustavo F. Padovan" <padovan@profusion.mobi>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 2/3] Bluetooth: Merge similar code in l2cap_conn_ready()
Date: Wed,  8 Jun 2011 19:10:23 -0300	[thread overview]
Message-ID: <1307571024-22442-2-git-send-email-padovan@profusion.mobi> (raw)
In-Reply-To: <1307571024-22442-1-git-send-email-padovan@profusion.mobi>

In both conditions we do exacly the same thing, so merge them.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
 net/bluetooth/l2cap_core.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 3af8882..28d4cf7 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -905,13 +905,8 @@ static void l2cap_conn_ready(struct l2cap_conn *conn)
 
 		bh_lock_sock(sk);
 
-		if (conn->hcon->type == LE_LINK) {
-			__clear_chan_timer(chan);
-			l2cap_state_change(chan, BT_CONNECTED);
-			sk->sk_state_change(sk);
-		}
-
-		if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) {
+		if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED ||
+						conn->hcon->type == LE_LINK) {
 			__clear_chan_timer(chan);
 			l2cap_state_change(chan, BT_CONNECTED);
 			sk->sk_state_change(sk);
-- 
1.7.5.1


  reply	other threads:[~2011-06-08 22:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-08 22:10 [PATCH 1/3] Bluetooth: Rename hci_acl_disconn to hci_disconnect Gustavo F. Padovan
2011-06-08 22:10 ` Gustavo F. Padovan [this message]
2011-06-08 22:10   ` [PATCH 3/3] Bluetooth: Don't forget to check for LE_LINK Gustavo F. Padovan

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=1307571024-22442-2-git-send-email-padovan@profusion.mobi \
    --to=padovan@profusion.mobi \
    --cc=linux-bluetooth@vger.kernel.org \
    /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