aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2011-11-09 06:58:57 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-11-09 09:48:47 -0500
commit2aeabcbedd51aef94b61d05b57246d1db4984453 (patch)
tree5e345ebc1eada08264caa8c552e6655a94e18c02 /net/bluetooth
parentfc2f4b13d8c91713efb972be42566f7f3625f5ed (diff)
Bluetooth: Remove redundant hci_dev comparisons in mgmt lookups
Now that pending commands are hci_dev specific there's no need to check whether a command matches hci_dev when iterating through them. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/mgmt.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index a849428ffbcb..a6720c6a4d2c 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -268,9 +268,6 @@ static void mgmt_pending_foreach(u16 opcode, struct hci_dev *hdev,
268 if (opcode > 0 && cmd->opcode != opcode) 268 if (opcode > 0 && cmd->opcode != opcode)
269 continue; 269 continue;
270 270
271 if (hdev && cmd->index != hdev->id)
272 continue;
273
274 cb(cmd, data); 271 cb(cmd, data);
275 } 272 }
276} 273}
@@ -280,13 +277,8 @@ static struct pending_cmd *mgmt_pending_find(u16 opcode, struct hci_dev *hdev)
280 struct pending_cmd *cmd; 277 struct pending_cmd *cmd;
281 278
282 list_for_each_entry(cmd, &hdev->mgmt_pending, list) { 279 list_for_each_entry(cmd, &hdev->mgmt_pending, list) {
283 if (cmd->opcode != opcode) 280 if (cmd->opcode == opcode)
284 continue; 281 return cmd;
285
286 if (hdev && cmd->index != hdev->id)
287 continue;
288
289 return cmd;
290 } 282 }
291 283
292 return NULL; 284 return NULL;
@@ -1300,9 +1292,6 @@ static inline struct pending_cmd *find_pairing(struct hci_conn *conn)
1300 if (cmd->opcode != MGMT_OP_PAIR_DEVICE) 1292 if (cmd->opcode != MGMT_OP_PAIR_DEVICE)
1301 continue; 1293 continue;
1302 1294
1303 if (cmd->index != hdev->id)
1304 continue;
1305
1306 if (cmd->user_data != conn) 1295 if (cmd->user_data != conn)
1307 continue; 1296 continue;
1308 1297