Linux bluetooth development
 help / color / mirror / Atom feed
From: Andre Guedes <andre.guedes@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v3 10/14] Bluetooth: Refactor hci_cc_le_set_scan_enable
Date: Tue, 30 Apr 2013 15:29:36 -0300	[thread overview]
Message-ID: <1367346580-6647-11-git-send-email-andre.guedes@openbossa.org> (raw)
In-Reply-To: <1367346580-6647-1-git-send-email-andre.guedes@openbossa.org>

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>
---
 net/bluetooth/hci_event.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 27f66dc..76ff1af 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;
 
-- 
1.8.2.1


  parent reply	other threads:[~2013-04-30 18:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-30 18:29 [PATCH v3 00/14] Update Discovery to use HCI request framework Andre Guedes
2013-04-30 18:29 ` [PATCH v3 01/14] Bluetooth: Make inquiry_cache_flush non-static Andre Guedes
2013-04-30 18:29 ` [PATCH v3 02/14] Bluetooth: Update start_discovery to use HCI request Andre Guedes
2013-04-30 18:29 ` [PATCH v3 03/14] Bluetooth: Remove start discovery handling from hci_event.c Andre Guedes
2013-04-30 18:29 ` [PATCH v3 04/14] Bluetooth: Make mgmt_start_discovery_failed static Andre Guedes
2013-04-30 18:29 ` [PATCH v3 05/14] Bluetooth: Move discovery macros to hci_core.h Andre Guedes
2013-04-30 18:29 ` [PATCH v3 06/14] Bluetooth: Use HCI request in interleaved discovery Andre Guedes
2013-04-30 18:29 ` [PATCH v3 07/14] Bluetooth: Update stop_discovery to use HCI request Andre Guedes
2013-04-30 18:29 ` [PATCH v3 08/14] Bluetooth: Remove stop discovery handling from hci_event.c Andre Guedes
2013-04-30 18:29 ` [PATCH v3 09/14] Bluetooth: Make mgmt_stop_discovery_failed static Andre Guedes
2013-04-30 18:29 ` Andre Guedes [this message]
2013-04-30 18:29 ` [PATCH v3 11/14] Bluetooth: Remove LE scan helpers Andre Guedes
2013-04-30 18:29 ` [PATCH v3 12/14] Bluetooth: Remove inquiry helpers Andre Guedes
2013-04-30 18:29 ` [PATCH v3 13/14] Bluetooth: Remove empty event handler Andre Guedes
2013-04-30 18:29 ` [PATCH v3 14/14] Bluetooth: Mgmt Device Found Event Andre Guedes
2013-05-03 22:25   ` Gustavo Padovan
2013-05-02  1:59 ` [PATCH v3 00/14] Update Discovery to use HCI request framework Marcel Holtmann
2013-05-02 13:16   ` Andre Guedes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1367346580-6647-11-git-send-email-andre.guedes@openbossa.org \
    --to=andre.guedes@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox