mips: fix r3k_cache_init build regression
authorArnd Bergmann <arnd@arndb.de>
Thu, 14 Dec 2023 20:54:47 +0000 (20:54 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 20 Dec 2023 23:02:57 +0000 (15:02 -0800)
commitbbe4f634f48cd832aa43e7f5a4edc7494ef7ff5f
tree624ba663af14a2b9bcb65c74ae8b764dd3099cc6
parentfc0fbad122a7609d785ee754c2b6e1e3265547d0
mips: fix r3k_cache_init build regression

My earlier patch removed __weak function declarations that used to be
turned into wild branches by the linker, instead causing a link failure
when the called functions are unavailable:

mips-linux-ld: arch/mips/mm/cache.o: in function `cpu_cache_init':
cache.c:(.text+0x670): undefined reference to `r3k_cache_init'

The __weak method seems suboptimal, so rather than putting that back, make
the function calls conditional on the Kconfig symbol that controls the
compilation.

[akpm@linux-foundation.org: fix whitespace while we're in there]
Link: https://lkml.kernel.org/r/20231214205506.310402-1-arnd@kernel.org
Fixes: 66445677f01e ("mips: move cache declarations into header")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: kernelci.org bot <bot@kernelci.org>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/mips/mm/cache.c