From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 29B6AA056A; Wed, 10 Mar 2021 19:31:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B443322A3D4; Wed, 10 Mar 2021 19:31:06 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 454B340F35 for ; Wed, 10 Mar 2021 19:31:05 +0100 (CET) IronPort-SDR: 1IlbFnRK+GHVL0QGXOdKN6MkhWphjl6z5UAnfuKFgwiBzkYbZyJMcI/iamM7lYIoGzyEzBW/ow k9ClDlmFD0hg== X-IronPort-AV: E=McAfee;i="6000,8403,9919"; a="187897566" X-IronPort-AV: E=Sophos;i="5.81,237,1610438400"; d="scan'208";a="187897566" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2021 10:31:04 -0800 IronPort-SDR: q+IuDMlyKwXrnGUJ6Qm4dwV0GbVtikb+C/DZjc//DUUC7s10TC7l63CfoISx00x3BXic7XuDlm 4fpMaQEuJaZA== X-IronPort-AV: E=Sophos;i="5.81,237,1610438400"; d="scan'208";a="520817521" Received: from rmenon-desk.amr.corp.intel.com (HELO [10.166.30.253]) ([10.166.30.253]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2021 10:31:03 -0800 To: Tyler Retzlaff , dev@dpdk.org Cc: anatoly.burakov@intel.com References: <1615358466-12761-1-git-send-email-roretzla@linux.microsoft.com> From: Ranjit Menon Message-ID: Date: Wed, 10 Mar 2021 10:31:03 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <1615358466-12761-1-git-send-email-roretzla@linux.microsoft.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH] librte_eal/common: fix return type of rte_bsf64 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 3/9/2021 10:41 PM, Tyler Retzlaff wrote: > based on the original commit and the usage of rte_bsf64 it appears the > function should always have returned uint32_t instead of int which is > consistent with the cast introduced in the return statement. > > Fixes: 4e261f551986 ("eal: add 64-bit bsf and 32-bit safe bsf > functions") > Cc: anatoly.burakov@intel.com > > Signed-off-by: Tyler Retzlaff > --- > lib/librte_eal/include/rte_common.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h > index 1b630baf1..5e70ee7a8 100644 > --- a/lib/librte_eal/include/rte_common.h > +++ b/lib/librte_eal/include/rte_common.h > @@ -679,7 +679,7 @@ rte_fls_u32(uint32_t x) > * @return > * least significant set bit in the input parameter. > */ > -static inline int > +static inline uint32_t > rte_bsf64(uint64_t v) > { > return (uint32_t)__builtin_ctzll(v); Acked-by: Ranjit Menon