From f94eba715c87de39e0576ac63f38c6ee88558b3c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 4 Jan 2013 11:55:00 -0800 Subject: [PATCH] core: Remove pointless temporary adapter path variable --- src/adapter.c | 10 ++++------ src/dbus-common.h | 2 -- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index 69d3d6265..9e9f67d57 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -3786,23 +3786,21 @@ static int adapter_register(struct btd_adapter *adapter, uint32_t current_settings, uint32_t supported_settings) { - char path[MAX_PATH_LENGTH]; - if (adapter_find_by_id(adapter->dev_id)) { error("Unable to register adapter: hci%d already exist", adapter->dev_id); return -EALREADY; } - snprintf(path, sizeof(path), "/org/bluez/hci%d", adapter->dev_id); - adapter->path = g_strdup(path); + adapter->path = g_strdup_printf("/org/bluez/hci%d", adapter->dev_id); if (!g_dbus_register_interface(btd_get_dbus_connection(), - path, ADAPTER_INTERFACE, + adapter->path, ADAPTER_INTERFACE, adapter_methods, NULL, adapter_properties, adapter, adapter_free)) { - error("Adapter interface init failed on path %s", path); + error("Adapter interface init failed on path %s", + adapter->path); return -EINVAL; } diff --git a/src/dbus-common.h b/src/dbus-common.h index e2ea365b1..f331b2f6d 100644 --- a/src/dbus-common.h +++ b/src/dbus-common.h @@ -21,8 +21,6 @@ * */ -#define MAX_PATH_LENGTH 64 - void dict_append_entry(DBusMessageIter *dict, const char *key, int type, void *val);