Skip to contentSkip to conversation

Cleanup set_mode code

PATCH In review Luiz Augusto von Dentz 2 participants 2 messages Nov 2, 2010 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 Cleanup set_mode code

From: Luiz Augusto von Dentz <[email protected]>

Now that MODE_LIMITED was removed there is no need to compare string mode to determine if scan mode will change or not.

---
 src/adapter.c |   21 +++++----------------
 1 files changed, 5 insertions(+), 16 deletions(-)
src/adapter.c +5 -16
index 32c74d1..e12d9e5 100644
@@ -603,22 +603,11 @@ done:
 
 	DBG("%s", modestr);
 
-	if (msg != NULL) {
-		/* Limited to Discoverable and vice-versa doesn't cause any
-		   change to scan mode */
-		if (g_str_equal(modestr, mode2str(adapter->mode)) == TRUE) {
-			DBusMessage *reply;
-
-			reply = g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
-
-			g_dbus_send_message(connection, reply);
-		} else
-			/* Wait for mode change to reply */
-			adapter->pending_mode = create_session(adapter,
-								connection,
-								msg, new_mode,
-								NULL);
-	} else
+	if (msg != NULL)
+		/* Wait for mode change to reply */
+		adapter->pending_mode = create_session(adapter, connection,
+							msg, new_mode, NULL);
+	else
 		/* Nothing to reply just write the new mode */
 		adapter->mode = new_mode;
 
Signature · 1 line
1.7.1
#1 lore raw

Hi Luiz,

Quoted 7 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

Now that MODE_LIMITED was removed there is no need to compare string mode to determine if scan mode will change or not.

---
 src/adapter.c |   21 +++++----------------
 1 files changed, 5 insertions(+), 16 deletions(-)

Pushed upstream. Thanks.

Johan