Skip to content

Commit

Permalink
fs/proc/vmcore.c: hide vmcoredd_mmap_dumps() for nommu builds
Browse files Browse the repository at this point in the history
Without CONFIG_MMU, we get a build warning:

  fs/proc/vmcore.c:228:12: error: 'vmcoredd_mmap_dumps' defined but not used [-Werror=unused-function]
   static int vmcoredd_mmap_dumps(struct vm_area_struct *vma, unsigned long dst,

The function is only referenced from an #ifdef'ed caller, so
this uses the same #ifdef around it.

Link: http://lkml.kernel.org/r/[email protected]
Fixes: 7efe48d ("vmcore: append device dumps to vmcore as elf notes")
Signed-off-by: Arnd Bergmann <[email protected]>
Cc: Ganesh Goudar <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Rahul Lakkireddy <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
arndb authored and torvalds committed Aug 24, 2018
1 parent 3cc97be commit a2036a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/proc/vmcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ static int vmcoredd_copy_dumps(void *dst, u64 start, size_t size, int userbuf)
return ret;
}

#ifdef CONFIG_MMU
static int vmcoredd_mmap_dumps(struct vm_area_struct *vma, unsigned long dst,
u64 start, size_t size)
{
Expand Down Expand Up @@ -259,6 +260,7 @@ static int vmcoredd_mmap_dumps(struct vm_area_struct *vma, unsigned long dst,
mutex_unlock(&vmcoredd_mutex);
return ret;
}
#endif /* CONFIG_MMU */
#endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */

/* Read from the ELF header and then the crash dump. On error, negative value is
Expand Down

0 comments on commit a2036a1

Please sign in to comment.