Commit 6f74b6f3 authored by Andrei Emeltchenko's avatar Andrei Emeltchenko Committed by Gustavo Padovan

Bluetooth: Comments and style fixes

Add comments to timer implementation and style fixes.
Signed-off-by: default avatarAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo Padovan <gustavo@padovan.org>
parent 21693c15
...@@ -627,8 +627,11 @@ static inline void l2cap_set_timer(struct l2cap_chan *chan, ...@@ -627,8 +627,11 @@ static inline void l2cap_set_timer(struct l2cap_chan *chan,
BT_DBG("chan %p state %s timeout %ld", chan, BT_DBG("chan %p state %s timeout %ld", chan,
state_to_string(chan->state), timeout); state_to_string(chan->state), timeout);
/* If delayed work cancelled do not hold(chan)
since it is already done with previous set_timer */
if (!cancel_delayed_work(work)) if (!cancel_delayed_work(work))
l2cap_chan_hold(chan); l2cap_chan_hold(chan);
schedule_delayed_work(work, timeout); schedule_delayed_work(work, timeout);
} }
...@@ -637,6 +640,8 @@ static inline bool l2cap_clear_timer(struct l2cap_chan *chan, ...@@ -637,6 +640,8 @@ static inline bool l2cap_clear_timer(struct l2cap_chan *chan,
{ {
bool ret; bool ret;
/* put(chan) if delayed work cancelled otherwise it
is done in delayed work function */
ret = cancel_delayed_work(work); ret = cancel_delayed_work(work);
if (ret) if (ret)
l2cap_chan_put(chan); l2cap_chan_put(chan);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment