diff mbox

validation: pktio: fix assert for odp_pktin_queue ret code

Message ID 1463066441-6779-1-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit 01c3f0d8b945dc276f31cde88c1bf4fdcb7ad83b
Headers show

Commit Message

Maxim Uvarov May 12, 2016, 3:20 p.m. UTC
Fix wrong return code check due to assignment to unsigned variable.
https://bugs.linaro.org/show_bug.cgi?id=2224

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

Comments

Bill Fischofer May 12, 2016, 6:43 p.m. UTC | #1
On Thu, May 12, 2016 at 10:20 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> Fix wrong return code check due to assignment to unsigned variable.

> https://bugs.linaro.org/show_bug.cgi?id=2224

>

> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

>


Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>



> ---

>  test/validation/pktio/pktio.c | 7 ++++---

>  1 file changed, 4 insertions(+), 3 deletions(-)

>

> diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c

> index a51e0b2..7b7c0a5 100644

> --- a/test/validation/pktio/pktio.c

> +++ b/test/validation/pktio/pktio.c

> @@ -493,9 +493,9 @@ static int recv_packets_tmo(odp_pktio_t pktio,

> odp_packet_t pkt_tbl[],

>         odp_pktin_queue_t pktin[MAX_QUEUES];

>         odp_time_t ts1, ts2;

>         int num_rx = 0;

> +       int num_q;

>         int i;

>         int n;

> -       unsigned num_q;

>         unsigned from_val;

>         unsigned *from = NULL;

>

> @@ -513,7 +513,8 @@ static int recv_packets_tmo(odp_pktio_t pktio,

> odp_packet_t pkt_tbl[],

>                         n = odp_pktin_recv_tmo(pktin[0], pkt_tmp, num -

> num_rx,

>                                                tmo);

>                 else

> -                       n = odp_pktin_recv_mq_tmo(pktin, num_q, from,

> pkt_tmp,

> +                       n = odp_pktin_recv_mq_tmo(pktin, (unsigned)num_q,

> +                                                 from, pkt_tmp,

>                                                   num - num_rx, tmo);

>                 ts2 = odp_time_global();

>

> @@ -526,7 +527,7 @@ static int recv_packets_tmo(odp_pktio_t pktio,

> odp_packet_t pkt_tbl[],

>                                 odp_packet_free(pkt_tmp[i]);

>                 }

>                 if (mode == RECV_MQ_TMO)

> -                       CU_ASSERT(from_val < num_q);

> +                       CU_ASSERT(from_val < (unsigned)num_q);

>         } while (num_rx < num);

>

>         if (tmo == ODP_PKTIN_WAIT)

> --

> 2.7.1.250.gff4ea60

>

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>
Maxim Uvarov May 13, 2016, 2:01 p.m. UTC | #2
Merged,
Maxim.

On 05/12/16 21:43, Bill Fischofer wrote:
>
>
> On Thu, May 12, 2016 at 10:20 AM, Maxim Uvarov 
> <maxim.uvarov@linaro.org <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     Fix wrong return code check due to assignment to unsigned variable.
>     https://bugs.linaro.org/show_bug.cgi?id=2224
>
>     Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org
>     <mailto:maxim.uvarov@linaro.org>>
>
>
> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org 
> <mailto:bill.fischofer@linaro.org>>
>
>     ---
>      test/validation/pktio/pktio.c | 7 ++++---
>      1 file changed, 4 insertions(+), 3 deletions(-)
>
>     diff --git a/test/validation/pktio/pktio.c
>     b/test/validation/pktio/pktio.c
>     index a51e0b2..7b7c0a5 100644
>     --- a/test/validation/pktio/pktio.c
>     +++ b/test/validation/pktio/pktio.c
>     @@ -493,9 +493,9 @@ static int recv_packets_tmo(odp_pktio_t pktio,
>     odp_packet_t pkt_tbl[],
>             odp_pktin_queue_t pktin[MAX_QUEUES];
>             odp_time_t ts1, ts2;
>             int num_rx = 0;
>     +       int num_q;
>             int i;
>             int n;
>     -       unsigned num_q;
>             unsigned from_val;
>             unsigned *from = NULL;
>
>     @@ -513,7 +513,8 @@ static int recv_packets_tmo(odp_pktio_t pktio,
>     odp_packet_t pkt_tbl[],
>                             n = odp_pktin_recv_tmo(pktin[0], pkt_tmp,
>     num - num_rx,
>                                                    tmo);
>                     else
>     -                       n = odp_pktin_recv_mq_tmo(pktin, num_q,
>     from, pkt_tmp,
>     +                       n = odp_pktin_recv_mq_tmo(pktin,
>     (unsigned)num_q,
>     +                                                 from, pkt_tmp,
>                                                       num - num_rx, tmo);
>                     ts2 = odp_time_global();
>
>     @@ -526,7 +527,7 @@ static int recv_packets_tmo(odp_pktio_t pktio,
>     odp_packet_t pkt_tbl[],
>     odp_packet_free(pkt_tmp[i]);
>                     }
>                     if (mode == RECV_MQ_TMO)
>     -                       CU_ASSERT(from_val < num_q);
>     +                       CU_ASSERT(from_val < (unsigned)num_q);
>             } while (num_rx < num);
>
>             if (tmo == ODP_PKTIN_WAIT)
>     --
>     2.7.1.250.gff4ea60
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
diff mbox

Patch

diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
index a51e0b2..7b7c0a5 100644
--- a/test/validation/pktio/pktio.c
+++ b/test/validation/pktio/pktio.c
@@ -493,9 +493,9 @@  static int recv_packets_tmo(odp_pktio_t pktio, odp_packet_t pkt_tbl[],
 	odp_pktin_queue_t pktin[MAX_QUEUES];
 	odp_time_t ts1, ts2;
 	int num_rx = 0;
+	int num_q;
 	int i;
 	int n;
-	unsigned num_q;
 	unsigned from_val;
 	unsigned *from = NULL;
 
@@ -513,7 +513,8 @@  static int recv_packets_tmo(odp_pktio_t pktio, odp_packet_t pkt_tbl[],
 			n = odp_pktin_recv_tmo(pktin[0], pkt_tmp, num - num_rx,
 					       tmo);
 		else
-			n = odp_pktin_recv_mq_tmo(pktin, num_q, from, pkt_tmp,
+			n = odp_pktin_recv_mq_tmo(pktin, (unsigned)num_q,
+						  from, pkt_tmp,
 						  num - num_rx, tmo);
 		ts2 = odp_time_global();
 
@@ -526,7 +527,7 @@  static int recv_packets_tmo(odp_pktio_t pktio, odp_packet_t pkt_tbl[],
 				odp_packet_free(pkt_tmp[i]);
 		}
 		if (mode == RECV_MQ_TMO)
-			CU_ASSERT(from_val < num_q);
+			CU_ASSERT(from_val < (unsigned)num_q);
 	} while (num_rx < num);
 
 	if (tmo == ODP_PKTIN_WAIT)