[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202207061052.4sleXVR2-lkp@intel.com>
Date: Wed, 6 Jul 2022 10:35:52 +0800
From: kernel test robot <lkp@...el.com>
To: Pavel Begunkov <asml.silence@...il.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [isilence:zc_v3 25/29] io_uring/net.c:746:41: warning: cast from
pointer to integer of different size
tree: https://github.com/isilence/linux zc_v3
head: c52112ad973c15ca7aabe9acad36cfeee093f2e1
commit: fa16929e045f5ac6150e90b57640cec185473888 [25/29] io_uring: sendzc with fixed buffers
config: i386-randconfig-a003
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/isilence/linux/commit/fa16929e045f5ac6150e90b57640cec185473888
git remote add isilence https://github.com/isilence/linux
git fetch --no-tags isilence zc_v3
git checkout fa16929e045f5ac6150e90b57640cec185473888
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
io_uring/net.c: In function 'io_sendzc':
>> io_uring/net.c:746:41: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
746 | (u64)zc->buf, zc->len);
| ^
vim +746 io_uring/net.c
707
708 int io_sendzc(struct io_kiocb *req, unsigned int issue_flags)
709 {
710 struct sockaddr_storage address;
711 struct io_ring_ctx *ctx = req->ctx;
712 struct io_sendzc *zc = io_kiocb_to_cmd(req);
713 struct io_notif_slot *notif_slot;
714 struct io_notif *notif;
715 struct msghdr msg;
716 struct iovec iov;
717 struct socket *sock;
718 unsigned msg_flags;
719 int ret, min_ret = 0;
720
721 if (!(req->flags & REQ_F_POLLED) &&
722 (zc->flags & IORING_RECVSEND_POLL_FIRST))
723 return -EAGAIN;
724
725 if (issue_flags & IO_URING_F_UNLOCKED)
726 return -EAGAIN;
727 sock = sock_from_file(req->file);
728 if (unlikely(!sock))
729 return -ENOTSOCK;
730
731 notif_slot = io_get_notif_slot(ctx, zc->slot_idx);
732 if (!notif_slot)
733 return -EINVAL;
734 notif = io_get_notif(ctx, notif_slot);
735 if (!notif)
736 return -ENOMEM;
737
738 msg.msg_name = NULL;
739 msg.msg_control = NULL;
740 msg.msg_controllen = 0;
741 msg.msg_namelen = 0;
742 msg.msg_managed_data = 1;
743
744 if (zc->flags & IORING_RECVSEND_FIXED_BUF) {
745 ret = io_import_fixed(WRITE, &msg.msg_iter, req->imu,
> 746 (u64)zc->buf, zc->len);
747 if (unlikely(ret))
748 return ret;
749 } else {
750 msg.msg_managed_data = 0;
751 ret = import_single_range(WRITE, zc->buf, zc->len, &iov,
752 &msg.msg_iter);
753 if (unlikely(ret))
754 return ret;
755 mm_account_pinned_pages(¬if->uarg.mmp, zc->len);
756 }
757
758 if (zc->addr) {
759 ret = move_addr_to_kernel(zc->addr, zc->addr_len, &address);
760 if (unlikely(ret < 0))
761 return ret;
762 msg.msg_name = (struct sockaddr *)&address;
763 msg.msg_namelen = zc->addr_len;
764 }
765
766 msg_flags = zc->msg_flags | MSG_ZEROCOPY;
767 if (issue_flags & IO_URING_F_NONBLOCK)
768 msg_flags |= MSG_DONTWAIT;
769 if (msg_flags & MSG_WAITALL)
770 min_ret = iov_iter_count(&msg.msg_iter);
771
772 msg.msg_flags = msg_flags;
773 msg.msg_ubuf = ¬if->uarg;
774 ret = sock_sendmsg(sock, &msg);
775
776 if (unlikely(ret < min_ret)) {
777 if (ret == -EAGAIN && (issue_flags & IO_URING_F_NONBLOCK))
778 return -EAGAIN;
779 return ret == -ERESTARTSYS ? -EINTR : ret;
780 }
781
782 io_req_set_res(req, ret, 0);
783 return IOU_OK;
784 }
785
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (155820 bytes)
Powered by blists - more mailing lists