From daef45bdc0d15130f0fc7a6b1e8033a3802f5a43 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 20 Sep 2013 14:00:23 +0200 Subject: [PATCH] bluez: no need to check for valid GError if glib function fails Signed-off-by: Thomas Haller --- src/bluez-manager/nm-bluez5-device.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/bluez-manager/nm-bluez5-device.c b/src/bluez-manager/nm-bluez5-device.c index 5d1ff8c58f..461e9546cc 100644 --- a/src/bluez-manager/nm-bluez5-device.c +++ b/src/bluez-manager/nm-bluez5-device.c @@ -305,8 +305,7 @@ on_adapter_acquired (GObject *object, GAsyncResult *res, NMBluezDevice *self) priv->adapter = g_dbus_proxy_new_for_bus_finish (res, &error); if (!priv->adapter) { - nm_log_warn (LOGD_BT, "failed to acquire adapter proxy: %s.", - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_BT, "failed to acquire adapter proxy: %s.", error->message); g_clear_error (&error); return; } @@ -431,8 +430,7 @@ on_proxy_acquired (GObject *object, GAsyncResult *res, NMBluezDevice *self) priv->proxy5 = g_dbus_proxy_new_for_bus_finish (res, &error); if (!priv->proxy5) { - nm_log_warn (LOGD_BT, "failed to acquire device proxy: %s.", - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_BT, "failed to acquire device proxy: %s.", error->message); g_clear_error (&error); g_signal_emit (self, signals[INITIALIZED], 0, FALSE); return; @@ -453,8 +451,7 @@ on_bus_acquired (GObject *object, GAsyncResult *res, NMBluezDevice *self) priv->dbus_connection = g_bus_get_finish (res, &error); if (!priv->dbus_connection) { - nm_log_warn (LOGD_BT, "failed to acquire bus connection: %s.", - error && error->message ? error->message : "(unknown)"); + nm_log_warn (LOGD_BT, "failed to acquire bus connection: %s.", error->message); g_clear_error (&error); g_signal_emit (self, signals[INITIALIZED], 0, FALSE); return;