From patchwork Mon Aug 8 21:21:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 114727 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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 29316A0540; Mon, 8 Aug 2022 23:21:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F302042B9C; Mon, 8 Aug 2022 23:21:39 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id DA22640A7E for ; Mon, 8 Aug 2022 23:21:36 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 205D4210942D; Mon, 8 Aug 2022 14:21:36 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 205D4210942D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1659993696; bh=/LDjnfU1qDiE6sV2RFLWzPWdZiVmRAOzTP9Adaqf6og=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kbrur3UDjHFJ3DRBXl3tVokNln5COzRgK1WYSKxlo5kM4H3s5V0YsrnQzTOL0qJKm zfoTqhvpoUZ5c4wzzXcxHE0MgxXmqiEfaDL4ppWWH30SmBcj7VmB5LseewbypfreML tT58OOeoxCARJ9oUOznMPVEt/8b9nFfi8DZLHdqE= From: Tyler Retzlaff To: dev@dpdk.org Cc: thomas@monjalon.net, anatoly.burakov@intel.com, ranjit.menon@intel.com, mb@smartsharesystems.com, Tyler Retzlaff , Tyler Retzlaff Subject: [PATCH 2/3] eal: change rte_fls and rte_bsf to return uint32_t Date: Mon, 8 Aug 2022 14:21:31 -0700 Message-Id: <1659993692-17479-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1659993692-17479-1-git-send-email-roretzla@linux.microsoft.com> References: <1615418650-19513-1-git-send-email-roretzla@linux.microsoft.com> <1659993692-17479-1-git-send-email-roretzla@linux.microsoft.com> 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 From: Tyler Retzlaff return fixed width uint32_t to be consistent with what appears to be the original authors intent. it doesn't make much sense to return signed integers for these functions. Signed-off-by: Tyler Retzlaff --- lib/eal/include/rte_common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h index a96cc2a..bd4184d 100644 --- a/lib/eal/include/rte_common.h +++ b/lib/eal/include/rte_common.h @@ -707,7 +707,7 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) * @return * The last (most-significant) bit set, or 0 if the input is 0. */ -static inline int +static inline uint32_t rte_fls_u32(uint32_t x) { return (x == 0) ? 0 : 32 - __builtin_clz(x); @@ -724,7 +724,7 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) * @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); @@ -766,7 +766,7 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) * @return * The last (most-significant) bit set, or 0 if the input is 0. */ -static inline int +static inline uint32_t rte_fls_u64(uint64_t x) { return (x == 0) ? 0 : 64 - __builtin_clzll(x);