Skip to content

Commit

Permalink
Bluetooth: Minor code refactoring
Browse files Browse the repository at this point in the history
This patch does a trivial code refacting in hci_discovery_active.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  • Loading branch information
Andre Guedes authored and Johan Hedberg committed Feb 13, 2012
1 parent c599008 commit 6fbe195
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,15 @@ bool hci_discovery_active(struct hci_dev *hdev)
{
struct discovery_state *discov = &hdev->discovery;

if (discov->state == DISCOVERY_INQUIRY ||
discov->state == DISCOVERY_LE_SCAN ||
discov->state == DISCOVERY_RESOLVING)
switch (discov->state) {
case DISCOVERY_INQUIRY:
case DISCOVERY_LE_SCAN:
case DISCOVERY_RESOLVING:
return true;

return false;
default:
return false;
}
}

void hci_discovery_set_state(struct hci_dev *hdev, int state)
Expand Down

0 comments on commit 6fbe195

Please sign in to comment.