All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [android-common:android-4.19 12/13] drivers/nvdimm/nd_virtio.c:56:28: sparse: sparse: incorrect type in assignment (different base types)
Date: Sat, 19 Jun 2021 11:24:30 +0800	[thread overview]
Message-ID: <202106191124.OMMYseRO-lkp@intel.com> (raw)

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

tree:   https://android.googlesource.com/kernel/common android-4.19
head:   89a7be58e85a4a5248d134aa58cfade92644bd3a
commit: 748a437c5c0179283ae1814b612f9e1a744f3839 [12/13] UPSTREAM: virtio-pmem: Add virtio pmem driver
config: x86_64-randconfig-s022-20210618 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        git remote add android-common https://android.googlesource.com/kernel/common
        git fetch --no-tags android-common android-4.19
        git checkout 748a437c5c0179283ae1814b612f9e1a744f3839
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 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/nvdimm/nd_virtio.c:56:28: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] type @@     got restricted __virtio32 @@
   drivers/nvdimm/nd_virtio.c:56:28: sparse:     expected unsigned int [usertype] type
   drivers/nvdimm/nd_virtio.c:56:28: sparse:     got restricted __virtio32
>> drivers/nvdimm/nd_virtio.c:93:59: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted __virtio32 [usertype] val @@     got unsigned int [usertype] ret @@
   drivers/nvdimm/nd_virtio.c:93:59: sparse:     expected restricted __virtio32 [usertype] val
   drivers/nvdimm/nd_virtio.c:93:59: sparse:     got unsigned int [usertype] ret

vim +56 drivers/nvdimm/nd_virtio.c

    36	
    37	 /* The request submission function */
    38	static int virtio_pmem_flush(struct nd_region *nd_region)
    39	{
    40		struct virtio_device *vdev = nd_region->provider_data;
    41		struct virtio_pmem *vpmem  = vdev->priv;
    42		struct virtio_pmem_request *req_data;
    43		struct scatterlist *sgs[2], sg, ret;
    44		unsigned long flags;
    45		int err, err1;
    46	
    47		might_sleep();
    48		req_data = kmalloc(sizeof(*req_data), GFP_KERNEL);
    49		if (!req_data)
    50			return -ENOMEM;
    51	
    52		req_data->done = false;
    53		init_waitqueue_head(&req_data->host_acked);
    54		init_waitqueue_head(&req_data->wq_buf);
    55		INIT_LIST_HEAD(&req_data->list);
  > 56		req_data->req.type = cpu_to_virtio32(vdev, VIRTIO_PMEM_REQ_TYPE_FLUSH);
    57		sg_init_one(&sg, &req_data->req, sizeof(req_data->req));
    58		sgs[0] = &sg;
    59		sg_init_one(&ret, &req_data->resp.ret, sizeof(req_data->resp));
    60		sgs[1] = &ret;
    61	
    62		spin_lock_irqsave(&vpmem->pmem_lock, flags);
    63		 /*
    64		  * If virtqueue_add_sgs returns -ENOSPC then req_vq virtual
    65		  * queue does not have free descriptor. We add the request
    66		  * to req_list and wait for host_ack to wake us up when free
    67		  * slots are available.
    68		  */
    69		while ((err = virtqueue_add_sgs(vpmem->req_vq, sgs, 1, 1, req_data,
    70						GFP_ATOMIC)) == -ENOSPC) {
    71	
    72			dev_info(&vdev->dev, "failed to send command to virtio pmem device, no free slots in the virtqueue\n");
    73			req_data->wq_buf_avail = false;
    74			list_add_tail(&req_data->list, &vpmem->req_list);
    75			spin_unlock_irqrestore(&vpmem->pmem_lock, flags);
    76	
    77			/* A host response results in "host_ack" getting called */
    78			wait_event(req_data->wq_buf, req_data->wq_buf_avail);
    79			spin_lock_irqsave(&vpmem->pmem_lock, flags);
    80		}
    81		err1 = virtqueue_kick(vpmem->req_vq);
    82		spin_unlock_irqrestore(&vpmem->pmem_lock, flags);
    83		/*
    84		 * virtqueue_add_sgs failed with error different than -ENOSPC, we can't
    85		 * do anything about that.
    86		 */
    87		if (err || !err1) {
    88			dev_info(&vdev->dev, "failed to send command to virtio pmem device\n");
    89			err = -EIO;
    90		} else {
    91			/* A host repsonse results in "host_ack" getting called */
    92			wait_event(req_data->host_acked, req_data->done);
  > 93			err = virtio32_to_cpu(vdev, req_data->resp.ret);
    94		}
    95	
    96		kfree(req_data);
    97		return err;
    98	};
    99	

---
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: 39191 bytes --]

                 reply	other threads:[~2021-06-19  3:24 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=202106191124.OMMYseRO-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.