lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 11 Nov 2019 03:32:55 +0100 From: Andrew Lunn <andrew@...n.ch> To: Olof Johansson <olof@...om.net> Cc: Florian Fainelli <f.fainelli@...il.com>, Heiner Kallweit <hkallweit1@...il.com>, netdev@...r.kernel.org, linux-kernel@...r.kernel.org, "David S . Miller" <davem@...emloft.net> Subject: Re: [PATCH] net: mdio-octeon: Fix pointer/integer casts 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@...om.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? Thanks Andrew
Powered by blists - more mailing lists