]> Pileus Git - ~andy/linux/commitdiff
Bluetooth: Refactor hci_cc_le_set_scan_enable
authorAndre Guedes <andre.guedes@openbossa.org>
Tue, 30 Apr 2013 18:29:36 +0000 (15:29 -0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Sat, 22 Jun 2013 23:23:51 +0000 (00:23 +0100)
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>
net/bluetooth/hci_event.c

index 27f66dc88c9b75c3c6f31f07873c168a61574e78..76ff1af05693a0f974d7307bb0429244af7f3104 100644 (file)
@@ -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;