From patchwork Wed Aug 28 22:03:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13782013 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFF1CC71153 for ; Wed, 28 Aug 2024 22:04:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.785168.1194616 (Exim 4.92) (envelope-from ) id 1sjQlq-0007Ss-A2; Wed, 28 Aug 2024 22:04:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 785168.1194616; Wed, 28 Aug 2024 22:04:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sjQlq-0007Sc-5I; Wed, 28 Aug 2024 22:04:06 +0000 Received: by outflank-mailman (input) for mailman id 785168; Wed, 28 Aug 2024 22:04:04 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sjQlo-0006E0-Fb for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 22:04:04 +0000 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [2a00:1450:4864:20::533]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 702a4b3d-6589-11ef-a0b0-8be0dac302b0; Thu, 29 Aug 2024 00:04:04 +0200 (CEST) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5c0abaae174so4210006a12.1 for ; Wed, 28 Aug 2024 15:04:04 -0700 (PDT) Received: from andrewcoop.eng.citrite.net ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c0bb1c2d2esm2695898a12.16.2024.08.28.15.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2024 15:04:01 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 702a4b3d-6589-11ef-a0b0-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1724882643; x=1725487443; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1d4T7bgcWZFGEOhnXIFX9rzTrMxxv0mMcntif1gRWqE=; b=rDw/v8bnzRTZHYzsgx9qQyUe+lDE7zoQbJXY3qfHCrH/mg8bbfkUd0Su/1Vu/0MNGg j0zR7Pib5OFCMbqvpBxVz8fH+MM8gC19U9Jt27euoeltoTuwOJVPxK3xtos5A8Q30ho0 z4nwJ4qqNGLBjyvaYWxs0PgLPFSVcLyolk734= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724882643; x=1725487443; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1d4T7bgcWZFGEOhnXIFX9rzTrMxxv0mMcntif1gRWqE=; b=cql2E8ZC2XHcazHTP+ukJ/6zv42aBKEZDF9+RUsnxgF5rDCprgaL869n1M4XpWzIN1 9Xiok5uktFD5X0KAzrkmDJbKtO13Qd2StZpZAfyMRa9m97LcJ6Eoantt7OQgje8W7oXG VLiAoYOju5VDpZ7BTORNGmshxp0VEPOXXs0PXVkeoWkkX4ei+7yCG07mlr/LNX6M4bRH JAXJvnXE3C1Xsxju0gZ+S6T4nhS/p/dYFNwTviJR6/UMxD1AvEY3j10znrF3FAIAe0Qv jR2rZKjlAdCTY7cSen0VRF21B/uN+FsJY+NRVl0AAmF3IQcZPKK5oQcTXpONAB0xWQqj MWaQ== X-Gm-Message-State: AOJu0YzYNc8jeASN8jAl4zcoKGUWB7XU+lJAtw/uXkVVMJmWTycaD8vz OStrptz00JAD8Fc7SVT0EnomPlXSfG2iHtmh1m1O8IdaDY0C8vFI/NcjIrIFdCjQPNjdcQR77Lx k X-Google-Smtp-Source: AGHT+IF7BfYv8A77TM6Js7u46H/5nrrqGXZxWpYnBfYsiP2mHja+VUkq+v83YoMCSlV9Z3MbjxLEzg== X-Received: by 2002:a05:6402:518e:b0:5be:fc44:d159 with SMTP id 4fb4d7f45d1cf-5c21ed52ba1mr605962a12.22.1724882642446; Wed, 28 Aug 2024 15:04:02 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand Marquis , Michal Orzel , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH v2 06/11] xen/bitops: Drop the remnants of hweight{8,16}() Date: Wed, 28 Aug 2024 23:03:46 +0100 Message-Id: <20240828220351.2686408-7-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240828220351.2686408-1-andrew.cooper3@citrix.com> References: <20240828220351.2686408-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 They are no more. No functional change. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel CC: Oleksii Kurochko CC: Shawn Anastasio --- xen/arch/arm/include/asm/bitops.h | 2 -- xen/arch/ppc/include/asm/bitops.h | 2 -- xen/arch/x86/include/asm/bitops.h | 2 -- xen/include/xen/bitops.h | 17 ----------------- 4 files changed, 23 deletions(-) diff --git a/xen/arch/arm/include/asm/bitops.h b/xen/arch/arm/include/asm/bitops.h index 3c023103f734..91cd167b6bbb 100644 --- a/xen/arch/arm/include/asm/bitops.h +++ b/xen/arch/arm/include/asm/bitops.h @@ -86,8 +86,6 @@ bool clear_mask16_timeout(uint16_t mask, volatile void *p, */ #define hweight64(x) generic_hweight64(x) #define hweight32(x) generic_hweight32(x) -#define hweight16(x) generic_hweight16(x) -#define hweight8(x) generic_hweight8(x) #endif /* _ARM_BITOPS_H */ /* diff --git a/xen/arch/ppc/include/asm/bitops.h b/xen/arch/ppc/include/asm/bitops.h index eb3355812ea3..a62c4f99c3bb 100644 --- a/xen/arch/ppc/include/asm/bitops.h +++ b/xen/arch/ppc/include/asm/bitops.h @@ -132,7 +132,5 @@ static inline int test_and_set_bit(unsigned int nr, volatile void *addr) */ #define hweight64(x) __builtin_popcountll(x) #define hweight32(x) __builtin_popcount(x) -#define hweight16(x) __builtin_popcount((uint16_t)(x)) -#define hweight8(x) __builtin_popcount((uint8_t)(x)) #endif /* _ASM_PPC_BITOPS_H */ diff --git a/xen/arch/x86/include/asm/bitops.h b/xen/arch/x86/include/asm/bitops.h index 8c0403405aa2..4c5b21907a64 100644 --- a/xen/arch/x86/include/asm/bitops.h +++ b/xen/arch/x86/include/asm/bitops.h @@ -483,7 +483,5 @@ static always_inline unsigned int arch_flsl(unsigned long x) */ #define hweight64(x) generic_hweight64(x) #define hweight32(x) generic_hweight32(x) -#define hweight16(x) generic_hweight16(x) -#define hweight8(x) generic_hweight8(x) #endif /* _X86_BITOPS_H */ diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h index e7c2c5598275..1c160b643ed6 100644 --- a/xen/include/xen/bitops.h +++ b/xen/include/xen/bitops.h @@ -395,23 +395,6 @@ static inline unsigned int generic_hweight32(unsigned int w) return (w + (w >> 16)) & 0xff; } -static inline unsigned int generic_hweight16(unsigned int w) -{ - w -= ((w >> 1) & 0x5555); - w = (w & 0x3333) + ((w >> 2) & 0x3333); - w = (w + (w >> 4)) & 0x0f0f; - - return (w + (w >> 8)) & 0xff; -} - -static inline unsigned int generic_hweight8(unsigned int w) -{ - w -= ((w >> 1) & 0x55); - w = (w & 0x33) + ((w >> 2) & 0x33); - - return (w + (w >> 4)) & 0x0f; -} - static inline unsigned int generic_hweight64(uint64_t w) { if ( BITS_PER_LONG < 64 )