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=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 CFED6C43603 for ; Thu, 12 Dec 2019 13:21:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A785121655 for ; Thu, 12 Dec 2019 13:21:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729414AbfLLNVH (ORCPT ); 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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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--