drivers/media/v4l2-core/videobuf2-dma-contig.c:486:2: error: implicit declaration of function 'dma_get_cache_alignment'

From: kbuild test robot
Date: Mon Aug 22 2016 - 17:03:06 EST


Hi Hans,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fa8410b355251fd30341662a40ac6b22d3e38468
commit: c1023ba74fc77dc56dc317bd98f5060aab889ac1 [media] drivers/media/platform/Kconfig: fix VIDEO_MEDIATEK_VCODEC dependency
date: 6 weeks ago
config: m32r-allmodconfig (attached as .config)
compiler: m32r-linux-gcc (GCC) 4.9.0
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout c1023ba74fc77dc56dc317bd98f5060aab889ac1
# save the attached .config to linux build tree
make.cross ARCH=m32r

All errors (new ones prefixed by >>):

drivers/media/v4l2-core/videobuf2-dma-contig.c: In function 'vb2_dc_get_userptr':
>> drivers/media/v4l2-core/videobuf2-dma-contig.c:486:2: error: implicit declaration of function 'dma_get_cache_alignment' [-Werror=implicit-function-declaration]
unsigned long dma_align = dma_get_cache_alignment();
^
cc1: some warnings being treated as errors

vim +/dma_get_cache_alignment +486 drivers/media/v4l2-core/videobuf2-dma-contig.c

774d2301 drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2013-06-19 470 {
774d2301 drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2013-06-19 471 /* really, we cannot do anything better at this point */
774d2301 drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2013-06-19 472 return (dma_addr_t)(pfn) << PAGE_SHIFT;
774d2301 drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2013-06-19 473 }
774d2301 drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2013-06-19 474 #endif
774d2301 drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2013-06-19 475
36c0f8b3 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2016-04-15 476 static void *vb2_dc_get_userptr(struct device *dev, unsigned long vaddr,
cd474037 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2014-11-18 477 unsigned long size, enum dma_data_direction dma_dir)
1a758d4e drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 478 {
1a758d4e drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 479 struct vb2_dc_buf *buf;
fb639eb3 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara 2015-07-13 480 struct frame_vector *vec;
e15dab75 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 481 unsigned long offset;
fb639eb3 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara 2015-07-13 482 int n_pages, i;
e15dab75 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 483 int ret = 0;
e15dab75 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 484 struct sg_table *sgt;
e15dab75 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 485 unsigned long contig_size;
d81e870d drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 @486 unsigned long dma_align = dma_get_cache_alignment();
251a79f8 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2014-11-18 487 DEFINE_DMA_ATTRS(attrs);
251a79f8 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2014-11-18 488
251a79f8 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2014-11-18 489 dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs);
d81e870d drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 490
d81e870d drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 491 /* Only cache aligned DMA transfers are reliable */
d81e870d drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 492 if (!IS_ALIGNED(vaddr | size, dma_align)) {
d81e870d drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 493 pr_debug("user data must be aligned to %lu bytes\n", dma_align);
d81e870d drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 494 return ERR_PTR(-EINVAL);

:::::: The code at line 486 was first introduced by commit
:::::: d81e870d5afa1b0a95ea94c4052d3c7e973fae8c [media] v4l: vb2-dma-contig: fail if user ptr buffer is not correctly aligned

:::::: TO: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
:::::: CC: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: Binary data