* [PATCH 1/2] Remove dead code from bonding_request_new
@ 2012-01-20 15:26 Szymon Janc
2012-01-20 15:26 ` [PATCH 2/2] Remove dead code from device_create_bonding Szymon Janc
2012-01-23 10:56 ` [PATCH 1/2] Remove dead code from bonding_request_new Johan Hedberg
0 siblings, 2 replies; 3+ messages in thread
From: Szymon Janc @ 2012-01-20 15:26 UTC (permalink / raw)
To: linux-bluetooth; +Cc: kanak.gupta, Szymon Janc
agent_create always return valid pointer so there is not need to check
for NULL as this will never happen.
---
src/device.c | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)
diff --git a/src/device.c b/src/device.c
index 16855b1..5224984 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2225,7 +2225,6 @@ static struct bonding_req *bonding_request_new(DBusConnection *conn,
{
struct bonding_req *bonding;
const char *name = dbus_message_get_sender(msg);
- struct agent *agent;
char addr[18];
ba2str(&device->bdaddr, addr);
@@ -2234,16 +2233,10 @@ static struct bonding_req *bonding_request_new(DBusConnection *conn,
if (!agent_path)
goto proceed;
- agent = agent_create(device->adapter, name, agent_path,
+ device->agent = agent_create(device->adapter, name, agent_path,
capability,
device_agent_removed,
device);
- if (!agent) {
- error("Unable to create a new agent");
- return NULL;
- }
-
- device->agent = agent;
DBG("Temporary agent registered for %s at %s:%s",
addr, name, agent_path);
--
on behalf of ST-Ericsson
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 2/2] Remove dead code from device_create_bonding
2012-01-20 15:26 [PATCH 1/2] Remove dead code from bonding_request_new Szymon Janc
@ 2012-01-20 15:26 ` Szymon Janc
2012-01-23 10:56 ` [PATCH 1/2] Remove dead code from bonding_request_new Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Szymon Janc @ 2012-01-20 15:26 UTC (permalink / raw)
To: linux-bluetooth; +Cc: kanak.gupta, Szymon Janc
bonding_request_new always return valid pointer so there is not need
to check for NULL as this will never happen.
---
src/device.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/src/device.c b/src/device.c
index 5224984..12463cf 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2303,10 +2303,6 @@ DBusMessage *device_create_bonding(struct btd_device *device,
bonding = bonding_request_new(conn, msg, device, agent_path,
capability);
- if (!bonding) {
- adapter_cancel_bonding(adapter, &device->bdaddr);
- return NULL;
- }
bonding->listener_id = g_dbus_add_disconnect_watch(conn,
dbus_message_get_sender(msg),
--
on behalf of ST-Ericsson
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 1/2] Remove dead code from bonding_request_new
2012-01-20 15:26 [PATCH 1/2] Remove dead code from bonding_request_new Szymon Janc
2012-01-20 15:26 ` [PATCH 2/2] Remove dead code from device_create_bonding Szymon Janc
@ 2012-01-23 10:56 ` Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2012-01-23 10:56 UTC (permalink / raw)
To: Szymon Janc; +Cc: linux-bluetooth, kanak.gupta
Hi Szymon,
On Fri, Jan 20, 2012, Szymon Janc wrote:
> agent_create always return valid pointer so there is not need to check
> for NULL as this will never happen.
> ---
> src/device.c | 9 +--------
> 1 files changed, 1 insertions(+), 8 deletions(-)
Both patches have been applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-23 10:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-20 15:26 [PATCH 1/2] Remove dead code from bonding_request_new Szymon Janc
2012-01-20 15:26 ` [PATCH 2/2] Remove dead code from device_create_bonding Szymon Janc
2012-01-23 10:56 ` [PATCH 1/2] Remove dead code from bonding_request_new Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).