Message ID | 20221005154036.4187143-1-thomas@monjalon.net (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Thomas Monjalon |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 49E5FA0542; Wed, 5 Oct 2022 17:40:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 27F7740694; Wed, 5 Oct 2022 17:40:56 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id AEA5240143 for <dev@dpdk.org>; Wed, 5 Oct 2022 17:40:54 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 79B4C320029B; Wed, 5 Oct 2022 11:40:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 05 Oct 2022 11:40:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1664984453; x=1665070853; bh=Uy gjG2fqMhv+T1p6OqLXttSxaemXa5xPQ3tZuggLDkU=; b=VHgQ+inn0QO78jPDam Q79egW6vGXfrhCA482eg58PGYHf+iPP8lz7g98nczCLeOVqVkfeUnPH8Baueo2un fUuiHibzBwSaOBRyIIU4DZRA+r27yNH4XByEBaqzid5w1opKlZbhMPcRlY7acBCt mpL5wRsBur1ac/n0uyisVwDSZR4vXwmdKiXsHJlULlMlGP8SxtnycTLMwWkx2XwH AZRVB9+/osUs361Zj5JgMeuVu+AQ6xO/7pM9ECa2p9+NRR68I9SIFjuk89oHWjIE 7zYJyUM7175jpxl95tJX4QXT1xkMRwcxHqIm0T9USOfspXH2nxtP8tiMt2MtaQF+ ZOVA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1664984453; x=1665070853; bh=UygjG2fqMhv+T 1p6OqLXttSxaemXa5xPQ3tZuggLDkU=; b=k2L8Q8klKUdt/x8OTsl5Btvax4kxt bFuWfB3z/FvQoLcQS+UAkMLg8JiwtySTGSdAQAqUVkpInn+QT4WLAD5/Km3MWKo1 Ylcp/+zzMgi9hXnVlJokV5mc4y0vgIRUyEoN4758W7MHNhNgiV9n+BZIOxp+mzzv 2ykHkgfyAQixBJ9lBkG6otssJL6ReiFeyd66hrSBN1beyp9e2y9juAcMz/1rw5XG IkuBGiaEfIuyshZdzkdXnoA7gGf59n+Hke4zMcWiGOcydk0nLx/ZjNuEeJKZRywK SfYMVM9ihSdv0mcpssNHzFjTIjneSsGD/M/bkm9aCdHej+eLFUGUOeRbA== X-ME-Sender: <xms:hKU9Y2iRGIHF3YlkGPsa-3iZIGcPDw5UzOB9xl2f6dRRw8bYIG2dag> <xme:hKU9Y3B1740CMxbBf31K-3MUiro-n3OwRhuQ0JjvwmvEZawPQ4JnihylBSmpDe-Qs w9cSPp2JLFAlBEJhA> X-ME-Received: <xmr:hKU9Y-H4F-0yG7kNjSy665QMuSI1lT6ToW-zrmfKeOnTtsY5uln8tQ8VKU2VtfE866_oQSzvuhqy-Zthc8pOvZj1QouvBRA> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeifedgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedvjefhudeghedvtdeijeeigeetuedugfejueekieeltdfhteev keehhfeilefhtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: <xmx:hKU9Y_SJHk8lSFCWVD_TDP9F6rtvaWIybAOLdLM7A7il220BsdGtLQ> <xmx:hKU9Yzy5JSFtZB-pL3h-on3xLKbEus932nEStQz78qqVgup04BuaIQ> <xmx:hKU9Y95isk2drdlxd0UqKM8Wd3-8kEbd0hWuM3AbyHK9vl5gzHu-BQ> <xmx:haU9Y-8xYHooFCNHUDw_T6Hwhi9MwBsZadrAFUjmoY4az7MQ-karvQ> Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 5 Oct 2022 11:40:52 -0400 (EDT) From: Thomas Monjalon <thomas@monjalon.net> To: dev@dpdk.org Cc: Stephen Hemminger <stephen@networkplumber.org>, Tyler Retzlaff <roretzla@linux.microsoft.com>, =?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com> Subject: [PATCH] eal: fix return type of bsf safe functions Date: Wed, 5 Oct 2022 17:40:36 +0200 Message-Id: <20221005154036.4187143-1-thomas@monjalon.net> X-Mailer: git-send-email 2.36.1 In-Reply-To: <22501102.ssLaC8jLEa@thomas> References: <22501102.ssLaC8jLEa@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
eal: fix return type of bsf safe functions
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
ci/github-robot: build | success | github build: passed |
ci/iol-testing | warning | apply patch failure |
Commit Message
Thomas Monjalon
Oct. 5, 2022, 3:40 p.m. UTC
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.
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 <thomas@monjalon.net>
---
lib/eal/include/rte_common.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Wed, Oct 5, 2022 at 5:41 PM Thomas Monjalon <thomas@monjalon.net> 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. > 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 <thomas@monjalon.net> Reviewed-by: David Marchand <david.marchand@redhat.com>
On Wed, Oct 05, 2022 at 09:41:26PM +0200, David Marchand wrote: > On Wed, Oct 5, 2022 at 5:41 PM Thomas Monjalon <thomas@monjalon.net> 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. > > 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 <thomas@monjalon.net> > > Reviewed-by: David Marchand <david.marchand@redhat.com> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
06/10/2022 00:20, Tyler Retzlaff: > On Wed, Oct 05, 2022 at 09:41:26PM +0200, David Marchand wrote: > > On Wed, Oct 5, 2022 at 5:41 PM Thomas Monjalon <thomas@monjalon.net> 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. > > > 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 <thomas@monjalon.net> > > > > Reviewed-by: David Marchand <david.marchand@redhat.com> > > Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Applied, sorry for the noise.
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 <thomas@monjalon.net> > --- > 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)
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)