From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16974D6A25D for ; Thu, 14 Nov 2024 23:57:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 89C716B007B; Thu, 14 Nov 2024 18:57:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 84C966B0082; Thu, 14 Nov 2024 18:57:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 714116B0083; Thu, 14 Nov 2024 18:57:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 533D56B007B for ; Thu, 14 Nov 2024 18:57:04 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 02456120618 for ; Thu, 14 Nov 2024 23:57:03 +0000 (UTC) X-FDA: 82786362540.10.D04546E Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf12.hostedemail.com (Postfix) with ESMTP id 0442540342 for ; Thu, 14 Nov 2024 23:56:41 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=c6tGHY2y; spf=pass (imf12.hostedemail.com: domain of akpm@linux-foundation.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731628446; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=HaQ4VUJYyW7Vc8j7r4DxgMIOprrUhy/MGAOxJINKfFw=; b=tkzHRFMMIRlbWEthzJFb3cYgRcaQ/GaRSb43Q52HpSW0E4quSHDZEscdcZgIQMCVbpFXde qgfV2kJpfO8kEovJmWjjLajTFdBMiPzqK5seZSdBUOKBNz8iQRPlElqkaqby7YR/7oiojW zmhvRkMT2xf+eq6RmQv6voP8Kw29EdQ= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=c6tGHY2y; spf=pass (imf12.hostedemail.com: domain of akpm@linux-foundation.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731628446; a=rsa-sha256; cv=none; b=HwnXAFBmemUbauyf0/2qNRTGIbPNtAA1Pi2tOyUMo0TtW+eNq09fyYvnY3R7Y2VEDRYnju poUPyPGn1nDiTrNEpSuBzK1uGeDnpi8TWPaxL9s5zAW8q9tPQoxoRs5pQtLsQ7YJPOm5fH E9mvwPsAtvNcPCkoLlI4B46zyfM6FM0= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 4E2CFA419DF; Thu, 14 Nov 2024 23:55:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23B65C4CECD; Thu, 14 Nov 2024 23:56:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1731628621; bh=4LEMw7tFZ/I2l0o9tYXh+UZzqxJqnQPfsr1Kfeb3eLk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=c6tGHY2yKKUHKw8OBYSweMkHUUuvnopjACx/RdLwVsviU+aQ3RYU9Oue96sB75Y0g NZQofGRg691A0PsHsb6yT90uzEYgigEcx8khpKRboxx2KYyHxlD3tfdbIG8Kf+rITz SLmrVxRfFQ5MUhjPy+ofIrr7W6rY08lqs0tful7Y= Date: Thu, 14 Nov 2024 15:56:56 -0800 From: Andrew Morton To: kernel test robot Cc: Qi Xi , oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Linux Memory Management List Subject: Re: fs/proc/vmcore.c:424:19: warning: 'mmap_vmcore_fault' defined but not used Message-Id: <20241114155656.a189f0b92d5596e4cb940d82@linux-foundation.org> In-Reply-To: <202411140156.2o0nS4fl-lkp@intel.com> References: <202411140156.2o0nS4fl-lkp@intel.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 0442540342 X-Stat-Signature: cez9gtdepbb1knsy7n49zedxaapteunq X-Rspam-User: X-HE-Tag: 1731628601-359295 X-HE-Meta: U2FsdGVkX1/JtX1VkRNSdA6O+RUU1uwmzICZKC1gSo0s/+pmIRQ7g1+jeCFvs97yjBdagSr87wguZCEGLsphsfkCVotNXt81ggoVO0d1SnlXHb7dr7HY6IN69fLJw7wL7fu33xfEudEWnCzwGSmIPMr4WJC8CwWJTbX+/41ECkpk7NOS4OaNenKbrP2OzGialo+fl2sjS3zrjiKYtNpEAtvSrJyM1dfjRgIKcRYNw4WsMLfMFPglkzXFLxkrXL5KBwtO6KFS3nyE4fY8Am9T76aECiPx2ZMSkfbsDicSJRRpWS8RBQfzwflleevWNm6ktgAlxux582Z0eOYP9AMGf+ZxftRckjzZwCXrDWwPFLXm6f8BwTajDWVvyy14Bvz2X2SEUeVV0Uea24sNreW9s/ozv3xfQhR9ni9UB0Pi7zr8pPWAYlN5KFXmettlWaqpuExLZf/KXvBOszEuMweU4MIu0ACS1v4JLCbzkKJO4YmlopHlRt4ssmW8N1hcegUxxwkI3SdTMoF3hbnDzDCO12FvPInC4Fh8fr+Lii8CGL9cEiI2MthuN0V32PX6DnExpTRspx1z2H+8LtxAKtUuD2jtRq4K47Fho5QiU9O6g0FrI4h1sVaB9g1czgTmA9vvxt2n2YKXCMKwGrEjyL9Ld7jRDHQEFev4UhbQeHTwkcWONrjkYHDXs21lHQLSaXLXmO7l39/nMq+c7crixA4Fv53ZMa7G9jzZTRN5a9IbWYw/UdC/vRkGye6j+PhSBEGVEDPR7iB5vekCQaWGBpVdk/jWrFbPL0q0sEZ727Lg1PmaD8jAPc8+w/KMVWt9ldIac4vril6sl5rh1sHg8WwSlXhzLxYGVVq6rPeu1qEfSnsfO/GAGF0SOo2DJ0ZhhP193Du3KnrFzu/8jJr6Uo9Lal05TEVGRNFOsMtxIOTj134JkTid5tjgkBl55jQbYsPnT1X1QqaFM4i6IHX29pa sRXRT3CI qx+rQfrtO6oNe5MkyFuHghOa33SZmjhoilaXcjvhtnNztqQOiHbs5RKy789dk/vX/BC2SoWRtMtZ/fXkOscTjKRB598aIldiOqIAX1Q5aVi/YE6yLPHvV8c//T2xrIaV7WkOErDh74HEXny0qvnk0Orh2IctbNar6qGLhabAKb43076mc0bUSR/U5gv6xx1DiA9VwuH09J0aw6EEY9d2jzKbO/kbdV0bqSMRzO1B52YjCCOq6I7G2qVDNqMkiTANZ6BwSmG4Pag/53R2yIJKS52kvm/9sL3guHtfNTzfv7PLUEfpfguWHraXdM0+giqHd4ymY0ykhOE0/Z14rjNVzFewCB9A+XW7BjTRmBvTUgYfsdiFlE73stTb1/39PAAJ8PpQyV2LlbBzul79eLEEqsnyUMtOprGAnbBCi++MMgB5dVXzGB9RT3nKq//r0LeIB0PD+MqBKn8Uweei0PkQk1kWpTFRTnkYEmaySfJvycAiImwI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, 14 Nov 2024 01:06:42 +0800 kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: f1b785f4c7870c42330b35522c2514e39a1e28e7 > commit: b8ee299855f08539e04d6c1a6acb3dc9e5423c00 fs/proc: fix compile warning about variable 'vmcore_mmap_ops' > date: 6 days ago > config: riscv-randconfig-r071-20241113 (https://download.01.org/0day-ci/archive/20241114/202411140156.2o0nS4fl-lkp@intel.com/config) > compiler: riscv32-linux-gcc (GCC) 14.2.0 > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241114/202411140156.2o0nS4fl-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot > | Closes: https://lore.kernel.org/oe-kbuild-all/202411140156.2o0nS4fl-lkp@intel.com/ > > All warnings (new ones prefixed by >>): > > >> fs/proc/vmcore.c:424:19: warning: 'mmap_vmcore_fault' defined but not used [-Wunused-function] > 424 | static vm_fault_t mmap_vmcore_fault(struct vm_fault *vmf) > | ^~~~~~~~~~~~~~~~~ Thanks, I did this: From: Andrew Morton Subject: fs/proc/vmcore.c: fix warning when CONFIG_MMU=n Date: Thu Nov 14 03:44:21 PM PST 2024 >> fs/proc/vmcore.c:424:19: warning: 'mmap_vmcore_fault' defined but not used [-Wunused-function] 424 | static vm_fault_t mmap_vmcore_fault(struct vm_fault *vmf) Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202411140156.2o0nS4fl-lkp@intel.com/ Cc: Qi Xi Signed-off-by: Andrew Morton --- fs/proc/vmcore.c | 56 ++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) --- a/fs/proc/vmcore.c~fs-proc-vmcorec-fix-warning-when-config_mmu=n +++ a/fs/proc/vmcore.c @@ -414,6 +414,34 @@ static ssize_t read_vmcore(struct kiocb return __read_vmcore(iter, &iocb->ki_pos); } +/** + * vmcore_alloc_buf - allocate buffer in vmalloc memory + * @size: size of buffer + * + * If CONFIG_MMU is defined, use vmalloc_user() to allow users to mmap + * the buffer to user-space by means of remap_vmalloc_range(). + * + * If CONFIG_MMU is not defined, use vzalloc() since mmap_vmcore() is + * disabled and there's no need to allow users to mmap the buffer. + */ +static inline char *vmcore_alloc_buf(size_t size) +{ +#ifdef CONFIG_MMU + return vmalloc_user(size); +#else + return vzalloc(size); +#endif +} + +/* + * Disable mmap_vmcore() if CONFIG_MMU is not defined. MMU is + * essential for mmap_vmcore() in order to map physically + * non-contiguous objects (ELF header, ELF note segment and memory + * regions in the 1st kernel pointed to by PT_LOAD entries) into + * virtually contiguous user-space in ELF layout. + */ +#ifdef CONFIG_MMU + /* * The vmcore fault handler uses the page cache and fills data using the * standard __read_vmcore() function. @@ -457,34 +485,6 @@ static vm_fault_t mmap_vmcore_fault(stru #endif } -/** - * vmcore_alloc_buf - allocate buffer in vmalloc memory - * @size: size of buffer - * - * If CONFIG_MMU is defined, use vmalloc_user() to allow users to mmap - * the buffer to user-space by means of remap_vmalloc_range(). - * - * If CONFIG_MMU is not defined, use vzalloc() since mmap_vmcore() is - * disabled and there's no need to allow users to mmap the buffer. - */ -static inline char *vmcore_alloc_buf(size_t size) -{ -#ifdef CONFIG_MMU - return vmalloc_user(size); -#else - return vzalloc(size); -#endif -} - -/* - * Disable mmap_vmcore() if CONFIG_MMU is not defined. MMU is - * essential for mmap_vmcore() in order to map physically - * non-contiguous objects (ELF header, ELF note segment and memory - * regions in the 1st kernel pointed to by PT_LOAD entries) into - * virtually contiguous user-space in ELF layout. - */ -#ifdef CONFIG_MMU - static const struct vm_operations_struct vmcore_mmap_ops = { .fault = mmap_vmcore_fault, }; _