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 95FC7A0542; Wed, 5 Oct 2022 17:15:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6BC9940694; Wed, 5 Oct 2022 17:15:34 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id CCA0B40143 for ; Wed, 5 Oct 2022 17:15:32 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 2AEC120E97BC; Wed, 5 Oct 2022 08:15:32 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2AEC120E97BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1664982932; bh=F7KLfZAz5dYno+/JXblBle0+mc26XebwGMyTnL6F8MU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=s7bJE6PpyicXr/WvalnDxYjujb6yDtvsR3Tp0A4ClCBEv+w1PTjttDMD4/umnmT8i 7spaTdV8uB+t/Io8IAlKzzmANH9NGJjtRodRZRpSEnyP7JC+wiOl/9dDa8VDcUmKfC WQHWgL9zBHz1WVtz9fTlGvuZODjYlOFBSoVUBLMs= Date: Wed, 5 Oct 2022 08:15:32 -0700 From: Tyler Retzlaff To: Thomas Monjalon Cc: dev@dpdk.org, anatoly.burakov@intel.com, ranjit.menon@intel.com, mb@smartsharesystems.com, Tyler Retzlaff , stephen@networkplumber.org Subject: Re: [PATCH 2/3] eal: change rte_fls and rte_bsf to return uint32_t Message-ID: <20221005151532.GA7581@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1615418650-19513-1-git-send-email-roretzla@linux.microsoft.com> <1659993692-17479-1-git-send-email-roretzla@linux.microsoft.com> <1659993692-17479-3-git-send-email-roretzla@linux.microsoft.com> <1849229.jbyF5MZJ3u@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1849229.jbyF5MZJ3u@thomas> User-Agent: Mutt/1.5.21 (2010-09-15) 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 On Wed, Oct 05, 2022 at 11:02:45AM +0200, Thomas Monjalon wrote: > 08/08/2022 23:21, Tyler Retzlaff: > > From: Tyler Retzlaff > > > > You forgot the _safe versions: > > --- a/lib/eal/include/rte_common.h > +++ b/lib/eal/include/rte_common.h > @@ -660,7 +660,7 @@ rte_bsf32(uint32_t v) > * @return > * Returns 0 if ``v`` was 0, otherwise returns 1. > */ > -static inline int > +static inline uint32_t > rte_bsf32_safe(uint32_t v, uint32_t *pos) > { > if (v == 0) > @@ -739,7 +739,7 @@ rte_bsf64(uint64_t v) > * @return > * Returns 0 if ``v`` was 0, otherwise returns 1. > */ > -static inline int > +static inline uint32_t > rte_bsf64_safe(uint64_t v, uint32_t *pos) > { > if (v == 0) > > > > the return values from the _safe versions are `int' treated like a bool type. they have been left as is to be consistent with the rest of dpdk return value types. the non-safe version returns were returning actual values and not an indication of success or failure. they could certainly be changed to C99 fixed width types but if they are changed at all perhaps they should be changed to _Bool or bool from stdbool.h? it looks like this change has been merged already but if you would like to make any further changes let me know i'll take care of it. thanks