lkml.org 
[lkml]   [2021]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[ti:ti-rt-linux-5.10.y 3381/9998] drivers/rpmsg/virtio_rpmsg_bus.c:893:58: sparse: sparse: incorrect type in argument 2 (different base types)
tree:   git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.10.y
head: 7ff055c5f01acc96255948cdd632c72fd78a1f72
commit: 7e3ea0d62a4bf0ca04be9bc320d13f564aab0a92 [3381/9998] TEMP: rpmsg: add a description field
config: x86_64-randconfig-s022-20211011 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-rt-linux-5.10.y
git checkout 7e3ea0d62a4bf0ca04be9bc320d13f564aab0a92
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/rpmsg/virtio_rpmsg_bus.c:893:58: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected restricted __virtio32 [usertype] val @@ got unsigned int [usertype] addr @@
drivers/rpmsg/virtio_rpmsg_bus.c:893:58: sparse: expected restricted __virtio32 [usertype] val
drivers/rpmsg/virtio_rpmsg_bus.c:893:58: sparse: got unsigned int [usertype] addr
>> drivers/rpmsg/virtio_rpmsg_bus.c:894:59: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected restricted __virtio32 [usertype] val @@ got unsigned int [usertype] flags @@
drivers/rpmsg/virtio_rpmsg_bus.c:894:59: sparse: expected restricted __virtio32 [usertype] val
drivers/rpmsg/virtio_rpmsg_bus.c:894:59: sparse: got unsigned int [usertype] flags

vim +893 drivers/rpmsg/virtio_rpmsg_bus.c

887
888 if (len == sizeof(*msg)) {
889 addr = virtio32_to_cpu(vrp->vdev, msg->addr);
890 flags = virtio32_to_cpu(vrp->vdev, msg->flags);
891 chinfo.desc[0] = '\0';
892 } else if (len == sizeof(*msg_ext)) {
> 893 addr = virtio32_to_cpu(vrp->vdev, msg_ext->addr);
> 894 flags = virtio32_to_cpu(vrp->vdev, msg_ext->flags);
895 msg_ext->desc[RPMSG_NAME_SIZE - 1] = '\0';
896 strncpy(chinfo.desc, msg_ext->desc, sizeof(chinfo.desc));
897 } else {
898 dev_err(dev, "malformed ns msg (%d)\n", len);
899 return -EINVAL;
900 }
901
902 /*
903 * the name service ept does _not_ belong to a real rpmsg channel,
904 * and is handled by the rpmsg bus itself.
905 * for sanity reasons, make sure a valid rpdev has _not_ sneaked
906 * in somehow.
907 */
908 if (rpdev) {
909 dev_err(dev, "anomaly: ns ept has an rpdev handle\n");
910 return -EINVAL;
911 }
912
913 /* don't trust the remote processor for null terminating the name */
914 msg->name[RPMSG_NAME_SIZE - 1] = '\0';
915
916 strncpy(chinfo.name, msg->name, sizeof(chinfo.name));
917 chinfo.src = RPMSG_ADDR_ANY;
918 chinfo.dst = addr;
919
920 dev_info(dev, "%sing channel %s addr 0x%x\n",
921 flags & RPMSG_NS_DESTROY ?
922 "destroy" : "creat", msg->name, chinfo.dst);
923
924 if (flags & RPMSG_NS_DESTROY) {
925 ret = rpmsg_unregister_device(&vrp->vdev->dev, &chinfo);
926 if (ret)
927 dev_err(dev, "rpmsg_destroy_channel failed: %d\n", ret);
928 } else {
929 newch = rpmsg_create_channel(vrp, &chinfo);
930 if (!newch)
931 dev_err(dev, "rpmsg_create_channel failed\n");
932 }
933
934 return 0;
935 }
936

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2021-10-11 15:41    [W:0.434 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site