[PATCH] dma-buf: use parameter structure for dma_buf_attach
kbuild test robot
lkp at intel.com
Tue Mar 27 20:01:26 UTC 2018
Hi Christian,
I love your patch! Yet something to improve:
[auto build test ERROR on drm/drm-next]
[also build test ERROR on v4.16-rc7 next-20180327]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Christian-K-nig/dma-buf-use-parameter-structure-for-dma_buf_attach/20180326-044631
base: git://people.freedesktop.org/~airlied/linux.git drm-next
config: openrisc-allmodconfig (attached as .config)
compiler: or1k-linux-gcc (GCC) 6.0.0 20160327 (experimental)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=openrisc
All errors (new ones prefixed by >>):
drivers/staging/media/tegra-vde/tegra-vde.c: In function 'tegra_vde_attach_dmabuf':
>> drivers/staging/media/tegra-vde/tegra-vde.c:534:13: error: 'dmabuf' undeclared (first use in this function)
.dmabuf = dmabuf
^~~~~~
drivers/staging/media/tegra-vde/tegra-vde.c:534:13: note: each undeclared identifier is reported only once for each function it appears in
vim +/dmabuf +534 drivers/staging/media/tegra-vde/tegra-vde.c
521
522 static int tegra_vde_attach_dmabuf(struct device *dev,
523 int fd,
524 unsigned long offset,
525 unsigned int min_size,
526 struct dma_buf_attachment **a,
527 dma_addr_t *addr,
528 struct sg_table **s,
529 size_t *size,
530 enum dma_data_direction dma_dir)
531 {
532 struct dma_buf_attach_info attach_info = {
533 .dev = dev,
> 534 .dmabuf = dmabuf
535 };
536 struct dma_buf_attachment *attachment;
537 struct dma_buf *dmabuf;
538 struct sg_table *sgt;
539 int err;
540
541 dmabuf = dma_buf_get(fd);
542 if (IS_ERR(dmabuf)) {
543 dev_err(dev, "Invalid dmabuf FD\n");
544 return PTR_ERR(dmabuf);
545 }
546
547 if ((u64)offset + min_size > dmabuf->size) {
548 dev_err(dev, "Too small dmabuf size %zu @0x%lX, "
549 "should be at least %d\n",
550 dmabuf->size, offset, min_size);
551 return -EINVAL;
552 }
553
554 attachment = dma_buf_attach(&attach_info);
555 if (IS_ERR(attachment)) {
556 dev_err(dev, "Failed to attach dmabuf\n");
557 err = PTR_ERR(attachment);
558 goto err_put;
559 }
560
561 sgt = dma_buf_map_attachment(attachment, dma_dir);
562 if (IS_ERR(sgt)) {
563 dev_err(dev, "Failed to get dmabufs sg_table\n");
564 err = PTR_ERR(sgt);
565 goto err_detach;
566 }
567
568 if (sgt->nents != 1) {
569 dev_err(dev, "Sparse DMA region is unsupported\n");
570 err = -EINVAL;
571 goto err_unmap;
572 }
573
574 *addr = sg_dma_address(sgt->sgl) + offset;
575 *a = attachment;
576 *s = sgt;
577
578 if (size)
579 *size = dmabuf->size - offset;
580
581 return 0;
582
583 err_unmap:
584 dma_buf_unmap_attachment(attachment, sgt, dma_dir);
585 err_detach:
586 dma_buf_detach(dmabuf, attachment);
587 err_put:
588 dma_buf_put(dmabuf);
589
590 return err;
591 }
592
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 44772 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180328/4d7cd874/attachment-0001.gz>
More information about the dri-devel
mailing list