From patchwork Wed Sep 4 22:55:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13791482 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 CC996CD4F4B for ; Wed, 4 Sep 2024 22:55:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.790820.1200609 (Exim 4.92) (envelope-from ) id 1slyuc-0001zr-M7; Wed, 04 Sep 2024 22:55:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 790820.1200609; Wed, 04 Sep 2024 22:55:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slyuc-0001zg-JK; Wed, 04 Sep 2024 22:55:42 +0000 Received: by outflank-mailman (input) for mailman id 790820; Wed, 04 Sep 2024 22:55:40 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slyua-0001Vf-L5 for xen-devel@lists.xenproject.org; Wed, 04 Sep 2024 22:55:40 +0000 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [2a00:1450:4864:20::52c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id cde1f527-6b10-11ef-99a1-01e77a169b0f; Thu, 05 Sep 2024 00:55:39 +0200 (CEST) Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5c09fd20eddso169692a12.3 for ; Wed, 04 Sep 2024 15:55:39 -0700 (PDT) Received: from andrewcoop.eng.citrite.net ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8a679755b3sm21546166b.146.2024.09.04.15.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 15:55:35 -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: cde1f527-6b10-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1725490538; x=1726095338; 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=n1i07dEr5xjoYZGp4+3iu4w7N+mO8cikgWiOPeIxB34=; b=HBrQW0Ucc8kdRydaiwxvOAMI4sODI+Ijlhrne5/KjYIgtyJJV/ojhIlcJTJCio0wwb Th24cl5PvXcUNH+dZuKBTjvf7uKKIQzihg4p1OAVGcCQ0ZgAI7GFnmsNn72YtnH45SLj oLRPWShDysusgLmOOo4DdhgeiMklBUrMjhHkQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725490538; x=1726095338; 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=n1i07dEr5xjoYZGp4+3iu4w7N+mO8cikgWiOPeIxB34=; b=QpbAhWQz30n73oZ0ROoXgVmTYK5ikjU3nn6L68ciMgfUxYShWsdoC3DvR6H4ITaVde MfzcsGNlFss6W7lO52Xf9IAmWrU4wV4J9gZA7mCfHEG6MsUU66ynH8CaGabxJxfEUFjl LewJN6KaAicPqD9mO2+L6Spt+RB8EI4ZMo8IwZjI/bwueKOMqPm+wjZr25Ck+KDJAlxy BoxKcSf1PcMzYzjDug3/Rd6T+oHguhMQED8U5PzzsnqOFX3KPeuzAE/wh1OAAAouf+eH wc6FcXovQh9z1DctCUQbcZfaZ0CrWhra0jTEyFQu59khNmWR8dj9L+Wm2NjtAntm8Sv3 fTgg== X-Gm-Message-State: AOJu0Ywg9LYOArvSLX8mf6UfksAZSO4qLprYoV0Ks2f6K94ACrFIiHiu Pbv9KQbZ7LBqH5DzlYnetZ+kotbwvMnozTEtDeo/RcpaidnKSQ97hQfUAu1FFjBehDqw80jRtSP o X-Google-Smtp-Source: AGHT+IGmD25QJYk6ymyce2efzSO/kxV6Ds+Iw/QZfDQRrhmzCGhKgvvxhkQ9tc8SBF+0sjO2Cyq1Ug== X-Received: by 2002:a17:907:3fa9:b0:a86:4649:28e6 with SMTP id a640c23a62f3a-a897fad290emr1957484366b.57.1725490537574; Wed, 04 Sep 2024 15:55:37 -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 v3 2/5] xen/bitops: Drop the remnants of hweight{8,16}() Date: Wed, 4 Sep 2024 23:55:27 +0100 Message-Id: <20240904225530.3888315-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240904225530.3888315-1-andrew.cooper3@citrix.com> References: <20240904225530.3888315-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 Acked-by: Stefano Stabellini Acked-by: Shawn Anastasio --- 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 6e4e112b8b92..64512e949530 100644 --- a/xen/arch/ppc/include/asm/bitops.h +++ b/xen/arch/ppc/include/asm/bitops.h @@ -134,7 +134,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 6f8e36f1c755..58c600155f7e 100644 --- a/xen/include/xen/bitops.h +++ b/xen/include/xen/bitops.h @@ -413,23 +413,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 )