diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2015-04-02 06:41:07 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-04-02 10:09:27 -0400 |
commit | 444c6dd54d81edf81c606f571cb52eff4d47fa99 (patch) | |
tree | dc665d1e9ac8a254f96553cf70985b564b3cad0d | |
parent | 64dd374eac154f747623b256c59ecaf5affba724 (diff) |
Bluetooth: Add clarifying comment to command status handling
When dealing with HCI command status events, the reasoning for trying to
mark a request as complete if no specific event is being waited for and
status was success is not self-evident. This patch adds a clarifying
comment above the if-statement.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | net/bluetooth/hci_event.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 7c0f992602f5..87e5bee36408 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -3124,6 +3124,12 @@ static void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
3124 | if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) | 3124 | if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) |
3125 | atomic_set(&hdev->cmd_cnt, 1); | 3125 | atomic_set(&hdev->cmd_cnt, 1); |
3126 | 3126 | ||
3127 | /* Indicate request completion if the command failed. Also, if | ||
3128 | * we're not waiting for a special event and we get a success | ||
3129 | * command status we should try to flag the request as completed | ||
3130 | * (since for this kind of commands there will not be a command | ||
3131 | * complete event). | ||
3132 | */ | ||
3127 | if (ev->status || | 3133 | if (ev->status || |
3128 | (hdev->sent_cmd && !bt_cb(hdev->sent_cmd)->req.event)) | 3134 | (hdev->sent_cmd && !bt_cb(hdev->sent_cmd)->req.event)) |
3129 | hci_req_cmd_complete(hdev, opcode, ev->status); | 3135 | hci_req_cmd_complete(hdev, opcode, ev->status); |