From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Heiko Stuebner <heiko@sntech.de>,
linux-pci@vger.kernel.org, Shawn Lin <shawn.lin@rock-chips.com>,
Eric Anholt <eric@anholt.net>, Hanjun Guo <guohanjun@huawei.com>,
Frank Rowand <frowand.list@gmail.com>,
Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Florian Fainelli <f.fainelli@gmail.com>,
linux-rockchip@lists.infradead.org, linux-rdma@vger.kernel.org,
maz@kernel.org, phil@raspberrypi.org, linux-acpi@vger.kernel.org,
bcm-kernel-feedback-list@broadcom.com,
Len Brown <lenb@kernel.org>,
devicetree@vger.kernel.org,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org, mbrugger@suse.com,
netdev@vger.kernel.org, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
linux-kernel@vger.kernel.org, jeremy.linton@arm.com,
iommu@lists.linux-foundation.org,
Rob Herring <robh+dt@kernel.org>,
Stefan Wahren <wahrenst@gmx.net>,
james.quinlan@broadcom.com, Sudeep Holla <sudeep.holla@arm.com>,
andrew.murray@arm.com, Robin Murphy <robin.murphy@arm.com>,
"David S. Miller" <davem@davemloft.net>,
Tariq Toukan <tariqt@mellanox.com>
Subject: Re: [PATCH v4 8/8] linux/log2.h: Use roundup/dow_pow_two() on 64bit calculations
Date: Thu, 12 Dec 2019 14:21:00 +0100 [thread overview]
Message-ID: <ff60337c5f6f324fb121fa7cad24e763af29cfe2.camel@suse.de> (raw)
In-Reply-To: <20191205203845.GA243596@google.com>
[-- Attachment #1.1: Type: text/plain, Size: 2721 bytes --]
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 >
> 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.
>
> 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 <nsaenzjulienne@suse.de>
>
> With the nits above and below addressed,
>
> Acked-by: Bjorn Helgaas <bhelgaas@google.com> # 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 <linux/platform_device.h>
> > #include <linux/pm_runtime.h>
> > #include <linux/sizes.h>
> > +#include <linux/log2.h>
> >
> > #include "pcie-cadence.h"
> >
> > @@ -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.
> > */
>
> 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 = phys_to_dma_direct(dev, (max_pfn - 1) << PAGE_SHIFT);
> >
> > - return (1ULL << (fls64(max_dma) - 1)) * 2 - 1;
> > + return rounddown_pow_of_two(max_dma) * 2 - 1;
>
> 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.
>
> But it's fine either way.
I'll split it into two parts, as RobH made a similar complaint.
Regards,
Nicolas
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-12-12 13:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-03 11:47 [PATCH v4 0/8] Raspberry Pi 4 PCIe support Nicolas Saenz Julienne
2019-12-03 11:47 ` [PATCH v4 1/8] dt-bindings: PCI: Add bindings for brcmstb's PCIe device Nicolas Saenz Julienne
2019-12-03 15:03 ` Andrew Murray
2019-12-03 11:47 ` [PATCH v4 2/8] ARM: dts: bcm2711: Enable PCIe controller Nicolas Saenz Julienne
2019-12-16 6:46 ` Jian-Hong Pan
2019-12-16 9:49 ` Nicolas Saenz Julienne
2019-12-03 11:47 ` [PATCH v4 3/8] PCI: brcmstb: Add Broadcom STB PCIe host controller driver Nicolas Saenz Julienne
2019-12-03 11:47 ` [PATCH v4 4/8] PCI: brcmstb: Add MSI support Nicolas Saenz Julienne
2019-12-03 11:47 ` [PATCH v4 6/8] arm64: defconfig: Enable Broadcom's STB PCIe controller Nicolas Saenz Julienne
2019-12-03 11:47 ` [PATCH v4 8/8] linux/log2.h: Use roundup/dow_pow_two() on 64bit calculations Nicolas Saenz Julienne
2019-12-03 15:53 ` Rob Herring
2019-12-03 16:06 ` Nicolas Saenz Julienne
2019-12-05 20:38 ` Bjorn Helgaas
2019-12-12 13:21 ` Nicolas Saenz Julienne [this message]
[not found] ` <20191203114743.1294-8-nsaenzjulienne@suse.de>
2019-12-03 16:39 ` [PATCH v4 7/8] linux/log2.h: Fix 64bit calculations in roundup/down_pow_two() Chuck Lever
2019-12-04 10:56 ` Martin Habets
2019-12-05 22:30 ` Bjorn Helgaas
2019-12-12 13:16 ` Nicolas Saenz Julienne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ff60337c5f6f324fb121fa7cad24e763af29cfe2.camel@suse.de \
--to=nsaenzjulienne@suse.de \
--cc=andrew.murray@arm.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=eric@anholt.net \
--cc=f.fainelli@gmail.com \
--cc=frowand.list@gmail.com \
--cc=guohanjun@huawei.com \
--cc=hch@lst.de \
--cc=heiko@sntech.de \
--cc=helgaas@kernel.org \
--cc=iommu@lists.linux-foundation.org \
--cc=james.quinlan@broadcom.com \
--cc=jeremy.linton@arm.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=m.szyprowski@samsung.com \
--cc=maz@kernel.org \
--cc=mbrugger@suse.com \
--cc=netdev@vger.kernel.org \
--cc=phil@raspberrypi.org \
--cc=rjw@rjwysocki.net \
--cc=robh+dt@kernel.org \
--cc=robin.murphy@arm.com \
--cc=shawn.lin@rock-chips.com \
--cc=sudeep.holla@arm.com \
--cc=tariqt@mellanox.com \
--cc=wahrenst@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).