Bluetooth: Minor code refactoring
authorAndre Guedes <andre.guedes@openbossa.org>
Fri, 3 Feb 2012 20:47:58 +0000 (17:47 -0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 13 Feb 2012 15:01:34 +0000 (17:01 +0200)
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>
net/bluetooth/hci_core.c

index 1705d9372725f5d9b7af2aeb40b65124b0ea3b7e..1175f27bd4451c1fd0dd757bfe2b8d6b6f2e7f1a 100644 (file)
@@ -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)