[v2,1/2] test: fix event timer compiler warning

Message ID 1538027175-87290-1-git-send-email-nikhil.rao@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v2,1/2] test: fix event timer compiler warning |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Rao, Nikhil Sept. 27, 2018, 5:46 a.m. UTC
  Limit the number of objects passed to rte_mempool_put_bulk()
to the size of the object table. This fix eliminates a compiler
warning (array-bounds) triggered when the march command line
parameter to gcc is set to nehalem.

Fixes: d1f3385d0076 ("test: add event timer adapter auto-test")
Cc: erik.g.carrillo@intel.com
Cc: stable@dpdk.org

Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
---

v2:
* fix compiler warning in event timer autotest.

 test/test/test_event_timer_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Bruce Richardson Sept. 27, 2018, 11:08 a.m. UTC | #1
On Thu, Sep 27, 2018 at 11:16:14AM +0530, Nikhil Rao wrote:
> Limit the number of objects passed to rte_mempool_put_bulk()
> to the size of the object table. This fix eliminates a compiler
> warning (array-bounds) triggered when the march command line
> parameter to gcc is set to nehalem.
> 
> Fixes: d1f3385d0076 ("test: add event timer adapter auto-test")
> Cc: erik.g.carrillo@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Jerin Jacob Sept. 28, 2018, 10:36 a.m. UTC | #2
-----Original Message-----
> Date: Thu, 27 Sep 2018 12:08:56 +0100
> From: Bruce Richardson <bruce.richardson@intel.com>
> To: Nikhil Rao <nikhil.rao@intel.com>
> CC: thomas@monjalon.net, jerin.jacob@caviumnetworks.com, dev@dpdk.org,
>  erik.g.carrillo@intel.com, stable@dpdk.org
> Subject: Re: [PATCH v2 1/2] test: fix event timer compiler warning
> User-Agent: Mutt/1.10.1 (2018-07-13)
> 
> 
> On Thu, Sep 27, 2018 at 11:16:14AM +0530, Nikhil Rao wrote:
> > Limit the number of objects passed to rte_mempool_put_bulk()
> > to the size of the object table. This fix eliminates a compiler
> > warning (array-bounds) triggered when the march command line
> > parameter to gcc is set to nehalem.
> >
> > Fixes: d1f3385d0076 ("test: add event timer adapter auto-test")
> > Cc: erik.g.carrillo@intel.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> > ---
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied to dpdk-next-eventdev/master. Thanks.
  

Patch

diff --git a/test/test/test_event_timer_adapter.c b/test/test/test_event_timer_adapter.c
index 93471db..a45b7d1 100644
--- a/test/test/test_event_timer_adapter.c
+++ b/test/test/test_event_timer_adapter.c
@@ -792,7 +792,7 @@ 
 		TEST_ASSERT_EQUAL(n, ret, "Failed to cancel complete burst of "
 				  "event timers");
 		rte_mempool_put_bulk(eventdev_test_mempool, (void **)ev_tim,
-				ret);
+				RTE_MIN(ret, MAX_BURST));
 
 		cancel_count += ret;
 	}