* [linux-next:master 6850/7915] mm/nommu.c:554:32: warning: variable 'prev' set but not used
@ 2022-02-24 7:50 kernel test robot
2022-02-24 17:51 ` Liam Howlett
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-02-24 7:50 UTC (permalink / raw)
To: Liam R. Howlett; +Cc: kbuild-all, Linux Memory Management List
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: d4a0ae62a277377de396850ed4b709b6bd9b7326
commit: b3d7ba3cdf23cae36715a695c7569f617e57d39d [6850/7915] mm: Remove the vma linked list
config: h8300-buildonly-randconfig-r003-20220224 (https://download.01.org/0day-ci/archive/20220224/202202241525.pbzn4rHq-lkp@intel.com/config)
compiler: h8300-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b3d7ba3cdf23cae36715a695c7569f617e57d39d
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout b3d7ba3cdf23cae36715a695c7569f617e57d39d
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=h8300 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from arch/h8300/include/asm/page.h:5,
from arch/h8300/include/asm/thread_info.h:12,
from include/linux/thread_info.h:60,
from include/asm-generic/preempt.h:5,
from ./arch/h8300/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:55,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from mm/nommu.c:20:
mm/nommu.c: In function 'kobjsize':
include/asm-generic/page.h:89:51: warning: ordered comparison of pointer with null pointer [-Wextra]
89 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
| ^~
mm/nommu.c:79:23: note: in expansion of macro 'virt_addr_valid'
79 | if (!objp || !virt_addr_valid(objp))
| ^~~~~~~~~~~~~~~
mm/nommu.c: In function 'add_vma_to_mm':
>> mm/nommu.c:554:32: warning: variable 'prev' set but not used [-Wunused-but-set-variable]
554 | struct vm_area_struct *prev;
| ^~~~
vim +/prev +554 mm/nommu.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 544
3034097a5017dd David Howells 2006-09-27 545 /*
8feae13110d60c David Howells 2009-01-08 546 * add a VMA into a process's mm_struct in the appropriate place in the list
8feae13110d60c David Howells 2009-01-08 547 * and tree and add to the address space's page tree also if not an anonymous
8feae13110d60c David Howells 2009-01-08 548 * page
c1e8d7c6a7a682 Michel Lespinasse 2020-06-08 549 * - should be called with mm->mmap_lock held writelocked
3034097a5017dd David Howells 2006-09-27 550 */
8feae13110d60c David Howells 2009-01-08 551 static void add_vma_to_mm(struct mm_struct *mm, struct vm_area_struct *vma)
^1da177e4c3f41 Linus Torvalds 2005-04-16 552 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 553 struct address_space *mapping;
4b662c6ba9aa9e Liam R. Howlett 2020-07-24 @554 struct vm_area_struct *prev;
4b662c6ba9aa9e Liam R. Howlett 2020-07-24 555 MA_STATE(mas, &mm->mm_mt, vma->vm_start, vma->vm_end);
8feae13110d60c David Howells 2009-01-08 556
8feae13110d60c David Howells 2009-01-08 557 BUG_ON(!vma->vm_region);
8feae13110d60c David Howells 2009-01-08 558
8feae13110d60c David Howells 2009-01-08 559 mm->map_count++;
8feae13110d60c David Howells 2009-01-08 560 vma->vm_mm = mm;
^1da177e4c3f41 Linus Torvalds 2005-04-16 561
^1da177e4c3f41 Linus Torvalds 2005-04-16 562 /* add the VMA to the mapping */
^1da177e4c3f41 Linus Torvalds 2005-04-16 563 if (vma->vm_file) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 564 mapping = vma->vm_file->f_mapping;
^1da177e4c3f41 Linus Torvalds 2005-04-16 565
83cde9e8ba95d1 Davidlohr Bueso 2014-12-12 566 i_mmap_lock_write(mapping);
^1da177e4c3f41 Linus Torvalds 2005-04-16 567 flush_dcache_mmap_lock(mapping);
6b2dbba8b6ac4d Michel Lespinasse 2012-10-08 568 vma_interval_tree_insert(vma, &mapping->i_mmap);
^1da177e4c3f41 Linus Torvalds 2005-04-16 569 flush_dcache_mmap_unlock(mapping);
83cde9e8ba95d1 Davidlohr Bueso 2014-12-12 570 i_mmap_unlock_write(mapping);
^1da177e4c3f41 Linus Torvalds 2005-04-16 571 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 572
4b662c6ba9aa9e Liam R. Howlett 2020-07-24 573 prev = mas_prev(&mas, 0);
4b662c6ba9aa9e Liam R. Howlett 2020-07-24 574 mas_reset(&mas);
8feae13110d60c David Howells 2009-01-08 575 /* add the VMA to the tree */
4b662c6ba9aa9e Liam R. Howlett 2020-07-24 576 vma_mas_store(vma, &mas);
^1da177e4c3f41 Linus Torvalds 2005-04-16 577 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 578
:::::: The code at line 554 was first introduced by commit
:::::: 4b662c6ba9aa9ed30b302eade5a79e857fc881b4 mm: Remove rb tree.
:::::: TO: Liam R. Howlett <Liam.Howlett@Oracle.com>
:::::: CC: Liam R. Howlett <Liam.Howlett@oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [linux-next:master 6850/7915] mm/nommu.c:554:32: warning: variable 'prev' set but not used
2022-02-24 7:50 [linux-next:master 6850/7915] mm/nommu.c:554:32: warning: variable 'prev' set but not used kernel test robot
@ 2022-02-24 17:51 ` Liam Howlett
0 siblings, 0 replies; 2+ messages in thread
From: Liam Howlett @ 2022-02-24 17:51 UTC (permalink / raw)
To: kernel test robot; +Cc: kbuild-all, Linux Memory Management List
* kernel test robot <lkp@intel.com> [220224 02:51]:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: d4a0ae62a277377de396850ed4b709b6bd9b7326
> commit: b3d7ba3cdf23cae36715a695c7569f617e57d39d [6850/7915] mm: Remove the vma linked list
> config: h8300-buildonly-randconfig-r003-20220224 (https://download.01.org/0day-ci/archive/20220224/202202241525.pbzn4rHq-lkp@intel.com/config)
> compiler: h8300-linux-gcc (GCC) 11.2.0
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b3d7ba3cdf23cae36715a695c7569f617e57d39d
> git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> git fetch --no-tags linux-next master
> git checkout b3d7ba3cdf23cae36715a695c7569f617e57d39d
> # save the config file to linux build tree
> mkdir build_dir
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=h8300 SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> In file included from arch/h8300/include/asm/page.h:5,
> from arch/h8300/include/asm/thread_info.h:12,
> from include/linux/thread_info.h:60,
> from include/asm-generic/preempt.h:5,
> from ./arch/h8300/include/generated/asm/preempt.h:1,
> from include/linux/preempt.h:78,
> from include/linux/spinlock.h:55,
> from include/linux/mmzone.h:8,
> from include/linux/gfp.h:6,
> from include/linux/mm.h:10,
> from mm/nommu.c:20:
> mm/nommu.c: In function 'kobjsize':
> include/asm-generic/page.h:89:51: warning: ordered comparison of pointer with null pointer [-Wextra]
> 89 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
> | ^~
> mm/nommu.c:79:23: note: in expansion of macro 'virt_addr_valid'
> 79 | if (!objp || !virt_addr_valid(objp))
> | ^~~~~~~~~~~~~~~
> mm/nommu.c: In function 'add_vma_to_mm':
> >> mm/nommu.c:554:32: warning: variable 'prev' set but not used [-Wunused-but-set-variable]
> 554 | struct vm_area_struct *prev;
> | ^~~~
>
Thank you. prev is no longer needed. I have fixed this for linux-next.
>
> vim +/prev +554 mm/nommu.c
>
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 544
> 3034097a5017dd David Howells 2006-09-27 545 /*
> 8feae13110d60c David Howells 2009-01-08 546 * add a VMA into a process's mm_struct in the appropriate place in the list
> 8feae13110d60c David Howells 2009-01-08 547 * and tree and add to the address space's page tree also if not an anonymous
> 8feae13110d60c David Howells 2009-01-08 548 * page
> c1e8d7c6a7a682 Michel Lespinasse 2020-06-08 549 * - should be called with mm->mmap_lock held writelocked
> 3034097a5017dd David Howells 2006-09-27 550 */
> 8feae13110d60c David Howells 2009-01-08 551 static void add_vma_to_mm(struct mm_struct *mm, struct vm_area_struct *vma)
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 552 {
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 553 struct address_space *mapping;
> 4b662c6ba9aa9e Liam R. Howlett 2020-07-24 @554 struct vm_area_struct *prev;
> 4b662c6ba9aa9e Liam R. Howlett 2020-07-24 555 MA_STATE(mas, &mm->mm_mt, vma->vm_start, vma->vm_end);
> 8feae13110d60c David Howells 2009-01-08 556
> 8feae13110d60c David Howells 2009-01-08 557 BUG_ON(!vma->vm_region);
> 8feae13110d60c David Howells 2009-01-08 558
> 8feae13110d60c David Howells 2009-01-08 559 mm->map_count++;
> 8feae13110d60c David Howells 2009-01-08 560 vma->vm_mm = mm;
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 561
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 562 /* add the VMA to the mapping */
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 563 if (vma->vm_file) {
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 564 mapping = vma->vm_file->f_mapping;
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 565
> 83cde9e8ba95d1 Davidlohr Bueso 2014-12-12 566 i_mmap_lock_write(mapping);
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 567 flush_dcache_mmap_lock(mapping);
> 6b2dbba8b6ac4d Michel Lespinasse 2012-10-08 568 vma_interval_tree_insert(vma, &mapping->i_mmap);
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 569 flush_dcache_mmap_unlock(mapping);
> 83cde9e8ba95d1 Davidlohr Bueso 2014-12-12 570 i_mmap_unlock_write(mapping);
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 571 }
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 572
> 4b662c6ba9aa9e Liam R. Howlett 2020-07-24 573 prev = mas_prev(&mas, 0);
> 4b662c6ba9aa9e Liam R. Howlett 2020-07-24 574 mas_reset(&mas);
> 8feae13110d60c David Howells 2009-01-08 575 /* add the VMA to the tree */
> 4b662c6ba9aa9e Liam R. Howlett 2020-07-24 576 vma_mas_store(vma, &mas);
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 577 }
> ^1da177e4c3f41 Linus Torvalds 2005-04-16 578
>
> :::::: The code at line 554 was first introduced by commit
> :::::: 4b662c6ba9aa9ed30b302eade5a79e857fc881b4 mm: Remove rb tree.
>
> :::::: TO: Liam R. Howlett <Liam.Howlett@Oracle.com>
> :::::: CC: Liam R. Howlett <Liam.Howlett@oracle.com>
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-24 17:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24 7:50 [linux-next:master 6850/7915] mm/nommu.c:554:32: warning: variable 'prev' set but not used kernel test robot
2022-02-24 17:51 ` Liam Howlett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox