lkml.org 
[lkml]   [2017]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] PCI: dwc: Use {upper,lower}_32_bits() macros for clarity
On 12/11, Lorenzo Pieralisi wrote:
> 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.
>

Ok. v2 coming shortly.

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

\
 
 \ /
  Last update: 2017-12-19 21:16    [W:1.011 / U:1.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site