mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [rcu:willy-maple 178/202] mm/mempolicy.c:807:25: warning: variable 'next' set but not used
@ 2021-02-02 23:50 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-02-02 23:50 UTC (permalink / raw)
  To: Liam R. Howlett; +Cc: kbuild-all, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 6345 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git willy-maple
head:   7e346d2845b4bd77663394f39fa70456e0084c86
commit: adcfbd7698558a279b852cb3a644557dc021b557 [178/202] mm/mempolicy: Use maple tree iterators instead of vma linked list
config: x86_64-randconfig-s021-20210202 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-215-g0fb77bb6-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?id=adcfbd7698558a279b852cb3a644557dc021b557
        git remote add rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
        git fetch --no-tags rcu willy-maple
        git checkout adcfbd7698558a279b852cb3a644557dc021b557
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

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 >>):

   mm/mempolicy.c: In function 'mbind_range':
>> mm/mempolicy.c:807:25: warning: variable 'next' set but not used [-Wunused-but-set-variable]
     807 |  struct vm_area_struct *next;
         |                         ^~~~


vim +/next +807 mm/mempolicy.c

8d34694c1abf29 KOSAKI Motohiro  2012-10-08  802  
^1da177e4c3f41 Linus Torvalds   2005-04-16  803  /* Step 2: apply policy to a range and do splits. */
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  804  static int mbind_range(struct mm_struct *mm, unsigned long start,
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  805  		       unsigned long end, struct mempolicy *new_pol)
^1da177e4c3f41 Linus Torvalds   2005-04-16  806  {
^1da177e4c3f41 Linus Torvalds   2005-04-16 @807  	struct vm_area_struct *next;
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  808  	struct vm_area_struct *prev;
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  809  	struct vm_area_struct *vma;
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  810  	int err = 0;
e26a51148f3ebd KOSAKI Motohiro  2011-12-28  811  	pgoff_t pgoff;
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  812  	unsigned long vmstart;
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  813  	unsigned long vmend;
adcfbd7698558a Liam R. Howlett  2021-01-04  814  	MA_STATE(mas, &mm->mm_mt, start, start);
^1da177e4c3f41 Linus Torvalds   2005-04-16  815  
adcfbd7698558a Liam R. Howlett  2021-01-04  816  	vma = mas_find(&mas, ULONG_MAX);
f18da660c095e3 Li Xinhai        2019-11-30  817  	VM_BUG_ON(!vma);
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  818  
adcfbd7698558a Liam R. Howlett  2021-01-04  819  	prev = vma_mas_prev(&mas);
e26a51148f3ebd KOSAKI Motohiro  2011-12-28  820  	if (start > vma->vm_start)
e26a51148f3ebd KOSAKI Motohiro  2011-12-28  821  		prev = vma;
e26a51148f3ebd KOSAKI Motohiro  2011-12-28  822  
adcfbd7698558a Liam R. Howlett  2021-01-04  823  	mas_for_each(&mas, vma, end - 1) {
adcfbd7698558a Liam R. Howlett  2021-01-04  824  		next = vma_next(mm, vma);
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  825  		vmstart = max(start, vma->vm_start);
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  826  		vmend   = min(end, vma->vm_end);
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  827  
e26a51148f3ebd KOSAKI Motohiro  2011-12-28  828  		if (mpol_equal(vma_policy(vma), new_pol))
adcfbd7698558a Liam R. Howlett  2021-01-04  829  			goto next;
e26a51148f3ebd KOSAKI Motohiro  2011-12-28  830  
e26a51148f3ebd KOSAKI Motohiro  2011-12-28  831  		pgoff = vma->vm_pgoff +
e26a51148f3ebd KOSAKI Motohiro  2011-12-28  832  			((vmstart - vma->vm_start) >> PAGE_SHIFT);
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  833  		prev = vma_merge(mm, prev, vmstart, vmend, vma->vm_flags,
e26a51148f3ebd KOSAKI Motohiro  2011-12-28  834  				 vma->anon_vma, vma->vm_file, pgoff,
19a809afe2fe08 Andrea Arcangeli 2015-09-04  835  				 new_pol, vma->vm_userfaultfd_ctx);
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  836  		if (prev) {
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  837  			vma = prev;
adcfbd7698558a Liam R. Howlett  2021-01-04  838  			next = vma_next(mm, vma);
3964acd0dbec12 Oleg Nesterov    2013-07-31  839  			if (mpol_equal(vma_policy(vma), new_pol))
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  840  				continue;
3964acd0dbec12 Oleg Nesterov    2013-07-31  841  			/* vma_merge() joined vma && vma->next, case 8 */
3964acd0dbec12 Oleg Nesterov    2013-07-31  842  			goto replace;
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  843  		}
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  844  		if (vma->vm_start != vmstart) {
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  845  			err = split_vma(vma->vm_mm, vma, vmstart, 1);
^1da177e4c3f41 Linus Torvalds   2005-04-16  846  			if (err)
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  847  				goto out;
^1da177e4c3f41 Linus Torvalds   2005-04-16  848  		}
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  849  		if (vma->vm_end != vmend) {
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  850  			err = split_vma(vma->vm_mm, vma, vmend, 0);
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  851  			if (err)
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  852  				goto out;
adcfbd7698558a Liam R. Howlett  2021-01-04  853  			mas_pause(&mas);
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  854  		}
3964acd0dbec12 Oleg Nesterov    2013-07-31  855   replace:
869833f2c5c6e4 KOSAKI Motohiro  2012-10-08  856  		err = vma_replace_policy(vma, new_pol);
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  857  		if (err)
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  858  			goto out;
adcfbd7698558a Liam R. Howlett  2021-01-04  859  next:
adcfbd7698558a Liam R. Howlett  2021-01-04  860  		prev = vma;
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  861  	}
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  862  
9d8cebd4bcd7c3 KOSAKI Motohiro  2010-03-05  863   out:
^1da177e4c3f41 Linus Torvalds   2005-04-16  864  	return err;
^1da177e4c3f41 Linus Torvalds   2005-04-16  865  }
^1da177e4c3f41 Linus Torvalds   2005-04-16  866  

:::::: The code at line 807 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35687 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-02 23:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 23:50 [rcu:willy-maple 178/202] mm/mempolicy.c:807:25: warning: variable 'next' set but not used kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®