aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-10-13 14:36:07 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2013-10-13 14:40:12 -0400
commit84b34d9867f826caecaab4444c86438935b7eb2b (patch)
tree248a315ce71b42aef4e60ab266614edb28cf6327 /net
parent5f6cd79f477743cab98fd49feb03a39e0138b32f (diff)
Bluetooth: Use l2cap_pi(sk) directly where possible
There are few places where it makes sense to use l2cap_pi(sk) directly instead of assigning it to temporary structure. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/l2cap_sock.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 6262e23b71a4..8fe9f497c645 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -976,13 +976,12 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan)
976 976
977static int l2cap_sock_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb) 977static int l2cap_sock_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb)
978{ 978{
979 int err;
980 struct sock *sk = chan->data; 979 struct sock *sk = chan->data;
981 struct l2cap_pinfo *pi = l2cap_pi(sk); 980 int err;
982 981
983 lock_sock(sk); 982 lock_sock(sk);
984 983
985 if (pi->rx_busy_skb) { 984 if (l2cap_pi(sk)->rx_busy_skb) {
986 err = -ENOMEM; 985 err = -ENOMEM;
987 goto done; 986 goto done;
988 } 987 }
@@ -998,9 +997,9 @@ static int l2cap_sock_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb)
998 * acked and reassembled until there is buffer space 997 * acked and reassembled until there is buffer space
999 * available. 998 * available.
1000 */ 999 */
1001 if (err < 0 && pi->chan->mode == L2CAP_MODE_ERTM) { 1000 if (err < 0 && chan->mode == L2CAP_MODE_ERTM) {
1002 pi->rx_busy_skb = skb; 1001 l2cap_pi(sk)->rx_busy_skb = skb;
1003 l2cap_chan_busy(pi->chan, 1); 1002 l2cap_chan_busy(chan, 1);
1004 err = 0; 1003 err = 0;
1005 } 1004 }
1006 1005
@@ -1128,6 +1127,7 @@ static void l2cap_sock_destruct(struct sock *sk)
1128 1127
1129 if (l2cap_pi(sk)->chan) 1128 if (l2cap_pi(sk)->chan)
1130 l2cap_chan_put(l2cap_pi(sk)->chan); 1129 l2cap_chan_put(l2cap_pi(sk)->chan);
1130
1131 if (l2cap_pi(sk)->rx_busy_skb) { 1131 if (l2cap_pi(sk)->rx_busy_skb) {
1132 kfree_skb(l2cap_pi(sk)->rx_busy_skb); 1132 kfree_skb(l2cap_pi(sk)->rx_busy_skb);
1133 l2cap_pi(sk)->rx_busy_skb = NULL; 1133 l2cap_pi(sk)->rx_busy_skb = NULL;
@@ -1139,8 +1139,7 @@ static void l2cap_sock_destruct(struct sock *sk)
1139 1139
1140static void l2cap_sock_init(struct sock *sk, struct sock *parent) 1140static void l2cap_sock_init(struct sock *sk, struct sock *parent)
1141{ 1141{
1142 struct l2cap_pinfo *pi = l2cap_pi(sk); 1142 struct l2cap_chan *chan = l2cap_pi(sk)->chan;
1143 struct l2cap_chan *chan = pi->chan;
1144 1143
1145 BT_DBG("sk %p", sk); 1144 BT_DBG("sk %p", sk);
1146 1145