Skip to content

Commit c2ec9c1

Browse files
author
Gustavo F. Padovan
committed
Bluetooth: Move l2cap_{set,clear}_timer to l2cap.h
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>
1 parent 613a1c0 commit c2ec9c1

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

‎include/net/bluetooth/l2cap.h‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,21 @@ enum {
595595
FLAG_EFS_ENABLE,
596596
};
597597

598+
static inline void l2cap_set_timer(struct l2cap_chan *chan,
599+
struct delayed_work *work, long timeout)
600+
{
601+
BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout);
602+
603+
cancel_delayed_work_sync(work);
604+
605+
schedule_delayed_work(work, timeout);
606+
}
607+
608+
static inline void l2cap_clear_timer(struct delayed_work *work)
609+
{
610+
cancel_delayed_work_sync(work);
611+
}
612+
598613
#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t))
599614
#define __clear_chan_timer(c) l2cap_clear_timer(&c->chan_timer)
600615
#define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \

‎net/bluetooth/l2cap_core.c‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -228,20 +228,6 @@ static u16 l2cap_alloc_cid(struct l2cap_conn *conn)
228228
return 0;
229229
}
230230

231-
static void l2cap_set_timer(struct l2cap_chan *chan, struct delayed_work *work, long timeout)
232-
{
233-
BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout);
234-
235-
cancel_delayed_work_sync(work);
236-
237-
schedule_delayed_work(work, timeout);
238-
}
239-
240-
static void l2cap_clear_timer(struct delayed_work *work)
241-
{
242-
cancel_delayed_work_sync(work);
243-
}
244-
245231
static char *state_to_string(int state)
246232
{
247233
switch(state) {

0 commit comments

Comments
 (0)