From patchwork Mon Mar 28 05:28:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 64513 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1268358lbc; Sun, 27 Mar 2016 22:29:12 -0700 (PDT) X-Received: by 10.50.20.98 with SMTP id m2mr8044902ige.9.1459142952354; Sun, 27 Mar 2016 22:29:12 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id m63si21425851ioi.64.2016.03.27.22.29.11; Sun, 27 Mar 2016 22:29:12 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 952AA616DF; Mon, 28 Mar 2016 05:29:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 78170616A2; Mon, 28 Mar 2016 05:29:07 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 292D6616A7; Mon, 28 Mar 2016 05:29:06 +0000 (UTC) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by lists.linaro.org (Postfix) with ESMTPS id 206656169C for ; Mon, 28 Mar 2016 05:29:05 +0000 (UTC) Received: by mail-pa0-f53.google.com with SMTP id tt10so90330744pab.3 for ; Sun, 27 Mar 2016 22:29:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SKWypPLwm1MYVMyBFUcNT2Eu80ovGHuQm23RjnffnAc=; b=IjcTw1tlcdsoFDG+HjDCGE2w7gU64zou5XynIbXJV930UTwJltF800zVenglMPL87N AqsiDWuFDyxeXS4RPueSAZcRba6fMeAE2VnlLFFgve19LAErtPcRI+8K6ekqGIYXb2ss 74u7Ak/gkGxrejcnPne4BzSzY9ITC80J0MxclS6A/NaKHSUhOgo8rdxW97dbXfgLSq95 D6Z3VspZH/Gh2VCBER5oQKW5gLp5GQGdWDiO+zV4X4CCBqXEVxqVgKx+TSFKZ4ErdoDm K1gnZz33TJ6ooMSoF33N8GvFcOKE8EuOSWRaPTCDjZcbS7b/DylIoC9oyBfrpWctgXIP YKFw== X-Gm-Message-State: AD7BkJJ4/uTVb1TFPNU9E0x5l24EbUZm2Li8oNHLKRQ+AYLCFhCRTcKecUlw8oHpGB701GdC33Y= X-Received: by 10.67.8.100 with SMTP id dj4mr39903860pad.88.1459142944455; Sun, 27 Mar 2016 22:29:04 -0700 (PDT) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id h2sm32038528pfd.91.2016.03.27.22.29.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 27 Mar 2016 22:29:03 -0700 (PDT) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Mon, 28 Mar 2016 10:58:44 +0530 Message-Id: <1459142924-5083-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] linux-generic: traffic-manager: fix integer handling issue X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Fixes: https://bugs.linaro.org/show_bug.cgi?id=2122 Signed-off-by: Balasubramanian Manoharan Reviewed-by: Bill Fischofer --- platform/linux-generic/odp_timer_wheel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_timer_wheel.c b/platform/linux-generic/odp_timer_wheel.c index 638edf4..8b8ca87 100644 --- a/platform/linux-generic/odp_timer_wheel.c +++ b/platform/linux-generic/odp_timer_wheel.c @@ -167,7 +167,8 @@ static uint32_t _odp_internal_ilog2(uint64_t value) uint32_t bit_shift; for (bit_shift = 0; bit_shift < 64; bit_shift++) { - pwr_of_2 = 1 << bit_shift; + /* FIX: BUG2122 Coverity issue */ + pwr_of_2 = (uint64_t)1 << bit_shift; if (value == pwr_of_2) return bit_shift; else if (value < pwr_of_2)