diff mbox

[2/4] validation: queue: check return value for odp_queue_enq_multi

Message ID 1419334799-19653-3-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit 88e69882905b81a90e4ed7310bd9cd7eab2a34dc
Headers show

Commit Message

Maxim Uvarov Dec. 23, 2014, 11:39 a.m. UTC
CID 85005:  Unchecked return value  (CHECKED_RETURN)
    Calling "odp_queue_enq_multi" without checking return value
    (as is done elsewhere 4 out of 5 times).

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 test/validation/odp_queue.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Mike Holmes Dec. 24, 2014, 9:28 p.m. UTC | #1
On 23 December 2014 at 06:39, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> CID 85005:  Unchecked return value  (CHECKED_RETURN)
>     Calling "odp_queue_enq_multi" without checking return value
>     (as is done elsewhere 4 out of 5 times).
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>

Reviewed-and-Tested-by: Mike Holmes <mike.holmes@linaro.org>


> ---
>  test/validation/odp_queue.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/test/validation/odp_queue.c b/test/validation/odp_queue.c
> index b5ccf9a..0613fd0 100644
> --- a/test/validation/odp_queue.c
> +++ b/test/validation/odp_queue.c
> @@ -40,7 +40,7 @@ static void test_odp_queue_sunnyday(void)
>         odp_buffer_pool_t msg_pool;
>         odp_queue_param_t param;
>         odp_buffer_t *pbuf_tmp;
> -       int i, deq_ret;
> +       int i, deq_ret, ret;
>         int nr_deq_entries = 0;
>         int max_iteration = CONFIG_MAX_ITERATION;
>         void *prtn = NULL;
> @@ -79,7 +79,8 @@ static void test_odp_queue_sunnyday(void)
>          * odp_queue_enq_multi may return 0..n buffers due to the resource
>          * constraints in the implementation at that given point of time.
>          */
> -       odp_queue_enq_multi(queue_id, enbuf, MAX_BUFFER_QUEUE);
> +       ret = odp_queue_enq_multi(queue_id, enbuf, MAX_BUFFER_QUEUE);
> +       CU_ASSERT(0 == ret);
>         pbuf_tmp = debuf;
>         do {
>                 deq_ret  = odp_queue_deq_multi(queue_id, pbuf_tmp,
> --
> 1.8.5.1.163.gd7aced9
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov Dec. 25, 2014, 11:13 a.m. UTC | #2
Merged this patch.

Maxim.

On 12/25/2014 12:28 AM, Mike Holmes wrote:
>
>
> On 23 December 2014 at 06:39, Maxim Uvarov <maxim.uvarov@linaro.org 
> <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     CID 85005:  Unchecked return value  (CHECKED_RETURN)
>         Calling "odp_queue_enq_multi" without checking return value
>         (as is done elsewhere 4 out of 5 times).
>
>     Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org
>     <mailto:maxim.uvarov@linaro.org>>
>
>
> Reviewed-and-Tested-by: Mike Holmes <mike.holmes@linaro.org 
> <mailto:mike.holmes@linaro.org>>
>
>     ---
>      test/validation/odp_queue.c | 5 +++--
>      1 file changed, 3 insertions(+), 2 deletions(-)
>
>     diff --git a/test/validation/odp_queue.c b/test/validation/odp_queue.c
>     index b5ccf9a..0613fd0 100644
>     --- a/test/validation/odp_queue.c
>     +++ b/test/validation/odp_queue.c
>     @@ -40,7 +40,7 @@ static void test_odp_queue_sunnyday(void)
>             odp_buffer_pool_t msg_pool;
>             odp_queue_param_t param;
>             odp_buffer_t *pbuf_tmp;
>     -       int i, deq_ret;
>     +       int i, deq_ret, ret;
>             int nr_deq_entries = 0;
>             int max_iteration = CONFIG_MAX_ITERATION;
>             void *prtn = NULL;
>     @@ -79,7 +79,8 @@ static void test_odp_queue_sunnyday(void)
>              * odp_queue_enq_multi may return 0..n buffers due to the
>     resource
>              * constraints in the implementation at that given point
>     of time.
>              */
>     -       odp_queue_enq_multi(queue_id, enbuf, MAX_BUFFER_QUEUE);
>     +       ret = odp_queue_enq_multi(queue_id, enbuf, MAX_BUFFER_QUEUE);
>     +       CU_ASSERT(0 == ret);
>             pbuf_tmp = debuf;
>             do {
>                     deq_ret  = odp_queue_deq_multi(queue_id, pbuf_tmp,
>     --
>     1.8.5.1.163.gd7aced9
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> -- 
> *Mike Holmes*
> Linaro  Sr Technical Manager
> LNG - ODP
diff mbox

Patch

diff --git a/test/validation/odp_queue.c b/test/validation/odp_queue.c
index b5ccf9a..0613fd0 100644
--- a/test/validation/odp_queue.c
+++ b/test/validation/odp_queue.c
@@ -40,7 +40,7 @@  static void test_odp_queue_sunnyday(void)
 	odp_buffer_pool_t msg_pool;
 	odp_queue_param_t param;
 	odp_buffer_t *pbuf_tmp;
-	int i, deq_ret;
+	int i, deq_ret, ret;
 	int nr_deq_entries = 0;
 	int max_iteration = CONFIG_MAX_ITERATION;
 	void *prtn = NULL;
@@ -79,7 +79,8 @@  static void test_odp_queue_sunnyday(void)
 	 * odp_queue_enq_multi may return 0..n buffers due to the resource
 	 * constraints in the implementation at that given point of time.
 	 */
-	odp_queue_enq_multi(queue_id, enbuf, MAX_BUFFER_QUEUE);
+	ret = odp_queue_enq_multi(queue_id, enbuf, MAX_BUFFER_QUEUE);
+	CU_ASSERT(0 == ret);
 	pbuf_tmp = debuf;
 	do {
 		deq_ret  = odp_queue_deq_multi(queue_id, pbuf_tmp,