Re: [PATCH BlueZ 10/12] adapter: Remove unwanted if check and code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Syam,

On 21:27 Wed 23 May, Syam Sidhardhan wrote:
> Here the variable agent never be NULL, so no need to check it
> against NULL.
> ---
>  src/adapter.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
> diff --git a/src/adapter.c b/src/adapter.c
> index 18dd5b6..16d379c 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -1618,9 +1618,6 @@ static DBusMessage *register_agent(DBusConnection *conn, DBusMessage *msg,
>  
>  	agent = agent_create(adapter, name, path, cap,
>  				(agent_remove_cb) agent_removed, adapter);
> -	if (!agent)
> -		return btd_error_failed(msg, "Failed to create a new agent");
> -

While you are at it, you could remove the "agent" variable.

Apart from this, the series looks good.

>  	adapter->agent = agent;
>  
>  	DBG("Agent registered for hci%d at %s:%s", adapter->dev_id, name,
> -- 
> 1.7.4.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Cheers,
-- 
Vinicius
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux