linux/include
Arnd Bergmann 5f7ec0f4c3 UPSTREAM: memblock: fix section mismatch warning
The inlining logic in clang-13 is rewritten to often not inline some
functions that were inlined by all earlier compilers.

In case of the memblock interfaces, this exposed a harmless bug of a
missing __init annotation:

WARNING: modpost: vmlinux.o(.text+0x507c0a): Section mismatch in reference from the function memblock_bottom_up() to the variable .meminit.data:memblock
The function memblock_bottom_up() references
the variable __meminitdata memblock.
This is often because memblock_bottom_up lacks a __meminitdata
annotation or the annotation of memblock is wrong.

Interestingly, these annotations were present originally, but got removed
with the explanation that the __init annotation prevents the function from
getting inlined.  I checked this again and found that while this is the
case with clang, gcc (version 7 through 10, did not test others) does
inline the functions regardless.

As the previous change was apparently intended to help the clang builds,
reverting it to help the newer clang versions seems appropriate as well.
gcc builds don't seem to care either way.

Link: https://lkml.kernel.org/r/20210225133808.2188581-1-arnd@kernel.org
Fixes: 5bdba520c1 ("mm: memblock: drop __init from memblock functions to make it inline")
Reference: 2cfb3665e8 ("include/linux/memblock.h: add __init to memblock_set_bottom_up()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Faiyaz Mohammed <faiyazm@codeaurora.org>
Cc: Baoquan He <bhe@redhat.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Aslan Bakirov <aslan@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 34dc2efb39)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I0940378d103fe706d408b7524acddf47f0ecc79d
2021-06-10 20:26:18 -07:00
..
acpi ACPI: scan: Use unique number for instance_no 2021-03-30 14:32:06 +02:00
asm-generic ANDROID: vmlinux.lds.h: Keep .eh_frame with CFI 2021-06-02 21:54:54 +00:00
clocksource
crypto Merge 5.10.37 into android12-5.10 2021-05-15 09:28:55 +02:00
drm UPSTREAM: drm/drm_vblank: set the dma-fence timestamp during send_vblank_event 2021-04-07 14:20:07 +00:00
dt-bindings FROMGIT: dt-bindings: connector: Replace BIT macro with generic bit ops 2021-06-07 06:15:29 +00:00
keys security: keys: trusted: fix TPM2 authorizations 2021-05-14 09:50:20 +02:00
kunit
kvm
linux UPSTREAM: memblock: fix section mismatch warning 2021-06-10 20:26:18 -07:00
math-emu
media ANDROID: media: v4l2-core: extend the v4l2 format to support request 2021-06-04 11:15:20 -07:00
memory
misc
net UPSTREAM: nl80211: fix kernel-doc warning in the new SAE attribute 2021-06-10 20:25:50 -07:00
pcmcia
ras
rdma
scsi Fix misc new gcc warnings 2021-05-11 14:47:36 +02:00
soc UPSTREAM: memory: mtk-smi: Allow building as module 2021-03-24 12:45:16 -07:00
sound FROMGIT: ASoC: soc-component: Add snd_soc_pcm_component_ack 2021-04-23 18:42:37 -07:00
target scsi: target: core: Add cmd length set before cmd complete 2021-03-17 17:06:25 +01:00
trace ANDROID: cpuidle-psci: Add vendor hook for cpuidle psci enter and exit 2021-06-10 22:06:51 +00:00
uapi FROMGIT: userfaultfd: fix UFFDIO_CONTINUE ioctl request definition 2021-06-04 19:13:43 +00:00
vdso
video
xen
OWNERS ANDROID: Add OWNERS files referring to the respective android-mainline OWNERS 2021-04-03 14:11:30 +00:00