From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8B5BC432C0 for ; Tue, 19 Nov 2019 11:30:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB36122302 for ; Tue, 19 Nov 2019 11:30:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727682AbfKSLaw (ORCPT ); Tue, 19 Nov 2019 06:30:52 -0500 Received: from mx2.suse.de ([195.135.220.15]:60704 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725280AbfKSLaw (ORCPT ); Tue, 19 Nov 2019 06:30:52 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id EFF35BC38; Tue, 19 Nov 2019 11:30:49 +0000 (UTC) Message-ID: <052d07fb4eb79b29dd58cab577d59bab6684329a.camel@suse.de> Subject: Re: [PATCH v2 1/6] linux/log2.h: Add roundup/rounddown_pow_two64() family of functions From: Nicolas Saenz Julienne To: Andrew Murray Cc: Heiko Stuebner , linux-pci@vger.kernel.org, Shawn Lin , Christoph Hellwig , Marek Szyprowski , Lorenzo Pieralisi , linux-rdma@vger.kernel.org, maz@kernel.org, phil@raspberrypi.org, iommu@lists.linux-foundation.org, linux-rockchip@lists.infradead.org, f.fainelli@gmail.com, Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, mbrugger@suse.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jeremy.linton@arm.com, Tom Joseph , wahrenst@gmx.net, james.quinlan@broadcom.com, Robin Murphy , "David S. Miller" , Tariq Toukan Date: Tue, 19 Nov 2019 12:30:47 +0100 In-Reply-To: <20191119111320.GP43905@e119886-lin.cambridge.arm.com> References: <20191112155926.16476-1-nsaenzjulienne@suse.de> <20191112155926.16476-2-nsaenzjulienne@suse.de> <20191119111320.GP43905@e119886-lin.cambridge.arm.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-JCAElqvKu605DtMG+rxz" User-Agent: Evolution 3.34.1 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org --=-JCAElqvKu605DtMG+rxz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Andrew, thanks for the review. > > +/** > > + * __roundup_pow_of_two64() - round 64bit value up to nearest power of= two > > + * @n: value to round up > > + */ > > +static inline __attribute__((const)) __u64 __roundup_pow_of_two64(__u6= 4 n) >=20 > To be consistent with other functions in the same file (__ilog_u64) you m= ay > want to rename this to __roundup_pow_of_two_u64. Sounds good to me. > Also do you know why u64 is used in some places and __u64 in others? That's unwarranted, it should be __u64 everywhere. > > +{ > > + return 1UL << fls64(n - 1); >=20 > Does this need to be (and for the others): >=20 > return 1ULL << fls64(n - 1); >=20 > Notice that the PCI drivers you convert, all use 1ULL. Noted Regards, Nicolas --=-JCAElqvKu605DtMG+rxz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAl3T0mcACgkQlfZmHno8 x/6BgQf9EPIQKoR6phksU0S8lgk9wqpGnUdxBbs82aHnTqsDgCrCDSnKXEYjrytg JP7gToqXjInWjAuYTza/e4u4j4nQShrZSrX/Wo7n0g/iOPzIrKgFEwt/I8JlZnxn eGSGgGDLXcFOIXzSy7aNsDEOHM1JS3Nan1xj+4vfNYb5bx3U7VlJuAAVsNZ7aLHu 1JSo56OTcTN6DejhWw1GzvlTsqzLUa41v8BUgW19GyOv185sXkbfJImn1hgkRuKj JHu3GwUlrQkRrcAs0xqLRflUJHE8If7t+Xh+Su4ToLjWKyWvMu4fnPpwFXCyHhyG T2k6eYGiEuyKMYHxJg9YLmvjNMdJuA== =s9/D -----END PGP SIGNATURE----- --=-JCAElqvKu605DtMG+rxz-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25E9EC432C0 for ; Tue, 19 Nov 2019 11:30:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA3622230C for ; Tue, 19 Nov 2019 11:30:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oA4PWEYn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA3622230C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Date:To:From:Subject:Message-ID:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YUF3tgcR2O/029DnF0GfI4QJXxZnmvAGUZOy9qg8wDA=; b=oA4PWEYn/lxkvSBNvE2PSIUY9 TwdhOOgZcStNz1JVVrzGCoEzJWsAm8QvHkPbU4Oca/JDiaqmDCGNHMhSHzRK5M+Nd1NcjJjNIuHPq 0SDvGdudB8rmDBK80q1hbCjkmCV/La5Z5qRsTm7UcHJ/aM1gVUo3Rlub/T3EuGn3cf7KIsblrtm7X oUhxSQwHbOXMJo27obq8j8+hyOxg28Zp1ZiQuHV2xlqewWAYc1Q+GZwv9nIZcigP/LD3VVteI+9Rs V0ADVWY+6K97lLwAqCxJAg0UDGEoMp3BIfcpcCQ8vIrVqphOihFX0TSAYkiiUTtDLDN9X7uvO/SnO 3Nwe3nOgg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iX1ig-00012R-BB; Tue, 19 Nov 2019 11:30:54 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iX1id-00011u-JV; Tue, 19 Nov 2019 11:30:53 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id EFF35BC38; Tue, 19 Nov 2019 11:30:49 +0000 (UTC) Message-ID: <052d07fb4eb79b29dd58cab577d59bab6684329a.camel@suse.de> Subject: Re: [PATCH v2 1/6] linux/log2.h: Add roundup/rounddown_pow_two64() family of functions From: Nicolas Saenz Julienne To: Andrew Murray Date: Tue, 19 Nov 2019 12:30:47 +0100 In-Reply-To: <20191119111320.GP43905@e119886-lin.cambridge.arm.com> References: <20191112155926.16476-1-nsaenzjulienne@suse.de> <20191112155926.16476-2-nsaenzjulienne@suse.de> <20191119111320.GP43905@e119886-lin.cambridge.arm.com> User-Agent: Evolution 3.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191119_033051_788303_FCC9737B X-CRM114-Status: GOOD ( 11.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , linux-pci@vger.kernel.org, Shawn Lin , Christoph Hellwig , Marek Szyprowski , Lorenzo Pieralisi , linux-rdma@vger.kernel.org, maz@kernel.org, phil@raspberrypi.org, iommu@lists.linux-foundation.org, linux-rockchip@lists.infradead.org, f.fainelli@gmail.com, Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, mbrugger@suse.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jeremy.linton@arm.com, Tom Joseph , wahrenst@gmx.net, james.quinlan@broadcom.com, Robin Murphy , "David S. Miller" , Tariq Toukan Content-Type: multipart/mixed; boundary="===============4784771574638619898==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4784771574638619898== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-JCAElqvKu605DtMG+rxz" --=-JCAElqvKu605DtMG+rxz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Andrew, thanks for the review. > > +/** > > + * __roundup_pow_of_two64() - round 64bit value up to nearest power of= two > > + * @n: value to round up > > + */ > > +static inline __attribute__((const)) __u64 __roundup_pow_of_two64(__u6= 4 n) >=20 > To be consistent with other functions in the same file (__ilog_u64) you m= ay > want to rename this to __roundup_pow_of_two_u64. Sounds good to me. > Also do you know why u64 is used in some places and __u64 in others? That's unwarranted, it should be __u64 everywhere. > > +{ > > + return 1UL << fls64(n - 1); >=20 > Does this need to be (and for the others): >=20 > return 1ULL << fls64(n - 1); >=20 > Notice that the PCI drivers you convert, all use 1ULL. Noted Regards, Nicolas --=-JCAElqvKu605DtMG+rxz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAl3T0mcACgkQlfZmHno8 x/6BgQf9EPIQKoR6phksU0S8lgk9wqpGnUdxBbs82aHnTqsDgCrCDSnKXEYjrytg JP7gToqXjInWjAuYTza/e4u4j4nQShrZSrX/Wo7n0g/iOPzIrKgFEwt/I8JlZnxn eGSGgGDLXcFOIXzSy7aNsDEOHM1JS3Nan1xj+4vfNYb5bx3U7VlJuAAVsNZ7aLHu 1JSo56OTcTN6DejhWw1GzvlTsqzLUa41v8BUgW19GyOv185sXkbfJImn1hgkRuKj JHu3GwUlrQkRrcAs0xqLRflUJHE8If7t+Xh+Su4ToLjWKyWvMu4fnPpwFXCyHhyG T2k6eYGiEuyKMYHxJg9YLmvjNMdJuA== =s9/D -----END PGP SIGNATURE----- --=-JCAElqvKu605DtMG+rxz-- --===============4784771574638619898== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4784771574638619898==--