Skip to content

Commit 5eefb47

Browse files
tobluxkuba-moo
authored andcommitted
net: smc91x: Fix m68k kernel compilation for ColdFire CPU
Compiling the m68k kernel with support for the ColdFire CPU family fails with the following error: In file included from drivers/net/ethernet/smsc/smc91x.c:80: drivers/net/ethernet/smsc/smc91x.c: In function ‘smc_reset’: drivers/net/ethernet/smsc/smc91x.h:160:40: error: implicit declaration of function ‘_swapw’; did you mean ‘swap’? [-Werror=implicit-function-declaration] 160 | #define SMC_outw(lp, v, a, r) writew(_swapw(v), (a) + (r)) | ^~~~~~ drivers/net/ethernet/smsc/smc91x.h:904:25: note: in expansion of macro ‘SMC_outw’ 904 | SMC_outw(lp, x, ioaddr, BANK_SELECT); \ | ^~~~~~~~ drivers/net/ethernet/smsc/smc91x.c:250:9: note: in expansion of macro ‘SMC_SELECT_BANK’ 250 | SMC_SELECT_BANK(lp, 2); | ^~~~~~~~~~~~~~~ cc1: some warnings being treated as errors The function _swapw() was removed in commit d97cf70 ("m68k: use asm-generic/io.h for non-MMU io access functions"), but is still used in drivers/net/ethernet/smsc/smc91x.h. Use ioread16be() and iowrite16be() to resolve the error. Cc: [email protected] Fixes: d97cf70 ("m68k: use asm-generic/io.h for non-MMU io access functions") Signed-off-by: Thorsten Blum <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8ec9897 commit 5eefb47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/smsc/smc91x.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ static inline void mcf_outsw(void *a, unsigned char *p, int l)
156156
writew(*wp++, a);
157157
}
158158

159-
#define SMC_inw(a, r) _swapw(readw((a) + (r)))
160-
#define SMC_outw(lp, v, a, r) writew(_swapw(v), (a) + (r))
159+
#define SMC_inw(a, r) ioread16be((a) + (r))
160+
#define SMC_outw(lp, v, a, r) iowrite16be(v, (a) + (r))
161161
#define SMC_insw(a, r, p, l) mcf_insw(a + r, p, l)
162162
#define SMC_outsw(a, r, p, l) mcf_outsw(a + r, p, l)
163163

0 commit comments

Comments
 (0)