It's only on 32 bit big endian. I don't have UBSAN for MIPS on my setup
so haven't noticed it.

#ifndef __LITTLE_ENDIAN
         pattern <<= (BITS_PER_LONG % bpp);
         pattern |= pattern >> bpp;          <-
#endif

In the 32 BPP case the result is identical in both the no shift and zero
result implementations.

I've patched it by skipping this realignment as it's only needed if the
BPP is smaller than the word length.

Thanks for looking into this!

Applied your patch from https://lore.kernel.org/linux-fbdev/20250821024248.7458-1-s...@c64.rulez.org/T/#u which fixes the USBAN hit for me.

Greetings,
Erhard

Reply via email to