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 AE964A00C2; Thu, 6 Oct 2022 20:20:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7EC4B40DDC; Thu, 6 Oct 2022 20:20:54 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id CBE3C40042 for ; Thu, 6 Oct 2022 20:20:52 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 4CAF011458 for ; Thu, 6 Oct 2022 20:20:52 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 4B8E8111FB; Thu, 6 Oct 2022 20:20:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=ALL_TRUSTED, AWL, NICE_REPLY_A autolearn=disabled version=3.4.6 X-Spam-Score: -2.2 Received: from [192.168.1.59] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id C67F411996; Thu, 6 Oct 2022 20:20:48 +0200 (CEST) Message-ID: <31ddddd0-170d-cb5e-f1af-a4c262c1e7d1@lysator.liu.se> Date: Thu, 6 Oct 2022 20:20:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] eal: fix return type of bsf safe functions To: Thomas Monjalon , dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , =?UTF-8?Q?Morten_Br=c3=b8rup?= , =?UTF-8?Q?Mattias_R=c3=b6nnblom?= References: <22501102.ssLaC8jLEa@thomas> <20221005154036.4187143-1-thomas@monjalon.net> Content-Language: en-US From: =?UTF-8?Q?Mattias_R=c3=b6nnblom?= In-Reply-To: <20221005154036.4187143-1-thomas@monjalon.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP 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 2022-10-05 17:40, Thomas Monjalon wrote: > In a recent commit, changing return type from int to uint32_t, > I did a last minute change to functions rte_bsf32_safe and rte_bsf64_safe, > because thought they were forgotten. > Actually these functions are returning 0 or 1, so it should be int. Wouldn't bool be a better choice? > The return type is reverted to the original type for these 2 functions. > > Fixes: 4b81c145ae37 ("eal: change return type of bsf/fls functions") > > Signed-off-by: Thomas Monjalon > --- > lib/eal/include/rte_common.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h > index 23d9e05cbb..15765b408d 100644 > --- 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 uint32_t > +static inline int > 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 uint32_t > +static inline int > rte_bsf64_safe(uint64_t v, uint32_t *pos) > { > if (v == 0)