linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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

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).