As Russell King found out the hard way, a change I did to fix multiplatform
builds with this driver broke the old Assabet/Neponset platform: It turns
out that while the driver is runtime configurable in principle, the
runtime configuration does not cover the specific case of machines that
can not do any 16-bit I/O on the smc91x registers.
The driver currently provides helpers to access 16-bit registers for
architectures that are known at compile-time to only have 8-bit I/O,
but my patch changed it to a runtime flag that never gets consulted
most register accesses.
This introduces new SMC_out16()/SMC_in16 helpers (if anyone can suggest
a better name, I'm glad to modify this) that behaves like SMC_outw()/SMC_inw()
most of the time, but uses a pair of 8-bit accesses on platforms that
have no support for wider register accesses.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: Russell King <linux@armlinux.org.uk>
Fixes: b70661c70830d ("net: smc91x: use run-time configuration on all ARM machines")
---
drivers/net/ethernet/smsc/smc91x.h | 125 ++++++++++++++++++++-----------------
1 file changed, 66 insertions(+), 59 deletions(-)
While this patch fixes one bug on Neponset, it probably doesn't address
the one that Russell ran into first, so this is for review only for now,
until the remaining problem(s) have been worked out.
Please ignore the first submission, I accidentally only sent out patch 2/2,
which does not actually fix a bug.
The ARM specific I/O operations are almost the same as the generic
ones, with the exception of the SMC_outw macro that works around
a problem of some platforms that cannot write to 16-bit registers
at an address that is not 32-bit aligned.
By inspection, I found that this is handled already in the
register abstractions for almost all cases, the exceptions being
SMC_SET_MAC_ADDR() and SMC_SET_MCAST(). I assume that all
platforms that require the hack for the other registers also
need it here, so the ones listed explictly here are the only
ones that work correctly, while the other ones either don't
need the hack at all, or they will set an incorrect MAC
address (which can often go unnoticed).
This changes the two macros that set the unaligned registers
to use 32-bit writes if possible, which should do the right
thing in all combinations. The ARM specific SMC_outw gets removed
as a consequence.
The only difference between the ARM behavior and the default is
the selection of the LED settings. The fact that we have different
defaults based on the CPU architectures here is a bit suspicious,
but probably harmless, and I have no plan of touching that.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/ethernet/smsc/smc91x.h | 50 +++++++++++++++++++++++---------------
1 file changed, 30 insertions(+), 20 deletions(-)
As Russell King found out the hard way, a change I did to fix multiplatform
builds with this driver broke the old Assabet/Neponset platform: It turns
out that while the driver is runtime configurable in principle, the
runtime configuration does not cover the specific case of machines that
can not do any 16-bit I/O on the smc91x registers.
The driver currently provides helpers to access 16-bit registers for
architectures that are known at compile-time to only have 8-bit I/O,
but my patch changed it to a runtime flag that never gets consulted
most register accesses.
This introduces new SMC_out16()/SMC_in16 helpers (if anyone can suggest
a better name, I'm glad to modify this) that behaves like SMC_outw()/SMC_inw()
most of the time, but uses a pair of 8-bit accesses on platforms that
have no support for wider register accesses.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: Russell King <linux@armlinux.org.uk>
Fixes: b70661c70830d ("net: smc91x: use run-time configuration on all ARM machines")
---
Having bad luck streak with this patch, the version I sent
had a couple of mistakes from the last rebase before sending
it out, this version should actually apply and build.
From: kbuild test robot <hidden> Date: 2016-08-25 16:34:05
Hi Arnd,
[auto build test WARNING on net-next/master]
[also build test WARNING on v4.8-rc3 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/Arnd-Bergmann/smc91x-always-use-8-bit-access-if-necessary/20160825-225929
config: m32r-defconfig (attached as .config)
compiler: m32r-linux-gcc (GCC) 4.9.0
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=m32r
All warnings (new ones prefixed by >>):
In file included from drivers/net/ethernet/smsc/smc91x.c:92:0:
drivers/net/ethernet/smsc/smc91x.h:444:0: warning: "SMC_insw" redefined
#define SMC_insw(a, r, p, l) BUG()
^
drivers/net/ethernet/smsc/smc91x.h:110:0: note: this is the location of the previous definition
#define SMC_insw(a, r, p, l) insw(((u32)a) + (r), p, l)
^
drivers/net/ethernet/smsc/smc91x.h:445:0: warning: "SMC_outsw" redefined
#define SMC_outsw(a, r, p, l) BUG()
^
drivers/net/ethernet/smsc/smc91x.h:111:0: note: this is the location of the previous definition
#define SMC_outsw(a, r, p, l) outsw(((u32)a) + (r), p, l)
^
drivers/net/ethernet/smsc/smc91x.h:455:0: warning: "SMC_inb" redefined
#define SMC_inb(ioaddr, reg) ({ BUG(); 0; })
^
drivers/net/ethernet/smsc/smc91x.h:106:0: note: this is the location of the previous definition
#define SMC_inb(a, r) inb(((u32)a) + (r))
^
drivers/net/ethernet/smsc/smc91x.h:456:0: warning: "SMC_outb" redefined
#define SMC_outb(x, ioaddr, reg) BUG()
^
drivers/net/ethernet/smsc/smc91x.h:108:0: note: this is the location of the previous definition
#define SMC_outb(v, a, r) outb(v, ((u32)a) + (r))
^
drivers/net/ethernet/smsc/smc91x.h:1128:2: error: #endif without #if
#endif /* _SMC91X_H_ */
^
drivers/net/ethernet/smsc/smc91x.c: In function 'smc_reset':
unsigned int __val16 = (x); \
^
drivers/net/ethernet/smsc/smc91x.h:981:32: note: in expansion of macro 'SMC_out16'
#define SMC_SET_MMU_CMD(lp, x) SMC_out16(x, ioaddr, MMU_CMD_REG(lp))
^
drivers/net/ethernet/smsc/smc91x.c:337:2: note: in expansion of macro 'SMC_SET_MMU_CMD'
SMC_SET_MMU_CMD(lp, MC_RESET);
^
drivers/net/ethernet/smsc/smc91x.c: In function 'smc_enable':
From: Nicolas Pitre <nico@fluxnic.net> Date: 2016-08-25 18:04:57
On Thu, 25 Aug 2016, Arnd Bergmann wrote:
As Russell King found out the hard way, a change I did to fix multiplatform
builds with this driver broke the old Assabet/Neponset platform: It turns
out that while the driver is runtime configurable in principle, the
runtime configuration does not cover the specific case of machines that
can not do any 16-bit I/O on the smc91x registers.
The driver currently provides helpers to access 16-bit registers for
architectures that are known at compile-time to only have 8-bit I/O,
but my patch changed it to a runtime flag that never gets consulted
most register accesses.
This introduces new SMC_out16()/SMC_in16 helpers (if anyone can suggest
a better name, I'm glad to modify this) that behaves like SMC_outw()/SMC_inw()
most of the time, but uses a pair of 8-bit accesses on platforms that
have no support for wider register accesses.
Why don't you fold this directly into SMC_outw() instead?
Nicolas
This is insufficient. If you look at how SMC_REG works, you'll notice
that it has side effects which can disrupt other accesses (it reads
the bank register if debugging is enabled.)
In any case, please wait for my tested patch for this.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
On Thursday, August 25, 2016 11:33:08 PM CEST Russell King - ARM Linux wrote:
This is insufficient. If you look at how SMC_REG works, you'll notice
that it has side effects which can disrupt other accesses (it reads
the bank register if debugging is enabled.)
From: kbuild test robot <hidden> Date: 2016-08-26 22:40:59
Hi Arnd,
[auto build test WARNING on net-next/master]
[also build test WARNING on v4.8-rc3 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/Arnd-Bergmann/smc91x-always-use-8-bit-access-if-necessary/20160825-225929
config: sh-microdev_defconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sh
All warnings (new ones prefixed by >>):
from drivers/net/ethernet/smsc/smc91x.c:72:
arch/sh/include/asm/io.h:159:25: note: expected 'long unsigned int' but argument is of type 'void *'
static inline void pfx##out##bwlq##p(type val, unsigned long port) \
^
arch/sh/include/asm/io.h:181:2: note: in expansion of macro '__BUILD_IOPORT_SINGLE'
__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
^
arch/sh/include/asm/io.h:185:2: note: in expansion of macro '__BUILD_IOPORT_PFX'
__BUILD_IOPORT_PFX(, bwlq, type)
^
arch/sh/include/asm/io.h:188:1: note: in expansion of macro 'BUILDIO_IOPORT'
BUILDIO_IOPORT(w, u16)
^
In file included from drivers/net/ethernet/smsc/smc91x.c:92:0:
drivers/net/ethernet/smsc/smc91x.h:424:16: warning: unused variable '__val16' [-Wunused-variable]
unsigned int __val16 = (x); \
^
drivers/net/ethernet/smsc/smc91x.h:1015:28: note: in expansion of macro 'SMC_out16'
#define SMC_SET_TCR(lp, x) SMC_out16(x, ioaddr, TCR_REG(lp))
^
drivers/net/ethernet/smsc/smc91x.c:319:2: note: in expansion of macro 'SMC_SET_TCR'
SMC_SET_TCR(lp, TCR_CLEAR);
^
drivers/net/ethernet/smsc/smc91x.h:91:35: warning: passing argument 2 of 'outw' makes integer from pointer without a cast [-Wint-conversion]
#define SMC_outw(v, a, r) outw(v, (a) + (r) - 0xa0000000)
^
drivers/net/ethernet/smsc/smc91x.h:428:3: note: in expansion of macro 'SMC_outw'
SMC_outw(x, ioaddr, reg); \
^
drivers/net/ethernet/smsc/smc91x.h:1015:28: note: in expansion of macro 'SMC_out16'
#define SMC_SET_TCR(lp, x) SMC_out16(x, ioaddr, TCR_REG(lp))
^
drivers/net/ethernet/smsc/smc91x.c:319:2: note: in expansion of macro 'SMC_SET_TCR'
SMC_SET_TCR(lp, TCR_CLEAR);
^
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:24,
from arch/sh/include/asm/hardirq.h:5,
from include/linux/hardirq.h:8,
from include/linux/interrupt.h:12,
from drivers/net/ethernet/smsc/smc91x.c:72:
arch/sh/include/asm/io.h:159:25: note: expected 'long unsigned int' but argument is of type 'void *'
static inline void pfx##out##bwlq##p(type val, unsigned long port) \
^
arch/sh/include/asm/io.h:181:2: note: in expansion of macro '__BUILD_IOPORT_SINGLE'
__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
^
arch/sh/include/asm/io.h:185:2: note: in expansion of macro '__BUILD_IOPORT_PFX'
__BUILD_IOPORT_PFX(, bwlq, type)
^
arch/sh/include/asm/io.h:188:1: note: in expansion of macro 'BUILDIO_IOPORT'
BUILDIO_IOPORT(w, u16)
^
In file included from drivers/net/ethernet/smsc/smc91x.c:92:0:
drivers/net/ethernet/smsc/smc91x.h:424:16: warning: unused variable '__val16' [-Wunused-variable]
unsigned int __val16 = (x); \
^
drivers/net/ethernet/smsc/smc91x.h:944:4: note: in expansion of macro 'SMC_out16'
SMC_out16(x, ioaddr, BANK_SELECT); \
^
drivers/net/ethernet/smsc/smc91x.c:321:2: note: in expansion of macro 'SMC_SELECT_BANK'
SMC_SELECT_BANK(lp, 1);
^
drivers/net/ethernet/smsc/smc91x.h:91:35: warning: passing argument 2 of 'outw' makes integer from pointer without a cast [-Wint-conversion]
#define SMC_outw(v, a, r) outw(v, (a) + (r) - 0xa0000000)
^
drivers/net/ethernet/smsc/smc91x.h:428:3: note: in expansion of macro 'SMC_outw'
SMC_outw(x, ioaddr, reg); \
^
drivers/net/ethernet/smsc/smc91x.h:944:4: note: in expansion of macro 'SMC_out16'
SMC_out16(x, ioaddr, BANK_SELECT); \
^
drivers/net/ethernet/smsc/smc91x.c:321:2: note: in expansion of macro 'SMC_SELECT_BANK'
SMC_SELECT_BANK(lp, 1);
^
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:24,
from arch/sh/include/asm/hardirq.h:5,
from include/linux/hardirq.h:8,
from include/linux/interrupt.h:12,
from drivers/net/ethernet/smsc/smc91x.c:72:
arch/sh/include/asm/io.h:159:25: note: expected 'long unsigned int' but argument is of type 'void *'
static inline void pfx##out##bwlq##p(type val, unsigned long port) \
^
arch/sh/include/asm/io.h:181:2: note: in expansion of macro '__BUILD_IOPORT_SINGLE'
__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
^
arch/sh/include/asm/io.h:185:2: note: in expansion of macro '__BUILD_IOPORT_PFX'
__BUILD_IOPORT_PFX(, bwlq, type)
^
arch/sh/include/asm/io.h:188:1: note: in expansion of macro 'BUILDIO_IOPORT'
BUILDIO_IOPORT(w, u16)
^
In file included from drivers/net/ethernet/smsc/smc91x.c:92:0:
drivers/net/ethernet/smsc/smc91x.h:88:28: warning: passing argument 1 of 'inw' makes integer from pointer without a cast [-Wint-conversion]
#define SMC_inw(a, r) inw((a) + (r) - 0xa0000000)
^
drivers/net/ethernet/smsc/smc91x.h:439:13: note: in expansion of macro 'SMC_inw'
__val16 = SMC_inw(ioaddr, reg); \
^
quoted
drivers/net/ethernet/smsc/smc91x.h:957:26: note: in expansion of macro 'SMC_in16'
#define SMC_GET_CTL(lp) SMC_in16(ioaddr, CTL_REG(lp))
^
drivers/net/ethernet/smsc/smc91x.c:322:8: note: in expansion of macro 'SMC_GET_CTL'
ctl = SMC_GET_CTL(lp) | CTL_LE_ENABLE;
^
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:24,
from arch/sh/include/asm/hardirq.h:5,
from include/linux/hardirq.h:8,
from include/linux/interrupt.h:12,
from drivers/net/ethernet/smsc/smc91x.c:72:
arch/sh/include/asm/io.h:168:25: note: expected 'long unsigned int' but argument is of type 'void *'
static inline type pfx##in##bwlq##p(unsigned long port) \
^
arch/sh/include/asm/io.h:181:2: note: in expansion of macro '__BUILD_IOPORT_SINGLE'
__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
^
arch/sh/include/asm/io.h:185:2: note: in expansion of macro '__BUILD_IOPORT_PFX'
__BUILD_IOPORT_PFX(, bwlq, type)
^
arch/sh/include/asm/io.h:188:1: note: in expansion of macro 'BUILDIO_IOPORT'
BUILDIO_IOPORT(w, u16)
^
In file included from drivers/net/ethernet/smsc/smc91x.c:92:0:
drivers/net/ethernet/smsc/smc91x.h:424:16: warning: unused variable '__val16' [-Wunused-variable]
unsigned int __val16 = (x); \
^
drivers/net/ethernet/smsc/smc91x.h:959:28: note: in expansion of macro 'SMC_out16'
#define SMC_SET_CTL(lp, x) SMC_out16(x, ioaddr, CTL_REG(lp))
^
drivers/net/ethernet/smsc/smc91x.c:333:2: note: in expansion of macro 'SMC_SET_CTL'
SMC_SET_CTL(lp, ctl);
^
drivers/net/ethernet/smsc/smc91x.h:91:35: warning: passing argument 2 of 'outw' makes integer from pointer without a cast [-Wint-conversion]
#define SMC_outw(v, a, r) outw(v, (a) + (r) - 0xa0000000)
^
drivers/net/ethernet/smsc/smc91x.h:428:3: note: in expansion of macro 'SMC_outw'
SMC_outw(x, ioaddr, reg); \
^
drivers/net/ethernet/smsc/smc91x.h:959:28: note: in expansion of macro 'SMC_out16'
#define SMC_SET_CTL(lp, x) SMC_out16(x, ioaddr, CTL_REG(lp))
^
drivers/net/ethernet/smsc/smc91x.c:333:2: note: in expansion of macro 'SMC_SET_CTL'
SMC_SET_CTL(lp, ctl);
^
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:24,
from arch/sh/include/asm/hardirq.h:5,
from include/linux/hardirq.h:8,
from include/linux/interrupt.h:12,
from drivers/net/ethernet/smsc/smc91x.c:72:
arch/sh/include/asm/io.h:159:25: note: expected 'long unsigned int' but argument is of type 'void *'
static inline void pfx##out##bwlq##p(type val, unsigned long port) \
^
arch/sh/include/asm/io.h:181:2: note: in expansion of macro '__BUILD_IOPORT_SINGLE'
__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
^
arch/sh/include/asm/io.h:185:2: note: in expansion of macro '__BUILD_IOPORT_PFX'
__BUILD_IOPORT_PFX(, bwlq, type)
^
arch/sh/include/asm/io.h:188:1: note: in expansion of macro 'BUILDIO_IOPORT'
BUILDIO_IOPORT(w, u16)
^
In file included from drivers/net/ethernet/smsc/smc91x.c:92:0:
drivers/net/ethernet/smsc/smc91x.h:424:16: warning: unused variable '__val16' [-Wunused-variable]
unsigned int __val16 = (x); \
^
drivers/net/ethernet/smsc/smc91x.h:944:4: note: in expansion of macro 'SMC_out16'
SMC_out16(x, ioaddr, BANK_SELECT); \
^
drivers/net/ethernet/smsc/smc91x.c:336:2: note: in expansion of macro 'SMC_SELECT_BANK'
SMC_SELECT_BANK(lp, 2);
^
drivers/net/ethernet/smsc/smc91x.h:91:35: warning: passing argument 2 of 'outw' makes integer from pointer without a cast [-Wint-conversion]
#define SMC_outw(v, a, r) outw(v, (a) + (r) - 0xa0000000)
^
drivers/net/ethernet/smsc/smc91x.h:428:3: note: in expansion of macro 'SMC_outw'
SMC_outw(x, ioaddr, reg); \
^
drivers/net/ethernet/smsc/smc91x.h:944:4: note: in expansion of macro 'SMC_out16'
SMC_out16(x, ioaddr, BANK_SELECT); \
^
drivers/net/ethernet/smsc/smc91x.c:336:2: note: in expansion of macro 'SMC_SELECT_BANK'
SMC_SELECT_BANK(lp, 2);
^
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:24,
from arch/sh/include/asm/hardirq.h:5,
from include/linux/hardirq.h:8,
from include/linux/interrupt.h:12,
from drivers/net/ethernet/smsc/smc91x.c:72:
arch/sh/include/asm/io.h:159:25: note: expected 'long unsigned int' but argument is of type 'void *'
static inline void pfx##out##bwlq##p(type val, unsigned long port) \
^
arch/sh/include/asm/io.h:181:2: note: in expansion of macro '__BUILD_IOPORT_SINGLE'
__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
^
arch/sh/include/asm/io.h:185:2: note: in expansion of macro '__BUILD_IOPORT_PFX'
__BUILD_IOPORT_PFX(, bwlq, type)
^
--
arch/sh/include/asm/io.h:168:25: note: expected 'long unsigned int' but argument is of type 'void *'
static inline type pfx##in##bwlq##p(unsigned long port) \
^
arch/sh/include/asm/io.h:181:2: note: in expansion of macro '__BUILD_IOPORT_SINGLE'
__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
^
arch/sh/include/asm/io.h:185:2: note: in expansion of macro '__BUILD_IOPORT_PFX'
__BUILD_IOPORT_PFX(, bwlq, type)
^
arch/sh/include/asm/io.h:188:1: note: in expansion of macro 'BUILDIO_IOPORT'
BUILDIO_IOPORT(w, u16)
^
In file included from drivers/net/ethernet/smsc/smc91x.c:92:0:
drivers/net/ethernet/smsc/smc91x.h:424:16: warning: unused variable '__val16' [-Wunused-variable]
unsigned int __val16 = (x); \
^
drivers/net/ethernet/smsc/smc91x.h:944:4: note: in expansion of macro 'SMC_out16'
SMC_out16(x, ioaddr, BANK_SELECT); \
^
drivers/net/ethernet/smsc/smc91x.c:1178:2: note: in expansion of macro 'SMC_SELECT_BANK'
SMC_SELECT_BANK(lp, 2);
^
drivers/net/ethernet/smsc/smc91x.h:91:35: warning: passing argument 2 of 'outw' makes integer from pointer without a cast [-Wint-conversion]
#define SMC_outw(v, a, r) outw(v, (a) + (r) - 0xa0000000)
^
drivers/net/ethernet/smsc/smc91x.h:428:3: note: in expansion of macro 'SMC_outw'
SMC_outw(x, ioaddr, reg); \
^
drivers/net/ethernet/smsc/smc91x.h:944:4: note: in expansion of macro 'SMC_out16'
SMC_out16(x, ioaddr, BANK_SELECT); \
^
drivers/net/ethernet/smsc/smc91x.c:1178:2: note: in expansion of macro 'SMC_SELECT_BANK'
SMC_SELECT_BANK(lp, 2);
^
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:24,
from arch/sh/include/asm/hardirq.h:5,
from include/linux/hardirq.h:8,
from include/linux/interrupt.h:12,
from drivers/net/ethernet/smsc/smc91x.c:72:
arch/sh/include/asm/io.h:159:25: note: expected 'long unsigned int' but argument is of type 'void *'
static inline void pfx##out##bwlq##p(type val, unsigned long port) \
^
arch/sh/include/asm/io.h:181:2: note: in expansion of macro '__BUILD_IOPORT_SINGLE'
__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
^
arch/sh/include/asm/io.h:185:2: note: in expansion of macro '__BUILD_IOPORT_PFX'
__BUILD_IOPORT_PFX(, bwlq, type)
^
arch/sh/include/asm/io.h:188:1: note: in expansion of macro 'BUILDIO_IOPORT'
BUILDIO_IOPORT(w, u16)
^
In file included from drivers/net/ethernet/smsc/smc91x.c:92:0:
drivers/net/ethernet/smsc/smc91x.c: In function 'smc_eph_interrupt':
drivers/net/ethernet/smsc/smc91x.h:424:16: warning: unused variable '__val16' [-Wunused-variable]
unsigned int __val16 = (x); \
^
drivers/net/ethernet/smsc/smc91x.h:944:4: note: in expansion of macro 'SMC_out16'
SMC_out16(x, ioaddr, BANK_SELECT); \
^
drivers/net/ethernet/smsc/smc91x.c:1200:2: note: in expansion of macro 'SMC_SELECT_BANK'
SMC_SELECT_BANK(lp, 1);
^
drivers/net/ethernet/smsc/smc91x.h:91:35: warning: passing argument 2 of 'outw' makes integer from pointer without a cast [-Wint-conversion]
#define SMC_outw(v, a, r) outw(v, (a) + (r) - 0xa0000000)
^
drivers/net/ethernet/smsc/smc91x.h:428:3: note: in expansion of macro 'SMC_outw'
SMC_outw(x, ioaddr, reg); \
^
drivers/net/ethernet/smsc/smc91x.h:944:4: note: in expansion of macro 'SMC_out16'
SMC_out16(x, ioaddr, BANK_SELECT); \
^
drivers/net/ethernet/smsc/smc91x.c:1200:2: note: in expansion of macro 'SMC_SELECT_BANK'
SMC_SELECT_BANK(lp, 1);
^
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:24,
from arch/sh/include/asm/hardirq.h:5,
from include/linux/hardirq.h:8,
from include/linux/interrupt.h:12,
from drivers/net/ethernet/smsc/smc91x.c:72:
arch/sh/include/asm/io.h:159:25: note: expected 'long unsigned int' but argument is of type 'void *'
static inline void pfx##out##bwlq##p(type val, unsigned long port) \
^
arch/sh/include/asm/io.h:181:2: note: in expansion of macro '__BUILD_IOPORT_SINGLE'
__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
^
arch/sh/include/asm/io.h:185:2: note: in expansion of macro '__BUILD_IOPORT_PFX'
__BUILD_IOPORT_PFX(, bwlq, type)
^
arch/sh/include/asm/io.h:188:1: note: in expansion of macro 'BUILDIO_IOPORT'
BUILDIO_IOPORT(w, u16)
^
In file included from drivers/net/ethernet/smsc/smc91x.c:92:0:
drivers/net/ethernet/smsc/smc91x.h:88:28: warning: passing argument 1 of 'inw' makes integer from pointer without a cast [-Wint-conversion]
#define SMC_inw(a, r) inw((a) + (r) - 0xa0000000)
^
drivers/net/ethernet/smsc/smc91x.h:439:13: note: in expansion of macro 'SMC_inw'
__val16 = SMC_inw(ioaddr, reg); \
^
quoted
drivers/net/ethernet/smsc/smc91x.h:957:26: note: in expansion of macro 'SMC_in16'
#define SMC_GET_CTL(lp) SMC_in16(ioaddr, CTL_REG(lp))
^
drivers/net/ethernet/smsc/smc91x.c:1201:8: note: in expansion of macro 'SMC_GET_CTL'
ctl = SMC_GET_CTL(lp);
^
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:24,
from arch/sh/include/asm/hardirq.h:5,
from include/linux/hardirq.h:8,
from include/linux/interrupt.h:12,
from drivers/net/ethernet/smsc/smc91x.c:72:
arch/sh/include/asm/io.h:168:25: note: expected 'long unsigned int' but argument is of type 'void *'
static inline type pfx##in##bwlq##p(unsigned long port) \
^
arch/sh/include/asm/io.h:181:2: note: in expansion of macro '__BUILD_IOPORT_SINGLE'
__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
^
arch/sh/include/asm/io.h:185:2: note: in expansion of macro '__BUILD_IOPORT_PFX'
__BUILD_IOPORT_PFX(, bwlq, type)
^
arch/sh/include/asm/io.h:188:1: note: in expansion of macro 'BUILDIO_IOPORT'
BUILDIO_IOPORT(w, u16)
^
In file included from drivers/net/ethernet/smsc/smc91x.c:92:0:
drivers/net/ethernet/smsc/smc91x.h:424:16: warning: unused variable '__val16' [-Wunused-variable]
unsigned int __val16 = (x); \
^
drivers/net/ethernet/smsc/smc91x.h:959:28: note: in expansion of macro 'SMC_out16'
#define SMC_SET_CTL(lp, x) SMC_out16(x, ioaddr, CTL_REG(lp))
^
drivers/net/ethernet/smsc/smc91x.c:1202:2: note: in expansion of macro 'SMC_SET_CTL'
SMC_SET_CTL(lp, ctl & ~CTL_LE_ENABLE);
^
drivers/net/ethernet/smsc/smc91x.h:91:35: warning: passing argument 2 of 'outw' makes integer from pointer without a cast [-Wint-conversion]
#define SMC_outw(v, a, r) outw(v, (a) + (r) - 0xa0000000)
^
drivers/net/ethernet/smsc/smc91x.h:428:3: note: in expansion of macro 'SMC_outw'
SMC_outw(x, ioaddr, reg); \
^
drivers/net/ethernet/smsc/smc91x.h:959:28: note: in expansion of macro 'SMC_out16'
#define SMC_SET_CTL(lp, x) SMC_out16(x, ioaddr, CTL_REG(lp))
^
drivers/net/ethernet/smsc/smc91x.c:1202:2: note: in expansion of macro 'SMC_SET_CTL'
SMC_SET_CTL(lp, ctl & ~CTL_LE_ENABLE);
^
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:24,
from arch/sh/include/asm/hardirq.h:5,
from include/linux/hardirq.h:8,
from include/linux/interrupt.h:12,
from drivers/net/ethernet/smsc/smc91x.c:72:
arch/sh/include/asm/io.h:159:25: note: expected 'long unsigned int' but argument is of type 'void *'
static inline void pfx##out##bwlq##p(type val, unsigned long port) \
^
arch/sh/include/asm/io.h:181:2: note: in expansion of macro '__BUILD_IOPORT_SINGLE'
__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
^
arch/sh/include/asm/io.h:185:2: note: in expansion of macro '__BUILD_IOPORT_PFX'
__BUILD_IOPORT_PFX(, bwlq, type)
^
arch/sh/include/asm/io.h:188:1: note: in expansion of macro 'BUILDIO_IOPORT'
BUILDIO_IOPORT(w, u16)
^
In file included from drivers/net/ethernet/smsc/smc91x.c:92:0:
drivers/net/ethernet/smsc/smc91x.h:424:16: warning: unused variable '__val16' [-Wunused-variable]
unsigned int __val16 = (x); \
^
drivers/net/ethernet/smsc/smc91x.h:959:28: note: in expansion of macro 'SMC_out16'
#define SMC_SET_CTL(lp, x) SMC_out16(x, ioaddr, CTL_REG(lp))
^
drivers/net/ethernet/smsc/smc91x.c:1203:2: note: in expansion of macro 'SMC_SET_CTL'
SMC_SET_CTL(lp, ctl);
^
drivers/net/ethernet/smsc/smc91x.h:91:35: warning: passing argument 2 of 'outw' makes integer from pointer without a cast [-Wint-conversion]
#define SMC_outw(v, a, r) outw(v, (a) + (r) - 0xa0000000)
^
drivers/net/ethernet/smsc/smc91x.h:428:3: note: in expansion of macro 'SMC_outw'
SMC_outw(x, ioaddr, reg); \
^
drivers/net/ethernet/smsc/smc91x.h:959:28: note: in expansion of macro 'SMC_out16'
#define SMC_SET_CTL(lp, x) SMC_out16(x, ioaddr, CTL_REG(lp))
^
drivers/net/ethernet/smsc/smc91x.c:1203:2: note: in expansion of macro 'SMC_SET_CTL'
SMC_SET_CTL(lp, ctl);
^
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:24,
from arch/sh/include/asm/hardirq.h:5,
from include/linux/hardirq.h:8,
from include/linux/interrupt.h:12,
from drivers/net/ethernet/smsc/smc91x.c:72:
arch/sh/include/asm/io.h:159:25: note: expected 'long unsigned int' but argument is of type 'void *'
static inline void pfx##out##bwlq##p(type val, unsigned long port) \
^
arch/sh/include/asm/io.h:181:2: note: in expansion of macro '__BUILD_IOPORT_SINGLE'
__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
^
arch/sh/include/asm/io.h:185:2: note: in expansion of macro '__BUILD_IOPORT_PFX'
__BUILD_IOPORT_PFX(, bwlq, type)
^
..
vim +/SMC_in16 +957 drivers/net/ethernet/smsc/smc91x.h
941 if (SMC_MUST_ALIGN_WRITE(lp)) \
942 SMC_outl((x)<<16, ioaddr, 12<<SMC_IO_SHIFT); \
943 else \
944 SMC_out16(x, ioaddr, BANK_SELECT); \
945 } while (0)
946
947 #define SMC_GET_BASE(lp) SMC_in16(ioaddr, BASE_REG(lp))
948
949 #define SMC_SET_BASE(lp, x) SMC_out16(x, ioaddr, BASE_REG(lp))
950
951 #define SMC_GET_CONFIG(lp) SMC_in16(ioaddr, CONFIG_REG(lp))
952
953 #define SMC_SET_CONFIG(lp, x) SMC_out16(x, ioaddr, CONFIG_REG(lp))
954
955 #define SMC_GET_COUNTER(lp) SMC_in16(ioaddr, COUNTER_REG(lp))
956
> 957 #define SMC_GET_CTL(lp) SMC_in16(ioaddr, CTL_REG(lp))
958
959 #define SMC_SET_CTL(lp, x) SMC_out16(x, ioaddr, CTL_REG(lp))
960
961 #define SMC_GET_MII(lp) SMC_in16(ioaddr, MII_REG(lp))
962
963 #define SMC_GET_GP(lp) SMC_in16(ioaddr, GP_REG(lp))
964
965 #define SMC_SET_GP(lp, x) \
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation