[U-Boot] [PATCH 3/4] net: pcnet: Make 64 bit safe

Paul Burton paul.burton at imgtec.com
Tue May 24 17:32:35 CEST 2016


On Tue, May 24, 2016 at 10:25:11AM -0500, Joe Hershberger wrote:
> Hi Paul,
> 
> On Tue, May 17, 2016 at 5:56 AM, Paul Burton <paul.burton at imgtec.com> wrote:
> > Fix the pcnet driver to build safely on 64 bit platforms, in preparation
> > for allowing MIPS64 builds for Malta boards.
> >
> > Signed-off-by: Paul Burton <paul.burton at imgtec.com>
> > ---
> >
> >  drivers/net/pcnet.c | 18 ++++++++++--------
> >  1 file changed, 10 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c
> > index 16a7512..7dff445 100644
> > --- a/drivers/net/pcnet.c
> > +++ b/drivers/net/pcnet.c
> > @@ -137,7 +137,7 @@ static int pcnet_probe (struct eth_device *dev, bd_t * bis, int dev_num);
> >  static inline pci_addr_t pcnet_virt_to_mem(const struct eth_device *dev,
> >                                                 void *addr, bool uncached)
> >  {
> > -       pci_dev_t devbusfn = (pci_dev_t)dev->priv;
> > +       pci_dev_t devbusfn = (pci_dev_t)(unsigned long)dev->priv;
> 
> I thought this sort of double cast was frowned upon and warns in some
> compilers. Is that not an issue here?

Hi Joe,

It doesn't trigger any warnings with my gcc 4.9.2 based Codescape
2016.05 toolchain[1].

Thanks,
    Paul

[1] http://codescape-mips-sdk.imgtec.com/components/toolchain/2016.05-01/


More information about the U-Boot mailing list