kallsyms: move kallsyms_show_value() out of kallsyms.c
authorManinder Singh <maninder1.s@samsung.com>
Thu, 8 Jun 2023 03:31:18 +0000 (09:01 +0530)
committerLuis Chamberlain <mcgrof@kernel.org>
Thu, 8 Jun 2023 19:27:20 +0000 (12:27 -0700)
commitb06e9318bfd03f531b918bd27b63f1eb88c21729
treed7dd7103a5e39bd4698bfe10815a86df8fba23aa
parent4f521bab5bfc854ec0dab7ef560dfa75247e615d
kallsyms: move kallsyms_show_value() out of kallsyms.c

function kallsyms_show_value() is used by other parts
like modules_open(), kprobes_read() etc. which can work in case of
!KALLSYMS also.

e.g. as of now lsmod do not show module address if KALLSYMS is disabled.
since kallsyms_show_value() defination is not present, it returns false
in !KALLSYMS.

/ # lsmod
test 12288 0 - Live 0x0000000000000000 (O)

So kallsyms_show_value() can be made generic
without dependency on KALLSYMS.

Thus moving out function to a new file ksyms_common.c.

With this patch code is just moved to new file
and no functional change.

Co-developed-by: Onkarnath <onkarnath.1@samsung.com>
Signed-off-by: Onkarnath <onkarnath.1@samsung.com>
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Reviewed-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
kernel/Makefile
kernel/kallsyms.c
kernel/ksyms_common.c [new file with mode: 0644]