From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr690114.outbound.protection.outlook.com ([40.107.69.114]:18358 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726674AbeH3WEe (ORCPT ); Thu, 30 Aug 2018 18:04:34 -0400 From: Sasha Levin To: "stable@vger.kernel.org" CC: Arnd Bergmann , Ganesh Goudar , "David S. Miller" , Rahul Lakkireddy , Alexey Dobriyan , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH AUTOSEL 4.18 006/113] fs/proc/vmcore.c: hide vmcoredd_mmap_dumps() for nommu builds Date: Thu, 30 Aug 2018 18:01:12 +0000 Message-ID: <20180830180050.35735-6-alexander.levin@microsoft.com> References: <20180830180050.35735-1-alexander.levin@microsoft.com> In-Reply-To: <20180830180050.35735-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Arnd Bergmann [ Upstream commit a2036a1ef2ee91acab01a0ae4a534070691a42ec ] Without CONFIG_MMU, we get a build warning: fs/proc/vmcore.c:228:12: error: 'vmcoredd_mmap_dumps' defined but not use= d [-Werror=3Dunused-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/20180525213526.2117790-1-arnd@arndb.de Fixes: 7efe48df8a3d ("vmcore: append device dumps to vmcore as elf notes") Signed-off-by: Arnd Bergmann Cc: Ganesh Goudar Cc: "David S. Miller" Cc: Rahul Lakkireddy Cc: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- fs/proc/vmcore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index cfb6674331fd..0651646dd04d 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c @@ -225,6 +225,7 @@ static int vmcoredd_copy_dumps(void *dst, u64 start, si= ze_t size, int userbuf) return ret; } =20 +#ifdef CONFIG_MMU static int vmcoredd_mmap_dumps(struct vm_area_struct *vma, unsigned long d= st, u64 start, size_t size) { @@ -259,6 +260,7 @@ static int vmcoredd_mmap_dumps(struct vm_area_struct *v= ma, unsigned long dst, mutex_unlock(&vmcoredd_mutex); return ret; } +#endif /* CONFIG_MMU */ #endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */ =20 /* Read from the ELF header and then the crash dump. On error, negative va= lue is --=20 2.17.1