public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Make L2CAP chan_add functions static
@ 2012-03-23 14:31 Andrei Emeltchenko
  2012-03-23 14:31 ` [PATCH 2/2] Bluetooth: Comments and style fixes Andrei Emeltchenko
  2012-03-23 18:06 ` [PATCH 1/2] Bluetooth: Make L2CAP chan_add functions static Marcel Holtmann
  0 siblings, 2 replies; 4+ messages in thread
From: Andrei Emeltchenko @ 2012-03-23 14:31 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Remove sparse warnings below:

...
net/bluetooth/l2cap_core.c:302:6: warning: symbol '__l2cap_chan_add' was
not declared. Should it be static?
net/bluetooth/l2cap_core.c:351:6: warning: symbol 'l2cap_chan_add' was
not declared. Should it be static?
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 net/bluetooth/l2cap_core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 887aea0..e66c9da 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -299,7 +299,7 @@ void l2cap_chan_destroy(struct l2cap_chan *chan)
 	l2cap_chan_put(chan);
 }
 
-void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan)
+static void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan)
 {
 	BT_DBG("conn %p, psm 0x%2.2x, dcid 0x%4.4x", conn,
 			__le16_to_cpu(chan->psm), chan->dcid);
@@ -348,7 +348,7 @@ void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan)
 	list_add(&chan->list, &conn->chan_l);
 }
 
-void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan)
+static void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan)
 {
 	mutex_lock(&conn->chan_lock);
 	__l2cap_chan_add(conn, chan);
-- 
1.7.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] Bluetooth: Comments and style fixes
  2012-03-23 14:31 [PATCH 1/2] Bluetooth: Make L2CAP chan_add functions static Andrei Emeltchenko
@ 2012-03-23 14:31 ` Andrei Emeltchenko
  2012-03-23 18:07   ` Marcel Holtmann
  2012-03-23 18:06 ` [PATCH 1/2] Bluetooth: Make L2CAP chan_add functions static Marcel Holtmann
  1 sibling, 1 reply; 4+ messages in thread
From: Andrei Emeltchenko @ 2012-03-23 14:31 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Add comments to timer implementation and style fixes.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 include/net/bluetooth/l2cap.h |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 9b242c6..35334a0 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -622,21 +622,26 @@ static inline void l2cap_chan_unlock(struct l2cap_chan *chan)
 }
 
 static inline void l2cap_set_timer(struct l2cap_chan *chan,
-					struct delayed_work *work, long timeout)
+				   struct delayed_work *work, long timeout)
 {
 	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))
 		l2cap_chan_hold(chan);
+
 	schedule_delayed_work(work, timeout);
 }
 
 static inline bool l2cap_clear_timer(struct l2cap_chan *chan,
-					struct delayed_work *work)
+				     struct delayed_work *work)
 {
 	bool ret;
 
+	/* put(chan) if delayed work cancelled otherwise it
+	   is done in delayed work function */
 	ret = cancel_delayed_work(work);
 	if (ret)
 		l2cap_chan_put(chan);
-- 
1.7.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] Bluetooth: Make L2CAP chan_add functions static
  2012-03-23 14:31 [PATCH 1/2] Bluetooth: Make L2CAP chan_add functions static Andrei Emeltchenko
  2012-03-23 14:31 ` [PATCH 2/2] Bluetooth: Comments and style fixes Andrei Emeltchenko
@ 2012-03-23 18:06 ` Marcel Holtmann
  1 sibling, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2012-03-23 18:06 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

> Remove sparse warnings below:
> 
> ...
> net/bluetooth/l2cap_core.c:302:6: warning: symbol '__l2cap_chan_add' was
> not declared. Should it be static?
> net/bluetooth/l2cap_core.c:351:6: warning: symbol 'l2cap_chan_add' was
> not declared. Should it be static?
> ...
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  net/bluetooth/l2cap_core.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] Bluetooth: Comments and style fixes
  2012-03-23 14:31 ` [PATCH 2/2] Bluetooth: Comments and style fixes Andrei Emeltchenko
@ 2012-03-23 18:07   ` Marcel Holtmann
  0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2012-03-23 18:07 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

> Add comments to timer implementation and style fixes.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  include/net/bluetooth/l2cap.h |   11 ++++++++---
>  1 files changed, 8 insertions(+), 3 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-23 18:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-23 14:31 [PATCH 1/2] Bluetooth: Make L2CAP chan_add functions static Andrei Emeltchenko
2012-03-23 14:31 ` [PATCH 2/2] Bluetooth: Comments and style fixes Andrei Emeltchenko
2012-03-23 18:07   ` Marcel Holtmann
2012-03-23 18:06 ` [PATCH 1/2] Bluetooth: Make L2CAP chan_add functions static Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox