Skip to content

Commit

Permalink
Bluetooth: Refactor hci_cc_le_set_scan_enable
Browse files Browse the repository at this point in the history
This patch does a trivial refactoring in hci_cc_le_set_scan_enable.
Since start and stop discovery command failures are now handled in
mgmt layer, the status check became empty. So, we can move it to
outside the switch statement.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
  • Loading branch information
Andre Guedes authored and Gustavo Padovan committed Jun 22, 2013
1 parent 1183fdc commit 3fd319b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,18 +949,15 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev,
if (!cp)
return;

if (status)
return;

switch (cp->enable) {
case LE_SCAN_ENABLE:
if (status)
return;

set_bit(HCI_LE_SCAN, &hdev->dev_flags);
break;

case LE_SCAN_DISABLE:
if (status)
return;

clear_bit(HCI_LE_SCAN, &hdev->dev_flags);
break;

Expand Down

0 comments on commit 3fd319b

Please sign in to comment.