From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [ti:ti-rt-linux-5.10.y 3381/10213] drivers/rpmsg/virtio_rpmsg_bus.c:893:58: sparse: sparse: incorrect type in argument 2 (different base types)
Date: Wed, 08 Dec 2021 02:22:53 +0800 [thread overview]
Message-ID: <202112080216.PGAcimTH-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3841 bytes --]
tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.10.y
head: 541ec9a6995c3dd881d6f0b63cc714a08ded457d
commit: 7e3ea0d62a4bf0ca04be9bc320d13f564aab0a92 [3381/10213] TEMP: rpmsg: add a description field
config: x86_64-randconfig-s032-20211207 (https://download.01.org/0day-ci/archive/20211208/202112080216.PGAcimTH-lkp(a)intel.com/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 config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/rpmsg/
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
reply other threads:[~2021-12-07 18:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202112080216.PGAcimTH-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.