All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/proc/vmcore: hide mmap_vmcore_fault() and vmcore_mmap_ops for nommu
@ 2021-06-12 13:09 ` Jisheng Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: Jisheng Zhang @ 2021-06-12 13:09 UTC (permalink / raw)
  To: Dave Young, Baoquan He, Vivek Goyal; +Cc: kexec, linux-kernel, linux-fsdevel

From: Jisheng Zhang <jszhang@kernel.org>

Without CONFIG_MMU, we get a W=1 build warning:

fs/proc/vmcore.c:443:42: warning: unused variable 'vmcore_mmap_ops' [-Wunused-const-variable]
static const struct vm_operations_struct vmcore_mmap_ops = {

The vmcore_mmap_ops is only referenced from an #ifdef'ed caller, so
this uses the same #ifdef around vmcore_mmap_ops and mmap_vmcore_fault().

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 fs/proc/vmcore.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 9a15334da208..d902a67cc3ea 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -401,6 +401,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,
 	return __read_vmcore((__force char *) buffer, buflen, fpos, 1);
 }
 
+#ifdef CONFIG_MMU
 /*
  * The vmcore fault handler uses the page cache and fills data using the
  * standard __vmcore_read() function.
@@ -443,6 +444,7 @@ static vm_fault_t mmap_vmcore_fault(struct vm_fault *vmf)
 static const struct vm_operations_struct vmcore_mmap_ops = {
 	.fault = mmap_vmcore_fault,
 };
+#endif
 
 /**
  * vmcore_alloc_buf - allocate buffer in vmalloc memory
-- 
2.32.0



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

* [PATCH] fs/proc/vmcore: hide mmap_vmcore_fault() and vmcore_mmap_ops for nommu
@ 2021-06-12 13:09 ` Jisheng Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: Jisheng Zhang @ 2021-06-12 13:09 UTC (permalink / raw)
  To: Dave Young, Baoquan He, Vivek Goyal; +Cc: kexec, linux-kernel, linux-fsdevel

From: Jisheng Zhang <jszhang@kernel.org>

Without CONFIG_MMU, we get a W=1 build warning:

fs/proc/vmcore.c:443:42: warning: unused variable 'vmcore_mmap_ops' [-Wunused-const-variable]
static const struct vm_operations_struct vmcore_mmap_ops = {

The vmcore_mmap_ops is only referenced from an #ifdef'ed caller, so
this uses the same #ifdef around vmcore_mmap_ops and mmap_vmcore_fault().

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 fs/proc/vmcore.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 9a15334da208..d902a67cc3ea 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -401,6 +401,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,
 	return __read_vmcore((__force char *) buffer, buflen, fpos, 1);
 }
 
+#ifdef CONFIG_MMU
 /*
  * The vmcore fault handler uses the page cache and fills data using the
  * standard __vmcore_read() function.
@@ -443,6 +444,7 @@ static vm_fault_t mmap_vmcore_fault(struct vm_fault *vmf)
 static const struct vm_operations_struct vmcore_mmap_ops = {
 	.fault = mmap_vmcore_fault,
 };
+#endif
 
 /**
  * vmcore_alloc_buf - allocate buffer in vmalloc memory
-- 
2.32.0



_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

end of thread, other threads:[~2021-06-12 13:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-12 13:09 [PATCH] fs/proc/vmcore: hide mmap_vmcore_fault() and vmcore_mmap_ops for nommu Jisheng Zhang
2021-06-12 13:09 ` Jisheng Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.