Bluetooth: Move l2cap_{set,clear}_timer to l2cap.h
authorGustavo F. Padovan <padovan@profusion.mobi>
Tue, 20 Dec 2011 12:57:26 +0000 (10:57 -0200)
committerGustavo F. Padovan <padovan@profusion.mobi>
Tue, 20 Dec 2011 19:06:30 +0000 (17:06 -0200)
It is the only place where it is used.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
include/net/bluetooth/l2cap.h
net/bluetooth/l2cap_core.c

index c0d168adf9be5e2533ab14ed913c06b4e0c529f4..e199c2f0e4dc694dc208ccd02d00f38cfb7be363 100644 (file)
@@ -595,6 +595,21 @@ enum {
        FLAG_EFS_ENABLE,
 };
 
+static inline void l2cap_set_timer(struct l2cap_chan *chan,
+                                       struct delayed_work *work, long timeout)
+{
+       BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout);
+
+       cancel_delayed_work_sync(work);
+
+       schedule_delayed_work(work, timeout);
+}
+
+static inline void l2cap_clear_timer(struct delayed_work *work)
+{
+       cancel_delayed_work_sync(work);
+}
+
 #define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t))
 #define __clear_chan_timer(c) l2cap_clear_timer(&c->chan_timer)
 #define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \
index ffa2f6b8408f5585ccb9ed8370616a930341ff94..5978d69f3d8a0e579b972c36711828ab2d081323 100644 (file)
@@ -228,20 +228,6 @@ static u16 l2cap_alloc_cid(struct l2cap_conn *conn)
        return 0;
 }
 
-static void l2cap_set_timer(struct l2cap_chan *chan, struct delayed_work *work, long timeout)
-{
-       BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout);
-
-       cancel_delayed_work_sync(work);
-
-       schedule_delayed_work(work, timeout);
-}
-
-static void l2cap_clear_timer(struct delayed_work *work)
-{
-       cancel_delayed_work_sync(work);
-}
-
 static char *state_to_string(int state)
 {
        switch(state) {