Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp810869ybl; Thu, 12 Dec 2019 05:21:52 -0800 (PST) X-Google-Smtp-Source: APXvYqx2te9vuRI3gKktOPZm1JewxWjD01qM6jzmGClvsSTFlRY41bL54OcvJjV1fsF8IFYQpH4v X-Received: by 2002:a05:6830:4a7:: with SMTP id l7mr7653959otd.372.1576156912862; Thu, 12 Dec 2019 05:21:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576156912; cv=none; d=google.com; s=arc-20160816; b=jOAldDxrwHKWk8JXA5lzPHQ9t3izW4SdHsYhHLBFw6BHUjzskz2brVpUIgSMSiD/2z oD94OWAn36nI0LbXH9/Jv5Rs729mSq+n136urCDx4g/Oiw6uN6r7pL6ACVMvEmaOjuEc Eb3pFys9jKY4jyYvJebohnobHkh4ygcTIeBhxsc0RHPvRxerXfrWBGPFy5tfZMrAPJWw mu11fxQ1ahW4T5rsr4IYKAgz3vCqYoQrcc4gSU8HhMtXzbvR+1wBdEPWfzfSS/Ag/gmj SA507Jrv7MSCY21YHgJDGsm4+iwRyx9LryniyxNiqLKyWv1jkPuKATOd94qM4oOwmuZM IgpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=35ussR7ANciarGRRdMjAu1+yuvG2VDFZNZnPhPnENm4=; b=FZ6DkDYYdgnoswe5ZwqfXi9f7cq16l5S1imE9as9DBvv1q25BKlBvCyjrxLs6fQ41Z m45hH/aIR0eSGx/BEQrL0xmhsoXMjpUZMqxsZrdxiAiFx9MT23QygE0PJu3rq0cHa/8X 4GZWmfdtOXXcF02dIIBbIiLJuI6qVfq6RVKWUAGHxYGX04x52KkSYQzmiCMlvhhuQgIL y1OSeKuuRIj91EqKR9UQ/MJ2p6wVD6LaXWcTe5cYeW3vWft2Fwi4Ac/0c4G4yi0iviYt Gui5PRjmUKosu6lCmjLgDrSSgKfIt8ka5clHIKkFxIVrt4sAArr3SOlPRHiJjzVnf0Hj v2TA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l127si3153612oif.11.2019.12.12.05.21.40; Thu, 12 Dec 2019 05:21:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729437AbfLLNVH (ORCPT + 99 others); Thu, 12 Dec 2019 08:21:07 -0500 Received: from mx2.suse.de ([195.135.220.15]:50418 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729378AbfLLNVH (ORCPT ); Thu, 12 Dec 2019 08:21:07 -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 B70EFAFD8; Thu, 12 Dec 2019 13:21:03 +0000 (UTC) Message-ID: Subject: Re: [PATCH v4 8/8] linux/log2.h: Use roundup/dow_pow_two() on 64bit calculations From: Nicolas Saenz Julienne To: Bjorn Helgaas Cc: andrew.murray@arm.com, maz@kernel.org, linux-kernel@vger.kernel.org, Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Tariq Toukan , Rob Herring , Frank Rowand , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Eric Anholt , Stefan Wahren , Shawn Lin , Heiko Stuebner , Christoph Hellwig , Marek Szyprowski , Robin Murphy , james.quinlan@broadcom.com, mbrugger@suse.com, phil@raspberrypi.org, jeremy.linton@arm.com, linux-pci@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, "Rafael J. Wysocki" , Len Brown , "David S. Miller" , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, iommu@lists.linux-foundation.org Date: Thu, 12 Dec 2019 14:21:00 +0100 In-Reply-To: <20191205203845.GA243596@google.com> References: <20191205203845.GA243596@google.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-lcx9Dpdc/nSfdN+F0tca" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-lcx9Dpdc/nSfdN+F0tca Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2019-12-05 at 14:38 -0600, Bjorn Helgaas wrote: > The subject contains a couple typos: it's missing "of" and it's > missing the "n" on "down". Noted >=20 > On Tue, Dec 03, 2019 at 12:47:41PM +0100, Nicolas Saenz Julienne wrote: > > The function now is safe to use while expecting a 64bit value. Use it > > where relevant. >=20 > Please include the function names ("roundup_pow_of_two()", > "rounddown_pow_of_two()") in the changelog so it is self-contained and > doesn't depend on the subject. Noted > > Signed-off-by: Nicolas Saenz Julienne >=20 > With the nits above and below addressed, >=20 > Acked-by: Bjorn Helgaas # drivers/pci Thanks! > > --- > > drivers/acpi/arm64/iort.c | 2 +- > > drivers/net/ethernet/mellanox/mlx4/en_clock.c | 3 ++- > > drivers/of/device.c | 3 ++- > > drivers/pci/controller/cadence/pcie-cadence-ep.c | 3 ++- > > drivers/pci/controller/cadence/pcie-cadence.c | 3 ++- > > drivers/pci/controller/pcie-brcmstb.c | 3 ++- > > drivers/pci/controller/pcie-rockchip-ep.c | 5 +++-- > > kernel/dma/direct.c | 2 +- > > 8 files changed, 15 insertions(+), 9 deletions(-) > > --- a/drivers/pci/controller/cadence/pcie-cadence-ep.c > > +++ b/drivers/pci/controller/cadence/pcie-cadence-ep.c > > @@ -10,6 +10,7 @@ > > #include > > #include > > #include > > +#include > > =20 > > #include "pcie-cadence.h" > > =20 > > @@ -65,7 +66,7 @@ static int cdns_pcie_ep_set_bar(struct pci_epc *epc, = u8 > > fn, > > * roundup_pow_of_two() returns an unsigned long, which is not suited > > * for 64bit values. > > */ >=20 > Please remove the comment above since it no longer applies. Noted [...] > > diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c > > index 6af7ae83c4ad..056886c4efec 100644 > > --- a/kernel/dma/direct.c > > +++ b/kernel/dma/direct.c > > @@ -53,7 +53,7 @@ u64 dma_direct_get_required_mask(struct device *dev) > > { > > u64 max_dma =3D phys_to_dma_direct(dev, (max_pfn - 1) << PAGE_SHIFT); > > =20 > > - return (1ULL << (fls64(max_dma) - 1)) * 2 - 1; > > + return rounddown_pow_of_two(max_dma) * 2 - 1; >=20 > Personally I would probably make this one a separate patch since it's > qualitatively different than the others and it would avoid the slight > awkwardness of the non-greppable "roundup/down_pow_of_two()" > construction in the commit subject. >=20 > But it's fine either way. I'll split it into two parts, as RobH made a similar complaint. Regards, Nicolas --=-lcx9Dpdc/nSfdN+F0tca 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/4FAl3yPrwACgkQlfZmHno8 x/4DxAf/dUNU44c6C5UlupKkHs1V09AR3yPNPOe8GrxrtpnzWAaNQ9L4S0ZG9ocS gey8W3CCPJPrWmqSAjQ8ddX9w+wKaaRaGFE3wHRFiGVMDSN8kGzHySuWi1ytfy0Y x0msb/bX87L3SwSegRTGlvbRJ1rDZl4WxCVFSrhCNRwem2R+v668VGifVS24Ay1f dwS7xyDUcMTmaiCfpK8KyJK1GdbScI6kVPFUM57deANw/I60zWGWykBnTeTQtlrM gLN2fGNP1wLRKZ5IEHObKLWo0rXTRKBjsouzL4/D5dW69LXZK1nS02rJsdu5bpUl WepA96OKnIgxngbBiO8z4btiMgZ1Jw== =QTsG -----END PGP SIGNATURE----- --=-lcx9Dpdc/nSfdN+F0tca--