[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202107132303.PnxeH02o-lkp@intel.com>
Date: Tue, 13 Jul 2021 23:17:14 +0800
From: kernel test robot <lkp@...el.com>
To: Christoph Hellwig <hch@....de>
Cc: clang-built-linux@...glegroups.com, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org
Subject: [hch-misc:follow_pfn 1/3]
drivers/media/common/videobuf2/videobuf2-dma-contig.c:539:1: warning: unused
label 'out'
tree: git://git.infradead.org/users/hch/misc.git follow_pfn
head: 66855f59863300731d08162e8d20d951b0827e28
commit: ba9792af6d1881f3e5fffbdd8b2308d854217878 [1/3] media: videobuf2: remove userptr support
config: x86_64-randconfig-a005-20210713 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8d69635ed9ecf36fd0ca85906bfde17949671cbe)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git remote add hch-misc git://git.infradead.org/users/hch/misc.git
git fetch --no-tags hch-misc follow_pfn
git checkout ba9792af6d1881f3e5fffbdd8b2308d854217878
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> drivers/media/common/videobuf2/videobuf2-dma-contig.c:539:1: warning: unused label 'out' [-Wunused-label]
out:
^~~~
drivers/media/common/videobuf2/videobuf2-dma-contig.c:468:15: warning: unused variable 'i' [-Wunused-variable]
int n_pages, i;
^
2 warnings generated.
vim +/out +539 drivers/media/common/videobuf2/videobuf2-dma-contig.c
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 461
36c0f8b32c4bd4 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2016-04-15 462 static void *vb2_dc_get_userptr(struct device *dev, unsigned long vaddr,
cd474037c4a9a9 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2014-11-18 463 unsigned long size, enum dma_data_direction dma_dir)
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 464 {
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 465 struct vb2_dc_buf *buf;
fb639eb3915431 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara 2015-07-13 466 struct frame_vector *vec;
c4860ad6056483 drivers/media/v4l2-core/videobuf2-dma-contig.c Tvrtko Ursulin 2017-07-31 467 unsigned int offset;
fb639eb3915431 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara 2015-07-13 468 int n_pages, i;
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 469 int ret = 0;
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 470 struct sg_table *sgt;
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 471 unsigned long contig_size;
d81e870d5afa1b drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 472 unsigned long dma_align = dma_get_cache_alignment();
d81e870d5afa1b drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 473
d81e870d5afa1b drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 474 /* Only cache aligned DMA transfers are reliable */
d81e870d5afa1b drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 475 if (!IS_ALIGNED(vaddr | size, dma_align)) {
d81e870d5afa1b drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 476 pr_debug("user data must be aligned to %lu bytes\n", dma_align);
d81e870d5afa1b drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 477 return ERR_PTR(-EINVAL);
d81e870d5afa1b drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 478 }
d81e870d5afa1b drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 479
d81e870d5afa1b drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 480 if (!size) {
d81e870d5afa1b drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 481 pr_debug("size is zero\n");
d81e870d5afa1b drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 482 return ERR_PTR(-EINVAL);
d81e870d5afa1b drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski 2012-06-12 483 }
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 484
10791829eb52d5 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2016-07-21 485 if (WARN_ON(!dev))
10791829eb52d5 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2016-07-21 486 return ERR_PTR(-EINVAL);
10791829eb52d5 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2016-07-21 487
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 488 buf = kzalloc(sizeof *buf, GFP_KERNEL);
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 489 if (!buf)
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 490 return ERR_PTR(-ENOMEM);
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 491
36c0f8b32c4bd4 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2016-04-15 492 buf->dev = dev;
cd474037c4a9a9 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2014-11-18 493 buf->dma_dir = dma_dir;
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 494
c4860ad6056483 drivers/media/v4l2-core/videobuf2-dma-contig.c Tvrtko Ursulin 2017-07-31 495 offset = lower_32_bits(offset_in_page(vaddr));
707947247e9517 drivers/media/common/videobuf2/videobuf2-dma-contig.c Hans Verkuil 2019-04-04 496 vec = vb2_create_framevec(vaddr, size);
fb639eb3915431 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara 2015-07-13 497 if (IS_ERR(vec)) {
fb639eb3915431 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara 2015-07-13 498 ret = PTR_ERR(vec);
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 499 goto fail_buf;
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 500 }
fb639eb3915431 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara 2015-07-13 501 buf->vec = vec;
fb639eb3915431 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara 2015-07-13 502 n_pages = frame_vector_count(vec);
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 503
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 504 sgt = kzalloc(sizeof(*sgt), GFP_KERNEL);
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 505 if (!sgt) {
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 506 pr_err("failed to allocate sg table\n");
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 507 ret = -ENOMEM;
fb639eb3915431 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara 2015-07-13 508 goto fail_pfnvec;
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 509 }
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 510
ba9792af6d1881 drivers/media/common/videobuf2/videobuf2-dma-contig.c Christoph Hellwig 2021-07-13 511 ret = sg_alloc_table_from_pages(sgt, vec->pages, n_pages,
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 512 offset, size, GFP_KERNEL);
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 513 if (ret) {
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 514 pr_err("failed to initialize sg table\n");
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 515 goto fail_sgt;
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 516 }
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 517
251a79f8f5adfd drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2014-11-18 518 /*
251a79f8f5adfd drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2014-11-18 519 * No need to sync to the device, this will happen later when the
251a79f8f5adfd drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2014-11-18 520 * prepare() memop is called.
251a79f8f5adfd drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil 2014-11-18 521 */
8b7c0280ab03dd drivers/media/common/videobuf2/videobuf2-dma-contig.c Marek Szyprowski 2020-09-04 522 if (dma_map_sgtable(buf->dev, sgt, buf->dma_dir,
8b7c0280ab03dd drivers/media/common/videobuf2/videobuf2-dma-contig.c Marek Szyprowski 2020-09-04 523 DMA_ATTR_SKIP_CPU_SYNC)) {
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 524 pr_err("failed to map scatterlist\n");
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 525 ret = -EIO;
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 526 goto fail_sgt_init;
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 527 }
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 528
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 529 contig_size = vb2_dc_get_contiguous_size(sgt);
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 530 if (contig_size < size) {
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 531 pr_err("contiguous mapping is too small %lu/%lu\n",
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 532 contig_size, size);
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 533 ret = -EFAULT;
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 534 goto fail_map_sg;
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 535 }
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 536
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 537 buf->dma_addr = sg_dma_address(sgt->sgl);
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 538 buf->dma_sgt = sgt;
fb639eb3915431 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara 2015-07-13 @539 out:
fb639eb3915431 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara 2015-07-13 540 buf->size = size;
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 541
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 542 return buf;
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 543
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 544 fail_map_sg:
8b7c0280ab03dd drivers/media/common/videobuf2/videobuf2-dma-contig.c Marek Szyprowski 2020-09-04 545 dma_unmap_sgtable(buf->dev, sgt, buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC);
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 546
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 547 fail_sgt_init:
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 548 sg_free_table(sgt);
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 549
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 550 fail_sgt:
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 551 kfree(sgt);
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 552
fb639eb3915431 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara 2015-07-13 553 fail_pfnvec:
fb639eb3915431 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara 2015-07-13 554 vb2_destroy_framevec(vec);
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 555
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 556 fail_buf:
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 557 kfree(buf);
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 558
e15dab752d4c58 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 2012-06-14 559 return ERR_PTR(ret);
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 560 }
1a758d4e847f77 drivers/media/video/videobuf2-dma-contig.c Pawel Osciak 2010-10-11 561
:::::: The code at line 539 was first introduced by commit
:::::: fb639eb39154312af8bf08c58cc0142179e0c224 [media] media: vb2: Convert vb2_dc_get_userptr() to use frame vector
:::::: TO: Jan Kara <jack@...e.cz>
:::::: CC: Mauro Carvalho Chehab <mchehab@....samsung.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (53021 bytes)
Powered by blists - more mailing lists