diff mbox

test/api_test/odp_ring_test.c: clear clang warning

Message ID 1408995152-29478-1-git-send-email-anders.roxell@linaro.org
State Accepted
Commit 21bd4f0c2e3b05571c573caa155888f9c253805c
Headers show

Commit Message

Anders Roxell Aug. 25, 2014, 7:32 p.m. UTC
Remove dead initialisation.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 test/api_test/odp_ring_test.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Santosh Shukla Aug. 26, 2014, 7:07 a.m. UTC | #1
On 26 August 2014 01:02, Anders Roxell <anders.roxell@linaro.org> wrote:
> Remove dead initialisation.
>
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>  test/api_test/odp_ring_test.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/test/api_test/odp_ring_test.c b/test/api_test/odp_ring_test.c
> index 6c2642e..93bd869 100644
> --- a/test/api_test/odp_ring_test.c
> +++ b/test/api_test/odp_ring_test.c
> @@ -103,7 +103,6 @@ static int test_ring_basic(odp_ring_t *r)
>
>         printf("enqueue MAX_BULK objs\n");
>         ret = odp_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
> -       cur_src += MAX_BULK;
>         if ((ret & ODP_RING_SZ_MASK) != MAX_BULK) {
>                 ODP_ERR("sp_enq for %d obj failed\n", MAX_BULK);
>                 goto fail;
> @@ -160,7 +159,6 @@ static int test_ring_basic(odp_ring_t *r)
>         }
>         printf("enqueue MAX_BULK objs\n");
>         ret = odp_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
> -       cur_src += MAX_BULK;
>         if (ret != 0) {
>                 ODP_ERR("mp_enq for %d obj failed\n", MAX_BULK);
>                 goto fail;
> @@ -192,9 +190,6 @@ static int test_ring_basic(odp_ring_t *r)
>                 goto fail;
>         }
>
> -       cur_src = src;
> -       cur_dst = dst;
> -

Rest of looks fine to me except above.. why you want to remove them?

If above change reverted then Reviewed-by : Santosh Shukla
<santosh.shukla@linaro.org>


>         printf("test watermark and default bulk enqueue / dequeue\n");
>         odp_ring_set_water_mark(r, 20);
>         num_elems = 16;
> @@ -209,7 +204,6 @@ static int test_ring_basic(odp_ring_t *r)
>                 goto fail;
>         }
>         ret = odp_ring_mp_enqueue_bulk(r, cur_src, num_elems);
> -       cur_src += num_elems;
>         if (ret != -EDQUOT) {
>                 ODP_ERR("Watermark not exceeded\n");
>                 goto fail;
> --
> 1.9.1
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Anders Roxell Aug. 26, 2014, 12:03 p.m. UTC | #2
On 2014-08-26 12:37, Santosh Shukla wrote:
> On 26 August 2014 01:02, Anders Roxell <anders.roxell@linaro.org> wrote:
> > Remove dead initialisation.
> >
> > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> > ---
> >  test/api_test/odp_ring_test.c | 6 ------
> >  1 file changed, 6 deletions(-)
> >
> > diff --git a/test/api_test/odp_ring_test.c b/test/api_test/odp_ring_test.c
> > index 6c2642e..93bd869 100644
> > --- a/test/api_test/odp_ring_test.c
> > +++ b/test/api_test/odp_ring_test.c
> > @@ -103,7 +103,6 @@ static int test_ring_basic(odp_ring_t *r)
> >
> >         printf("enqueue MAX_BULK objs\n");
> >         ret = odp_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
> > -       cur_src += MAX_BULK;
> >         if ((ret & ODP_RING_SZ_MASK) != MAX_BULK) {
> >                 ODP_ERR("sp_enq for %d obj failed\n", MAX_BULK);
> >                 goto fail;
> > @@ -160,7 +159,6 @@ static int test_ring_basic(odp_ring_t *r)
> >         }
> >         printf("enqueue MAX_BULK objs\n");
> >         ret = odp_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
> > -       cur_src += MAX_BULK;
> >         if (ret != 0) {
> >                 ODP_ERR("mp_enq for %d obj failed\n", MAX_BULK);
> >                 goto fail;
> > @@ -192,9 +190,6 @@ static int test_ring_basic(odp_ring_t *r)
> >                 goto fail;
> >         }
> >
> > -       cur_src = src;
> > -       cur_dst = dst;
> > -
> 
> Rest of looks fine to me except above.. why you want to remove them?

because they are not needed... if you look in the file before and after
you will see them again 4 lines down...


> 
> If above change reverted then Reviewed-by : Santosh Shukla
> <santosh.shukla@linaro.org>
> 
> 
> >         printf("test watermark and default bulk enqueue / dequeue\n");
> >         odp_ring_set_water_mark(r, 20);
> >         num_elems = 16;

if the diff showed more you would see them here as well... and this one
I didn't remove...

> > @@ -209,7 +204,6 @@ static int test_ring_basic(odp_ring_t *r)
> >                 goto fail;
> >         }
> >         ret = odp_ring_mp_enqueue_bulk(r, cur_src, num_elems);
> > -       cur_src += num_elems;
> >         if (ret != -EDQUOT) {
> >                 ODP_ERR("Watermark not exceeded\n");
> >                 goto fail;
> > --
> > 1.9.1
> >
> >
> > _______________________________________________
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/lng-odp
Santosh Shukla Aug. 26, 2014, 12:32 p.m. UTC | #3
On 26 August 2014 17:33, Anders Roxell <anders.roxell@linaro.org> wrote:
> On 2014-08-26 12:37, Santosh Shukla wrote:
>> On 26 August 2014 01:02, Anders Roxell <anders.roxell@linaro.org> wrote:
>> > Remove dead initialisation.
>> >
>> > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
>> > ---
>> >  test/api_test/odp_ring_test.c | 6 ------
>> >  1 file changed, 6 deletions(-)
>> >
>> > diff --git a/test/api_test/odp_ring_test.c b/test/api_test/odp_ring_test.c
>> > index 6c2642e..93bd869 100644
>> > --- a/test/api_test/odp_ring_test.c
>> > +++ b/test/api_test/odp_ring_test.c
>> > @@ -103,7 +103,6 @@ static int test_ring_basic(odp_ring_t *r)
>> >
>> >         printf("enqueue MAX_BULK objs\n");
>> >         ret = odp_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
>> > -       cur_src += MAX_BULK;
>> >         if ((ret & ODP_RING_SZ_MASK) != MAX_BULK) {
>> >                 ODP_ERR("sp_enq for %d obj failed\n", MAX_BULK);
>> >                 goto fail;
>> > @@ -160,7 +159,6 @@ static int test_ring_basic(odp_ring_t *r)
>> >         }
>> >         printf("enqueue MAX_BULK objs\n");
>> >         ret = odp_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
>> > -       cur_src += MAX_BULK;
>> >         if (ret != 0) {
>> >                 ODP_ERR("mp_enq for %d obj failed\n", MAX_BULK);
>> >                 goto fail;
>> > @@ -192,9 +190,6 @@ static int test_ring_basic(odp_ring_t *r)
>> >                 goto fail;
>> >         }
>> >
>> > -       cur_src = src;
>> > -       cur_dst = dst;
>> > -
>>
>> Rest of looks fine to me except above.. why you want to remove them?
>
> because they are not needed... if you look in the file before and after
> you will see them again 4 lines down...

Yes.
>
>
>>
>> If above change reverted then Reviewed-by : Santosh Shukla
>> <santosh.shukla@linaro.org>
>>
>>
>> >         printf("test watermark and default bulk enqueue / dequeue\n");
>> >         odp_ring_set_water_mark(r, 20);
>> >         num_elems = 16;
>
> if the diff showed more you would see them here as well... and this one
> I didn't remove...

I didn't understood above.
>
>> > @@ -209,7 +204,6 @@ static int test_ring_basic(odp_ring_t *r)
>> >                 goto fail;
>> >         }
>> >         ret = odp_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>> > -       cur_src += num_elems;
>> >         if (ret != -EDQUOT) {
>> >                 ODP_ERR("Watermark not exceeded\n");
>> >                 goto fail;
>> > --
>> > 1.9.1
>> >
>> >
>> > _______________________________________________
>> > lng-odp mailing list
>> > lng-odp@lists.linaro.org
>> > http://lists.linaro.org/mailman/listinfo/lng-odp
Santosh Shukla Aug. 26, 2014, 1:04 p.m. UTC | #4
On 26 August 2014 18:02, Santosh Shukla <santosh.shukla@linaro.org> wrote:
> On 26 August 2014 17:33, Anders Roxell <anders.roxell@linaro.org> wrote:
>> On 2014-08-26 12:37, Santosh Shukla wrote:
>>> On 26 August 2014 01:02, Anders Roxell <anders.roxell@linaro.org> wrote:
>>> > Remove dead initialisation.
>>> >
>>> > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
>>> > ---
>>> >  test/api_test/odp_ring_test.c | 6 ------
>>> >  1 file changed, 6 deletions(-)
>>> >
>>> > diff --git a/test/api_test/odp_ring_test.c b/test/api_test/odp_ring_test.c
>>> > index 6c2642e..93bd869 100644
>>> > --- a/test/api_test/odp_ring_test.c
>>> > +++ b/test/api_test/odp_ring_test.c
>>> > @@ -103,7 +103,6 @@ static int test_ring_basic(odp_ring_t *r)
>>> >
>>> >         printf("enqueue MAX_BULK objs\n");
>>> >         ret = odp_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
>>> > -       cur_src += MAX_BULK;
>>> >         if ((ret & ODP_RING_SZ_MASK) != MAX_BULK) {
>>> >                 ODP_ERR("sp_enq for %d obj failed\n", MAX_BULK);
>>> >                 goto fail;
>>> > @@ -160,7 +159,6 @@ static int test_ring_basic(odp_ring_t *r)
>>> >         }
>>> >         printf("enqueue MAX_BULK objs\n");
>>> >         ret = odp_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
>>> > -       cur_src += MAX_BULK;
>>> >         if (ret != 0) {
>>> >                 ODP_ERR("mp_enq for %d obj failed\n", MAX_BULK);
>>> >                 goto fail;
>>> > @@ -192,9 +190,6 @@ static int test_ring_basic(odp_ring_t *r)
>>> >                 goto fail;
>>> >         }
>>> >
>>> > -       cur_src = src;
>>> > -       cur_dst = dst;
>>> > -
>>>
>>> Rest of looks fine to me except above.. why you want to remove them?
>>
>> because they are not needed... if you look in the file before and after
>> you will see them again 4 lines down...
>
> Yes.
>>
>>
>>>
>>> If above change reverted then Reviewed-by : Santosh Shukla
>>> <santosh.shukla@linaro.org>
>>>
>>>
>>> >         printf("test watermark and default bulk enqueue / dequeue\n");
>>> >         odp_ring_set_water_mark(r, 20);
>>> >         num_elems = 16;
>>
>> if the diff showed more you would see them here as well... and this one
>> I didn't remove...
>
> I didn't understood above.

Per small HO session :) , Change look good to me. Thanks.

>>
>>> > @@ -209,7 +204,6 @@ static int test_ring_basic(odp_ring_t *r)
>>> >                 goto fail;
>>> >         }
>>> >         ret = odp_ring_mp_enqueue_bulk(r, cur_src, num_elems);
>>> > -       cur_src += num_elems;
>>> >         if (ret != -EDQUOT) {
>>> >                 ODP_ERR("Watermark not exceeded\n");
>>> >                 goto fail;
>>> > --
>>> > 1.9.1
>>> >
>>> >
>>> > _______________________________________________
>>> > lng-odp mailing list
>>> > lng-odp@lists.linaro.org
>>> > http://lists.linaro.org/mailman/listinfo/lng-odp
Maxim Uvarov Aug. 26, 2014, 1:40 p.m. UTC | #5
Merged, thanks!

Maxim.

On 08/25/2014 11:32 PM, Anders Roxell wrote:
> Remove dead initialisation.
>
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>   test/api_test/odp_ring_test.c | 6 ------
>   1 file changed, 6 deletions(-)
>
> diff --git a/test/api_test/odp_ring_test.c b/test/api_test/odp_ring_test.c
> index 6c2642e..93bd869 100644
> --- a/test/api_test/odp_ring_test.c
> +++ b/test/api_test/odp_ring_test.c
> @@ -103,7 +103,6 @@ static int test_ring_basic(odp_ring_t *r)
>   
>   	printf("enqueue MAX_BULK objs\n");
>   	ret = odp_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
> -	cur_src += MAX_BULK;
>   	if ((ret & ODP_RING_SZ_MASK) != MAX_BULK) {
>   		ODP_ERR("sp_enq for %d obj failed\n", MAX_BULK);
>   		goto fail;
> @@ -160,7 +159,6 @@ static int test_ring_basic(odp_ring_t *r)
>   	}
>   	printf("enqueue MAX_BULK objs\n");
>   	ret = odp_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
> -	cur_src += MAX_BULK;
>   	if (ret != 0) {
>   		ODP_ERR("mp_enq for %d obj failed\n", MAX_BULK);
>   		goto fail;
> @@ -192,9 +190,6 @@ static int test_ring_basic(odp_ring_t *r)
>   		goto fail;
>   	}
>   
> -	cur_src = src;
> -	cur_dst = dst;
> -
>   	printf("test watermark and default bulk enqueue / dequeue\n");
>   	odp_ring_set_water_mark(r, 20);
>   	num_elems = 16;
> @@ -209,7 +204,6 @@ static int test_ring_basic(odp_ring_t *r)
>   		goto fail;
>   	}
>   	ret = odp_ring_mp_enqueue_bulk(r, cur_src, num_elems);
> -	cur_src += num_elems;
>   	if (ret != -EDQUOT) {
>   		ODP_ERR("Watermark not exceeded\n");
>   		goto fail;
diff mbox

Patch

diff --git a/test/api_test/odp_ring_test.c b/test/api_test/odp_ring_test.c
index 6c2642e..93bd869 100644
--- a/test/api_test/odp_ring_test.c
+++ b/test/api_test/odp_ring_test.c
@@ -103,7 +103,6 @@  static int test_ring_basic(odp_ring_t *r)
 
 	printf("enqueue MAX_BULK objs\n");
 	ret = odp_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);
-	cur_src += MAX_BULK;
 	if ((ret & ODP_RING_SZ_MASK) != MAX_BULK) {
 		ODP_ERR("sp_enq for %d obj failed\n", MAX_BULK);
 		goto fail;
@@ -160,7 +159,6 @@  static int test_ring_basic(odp_ring_t *r)
 	}
 	printf("enqueue MAX_BULK objs\n");
 	ret = odp_ring_mp_enqueue_bulk(r, cur_src, MAX_BULK);
-	cur_src += MAX_BULK;
 	if (ret != 0) {
 		ODP_ERR("mp_enq for %d obj failed\n", MAX_BULK);
 		goto fail;
@@ -192,9 +190,6 @@  static int test_ring_basic(odp_ring_t *r)
 		goto fail;
 	}
 
-	cur_src = src;
-	cur_dst = dst;
-
 	printf("test watermark and default bulk enqueue / dequeue\n");
 	odp_ring_set_water_mark(r, 20);
 	num_elems = 16;
@@ -209,7 +204,6 @@  static int test_ring_basic(odp_ring_t *r)
 		goto fail;
 	}
 	ret = odp_ring_mp_enqueue_bulk(r, cur_src, num_elems);
-	cur_src += num_elems;
 	if (ret != -EDQUOT) {
 		ODP_ERR("Watermark not exceeded\n");
 		goto fail;