[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DD002C93C@AcuExch.aculab.com>
Date: Wed, 28 Jun 2017 08:47:34 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Al Cooper' <alcooperx@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Felipe Balbi <balbi@...nel.org>,
yuan linyu <Linyu.Yuan@...atel-sbell.com.cn>,
"Florian Fainelli" <f.fainelli@...il.com>,
"open list:USB SUBSYSTEM" <linux-usb@...r.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>,
"bcm-kernel-feedback-list@...adcom.com"
<bcm-kernel-feedback-list@...adcom.com>
Subject: RE: [PATCH 4/8] usb: bdc: Small code cleanup
From: Al Cooper
> Sent: 27 June 2017 19:23
> Signed-off-by: Al Cooper <alcooperx@...il.com>
> ---
> drivers/usb/gadget/udc/bdc/bdc_core.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
> index 3bd82d2..621328f 100644
> --- a/drivers/usb/gadget/udc/bdc/bdc_core.c
> +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
> @@ -488,28 +488,29 @@ static int bdc_probe(struct platform_device *pdev)
> platform_set_drvdata(pdev, bdc);
> bdc->irq = irq;
> bdc->dev = dev;
> - dev_dbg(bdc->dev, "bdc->regs: %p irq=%d\n", bdc->regs, bdc->irq);
> + dev_dbg(dev, "bdc->regs: %p irq=%d\n", bdc->regs, bdc->irq);
The compiler will use the value without re-reading it.
In the other places it makes very little difference.
The changed code might require one less memory read, but if the extra
'live' local variable causes gcc to save registers to stack all
bets are off.
The more explicit bdc->dev is probably more readable.
>
> temp = bdc_readl(bdc->regs, BDC_BDCSC);
> if ((temp & BDC_P64) &&
> !dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64))) {
> - dev_dbg(bdc->dev, "Using 64-bit address\n");
> + dev_dbg(dev, "Using 64-bit address\n");
> } else {
> - ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> + ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
That just wrong...
Or was wrong before.
...
David
Powered by blists - more mailing lists