From: Mikel Astiz <mikel.astiz.oss@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Mikel Astiz <mikel.astiz@bmw-carit.de>
Subject: [RFC v1 01/16] cups: Remove unnecessary code
Date: Thu, 15 Nov 2012 16:09:04 +0100 [thread overview]
Message-ID: <1352992159-11559-2-git-send-email-mikel.astiz.oss@gmail.com> (raw)
In-Reply-To: <1352992159-11559-1-git-send-email-mikel.astiz.oss@gmail.com>
From: Mikel Astiz <mikel.astiz@bmw-carit.de>
The adapter is always known so the code to handle the NULL case is not
needed.
---
profiles/cups/main.c | 22 ++--------------------
1 file changed, 2 insertions(+), 20 deletions(-)
diff --git a/profiles/cups/main.c b/profiles/cups/main.c
index 5aa927f..977c057 100644
--- a/profiles/cups/main.c
+++ b/profiles/cups/main.c
@@ -31,6 +31,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+#include <assert.h>
#include <signal.h>
#include <sys/socket.h>
#include <glib.h>
@@ -338,26 +339,7 @@ static void remote_device_found(const char *adapter, const char *bdaddr,
adapter_reply = NULL;
- if (adapter == NULL) {
- message = dbus_message_new_method_call("org.bluez", "/",
- "org.bluez.Manager",
- "DefaultAdapter");
-
- adapter_reply = dbus_connection_send_with_reply_and_block(conn,
- message, -1, NULL);
-
- dbus_message_unref(message);
-
- if (!adapter_reply)
- return;
-
- if (dbus_message_get_args(adapter_reply, NULL,
- DBUS_TYPE_OBJECT_PATH, &adapter,
- DBUS_TYPE_INVALID) == FALSE) {
- dbus_message_unref(adapter_reply);
- return;
- }
- }
+ assert(adapter != NULL);
message = dbus_message_new_method_call("org.bluez", adapter,
"org.bluez.Adapter",
--
1.7.11.7
next prev parent reply other threads:[~2012-11-15 15:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-15 15:09 [RFC v1 00/16] Manager/Adapter transition to ObjectManager Mikel Astiz
2012-11-15 15:09 ` Mikel Astiz [this message]
2012-11-15 15:09 ` [RFC v1 02/16] doc: Add missing documentation in FindAdapter Mikel Astiz
2012-11-15 15:09 ` [RFC v1 03/16] manager: Extend FindAdapter with "default" pattern Mikel Astiz
2012-11-16 13:29 ` Luiz Augusto von Dentz
2012-11-15 15:09 ` [RFC v1 04/16] test: Avoid using DefaultAdapter() Mikel Astiz
2012-11-15 15:09 ` [RFC v1 05/16] manager: Move org.bluez.Manager to org/bluez Mikel Astiz
2012-11-15 15:09 ` [RFC v1 06/16] test: Update to new Manager path Mikel Astiz
2012-11-15 15:09 ` [RFC v1 07/16] test: Update monitor script to ObjectManager Mikel Astiz
2012-11-15 15:09 ` [RFC v1 08/16] manager: Expose default adapter using property Mikel Astiz
2012-11-15 15:09 ` [RFC v1 09/16] test: Update test-manager script to ObjectManager Mikel Astiz
2012-11-15 15:09 ` [RFC v1 10/16] manager: Remove AdapterAdded/AdapterRemoved signals Mikel Astiz
2012-11-15 15:09 ` [RFC v1 11/16] manager: Remove redundant Adapters property Mikel Astiz
2012-11-15 15:09 ` [RFC v1 12/16] test: Use ObjectManager instead of " Mikel Astiz
2012-11-15 15:09 ` [RFC v1 13/16] adapter: Remove DeviceCreated/DeviceRemoved signals Mikel Astiz
2012-11-15 15:09 ` [RFC v1 14/16] adapter: Remove redundant Devices property Mikel Astiz
2012-11-15 15:09 ` [RFC v1 15/16] test: Use ObjectManager instead of " Mikel Astiz
2012-11-15 15:09 ` [RFC v1 16/16] adapter: Remove FindDevice method from D-Bus API Mikel Astiz
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=1352992159-11559-2-git-send-email-mikel.astiz.oss@gmail.com \
--to=mikel.astiz.oss@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=mikel.astiz@bmw-carit.de \
/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