public inbox for linux-nvdimm@lists.01.org
 help / color / mirror / Atom feed
* [linux-nvdimm:libnvdimm-for-next 4/15] drivers/nvdimm/virtio_pmem.c:61:9: sparse: sparse: incompatible types in comparison expression (different base types):
@ 2019-06-20  9:48 kbuild test robot
  2019-06-20 13:42 ` Pankaj Gupta
  0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2019-06-20  9:48 UTC (permalink / raw)
  To: Pankaj Gupta; +Cc: Cornelia Huck, kbuild-all, Yuval Shaia, linux-nvdimm

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git libnvdimm-for-next
head:   3b6047778c09037615e7b919c922081ef1a37a7f
commit: 5990fce9c50eae1261a52df1488d04a47f4cfca7 [4/15] virtio-pmem: Add virtio pmem driver
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-rc1-7-g2b96cd8-dirty
        git checkout 5990fce9c50eae1261a52df1488d04a47f4cfca7
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

>> drivers/nvdimm/virtio_pmem.c:61:9: sparse: sparse: incompatible types in comparison expression (different base types):
>> drivers/nvdimm/virtio_pmem.c:61:9: sparse:    restricted __le64 *
>> drivers/nvdimm/virtio_pmem.c:61:9: sparse:    unsigned long long *
   drivers/nvdimm/virtio_pmem.c:63:9: sparse: sparse: incompatible types in comparison expression (different base types):
   drivers/nvdimm/virtio_pmem.c:63:9: sparse:    restricted __le64 *
   drivers/nvdimm/virtio_pmem.c:63:9: sparse:    unsigned long long *

vim +61 drivers/nvdimm/virtio_pmem.c

    31	
    32	static int virtio_pmem_probe(struct virtio_device *vdev)
    33	{
    34		struct nd_region_desc ndr_desc = {};
    35		int nid = dev_to_node(&vdev->dev);
    36		struct nd_region *nd_region;
    37		struct virtio_pmem *vpmem;
    38		struct resource res;
    39		int err = 0;
    40	
    41		if (!vdev->config->get) {
    42			dev_err(&vdev->dev, "%s failure: config access disabled\n",
    43				__func__);
    44			return -EINVAL;
    45		}
    46	
    47		vpmem = devm_kzalloc(&vdev->dev, sizeof(*vpmem), GFP_KERNEL);
    48		if (!vpmem) {
    49			err = -ENOMEM;
    50			goto out_err;
    51		}
    52	
    53		vpmem->vdev = vdev;
    54		vdev->priv = vpmem;
    55		err = init_vq(vpmem);
    56		if (err) {
    57			dev_err(&vdev->dev, "failed to initialize virtio pmem vq's\n");
    58			goto out_err;
    59		}
    60	
  > 61		virtio_cread(vpmem->vdev, struct virtio_pmem_config,
    62				start, &vpmem->start);
    63		virtio_cread(vpmem->vdev, struct virtio_pmem_config,
    64				size, &vpmem->size);
    65	
    66		res.start = vpmem->start;
    67		res.end   = vpmem->start + vpmem->size - 1;
    68		vpmem->nd_desc.provider_name = "virtio-pmem";
    69		vpmem->nd_desc.module = THIS_MODULE;
    70	
    71		vpmem->nvdimm_bus = nvdimm_bus_register(&vdev->dev,
    72							&vpmem->nd_desc);
    73		if (!vpmem->nvdimm_bus) {
    74			dev_err(&vdev->dev, "failed to register device with nvdimm_bus\n");
    75			err = -ENXIO;
    76			goto out_vq;
    77		}
    78	
    79		dev_set_drvdata(&vdev->dev, vpmem->nvdimm_bus);
    80	
    81		ndr_desc.res = &res;
    82		ndr_desc.numa_node = nid;
    83		ndr_desc.flush = async_pmem_flush;
    84		set_bit(ND_REGION_PAGEMAP, &ndr_desc.flags);
    85		set_bit(ND_REGION_ASYNC, &ndr_desc.flags);
    86		nd_region = nvdimm_pmem_region_create(vpmem->nvdimm_bus, &ndr_desc);
    87		if (!nd_region) {
    88			dev_err(&vdev->dev, "failed to create nvdimm region\n");
    89			err = -ENXIO;
    90			goto out_nd;
    91		}
    92		nd_region->provider_data = dev_to_virtio(nd_region->dev.parent->parent);
    93		return 0;
    94	out_nd:
    95		nvdimm_bus_unregister(vpmem->nvdimm_bus);
    96	out_vq:
    97		vdev->config->del_vqs(vdev);
    98	out_err:
    99		return err;
   100	}
   101	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-nvdimm:libnvdimm-for-next 4/15] drivers/nvdimm/virtio_pmem.c:61:9: sparse: sparse: incompatible types in comparison expression (different base types):
  2019-06-20  9:48 [linux-nvdimm:libnvdimm-for-next 4/15] drivers/nvdimm/virtio_pmem.c:61:9: sparse: sparse: incompatible types in comparison expression (different base types): kbuild test robot
@ 2019-06-20 13:42 ` Pankaj Gupta
  0 siblings, 0 replies; 2+ messages in thread
From: Pankaj Gupta @ 2019-06-20 13:42 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Michael S. Tsirkin, Cornelia Huck, Yuval Shaia, linux-nvdimm,
	kbuild-all


Hi,

Thanks for the email. I will fix this warning with other build fixes found
by test bot and send a v14.

Best regards,
Pankaj

> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git
> libnvdimm-for-next
> head:   3b6047778c09037615e7b919c922081ef1a37a7f
> commit: 5990fce9c50eae1261a52df1488d04a47f4cfca7 [4/15] virtio-pmem: Add
> virtio pmem driver
> reproduce:
>         # apt-get install sparse
>         # sparse version: v0.6.1-rc1-7-g2b96cd8-dirty
>         git checkout 5990fce9c50eae1261a52df1488d04a47f4cfca7
>         make ARCH=x86_64 allmodconfig
>         make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> 
> sparse warnings: (new ones prefixed by >>)
> 
> >> drivers/nvdimm/virtio_pmem.c:61:9: sparse: sparse: incompatible types in
> >> comparison expression (different base types):
> >> drivers/nvdimm/virtio_pmem.c:61:9: sparse:    restricted __le64 *
> >> drivers/nvdimm/virtio_pmem.c:61:9: sparse:    unsigned long long *
>    drivers/nvdimm/virtio_pmem.c:63:9: sparse: sparse: incompatible types in
>    comparison expression (different base types):
>    drivers/nvdimm/virtio_pmem.c:63:9: sparse:    restricted __le64 *
>    drivers/nvdimm/virtio_pmem.c:63:9: sparse:    unsigned long long *
> 
> vim +61 drivers/nvdimm/virtio_pmem.c
> 
>     31
>     32	static int virtio_pmem_probe(struct virtio_device *vdev)
>     33	{
>     34		struct nd_region_desc ndr_desc = {};
>     35		int nid = dev_to_node(&vdev->dev);
>     36		struct nd_region *nd_region;
>     37		struct virtio_pmem *vpmem;
>     38		struct resource res;
>     39		int err = 0;
>     40
>     41		if (!vdev->config->get) {
>     42			dev_err(&vdev->dev, "%s failure: config access disabled\n",
>     43				__func__);
>     44			return -EINVAL;
>     45		}
>     46
>     47		vpmem = devm_kzalloc(&vdev->dev, sizeof(*vpmem), GFP_KERNEL);
>     48		if (!vpmem) {
>     49			err = -ENOMEM;
>     50			goto out_err;
>     51		}
>     52
>     53		vpmem->vdev = vdev;
>     54		vdev->priv = vpmem;
>     55		err = init_vq(vpmem);
>     56		if (err) {
>     57			dev_err(&vdev->dev, "failed to initialize virtio pmem vq's\n");
>     58			goto out_err;
>     59		}
>     60
>   > 61		virtio_cread(vpmem->vdev, struct virtio_pmem_config,
>     62				start, &vpmem->start);
>     63		virtio_cread(vpmem->vdev, struct virtio_pmem_config,
>     64				size, &vpmem->size);
>     65
>     66		res.start = vpmem->start;
>     67		res.end   = vpmem->start + vpmem->size - 1;
>     68		vpmem->nd_desc.provider_name = "virtio-pmem";
>     69		vpmem->nd_desc.module = THIS_MODULE;
>     70
>     71		vpmem->nvdimm_bus = nvdimm_bus_register(&vdev->dev,
>     72							&vpmem->nd_desc);
>     73		if (!vpmem->nvdimm_bus) {
>     74			dev_err(&vdev->dev, "failed to register device with nvdimm_bus\n");
>     75			err = -ENXIO;
>     76			goto out_vq;
>     77		}
>     78
>     79		dev_set_drvdata(&vdev->dev, vpmem->nvdimm_bus);
>     80
>     81		ndr_desc.res = &res;
>     82		ndr_desc.numa_node = nid;
>     83		ndr_desc.flush = async_pmem_flush;
>     84		set_bit(ND_REGION_PAGEMAP, &ndr_desc.flags);
>     85		set_bit(ND_REGION_ASYNC, &ndr_desc.flags);
>     86		nd_region = nvdimm_pmem_region_create(vpmem->nvdimm_bus, &ndr_desc);
>     87		if (!nd_region) {
>     88			dev_err(&vdev->dev, "failed to create nvdimm region\n");
>     89			err = -ENXIO;
>     90			goto out_nd;
>     91		}
>     92		nd_region->provider_data =
>     dev_to_virtio(nd_region->dev.parent->parent);
>     93		return 0;
>     94	out_nd:
>     95		nvdimm_bus_unregister(vpmem->nvdimm_bus);
>     96	out_vq:
>     97		vdev->config->del_vqs(vdev);
>     98	out_err:
>     99		return err;
>    100	}
>    101
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> 
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-20 13:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-20  9:48 [linux-nvdimm:libnvdimm-for-next 4/15] drivers/nvdimm/virtio_pmem.c:61:9: sparse: sparse: incompatible types in comparison expression (different base types): kbuild test robot
2019-06-20 13:42 ` Pankaj Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox