2014-07-18 14:35:29

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH 1/2] android/hal-sco: Remove unneeded check

From: Andrei Emeltchenko <[email protected]>

rsp_len cannot be NULL since it checked for NULL in the beginning of the
function.
---
android/hal-sco.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/android/hal-sco.c b/android/hal-sco.c
index b13eb91..62e16a8 100644
--- a/android/hal-sco.c
+++ b/android/hal-sco.c
@@ -265,8 +265,7 @@ static int sco_ipc_cmd(uint8_t service_id, uint8_t opcode, uint16_t len,
goto failed;
}

- if (rsp_len)
- *rsp_len = cmd.len;
+ *rsp_len = cmd.len;

return SCO_STATUS_SUCCESS;

--
1.9.1



2014-07-21 08:42:47

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH 1/2] android/hal-sco: Remove unneeded check

Hi Andrei,

On Fri, Jul 18, 2014, Andrei Emeltchenko wrote:
> rsp_len cannot be NULL since it checked for NULL in the beginning of the
> function.
> ---
> android/hal-sco.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)

Both patches have been applied. Thanks.

Johan

2014-07-18 14:35:30

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH 2/2] android/hal-audio: Remove unneeded check

From: Andrei Emeltchenko <[email protected]>

rsp_len cannot be NULL here because of NULL check in the beginning of
the function.
---
android/hal-audio.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/android/hal-audio.c b/android/hal-audio.c
index d7a06fa..66dc46a 100644
--- a/android/hal-audio.c
+++ b/android/hal-audio.c
@@ -286,8 +286,7 @@ static int audio_ipc_cmd(uint8_t service_id, uint8_t opcode, uint16_t len,
goto failed;
}

- if (rsp_len)
- *rsp_len = cmd.len;
+ *rsp_len = cmd.len;

return AUDIO_STATUS_SUCCESS;

--
1.9.1