All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 1/2] Bluetooth: Use chan instead of sk
@ 2012-01-13 15:21 Emeltchenko Andrei
  2012-01-13 15:21 ` [RFC 2/2] Bluetooth: Change sk to l2cap_chan Emeltchenko Andrei
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Emeltchenko Andrei @ 2012-01-13 15:21 UTC (permalink / raw)
  To: linux-bluetooth

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

Remove unneeded conversion from sk to chan.

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

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index a75ee3b..52c7412 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -73,7 +73,7 @@ static int l2cap_build_conf_req(struct l2cap_chan *chan, void *data);
 static void l2cap_send_disconn_req(struct l2cap_conn *conn,
 				struct l2cap_chan *chan, int err);
 
-static int l2cap_ertm_data_rcv(struct sock *sk, struct sk_buff *skb);
+static int l2cap_ertm_data_rcv(struct l2cap_chan *chan, struct sk_buff *skb);
 
 /* ---- L2CAP channels ---- */
 
@@ -4138,9 +4138,8 @@ static inline int l2cap_data_channel_sframe(struct l2cap_chan *chan, u32 rx_cont
 	return 0;
 }
 
-static int l2cap_ertm_data_rcv(struct sock *sk, struct sk_buff *skb)
+int l2cap_ertm_data_rcv(struct l2cap_chan *chan, struct sk_buff *skb)
 {
-	struct l2cap_chan *chan = l2cap_pi(sk)->chan;
 	u32 control;
 	u16 req_seq;
 	int len, next_tx_seq_offset, req_seq_offset;
@@ -4241,7 +4240,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
 		break;
 
 	case L2CAP_MODE_ERTM:
-		l2cap_ertm_data_rcv(sk, skb);
+		l2cap_ertm_data_rcv(chan, skb);
 
 		goto done;
 
-- 
1.7.4.1


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

* [RFC 2/2] Bluetooth: Change sk to l2cap_chan
  2012-01-13 15:21 [RFC 1/2] Bluetooth: Use chan instead of sk Emeltchenko Andrei
@ 2012-01-13 15:21 ` Emeltchenko Andrei
  2012-01-13 17:00   ` Marcel Holtmann
  2012-01-13 16:59 ` [RFC 1/2] Bluetooth: Use chan instead of sk Marcel Holtmann
  2012-01-16  9:57 ` Johan Hedberg
  2 siblings, 1 reply; 5+ messages in thread
From: Emeltchenko Andrei @ 2012-01-13 15:21 UTC (permalink / raw)
  To: linux-bluetooth

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


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

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 52c7412..0087db8 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1518,9 +1518,10 @@ static void l2cap_send_srejtail(struct l2cap_chan *chan)
 	l2cap_send_sframe(chan, control);
 }
 
-static inline int l2cap_skbuff_fromiovec(struct sock *sk, struct msghdr *msg, int len, int count, struct sk_buff *skb)
+static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan, struct msghdr *msg, int len, int count, struct sk_buff *skb)
 {
-	struct l2cap_conn *conn = l2cap_pi(sk)->chan->conn;
+	struct sock *sk = chan->sk;
+	struct l2cap_conn *conn = chan->conn;
 	struct sk_buff **frag;
 	int err, sent = 0;
 
@@ -1578,7 +1579,7 @@ static struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan,
 	lh->len = cpu_to_le16(len + (hlen - L2CAP_HDR_SIZE));
 	put_unaligned_le16(chan->psm, skb_put(skb, 2));
 
-	err = l2cap_skbuff_fromiovec(sk, msg, len, count, skb);
+	err = l2cap_skbuff_fromiovec(chan, msg, len, count, skb);
 	if (unlikely(err < 0)) {
 		kfree_skb(skb);
 		return ERR_PTR(err);
@@ -1611,7 +1612,7 @@ static struct sk_buff *l2cap_create_basic_pdu(struct l2cap_chan *chan,
 	lh->cid = cpu_to_le16(chan->dcid);
 	lh->len = cpu_to_le16(len + (hlen - L2CAP_HDR_SIZE));
 
-	err = l2cap_skbuff_fromiovec(sk, msg, len, count, skb);
+	err = l2cap_skbuff_fromiovec(chan, msg, len, count, skb);
 	if (unlikely(err < 0)) {
 		kfree_skb(skb);
 		return ERR_PTR(err);
@@ -1661,7 +1662,7 @@ static struct sk_buff *l2cap_create_iframe_pdu(struct l2cap_chan *chan,
 	if (sdulen)
 		put_unaligned_le16(sdulen, skb_put(skb, L2CAP_SDULEN_SIZE));
 
-	err = l2cap_skbuff_fromiovec(sk, msg, len, count, skb);
+	err = l2cap_skbuff_fromiovec(chan, msg, len, count, skb);
 	if (unlikely(err < 0)) {
 		kfree_skb(skb);
 		return ERR_PTR(err);
-- 
1.7.4.1


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

* Re: [RFC 1/2] Bluetooth: Use chan instead of sk
  2012-01-13 15:21 [RFC 1/2] Bluetooth: Use chan instead of sk Emeltchenko Andrei
  2012-01-13 15:21 ` [RFC 2/2] Bluetooth: Change sk to l2cap_chan Emeltchenko Andrei
@ 2012-01-13 16:59 ` Marcel Holtmann
  2012-01-16  9:57 ` Johan Hedberg
  2 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2012-01-13 16:59 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

> Remove unneeded conversion from sk to chan.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  net/bluetooth/l2cap_core.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)

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

Regards

Marcel



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

* Re: [RFC 2/2] Bluetooth: Change sk to l2cap_chan
  2012-01-13 15:21 ` [RFC 2/2] Bluetooth: Change sk to l2cap_chan Emeltchenko Andrei
@ 2012-01-13 17:00   ` Marcel Holtmann
  0 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2012-01-13 17:00 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

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

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

Regards

Marcel



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

* Re: [RFC 1/2] Bluetooth: Use chan instead of sk
  2012-01-13 15:21 [RFC 1/2] Bluetooth: Use chan instead of sk Emeltchenko Andrei
  2012-01-13 15:21 ` [RFC 2/2] Bluetooth: Change sk to l2cap_chan Emeltchenko Andrei
  2012-01-13 16:59 ` [RFC 1/2] Bluetooth: Use chan instead of sk Marcel Holtmann
@ 2012-01-16  9:57 ` Johan Hedberg
  2 siblings, 0 replies; 5+ messages in thread
From: Johan Hedberg @ 2012-01-16  9:57 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

On Fri, Jan 13, 2012, Emeltchenko Andrei wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> 
> Remove unneeded conversion from sk to chan.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  net/bluetooth/l2cap_core.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)

Both patches have been applied to my bluetooth-next tree. Thanks.

Johan

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

end of thread, other threads:[~2012-01-16  9:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-13 15:21 [RFC 1/2] Bluetooth: Use chan instead of sk Emeltchenko Andrei
2012-01-13 15:21 ` [RFC 2/2] Bluetooth: Change sk to l2cap_chan Emeltchenko Andrei
2012-01-13 17:00   ` Marcel Holtmann
2012-01-13 16:59 ` [RFC 1/2] Bluetooth: Use chan instead of sk Marcel Holtmann
2012-01-16  9:57 ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.