From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7D4DC5688 for ; Fri, 14 Apr 2017 18:05:08 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Apr 2017 09:05:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,199,1488873600"; d="scan'208";a="74162619" Received: from silpixa00398672.ir.intel.com ([10.237.223.128]) by orsmga002.jf.intel.com with ESMTP; 14 Apr 2017 09:05:04 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: jerin.jacob@caviumnetworks.com, Harry van Haaren Date: Fri, 14 Apr 2017 17:04:58 +0100 Message-Id: <1492185898-43547-1-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] eventdev: fix dequeue timeout bitmask brackets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 16:05:10 -0000 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 [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