aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/a2mp.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-10-05 14:47:47 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2013-10-06 04:25:30 -0400
commit23f0cb41a20e9850513fa4943f6a19525000cce2 (patch)
treef84416e2290abb71d3ccf105a084edd8ec9165c5 /net/bluetooth/a2mp.c
parent346e7099c299eae085efd9b4aeda813d69bc364b (diff)
Bluetooth: Remove check for number of AMP controller
The number of controllers for the AMP discover response has already been calculated. And since the hci_dev_list lock is held, it can not change. So there is no need for any extra checks. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/a2mp.c')
-rw-r--r--net/bluetooth/a2mp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index a1aae5c45b7e..529789d81159 100644
--- a/net/bluetooth/a2mp.c
+++ b/net/bluetooth/a2mp.c
@@ -76,7 +76,7 @@ u8 __next_ident(struct amp_mgr *mgr)
76} 76}
77 77
78/* hci_dev_list shall be locked */ 78/* hci_dev_list shall be locked */
79static void __a2mp_add_cl(struct amp_mgr *mgr, struct a2mp_cl *cl, u8 num_ctrl) 79static void __a2mp_add_cl(struct amp_mgr *mgr, struct a2mp_cl *cl)
80{ 80{
81 int i = 0; 81 int i = 0;
82 struct hci_dev *hdev; 82 struct hci_dev *hdev;
@@ -91,8 +91,7 @@ static void __a2mp_add_cl(struct amp_mgr *mgr, struct a2mp_cl *cl, u8 num_ctrl)
91 continue; 91 continue;
92 92
93 /* Starting from second entry */ 93 /* Starting from second entry */
94 if (++i >= num_ctrl) 94 ++i;
95 return;
96 95
97 cl[i].id = hdev->id; 96 cl[i].id = hdev->id;
98 cl[i].type = hdev->amp_type; 97 cl[i].type = hdev->amp_type;
@@ -166,7 +165,7 @@ static int a2mp_discover_req(struct amp_mgr *mgr, struct sk_buff *skb,
166 rsp->mtu = __constant_cpu_to_le16(L2CAP_A2MP_DEFAULT_MTU); 165 rsp->mtu = __constant_cpu_to_le16(L2CAP_A2MP_DEFAULT_MTU);
167 rsp->ext_feat = 0; 166 rsp->ext_feat = 0;
168 167
169 __a2mp_add_cl(mgr, rsp->cl, num_ctrl); 168 __a2mp_add_cl(mgr, rsp->cl);
170 169
171 read_unlock(&hci_dev_list_lock); 170 read_unlock(&hci_dev_list_lock);
172 171