mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] coredump: Fix build error for ‘dump_emit_page’ defined but not used
@ 2022-11-15  4:04 Li Hua
  2022-11-15 19:35 ` Chaitanya Kulkarni
  0 siblings, 1 reply; 2+ messages in thread
From: Li Hua @ 2022-11-15  4:04 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, linux-kernel, weiyongjun1, yusongping, hucool.lihua

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

Fix this by adding the missing CONFIG_ELF_CORE for dump_emit_page.

Fixes: 06bbaa6dc53c ("[coredump] don't use __kernel_write() on kmap_local_page()")
Signed-off-by: Li Hua <hucool.lihua@huawei.com>
---
 fs/coredump.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/coredump.c b/fs/coredump.c
index 7bad7785e8e6..8663042ebe9c 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -831,6 +831,7 @@ static int __dump_skip(struct coredump_params *cprm, size_t nr)
 	}
 }
 
+#ifdef CONFIG_ELF_CORE
 static int dump_emit_page(struct coredump_params *cprm, struct page *page)
 {
 	struct bio_vec bvec = {
@@ -863,6 +864,7 @@ static int dump_emit_page(struct coredump_params *cprm, struct page *page)
 
 	return 1;
 }
+#endif
 
 int dump_emit(struct coredump_params *cprm, const void *addr, int nr)
 {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] coredump: Fix build error for ‘dump_emit_page’ defined but not used
  2022-11-15  4:04 [PATCH] coredump: Fix build error for ‘dump_emit_page’ defined but not used Li Hua
@ 2022-11-15 19:35 ` Chaitanya Kulkarni
  0 siblings, 0 replies; 2+ messages in thread
From: Chaitanya Kulkarni @ 2022-11-15 19:35 UTC (permalink / raw)
  To: Li Hua, viro; +Cc: linux-fsdevel, linux-kernel, weiyongjun1, yusongping

On 11/14/22 20:04, Li Hua wrote:
> If CONFIG_ELF_CORE is not set:
>      fs/coredump.c:834:12: error: ‘dump_emit_page’ defined but not used [-Werror=unused-function]
>      static int dump_emit_page(struct coredump_params *cprm, struct page *page)
>              ^~~~~~~~~~~~~~
> 
> Fix this by adding the missing CONFIG_ELF_CORE for dump_emit_page.
> 
> Fixes: 06bbaa6dc53c ("[coredump] don't use __kernel_write() on kmap_local_page()")
> Signed-off-by: Li Hua <hucool.lihua@huawei.com>
> ---


Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-15 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15  4:04 [PATCH] coredump: Fix build error for ‘dump_emit_page’ defined but not used Li Hua
2022-11-15 19:35 ` Chaitanya Kulkarni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®