summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-09-25 14:39:29 -0700
committerJohan Hedberg <johan.hedberg@nokia.com>2008-09-25 14:39:29 -0700
commit5db4580312522b870068c89f5064d1c832075434 (patch)
tree77379a27494b05044a584f3dfff5e79e14c15d7e
parent1af86fb9d1717a27b3a776fc0fb62c96045ccb9a (diff)
Code cleanup
-rw-r--r--src/adapter.c2
-rw-r--r--src/dbus-hci.c10
2 files changed, 5 insertions, 7 deletions
diff --git a/src/adapter.c b/src/adapter.c
index 9a52c6c7..f6aea35b 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -3195,7 +3195,7 @@ void adapter_free_bonding_request(struct btd_adapter *adapter)
struct bonding_request_info *adapter_get_bonding_info(struct btd_adapter *adapter)
{
- if (!adapter || !adapter->bonding)
+ if (!adapter)
return NULL;
return adapter->bonding;
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index 7261deaa..8332fb4d 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -507,7 +507,6 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer,
struct bonding_request_info *bonding;
gboolean paired = TRUE;
struct pending_auth_info *auth;
- const gchar *dev_path;
debug("hcid_dbus_bonding_process_complete: status=%02x", status);
@@ -521,10 +520,8 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer,
bonding = adapter_get_bonding_info(adapter);
- if (status) {
- if (bonding)
- bonding->hci_status = status;
- }
+ if (status && bonding)
+ bonding->hci_status = status;
auth = adapter_find_auth_request(adapter, peer);
if (!auth) {
@@ -542,6 +539,8 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer,
device = adapter_get_device(connection, adapter, paddr);
if (device) {
+ const gchar *dev_path;
+
debug("hcid_dbus_bonding_process_complete: removing temporary flag");
device_set_temporary(device, FALSE);
@@ -553,7 +552,6 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer,
}
proceed:
- bonding = adapter_get_bonding_info(adapter);
if (!bonding || bacmp(&bonding->bdaddr, peer))
return; /* skip: no bonding req pending */