From: Andre Guedes Date: Tue, 30 Apr 2013 18:29:36 +0000 (-0300) Subject: Bluetooth: Refactor hci_cc_le_set_scan_enable X-Git-Tag: next-20130607~63^2~8 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=22c56b8620e3b6fc2af12f31591d826a3bc68ea5;p=karo-tx-linux.git Bluetooth: Refactor hci_cc_le_set_scan_enable 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 Acked-by: Johan Hedberg Signed-off-by: Gustavo Padovan --- diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 27f66dc88c9b..76ff1af05693 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -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;