Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev: c2p: Fix link failure on non-inlining

When the compiler decides not to inline the Chunky-to-Planar core
functions, the build fails with:

c2p_planar.c:(.text+0xd6): undefined reference to `c2p_unsupported'
c2p_planar.c:(.text+0x1dc): undefined reference to `c2p_unsupported'
c2p_iplan2.c:(.text+0xc4): undefined reference to `c2p_unsupported'
c2p_iplan2.c:(.text+0x150): undefined reference to `c2p_unsupported'

Fix this by marking the functions __always_inline.

While this could be triggered before by manually enabling both
CONFIG_OPTIMIZE_INLINING and CONFIG_CC_OPTIMIZE_FOR_SIZE, it was exposed
in the m68k defconfig by commit ac7c3e4ff401b304 ("compiler: enable
CONFIG_OPTIMIZE_INLINING forcibly").

Fixes: 9012d011660ea5cf ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING")
Reported-by: noreply@ellerman.id.au
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190927094708.11563-1-geert@linux-m68k.org

authored by

Geert Uytterhoeven and committed by
Daniel Vetter
b330f397 f70744c6

+4 -4
+4 -4
drivers/video/fbdev/c2p_core.h
··· 29 29 30 30 extern void c2p_unsupported(void); 31 31 32 - static inline u32 get_mask(unsigned int n) 32 + static __always_inline u32 get_mask(unsigned int n) 33 33 { 34 34 switch (n) { 35 35 case 1: ··· 57 57 * Transpose operations on 8 32-bit words 58 58 */ 59 59 60 - static inline void transp8(u32 d[], unsigned int n, unsigned int m) 60 + static __always_inline void transp8(u32 d[], unsigned int n, unsigned int m) 61 61 { 62 62 u32 mask = get_mask(n); 63 63 ··· 99 99 * Transpose operations on 4 32-bit words 100 100 */ 101 101 102 - static inline void transp4(u32 d[], unsigned int n, unsigned int m) 102 + static __always_inline void transp4(u32 d[], unsigned int n, unsigned int m) 103 103 { 104 104 u32 mask = get_mask(n); 105 105 ··· 126 126 * Transpose operations on 4 32-bit words (reverse order) 127 127 */ 128 128 129 - static inline void transp4x(u32 d[], unsigned int n, unsigned int m) 129 + static __always_inline void transp4x(u32 d[], unsigned int n, unsigned int m) 130 130 { 131 131 u32 mask = get_mask(n); 132 132