From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: Jingoo Han <jingoohan1@gmail.com>,
Joao Pinto <Joao.Pinto@synopsys.com>,
linux-kernel@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: dwc: Use {upper,lower}_32_bits() macros for clarity
Date: Mon, 11 Dec 2017 10:19:47 +0000 [thread overview]
Message-ID: <20171211101947.GA3225@red-moon> (raw)
In-Reply-To: <20171129005334.16425-1-sboyd@codeaurora.org>
On Tue, Nov 28, 2017 at 04:53:34PM -0800, Stephen Boyd wrote:
> We have macros for getting the upper or lower 32 bits of a
> number. Use them here to shave a couple lines off the code.
>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
> drivers/pci/dwc/pcie-designware-host.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/dwc/pcie-designware-host.c b/drivers/pci/dwc/pcie-designware-host.c
> index 157621175147..ae5abfddf8de 100644
> --- a/drivers/pci/dwc/pcie-designware-host.c
> +++ b/drivers/pci/dwc/pcie-designware-host.c
> @@ -89,10 +89,8 @@ void dw_pcie_msi_init(struct pcie_port *pp)
> msi_target = virt_to_phys((void *)pp->msi_data);
>
> /* program the msi_data */
> - dw_pcie_wr_own_conf(pp, PCIE_MSI_ADDR_LO, 4,
> - (u32)(msi_target & 0xffffffff));
> - dw_pcie_wr_own_conf(pp, PCIE_MSI_ADDR_HI, 4,
> - (u32)(msi_target >> 32 & 0xffffffff));
> + dw_pcie_wr_own_conf(pp, PCIE_MSI_ADDR_LO, 4, lower_32_bits(msi_target));
> + dw_pcie_wr_own_conf(pp, PCIE_MSI_ADDR_HI, 4, upper_32_bits(msi_target));
> }
Hi Stephen,
I was about to apply it but I think that for consistency it would be
better to convert to {lower,upper}_32_bits() also code in
dw_msi_setup_msg() and slightly reword the log accordingly; if you do
not mind sending a v2 with those changes I will apply then.
Thanks,
Lorenzo
next prev parent reply other threads:[~2017-12-11 10:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 0:53 [PATCH] PCI: dwc: Use {upper,lower}_32_bits() macros for clarity Stephen Boyd
2017-11-29 23:48 ` Jingoo Han
2017-12-11 10:19 ` Lorenzo Pieralisi [this message]
2017-12-19 20:16 ` Stephen Boyd
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=20171211101947.GA3225@red-moon \
--to=lorenzo.pieralisi@arm.com \
--cc=Joao.Pinto@synopsys.com \
--cc=bhelgaas@google.com \
--cc=jingoohan1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=sboyd@codeaurora.org \
/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).