[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <202411140156.2o0nS4fl-lkp@intel.com>
Date: Thu, 14 Nov 2024 01:06:42 +0800
From: kernel test robot <lkp@...el.com>
To: Qi Xi <xiqi2@...wei.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Memory Management List <linux-mm@...ck.org>
Subject: fs/proc/vmcore.c:424:19: warning: 'mmap_vmcore_fault' defined but
not used
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 <lkp@...el.com>
| 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)
| ^~~~~~~~~~~~~~~~~
vim +/mmap_vmcore_fault +424 fs/proc/vmcore.c
9cb218131de1c59 Michael Holzheu 2013-09-11 416
9cb218131de1c59 Michael Holzheu 2013-09-11 417 /*
9cb218131de1c59 Michael Holzheu 2013-09-11 418 * The vmcore fault handler uses the page cache and fills data using the
4a22fd20379ca89 Matthew Wilcox (Oracle 2022-04-29 419) * standard __read_vmcore() function.
9cb218131de1c59 Michael Holzheu 2013-09-11 420 *
9cb218131de1c59 Michael Holzheu 2013-09-11 421 * On s390 the fault handler is used for memory regions that can't be mapped
9cb218131de1c59 Michael Holzheu 2013-09-11 422 * directly with remap_pfn_range().
9cb218131de1c59 Michael Holzheu 2013-09-11 423 */
36f062042b0fd9f Souptick Joarder 2018-08-21 @424 static vm_fault_t mmap_vmcore_fault(struct vm_fault *vmf)
9cb218131de1c59 Michael Holzheu 2013-09-11 425 {
9cb218131de1c59 Michael Holzheu 2013-09-11 426 #ifdef CONFIG_S390
11bac80004499ea Dave Jiang 2017-02-24 427 struct address_space *mapping = vmf->vma->vm_file->f_mapping;
9cb218131de1c59 Michael Holzheu 2013-09-11 428 pgoff_t index = vmf->pgoff;
4a22fd20379ca89 Matthew Wilcox (Oracle 2022-04-29 429) struct iov_iter iter;
4a22fd20379ca89 Matthew Wilcox (Oracle 2022-04-29 430) struct kvec kvec;
9cb218131de1c59 Michael Holzheu 2013-09-11 431 struct page *page;
9cb218131de1c59 Michael Holzheu 2013-09-11 432 loff_t offset;
9cb218131de1c59 Michael Holzheu 2013-09-11 433 int rc;
9cb218131de1c59 Michael Holzheu 2013-09-11 434
9cb218131de1c59 Michael Holzheu 2013-09-11 435 page = find_or_create_page(mapping, index, GFP_KERNEL);
9cb218131de1c59 Michael Holzheu 2013-09-11 436 if (!page)
9cb218131de1c59 Michael Holzheu 2013-09-11 437 return VM_FAULT_OOM;
9cb218131de1c59 Michael Holzheu 2013-09-11 438 if (!PageUptodate(page)) {
09cbfeaf1a5a67b Kirill A. Shutemov 2016-04-01 439 offset = (loff_t) index << PAGE_SHIFT;
4a22fd20379ca89 Matthew Wilcox (Oracle 2022-04-29 440) kvec.iov_base = page_address(page);
4a22fd20379ca89 Matthew Wilcox (Oracle 2022-04-29 441) kvec.iov_len = PAGE_SIZE;
de4eda9de2d957e Al Viro 2022-09-15 442 iov_iter_kvec(&iter, ITER_DEST, &kvec, 1, PAGE_SIZE);
4a22fd20379ca89 Matthew Wilcox (Oracle 2022-04-29 443)
4a22fd20379ca89 Matthew Wilcox (Oracle 2022-04-29 444) rc = __read_vmcore(&iter, &offset);
9cb218131de1c59 Michael Holzheu 2013-09-11 445 if (rc < 0) {
9cb218131de1c59 Michael Holzheu 2013-09-11 446 unlock_page(page);
09cbfeaf1a5a67b Kirill A. Shutemov 2016-04-01 447 put_page(page);
b5c212374c85353 Souptick Joarder 2018-10-30 448 return vmf_error(rc);
9cb218131de1c59 Michael Holzheu 2013-09-11 449 }
9cb218131de1c59 Michael Holzheu 2013-09-11 450 SetPageUptodate(page);
9cb218131de1c59 Michael Holzheu 2013-09-11 451 }
9cb218131de1c59 Michael Holzheu 2013-09-11 452 unlock_page(page);
9cb218131de1c59 Michael Holzheu 2013-09-11 453 vmf->page = page;
9cb218131de1c59 Michael Holzheu 2013-09-11 454 return 0;
9cb218131de1c59 Michael Holzheu 2013-09-11 455 #else
9cb218131de1c59 Michael Holzheu 2013-09-11 456 return VM_FAULT_SIGBUS;
9cb218131de1c59 Michael Holzheu 2013-09-11 457 #endif
9cb218131de1c59 Michael Holzheu 2013-09-11 458 }
9cb218131de1c59 Michael Holzheu 2013-09-11 459
:::::: The code at line 424 was first introduced by commit
:::::: 36f062042b0fd9f8e41b97a472f52139886ca26f fs/proc/vmcore.c: use new typedef vm_fault_t
:::::: TO: Souptick Joarder <jrdr.linux@...il.com>
:::::: CC: Linus Torvalds <torvalds@...ux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists