[linux-next:master 2882/4500] drivers/staging/comedi/comedi_fops.c:2399:8: error: 'PAGE_SHARED' undeclared; did you mean

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   93bf8b946e5f9a0b0c68155597b53fd8ccce2827
commit: 0a9e723f97367373133a4951f26a7b515223ca7b [2882/4500] csky: Coding convention del unnecessary definition
config: csky-randconfig-p001-20210118 (attached as .config)
compiler: csky-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/next/linux-next.git/commit/?id=0a9e723f97367373133a4951f26a7b515223ca7b
        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 0a9e723f97367373133a4951f26a7b515223ca7b
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=csky 

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

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
--
   drivers/media/usb/cpia2/cpia2_core.c: In function 'cpia2_remap_buffer':
>> drivers/media/usb/cpia2/cpia2_core.c:2410:66: error: 'PAGE_SHARED' undeclared (first use in this function)
    2410 |   if (remap_pfn_range(vma, start, page >> PAGE_SHIFT, PAGE_SIZE, PAGE_SHARED))
         |                                                                  ^~~~~~~~~~~
   drivers/media/usb/cpia2/cpia2_core.c:2410:66: note: each undeclared identifier is reported only once for each function it appears in


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

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

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux