From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH] eventdev: fix dequeue timeout bitmask brackets Date: Sat, 15 Apr 2017 10:28:12 +0530 Message-ID: <20170415045811.GA9449@jerin> References: <1492185898-43547-1-git-send-email-harry.van.haaren@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Harry van Haaren Return-path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0054.outbound.protection.outlook.com [104.47.41.54]) by dpdk.org (Postfix) with ESMTP id 395FF2BB1 for ; Sat, 15 Apr 2017 06:58:40 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1492185898-43547-1-git-send-email-harry.van.haaren@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- > Date: Fri, 14 Apr 2017 17:04:58 +0100 > From: Harry van Haaren > To: dev@dpdk.org > CC: jerin.jacob@caviumnetworks.com, Harry van Haaren > > Subject: [PATCH] eventdev: fix dequeue timeout bitmask brackets > X-Mailer: git-send-email 2.7.4 > > Fix brackets around the & operator to first mask a single bit > and then perform the not operator. Previously the result was > not as expected, due to the ! operator being performed first. > > As noted on list[1] Clang 4.0 warns about a possible bug for > this type of line: > if (!variable & FLAG) { > > Fixes: 4f0804bbdfb9 ("eventdev: implement the northbound APIs") > > Signed-off-by: Harry van Haaren Acked-by: Jerin Jacob > > [1] http://dpdk.org/ml/archives/dev/2017-April/064089.html > --- > lib/librte_eventdev/rte_eventdev.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c > index 8042988..a64071e 100644 > --- a/lib/librte_eventdev/rte_eventdev.c > +++ b/lib/librte_eventdev/rte_eventdev.c > @@ -368,7 +368,8 @@ rte_event_dev_configure(uint8_t dev_id, > (*dev->dev_ops->dev_infos_get)(dev, &info); > > /* Check dequeue_timeout_ns value is in limit */ > - if (!dev_conf->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT) { > + if (!(dev_conf->event_dev_cfg & > + RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT)) { > if (dev_conf->dequeue_timeout_ns < info.min_dequeue_timeout_ns > || dev_conf->dequeue_timeout_ns > > info.max_dequeue_timeout_ns) { > -- > 2.7.4 >