Return-Path: From: Mikel Astiz To: linux-bluetooth@vger.kernel.org Cc: Mikel Astiz Subject: [PATCH v3 01/15] cups: Remove unnecessary code Date: Wed, 5 Dec 2012 13:51:28 +0100 Message-Id: <1354711902-16390-2-git-send-email-mikel.astiz.oss@gmail.com> In-Reply-To: <1354711902-16390-1-git-send-email-mikel.astiz.oss@gmail.com> References: <1354711902-16390-1-git-send-email-mikel.astiz.oss@gmail.com> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: From: Mikel Astiz 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 #include #include +#include #include #include #include @@ -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