Messages in this thread | | | Date | Thu, 9 May 2024 22:36:57 +0200 | From | Andrew Lunn <> | Subject | Re: [PATCH] net: smc91x: Fix m68k kernel compilation for ColdFire CPU |
| |
On Thu, May 09, 2024 at 02:17:14PM +0200, Thorsten Blum wrote: > 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 d97cf70af097 ("m68k: use > asm-generic/io.h for non-MMU io access functions"), but is still used in > drivers/net/ethernet/smsc/smc91x.h. > > Re-adding the previously deleted _swapw() function resolves the error.
This seems like the wrong fix.
commit d97cf70af09721ef416c61faa44543e3b84c9a55 Author: Greg Ungerer <gerg@linux-m68k.org> Date: Fri Mar 23 23:39:10 2018 +1000
m68k: use asm-generic/io.h for non-MMU io access functions
There is nothing really special about the non-MMU m68k IO access functions. So we can easily switch to using the asm-generic/io.h functions.
So it rather than put something back which there is an aim to remove, please find the generic replacement. This _swapw() swaps a 16 bit word. The generic for that is swab16().
I'm also surprised it took 6 years to find this. Has something else changed recently?
Andrew
--- pw-bot: cr
| |