LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Christophe Leroy' <christophe.leroy@csgroup.eu>,
	Xu Wang <vulab@iscas.ac.cn>,
	"pantelis.antoniou@gmail.com" <pantelis.antoniou@gmail.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] net: ethernet: fs-enet: remove casting dma_alloc_coherent
Date: Fri, 11 Dec 2020 16:07:37 +0000	[thread overview]
Message-ID: <6fc4b62ee7754d78b8f7b9c2275bc47e@AcuMS.aculab.com> (raw)
In-Reply-To: <34548188-67f4-d3ef-c2e3-871fc520e838@csgroup.eu>

From: Christophe Leroy
> Sent: 11 December 2020 15:22
> 
> Le 11/12/2020 à 09:52, Xu Wang a écrit :
> > Remove casting the values returned by dma_alloc_coherent.
> 
> Can you explain more in the commit log ?
> 
> As far as I can see, dma_alloc_coherent() doesn't return __iomem, and ring_base member is __iomem

Which is probably wrong - that is the kernel address of kernel memory.
So it shouldn't have the __iomem marker.

I wonder what else is wrong....

	David

> 
> Christophe
> 
> >
> > Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
> > ---
> >   drivers/net/ethernet/freescale/fs_enet/mac-fec.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-fec.c
> b/drivers/net/ethernet/freescale/fs_enet/mac-fec.c
> > index 99fe2c210d0f..3ae345676e50 100644
> > --- a/drivers/net/ethernet/freescale/fs_enet/mac-fec.c
> > +++ b/drivers/net/ethernet/freescale/fs_enet/mac-fec.c
> > @@ -131,7 +131,7 @@ static int allocate_bd(struct net_device *dev)
> >   	struct fs_enet_private *fep = netdev_priv(dev);
> >   	const struct fs_platform_info *fpi = fep->fpi;
> >
> > -	fep->ring_base = (void __force __iomem *)dma_alloc_coherent(fep->dev,
> > +	fep->ring_base = dma_alloc_coherent(fep->dev,
> >   					    (fpi->tx_ring + fpi->rx_ring) *
> >   					    sizeof(cbd_t), &fep->ring_mem_addr,
> >   					    GFP_KERNEL);
> >

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  reply	other threads:[~2020-12-11 20:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11  8:52 [PATCH] net: ethernet: fs-enet: remove casting dma_alloc_coherent Xu Wang
2020-12-11 15:22 ` Christophe Leroy
2020-12-11 16:07   ` David Laight [this message]
2020-12-11 16:42     ` Christophe Leroy
2020-12-11 16:55       ` David Laight
2021-03-16 18:10         ` Christophe Leroy

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=6fc4b62ee7754d78b8f7b9c2275bc47e@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=pantelis.antoniou@gmail.com \
    --cc=vulab@iscas.ac.cn \
    /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