coredump: Move dump_emit_page() to kill unused warning
authorGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 3 Oct 2022 09:06:57 +0000 (11:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Feb 2023 11:59:50 +0000 (12:59 +0100)
commit0ed7b542c21c507fa170d02e3dd69837a55bffda
tree987818b5727b3655ba03e1e689fea4ae7b7c0010
parent7f9f6c54da876b3f0bece2b569456ceb96965ed7
coredump: Move dump_emit_page() to kill unused warning

commit 9c7417b5ec440242bb5b64521acd53d4e19130c1 upstream.

If CONFIG_ELF_CORE is not set:

    fs/coredump.c:835:12: error: ‘dump_emit_page’ defined but not used [-Werror=unused-function]
      835 | static int dump_emit_page(struct coredump_params *cprm, struct page *page)
          |            ^~~~~~~~~~~~~~

Fix this by moving dump_emit_page() inside the existing section
protected by #ifdef CONFIG_ELF_CORE.

Fixes: 06bbaa6dc53cb720 ("[coredump] don't use __kernel_write() on kmap_local_page()")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/coredump.c