]> www.infradead.org Git - users/hch/misc.git/commit
x86/ioremap: Simplify setup_data mapping variants
authorBaoquan He <bhe@redhat.com>
Sat, 23 Nov 2024 11:42:19 +0000 (19:42 +0800)
committerBorislav Petkov (AMD) <bp@alien8.de>
Sat, 7 Dec 2024 16:23:15 +0000 (17:23 +0100)
commit095ac6fa19500fecd7c62e755dee45bb303d4d43
tree08e12901fa9e169771af2f995170907a7eaff8f0
parent5daececd4ff533ab316ab360aba0bda1bf01961d
x86/ioremap: Simplify setup_data mapping variants

memremap_is_setup_data() and early_memremap_is_setup_data() share
completely the same process and handling, except for the differing
memremap/unmap invocations.

Add a helper __memremap_is_setup_data() extracting the common part and
simplify a lot of code while at it.

Mark __memremap_is_setup_data() as __ref to suppress this section
mismatch warning:

  WARNING: modpost: vmlinux: section mismatch in reference: __memremap_is_setup_data+0x5f (section: .text) ->
  early_memunmap (section: .init.text)

  [ bp: Massage a bit. ]

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20241123114221.149383-2-bhe@redhat.com
arch/x86/mm/ioremap.c