All of lore.kernel.org
 help / color / mirror / Atom feed
* [mips-linux:mips-next 47/49] drivers/staging/comedi/comedi_fops.c:2399:8: error: 'PAGE_SHARED' undeclared; did you mean
@ 2020-11-20  0:11 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-11-20  0:11 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git mips-next
head:   91c7a7e0656de077911332f2acdb60f6fd4a134f
commit: 0df162e1377a585ced8adb932f7d6e4164e91ccf [47/49] MIPS: mm: Clean up setup of protection map
config: mips-randconfig-r002-20201119 (attached as .config)
compiler: mips64-linux-gcc (GCC) 9.3.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/mips/linux.git/commit/?id=0df162e1377a585ced8adb932f7d6e4164e91ccf
        git remote add mips-linux https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git
        git fetch --no-tags mips-linux mips-next
        git checkout 0df162e1377a585ced8adb932f7d6e4164e91ccf
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/staging/comedi/comedi_fops.c: In function 'comedi_mmap':
>> drivers/staging/comedi/comedi_fops.c:2399:8: error: 'PAGE_SHARED' undeclared (first use in this function); did you mean 'VM_SHARED'?
    2399 |        PAGE_SHARED);
         |        ^~~~~~~~~~~
         |        VM_SHARED
   drivers/staging/comedi/comedi_fops.c:2399:8: note: each undeclared identifier is reported only once for each function it appears in

vim +2399 drivers/staging/comedi/comedi_fops.c

ed9eccbe8970f6e David Schleef      2008-11-04  2315  
ed9eccbe8970f6e David Schleef      2008-11-04  2316  static int comedi_mmap(struct file *file, struct vm_area_struct *vma)
ed9eccbe8970f6e David Schleef      2008-11-04  2317  {
20f083c07565cb7 Ian Abbott         2014-11-04  2318  	struct comedi_file *cfp = file->private_data;
20f083c07565cb7 Ian Abbott         2014-11-04  2319  	struct comedi_device *dev = cfp->dev;
a52840a98bbb50a H Hartley Sweeten  2012-12-19  2320  	struct comedi_subdevice *s;
a52840a98bbb50a H Hartley Sweeten  2012-12-19  2321  	struct comedi_async *async;
b34aa86f12e8848 Ian Abbott         2014-04-10  2322  	struct comedi_buf_map *bm = NULL;
e36472145aa706c Ian Abbott         2019-06-25  2323  	struct comedi_buf_page *buf;
ed9eccbe8970f6e David Schleef      2008-11-04  2324  	unsigned long start = vma->vm_start;
ed9eccbe8970f6e David Schleef      2008-11-04  2325  	unsigned long size;
ed9eccbe8970f6e David Schleef      2008-11-04  2326  	int n_pages;
ed9eccbe8970f6e David Schleef      2008-11-04  2327  	int i;
e36472145aa706c Ian Abbott         2019-06-25  2328  	int retval = 0;
3ffab428f40849e Bernd Porr         2011-11-08  2329  
b34aa86f12e8848 Ian Abbott         2014-04-10  2330  	/*
c1e8d7c6a7a682e Michel Lespinasse  2020-06-08  2331  	 * 'trylock' avoids circular dependency with current->mm->mmap_lock
b34aa86f12e8848 Ian Abbott         2014-04-10  2332  	 * and down-reading &dev->attach_lock should normally succeed without
b34aa86f12e8848 Ian Abbott         2014-04-10  2333  	 * contention unless the device is in the process of being attached
b34aa86f12e8848 Ian Abbott         2014-04-10  2334  	 * or detached.
b34aa86f12e8848 Ian Abbott         2014-04-10  2335  	 */
b34aa86f12e8848 Ian Abbott         2014-04-10  2336  	if (!down_read_trylock(&dev->attach_lock))
b34aa86f12e8848 Ian Abbott         2014-04-10  2337  		return -EAGAIN;
a52840a98bbb50a H Hartley Sweeten  2012-12-19  2338  
ed9eccbe8970f6e David Schleef      2008-11-04  2339  	if (!dev->attached) {
272850f07c47ab1 H Hartley Sweeten  2013-11-26  2340  		dev_dbg(dev->class_dev, "no driver attached\n");
ed9eccbe8970f6e David Schleef      2008-11-04  2341  		retval = -ENODEV;
ed9eccbe8970f6e David Schleef      2008-11-04  2342  		goto done;
ed9eccbe8970f6e David Schleef      2008-11-04  2343  	}
a52840a98bbb50a H Hartley Sweeten  2012-12-19  2344  
476b847733636ce Greg Kroah-Hartman 2008-11-13  2345  	if (vma->vm_flags & VM_WRITE)
20f083c07565cb7 Ian Abbott         2014-11-04  2346  		s = comedi_file_write_subdevice(file);
476b847733636ce Greg Kroah-Hartman 2008-11-13  2347  	else
20f083c07565cb7 Ian Abbott         2014-11-04  2348  		s = comedi_file_read_subdevice(file);
a52840a98bbb50a H Hartley Sweeten  2012-12-19  2349  	if (!s) {
ed9eccbe8970f6e David Schleef      2008-11-04  2350  		retval = -EINVAL;
ed9eccbe8970f6e David Schleef      2008-11-04  2351  		goto done;
ed9eccbe8970f6e David Schleef      2008-11-04  2352  	}
a52840a98bbb50a H Hartley Sweeten  2012-12-19  2353  
ed9eccbe8970f6e David Schleef      2008-11-04  2354  	async = s->async;
a52840a98bbb50a H Hartley Sweeten  2012-12-19  2355  	if (!async) {
ed9eccbe8970f6e David Schleef      2008-11-04  2356  		retval = -EINVAL;
ed9eccbe8970f6e David Schleef      2008-11-04  2357  		goto done;
ed9eccbe8970f6e David Schleef      2008-11-04  2358  	}
ed9eccbe8970f6e David Schleef      2008-11-04  2359  
ed9eccbe8970f6e David Schleef      2008-11-04  2360  	if (vma->vm_pgoff != 0) {
272850f07c47ab1 H Hartley Sweeten  2013-11-26  2361  		dev_dbg(dev->class_dev, "mmap() offset must be 0.\n");
ed9eccbe8970f6e David Schleef      2008-11-04  2362  		retval = -EINVAL;
ed9eccbe8970f6e David Schleef      2008-11-04  2363  		goto done;
ed9eccbe8970f6e David Schleef      2008-11-04  2364  	}
ed9eccbe8970f6e David Schleef      2008-11-04  2365  
ed9eccbe8970f6e David Schleef      2008-11-04  2366  	size = vma->vm_end - vma->vm_start;
ed9eccbe8970f6e David Schleef      2008-11-04  2367  	if (size > async->prealloc_bufsz) {
ed9eccbe8970f6e David Schleef      2008-11-04  2368  		retval = -EFAULT;
ed9eccbe8970f6e David Schleef      2008-11-04  2369  		goto done;
ed9eccbe8970f6e David Schleef      2008-11-04  2370  	}
44b8c793fc0d630 Sandhya Bankar     2016-03-06  2371  	if (offset_in_page(size)) {
ed9eccbe8970f6e David Schleef      2008-11-04  2372  		retval = -EFAULT;
ed9eccbe8970f6e David Schleef      2008-11-04  2373  		goto done;
ed9eccbe8970f6e David Schleef      2008-11-04  2374  	}
ed9eccbe8970f6e David Schleef      2008-11-04  2375  
ec9d0754e0c6401 sayli karnik       2016-09-20  2376  	n_pages = vma_pages(vma);
b34aa86f12e8848 Ian Abbott         2014-04-10  2377  
b34aa86f12e8848 Ian Abbott         2014-04-10  2378  	/* get reference to current buf map (if any) */
b34aa86f12e8848 Ian Abbott         2014-04-10  2379  	bm = comedi_buf_map_from_subdev_get(s);
af93da31634d6d5 Ian Abbott         2013-11-08  2380  	if (!bm || n_pages > bm->n_pages) {
af93da31634d6d5 Ian Abbott         2013-11-08  2381  		retval = -EINVAL;
af93da31634d6d5 Ian Abbott         2013-11-08  2382  		goto done;
af93da31634d6d5 Ian Abbott         2013-11-08  2383  	}
e36472145aa706c Ian Abbott         2019-06-25  2384  	if (bm->dma_dir != DMA_NONE) {
e36472145aa706c Ian Abbott         2019-06-25  2385  		/*
e36472145aa706c Ian Abbott         2019-06-25  2386  		 * DMA buffer was allocated as a single block.
e36472145aa706c Ian Abbott         2019-06-25  2387  		 * Address is in page_list[0].
e36472145aa706c Ian Abbott         2019-06-25  2388  		 */
e36472145aa706c Ian Abbott         2019-06-25  2389  		buf = &bm->page_list[0];
e36472145aa706c Ian Abbott         2019-06-25  2390  		retval = dma_mmap_coherent(bm->dma_hw_dev, vma, buf->virt_addr,
e36472145aa706c Ian Abbott         2019-06-25  2391  					   buf->dma_addr, n_pages * PAGE_SIZE);
e36472145aa706c Ian Abbott         2019-06-25  2392  	} else {
ed9eccbe8970f6e David Schleef      2008-11-04  2393  		for (i = 0; i < n_pages; ++i) {
e36472145aa706c Ian Abbott         2019-06-25  2394  			unsigned long pfn;
e36472145aa706c Ian Abbott         2019-06-25  2395  
e36472145aa706c Ian Abbott         2019-06-25  2396  			buf = &bm->page_list[i];
e36472145aa706c Ian Abbott         2019-06-25  2397  			pfn = page_to_pfn(virt_to_page(buf->virt_addr));
e36472145aa706c Ian Abbott         2019-06-25  2398  			retval = remap_pfn_range(vma, start, pfn, PAGE_SIZE,
e36472145aa706c Ian Abbott         2019-06-25 @2399  						 PAGE_SHARED);
e36472145aa706c Ian Abbott         2019-06-25  2400  			if (retval)
e36472145aa706c Ian Abbott         2019-06-25  2401  				break;
a52840a98bbb50a H Hartley Sweeten  2012-12-19  2402  
ed9eccbe8970f6e David Schleef      2008-11-04  2403  			start += PAGE_SIZE;
ed9eccbe8970f6e David Schleef      2008-11-04  2404  		}
e36472145aa706c Ian Abbott         2019-06-25  2405  	}
ed9eccbe8970f6e David Schleef      2008-11-04  2406  
e36472145aa706c Ian Abbott         2019-06-25  2407  	if (retval == 0) {
ed9eccbe8970f6e David Schleef      2008-11-04  2408  		vma->vm_ops = &comedi_vm_ops;
af93da31634d6d5 Ian Abbott         2013-11-08  2409  		vma->vm_private_data = bm;
ed9eccbe8970f6e David Schleef      2008-11-04  2410  
af93da31634d6d5 Ian Abbott         2013-11-08  2411  		vma->vm_ops->open(vma);
e36472145aa706c Ian Abbott         2019-06-25  2412  	}
ed9eccbe8970f6e David Schleef      2008-11-04  2413  
ed9eccbe8970f6e David Schleef      2008-11-04  2414  done:
b34aa86f12e8848 Ian Abbott         2014-04-10  2415  	up_read(&dev->attach_lock);
b34aa86f12e8848 Ian Abbott         2014-04-10  2416  	comedi_buf_map_put(bm);	/* put reference to buf map - okay if NULL */
ed9eccbe8970f6e David Schleef      2008-11-04  2417  	return retval;
ed9eccbe8970f6e David Schleef      2008-11-04  2418  }
ed9eccbe8970f6e David Schleef      2008-11-04  2419  

:::::: The code at line 2399 was first introduced by commit
:::::: e36472145aa706c186a6bb4f6419c613b0b1305c staging: comedi: use dma_mmap_coherent for DMA-able buffer mmap

:::::: TO: Ian Abbott <abbotti@mev.co.uk>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

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

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

only message in thread, other threads:[~2020-11-20  0:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-20  0:11 [mips-linux:mips-next 47/49] drivers/staging/comedi/comedi_fops.c:2399:8: error: 'PAGE_SHARED' undeclared; did you mean kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.