Commit 1a928623 authored by Ashutosh Dixit's avatar Ashutosh Dixit Committed by Greg Kroah-Hartman

misc: mic: Suppress memory space sparse warnings

MIC card and host drivers are able to use virtio over the PCIe bus by
treating ioremap return values for the prefetchable BARs as pointers,
effectively treating I/O memory the same as system memory. However this
results in sparse warnings. Knowing that these warnings do not point to
a functional issue, this patch suppresses these warnings.
Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Reviewed-by: default avatarSudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: default avatarNikhil Rao <nikhil.rao@intel.com>
Signed-off-by: default avatarAshutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 173c0727
...@@ -256,8 +256,9 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev, ...@@ -256,8 +256,9 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev,
mvdev->vr[index] = va; mvdev->vr[index] = va;
memset_io(va, 0x0, _vr_size); memset_io(va, 0x0, _vr_size);
vq = vring_new_virtqueue(index, le16_to_cpu(config.num), vq = vring_new_virtqueue(index, le16_to_cpu(config.num),
MIC_VIRTIO_RING_ALIGN, vdev, false, va, MIC_VIRTIO_RING_ALIGN, vdev, false,
mic_notify, callback, name); (void __force *)va, mic_notify, callback,
name);
if (!vq) { if (!vq) {
err = -ENOMEM; err = -ENOMEM;
goto unmap; goto unmap;
...@@ -540,7 +541,8 @@ static void mic_scan_devices(struct mic_driver *mdrv, bool remove) ...@@ -540,7 +541,8 @@ static void mic_scan_devices(struct mic_driver *mdrv, bool remove)
continue; continue;
/* device already exists */ /* device already exists */
dev = device_find_child(mdrv->dev, d, mic_match_desc); dev = device_find_child(mdrv->dev, (void __force *)d,
mic_match_desc);
if (dev) { if (dev) {
if (remove) if (remove)
iowrite8(MIC_VIRTIO_PARAM_DEV_REMOVE, iowrite8(MIC_VIRTIO_PARAM_DEV_REMOVE,
......
...@@ -41,7 +41,7 @@ static int mic_virtio_copy_to_user(struct mic_vdev *mvdev, ...@@ -41,7 +41,7 @@ static int mic_virtio_copy_to_user(struct mic_vdev *mvdev,
* We are copying from IO below an should ideally use something * We are copying from IO below an should ideally use something
* like copy_to_user_fromio(..) if it existed. * like copy_to_user_fromio(..) if it existed.
*/ */
if (copy_to_user(ubuf, dbuf, len)) { if (copy_to_user(ubuf, (void __force *)dbuf, len)) {
err = -EFAULT; err = -EFAULT;
dev_err(mic_dev(mvdev), "%s %d err %d\n", dev_err(mic_dev(mvdev), "%s %d err %d\n",
__func__, __LINE__, err); __func__, __LINE__, err);
...@@ -66,7 +66,7 @@ static int mic_virtio_copy_from_user(struct mic_vdev *mvdev, ...@@ -66,7 +66,7 @@ static int mic_virtio_copy_from_user(struct mic_vdev *mvdev,
* We are copying to IO below and should ideally use something * We are copying to IO below and should ideally use something
* like copy_from_user_toio(..) if it existed. * like copy_from_user_toio(..) if it existed.
*/ */
if (copy_from_user(dbuf, ubuf, len)) { if (copy_from_user((void __force *)dbuf, ubuf, len)) {
err = -EFAULT; err = -EFAULT;
dev_err(mic_dev(mvdev), "%s %d err %d\n", dev_err(mic_dev(mvdev), "%s %d err %d\n",
__func__, __LINE__, err); __func__, __LINE__, err);
...@@ -293,8 +293,8 @@ static void mic_virtio_init_post(struct mic_vdev *mvdev) ...@@ -293,8 +293,8 @@ static void mic_virtio_init_post(struct mic_vdev *mvdev)
continue; continue;
} }
mvdev->mvr[i].vrh.vring.used = mvdev->mvr[i].vrh.vring.used =
mvdev->mdev->aper.va (void __force *)mvdev->mdev->aper.va +
+ le64_to_cpu(vqconfig[i].used_address); le64_to_cpu(vqconfig[i].used_address);
} }
mvdev->dc->used_address_updated = 0; mvdev->dc->used_address_updated = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment