From nobody Mon Feb 9 14:06:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1559652116; cv=none; d=zoho.com; s=zohoarc; b=DhyeC/L2qUdg0COcL42zLahatGRr2i972dP/Y/5yc3TU4y8GlDQ+hrf9l0X4AMizYVZ9ozo/Lcgy+IeHBwaFSEjjJuV8N+iWrMTEb7QQgm/1uCx4mttXfGIrEumaRTZb7OnKatRJpEOXM8Z2XOz9lcoy5yzblgMiRLfVkrUxVsA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559652116; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=WPYTUL/+4lh4Ua42ZE+WCTxVkMRqarIJLWl5JYYENeg=; b=Lia6NTVSbfcZbtVH8U9PSRYPuSAj5EqbMksK+tm/WSU8/UDQych/p92eAA9R0oSKNtGCgyqOz+sGPvmyHch5bSDAlaNvQAAh8kLDRu+OwVkP96SMY7X72yDPPChr1yCxp3/gJUZ1xi3ZWrRCc3kYfGbNfwtDp+JfAYcn59gjdsE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1559652116897389.67836797417385; Tue, 4 Jun 2019 05:41:56 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hY8k2-00025M-T0; Tue, 04 Jun 2019 12:40:38 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hY8k2-00025E-6r for xen-devel@lists.xenproject.org; Tue, 04 Jun 2019 12:40:38 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id f388c54e-86c5-11e9-8980-bc764e045a96; Tue, 04 Jun 2019 12:40:36 +0000 (UTC) X-Inumbo-ID: f388c54e-86c5-11e9-8980-bc764e045a96 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@MIAPEX02MSOL02.citrite.net Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=23.29.105.83; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 23.29.105.83 as permitted sender) identity=mailfrom; client-ip=23.29.105.83; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:23.29.105.83 ip4:162.221.156.50 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@MIAPEX02MSOL02.citrite.net) identity=helo; client-ip=23.29.105.83; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@MIAPEX02MSOL02.citrite.net"; x-conformance=sidf_compatible IronPort-SDR: iSyZ+JvwOIsFbC6ic5kUytNcmGsd1auqrxjzsz0Uy2LlVwIV6StnFeY5cJ2uL1Ae4QqeUwEgTF GBf33jLwJt1mw99bolE0n0WWeure+cVbek8K4LG2lCCN6nC8FGWmHWgPeCwNOis4iLa399o6kY mCVC9netValR/sQd9YBU+1TAGz0KMk4HIUQB6m/DIJ9eKYHN1l/H1CHcDw6wthk8TePhJvB1co Ls43WWYJiRsnXZpl39oZr13TiXNSX+GzjtjCh0ajKg8FlzfeeHUxUeKCfCyFgn1nvGu4FdWrWN DVQ= X-SBRS: 2.7 X-MesageID: 1287738 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 23.29.105.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.60,550,1549947600"; d="scan'208";a="1287738" From: Andrew Cooper To: Xen-devel Date: Tue, 4 Jun 2019 13:40:23 +0100 Message-ID: <1559652023-26502-1-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] xen/bitops: Further reduce the #ifdef-ary in generic_hweight64() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This #ifdef-ary isn't necessary, and the logic can live in a plain if() No functional change. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- xen/include/xen/bitops.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h index b512800..dfb7041 100644 --- a/xen/include/xen/bitops.h +++ b/xen/include/xen/bitops.h @@ -184,10 +184,9 @@ static inline unsigned int generic_hweight8(unsigned i= nt w) =20 static inline unsigned int generic_hweight64(uint64_t w) { -#if BITS_PER_LONG < 64 - return generic_hweight32((unsigned int)(w >> 32)) + - generic_hweight32((unsigned int)w); -#else + if ( BITS_PER_LONG < 64 ) + return generic_hweight32(w >> 32) + generic_hweight32(w); + w -=3D (w >> 1) & 0x5555555555555555ul; w =3D (w & 0x3333333333333333ul) + ((w >> 2) & 0x3333333333333333ul); w =3D (w + (w >> 4)) & 0x0f0f0f0f0f0f0f0ful; @@ -199,7 +198,6 @@ static inline unsigned int generic_hweight64(uint64_t w) w +=3D w >> 16; =20 return (w + (w >> 32)) & 0xFF; -#endif } =20 static inline unsigned long hweight_long(unsigned long w) --=20 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel