Netdev Archive on lore.kernel.org
 help / color / Atom feed
From: Olof Johansson <olof@lixom.net>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Network Development <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH] net: mdio-octeon: Fix pointer/integer casts
Date: Sun, 10 Nov 2019 18:36:35 -0800
Message-ID: <CAOesGMgokhLiTnAc7b04FPYY=i7ehCE5a3jJaj4j_UDuqR_DHA@mail.gmail.com> (raw)
In-Reply-To: <20191111023255.GY25889@lunn.ch>

On Sun, Nov 10, 2019 at 6:32 PM Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Sun, Nov 10, 2019 at 04:42:11PM -0800, Olof Johansson wrote:
> > Fixes a bunch of these warnings on arm allmodconfig:
> >
> > In file included from /build/drivers/net/phy/mdio-cavium.c:11:
> > /build/drivers/net/phy/mdio-cavium.c: In function 'cavium_mdiobus_set_mode':
> > /build/drivers/net/phy/mdio-cavium.h:114:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> >   114 | #define oct_mdio_readq(addr)  readq((void *)addr)
> >       |                                     ^
> > /build/drivers/net/phy/mdio-cavium.c:21:16: note: in expansion of macro 'oct_mdio_readq'
> >    21 |  smi_clk.u64 = oct_mdio_readq(p->register_base + SMI_CLK);
> >       |                ^~~~~~~~~~~~~~
> >
> > Fixes: 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS")
> > Signed-off-by: Olof Johansson <olof@lixom.net>
> > ---
> >  drivers/net/phy/mdio-cavium.h  | 14 +++++++-------
> >  drivers/net/phy/mdio-octeon.c  |  5 ++---
> >  drivers/net/phy/mdio-thunder.c |  2 +-
> >  3 files changed, 10 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/net/phy/mdio-cavium.h b/drivers/net/phy/mdio-cavium.h
> > index b7f89ad27465f..1cf81f0bc585f 100644
> > --- a/drivers/net/phy/mdio-cavium.h
> > +++ b/drivers/net/phy/mdio-cavium.h
> > @@ -90,7 +90,7 @@ union cvmx_smix_wr_dat {
> >
> >  struct cavium_mdiobus {
> >       struct mii_bus *mii_bus;
> > -     u64 register_base;
> > +     void __iomem *register_base;
> >       enum cavium_mdiobus_mode mode;
> >  };
> >
> > @@ -98,20 +98,20 @@ struct cavium_mdiobus {
> >
> >  #include <asm/octeon/octeon.h>
> >
> > -static inline void oct_mdio_writeq(u64 val, u64 addr)
> > +static inline void oct_mdio_writeq(u64 val, void __iomem *addr)
> >  {
> > -     cvmx_write_csr(addr, val);
> > +     cvmx_write_csr((u64)addr, val);
> >  }
>
> Hi Olof
>
> Humm. The warning goes away, but is it really any better?
>
> Did you try also changing the stub function in
> drivers/staging/octeon/octeon-stubs.h so it takes void __iomem?  Or
> did that cause a lot more warnings from other places?

That percolates through a bunch of MIPS code that I didn't feel like
getting into. So indeed, I stopped at that point.


-Olof

  reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11  0:42 Olof Johansson
2019-11-11  2:32 ` Andrew Lunn
2019-11-11  2:36   ` Olof Johansson [this message]
2019-11-12  5:46 ` David Miller
2019-11-12 13:23   ` Andrew Lunn
2019-11-12 19:51     ` Olof Johansson

Reply instructions:

You may reply publically 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='CAOesGMgokhLiTnAc7b04FPYY=i7ehCE5a3jJaj4j_UDuqR_DHA@mail.gmail.com' \
    --to=olof@lixom.net \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git