2014-09-19 12:45:19

by Gowtham Anandha Babu

[permalink] [raw]
Subject: [PATCH] obexd/src/manager: Fix the double check for agent

Removes the check for NULL agent and fix the
coding style for enum.
---
agent_free() function contains the NULL check already.
---
obexd/src/manager.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index 326e56f..9c6623e 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -64,7 +64,7 @@ struct agent {
};

enum {
- TRANSFER_STATUS_QUEUED = 0,
+ TRANSFER_STATUS_QUEUED = 0,
TRANSFER_STATUS_ACTIVE,
TRANSFER_STATUS_COMPLETE,
TRANSFER_STATUS_ERROR
@@ -521,8 +521,7 @@ void manager_cleanup(void)

/* FIXME: Release agent? */

- if (agent)
- agent_free(agent);
+ agent_free(agent);

g_dbus_detach_object_manager(connection);

--
1.9.1



2014-09-19 13:01:18

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH] obexd/src/manager: Fix the double check for agent

Hi,

On Fri, Sep 19, 2014 at 3:45 PM, Gowtham Anandha Babu
<[email protected]> wrote:
> Removes the check for NULL agent and fix the
> coding style for enum.
> ---
> agent_free() function contains the NULL check already.
> ---
> obexd/src/manager.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/obexd/src/manager.c b/obexd/src/manager.c
> index 326e56f..9c6623e 100644
> --- a/obexd/src/manager.c
> +++ b/obexd/src/manager.c
> @@ -64,7 +64,7 @@ struct agent {
> };
>
> enum {
> - TRANSFER_STATUS_QUEUED = 0,
> + TRANSFER_STATUS_QUEUED = 0,
> TRANSFER_STATUS_ACTIVE,
> TRANSFER_STATUS_COMPLETE,
> TRANSFER_STATUS_ERROR
> @@ -521,8 +521,7 @@ void manager_cleanup(void)
>
> /* FIXME: Release agent? */
>
> - if (agent)
> - agent_free(agent);
> + agent_free(agent);
>
> g_dbus_detach_object_manager(connection);
>
> --
> 1.9.1

Please split the coding style fix.


--
Luiz Augusto von Dentz