Bluetooth: Simplify __l2cap_global_chan_by_addr
authorSzymon Janc <szymon.janc@tieto.com>
Wed, 16 Nov 2011 08:32:22 +0000 (09:32 +0100)
committerGustavo F. Padovan <padovan@profusion.mobi>
Wed, 16 Nov 2011 20:29:44 +0000 (18:29 -0200)
Make __l2cap_global_chan_by_addr similar to other find functions.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/l2cap_core.c

index 26925a8f8ead311a9e34808d687a93e1d9f65318..7c746ec85143df17c570322603e7f9af5005f74b 100644 (file)
@@ -154,12 +154,9 @@ static struct l2cap_chan *__l2cap_global_chan_by_addr(__le16 psm, bdaddr_t *src)
 
        list_for_each_entry(c, &chan_list, global_l) {
                if (c->sport == psm && !bacmp(&bt_sk(c->sk)->src, src))
-                       goto found;
+                       return c;
        }
-
-       c = NULL;
-found:
-       return c;
+       return NULL;
 }
 
 int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm)