From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH] Cleanup set_mode code
Date: Tue, 2 Nov 2010 16:44:16 +0200 [thread overview]
Message-ID: <1288709056-7551-1-git-send-email-luiz.dentz@gmail.com> (raw)
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
next reply other threads:[~2010-11-02 14:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-02 14:44 Luiz Augusto von Dentz [this message]
2010-11-02 22:25 ` [PATCH] Cleanup set_mode code Johan Hedberg
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=1288709056-7551-1-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--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