Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2aeabcbe authored by Johan Hedberg's avatar Johan Hedberg Committed by Gustavo Padovan
Browse files

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: default avatarJohan Hedberg <johan.hedberg@intel.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent fc2f4b13
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -268,9 +268,6 @@ static void mgmt_pending_foreach(u16 opcode, struct hci_dev *hdev,
		if (opcode > 0 && cmd->opcode != opcode)
			continue;

		if (hdev && cmd->index != hdev->id)
			continue;

		cb(cmd, data);
	}
}
@@ -280,12 +277,7 @@ static struct pending_cmd *mgmt_pending_find(u16 opcode, struct hci_dev *hdev)
	struct pending_cmd *cmd;

	list_for_each_entry(cmd, &hdev->mgmt_pending, list) {
		if (cmd->opcode != opcode)
			continue;

		if (hdev && cmd->index != hdev->id)
			continue;

		if (cmd->opcode == opcode)
			return cmd;
	}

@@ -1300,9 +1292,6 @@ static inline struct pending_cmd *find_pairing(struct hci_conn *conn)
		if (cmd->opcode != MGMT_OP_PAIR_DEVICE)
			continue;

		if (cmd->index != hdev->id)
			continue;

		if (cmd->user_data != conn)
			continue;