From patchwork Thu Jan 19 07:21:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi He X-Patchwork-Id: 91839 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp151110qgi; Wed, 18 Jan 2017 23:21:54 -0800 (PST) X-Received: by 10.200.48.235 with SMTP id w40mr6997131qta.72.1484810514188; Wed, 18 Jan 2017 23:21:54 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 43si2052693qtx.313.2017.01.18.23.21.53; Wed, 18 Jan 2017 23:21:54 -0800 (PST) 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 789E160D25; Thu, 19 Jan 2017 07:21:53 +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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 5B3A260BEE; Thu, 19 Jan 2017 07:21:49 +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 83B7C60BE8; Thu, 19 Jan 2017 07:21:47 +0000 (UTC) Received: from mail-pg0-f54.google.com (mail-pg0-f54.google.com [74.125.83.54]) by lists.linaro.org (Postfix) with ESMTPS id 47C9960BE8 for ; Thu, 19 Jan 2017 07:21:46 +0000 (UTC) Received: by mail-pg0-f54.google.com with SMTP id 194so11885106pgd.2 for ; Wed, 18 Jan 2017 23:21:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=u6yWnM+f9GQP+4RJYZELNcx1C1tTXMprypWziqN1sS8=; b=tyjf9p5vfiCYhY6YZCG//ICDohJ/rXV0OVLAPf3zxd+bbFuNTilKXSEV6Q07TXJ5+2 uGmHOeg+jiLJgFhNHMJ/grhhkh+lBuU4/LD2lggp8TObbzycOK56TleDKRrrovxjax2B mY1Hr+1P7xpC4L57y8zSjYsr8h2oJKQ0gmX3snO9Ude/ka/XRmBfkPpSVOAn1wn2Q+fc J8prnIvHevzd0RpWngJXqJFDha8wPd8djYb0SjMBhWOpskY8hkpNhaGF9v/EJ0Pb1ZPq EsciZrbEvfEr/vuZvFtiPQWyNpCHgoC4Rfk70Mld8gjoloVzJjKZp0PJKaAmWVi6/6C0 /p5g== X-Gm-Message-State: AIkVDXKLQbfklRVmFaVKEoqne/HRC6mfTiQ2w++b2DlU0ilPu5XYUPSPBXVRlvGHwr/JzyHjrGs= X-Received: by 10.84.169.36 with SMTP id g33mr11222783plb.36.1484810505515; Wed, 18 Jan 2017 23:21:45 -0800 (PST) Received: from ubuntu.heyii.co (ubuntu.heyii.co. [45.32.66.203]) by smtp.googlemail.com with ESMTPSA id p1sm5804724pgc.29.2017.01.18.23.21.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Jan 2017 23:21:45 -0800 (PST) From: Yi He To: bill.fischofer@linaro.org, lng-odp@lists.linaro.org Date: Thu, 19 Jan 2017 07:21:37 +0000 Message-Id: <1484810497-21359-1-git-send-email-yi.he@linaro.org> X-Mailer: git-send-email 1.9.1 Subject: [lng-odp] [API-NEXT PATCH] linux-gen: align: fix round up power of two 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Fix Bug https://bugs.linaro.org/show_bug.cgi?id=2828 incorrect sizeof expression (BAD_SIZEOF) of ODP_ROUNDUP_POWER_2(literal constant) usage. Signed-off-by: Yi He --- platform/linux-generic/include/odp_align_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/platform/linux-generic/include/odp_align_internal.h b/platform/linux-generic/include/odp_align_internal.h index d9cd30b..2c2f1f5 100644 --- a/platform/linux-generic/include/odp_align_internal.h +++ b/platform/linux-generic/include/odp_align_internal.h @@ -40,7 +40,7 @@ extern "C" { * power of two value. Zero is not supported as an input value. */ #define ODP_ROUNDUP_POWER_2(x)\ - (1 << (((int)(8 * sizeof(x))) - __builtin_clz((x) - 1))) + (1 << (((int)(8 * sizeof(unsigned int))) - __builtin_clz((x) - 1))) /** * @internal