Re: [PATCH] net: smc91x: Fix m68k kernel compilation for ColdFire CPU

From: Arnd Bergmann
Date: Thu May 09 2024 - 16:47:38 EST


On Thu, May 9, 2024, at 14:17, Thorsten Blum wrote:
>
> +static inline unsigned short _swapw(volatile unsigned short v)
> +{
> + return ((v << 8) | (v >> 8));
> +}
> +
> #define SMC_inw(a, r) _swapw(readw((a) + (r)))
> #define SMC_outw(lp, v, a, r) writew(_swapw(v), (a) + (r))
> #define SMC_insw(a, r, p, l) mcf_insw(a + r, p, l)

I think you can just use iowrite16_be() and ioread16_be()
here in place of the little-endian access plus swap.

Also, it looks like it's been broken for six years without
anyone noticing the problem, so I wonder if there are even
still any machines that use this driver and get kernel
updates.

Arnd