* [PATCH] Cleanup set_mode code
@ 2010-11-02 14:44 Luiz Augusto von Dentz
2010-11-02 22:25 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2010-11-02 14:44 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
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(-)
diff --git a/src/adapter.c b/src/adapter.c
index 32c74d1..e12d9e5 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -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;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-02 22:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-02 14:44 [PATCH] Cleanup set_mode code Luiz Augusto von Dentz
2010-11-02 22:25 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox