All of lore.kernel.org
 help / color / mirror / Atom feed
* [ti:ti-rt-linux-5.10.y 3375/3400] drivers/rpmsg/virtio_rpmsg_bus.c:893:58: sparse: sparse: incorrect type in argument 2 (different base types)
@ 2021-03-13  0:28 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-03-13  0:28 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3722 bytes --]

tree:   git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.10.y
head:   921d9bfc28005a87544f765199650381d0fb53b8
commit: 7e3ea0d62a4bf0ca04be9bc320d13f564aab0a92 [3375/3400] TEMP: rpmsg: add a description field
config: x86_64-randconfig-s022-20210313 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-262-g5e674421-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(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30249 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-13  0:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-13  0:28 [ti:ti-rt-linux-5.10.y 3375/3400] drivers/rpmsg/virtio_rpmsg_bus.c:893:58: sparse: sparse: incorrect type in argument 2 (different base types) kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.