Re: [PATCH] drm/virtio: Add window server support
From: kbuild test robot <hidden>
Date: 2017-12-16 00:59:11
Also in:
dri-devel, lkml
Hi Tomeu, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v4.15-rc3] [cannot apply to drm/drm-next drm-exynos/exynos-drm/for-next next-20171215] [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/Tomeu-Vizoso/drm-virtio-Add-window-server-support/20171216-081939 config: i386-randconfig-x002-201750 (attached as .config) compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025 reproduce: # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): In file included from include/linux/kernel.h:10:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from include/uapi/linux/aio_abi.h:31, from include/linux/syscalls.h:72, from drivers/gpu/drm/virtio/virtgpu_ioctl.c:29: drivers/gpu/drm/virtio/virtgpu_ioctl.c: In function 'winsrv_ioctl_rx': drivers/gpu/drm/virtio/virtgpu_ioctl.c:562:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] if (copy_to_user((void *)cmd->data + read_count, ^ include/linux/compiler.h:58:30: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^~~~
quoted
drivers/gpu/drm/virtio/virtgpu_ioctl.c:562:3: note: in expansion of macro 'if'
if (copy_to_user((void *)cmd->data + read_count,
^~
drivers/gpu/drm/virtio/virtgpu_ioctl.c:562:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
if (copy_to_user((void *)cmd->data + read_count,
^
include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~quoted
drivers/gpu/drm/virtio/virtgpu_ioctl.c:562:3: note: in expansion of macro 'if'
if (copy_to_user((void *)cmd->data + read_count,
^~
drivers/gpu/drm/virtio/virtgpu_ioctl.c:562:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
if (copy_to_user((void *)cmd->data + read_count,
^
include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^~~~quoted
drivers/gpu/drm/virtio/virtgpu_ioctl.c:562:3: note: in expansion of macro 'if'
if (copy_to_user((void *)cmd->data + read_count,
^~
drivers/gpu/drm/virtio/virtgpu_ioctl.c: In function 'winsrv_ioctl':
drivers/gpu/drm/virtio/virtgpu_ioctl.c:615:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(const char __user *) winsrv_cmd.data,
^
vim +/if +562 drivers/gpu/drm/virtio/virtgpu_ioctl.c
547
548 static int winsrv_ioctl_rx(struct virtio_gpu_device *vgdev,
549 struct virtio_gpu_winsrv_conn *conn,
550 struct drm_virtgpu_winsrv *cmd)
551 {
552 struct virtio_gpu_winsrv_rx_qentry *qentry, *tmp;
553 struct virtio_gpu_winsrv_rx *virtio_cmd;
554 int available_len = cmd->len;
555 int read_count = 0;
556
557 list_for_each_entry_safe(qentry, tmp, &conn->cmdq, next) {
558 virtio_cmd = qentry->cmd;
559 if (virtio_cmd->len > available_len)
560 return 0;
561
> 562 if (copy_to_user((void *)cmd->data + read_count,
563 virtio_cmd->data,
564 virtio_cmd->len)) {
565 /* return error unless we have some data to return */
566 if (read_count == 0)
567 return -EFAULT;
568 }
569
570 /*
571 * here we could export resource IDs to FDs, but no protocol
572 * as of today requires it
573 */
574
575 available_len -= virtio_cmd->len;
576 read_count += virtio_cmd->len;
577
578 virtio_gpu_queue_winsrv_rx_in(vgdev, virtio_cmd);
579
580 list_del(&qentry->next);
581 kfree(qentry);
582 }
583
584 cmd->len = read_count;
585
586 return 0;
587 }
588
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation Attachments
- .config.gz [application/gzip] 27343 bytes
- (unnamed) [text/plain] 183 bytes · preview