Commit ba01cea2 authored by Vincent Whitchurch's avatar Vincent Whitchurch Committed by Greg Kroah-Hartman

mic: vop: Cast pointers to unsigned long

Fix these on 32-bit:

 vop_vringh.c:711:13: error: cast from pointer to integer of different
 size [-Werror=pointer-to-int-cast]
Signed-off-by: default avatarVincent Whitchurch <vincent.whitchurch@axis.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 401c9bd1
...@@ -514,7 +514,7 @@ static int _vop_add_device(struct mic_device_desc __iomem *d, ...@@ -514,7 +514,7 @@ static int _vop_add_device(struct mic_device_desc __iomem *d,
vdev->desc = d; vdev->desc = d;
vdev->dc = (void __iomem *)d + _vop_aligned_desc_size(d); vdev->dc = (void __iomem *)d + _vop_aligned_desc_size(d);
vdev->dnode = dnode; vdev->dnode = dnode;
vdev->vdev.priv = (void *)(u64)dnode; vdev->vdev.priv = (void *)(unsigned long)dnode;
init_completion(&vdev->reset_done); init_completion(&vdev->reset_done);
vdev->h2c_vdev_db = vpdev->hw_ops->next_db(vpdev); vdev->h2c_vdev_db = vpdev->hw_ops->next_db(vpdev);
...@@ -536,7 +536,7 @@ static int _vop_add_device(struct mic_device_desc __iomem *d, ...@@ -536,7 +536,7 @@ static int _vop_add_device(struct mic_device_desc __iomem *d,
offset, type); offset, type);
goto free_irq; goto free_irq;
} }
writeq((u64)vdev, &vdev->dc->vdev); writeq((unsigned long)vdev, &vdev->dc->vdev);
dev_dbg(_vop_dev(vdev), "%s: registered vop device %u type %u vdev %p\n", dev_dbg(_vop_dev(vdev), "%s: registered vop device %u type %u vdev %p\n",
__func__, offset, type, vdev); __func__, offset, type, vdev);
...@@ -563,13 +563,18 @@ static int vop_match_desc(struct device *dev, void *data) ...@@ -563,13 +563,18 @@ static int vop_match_desc(struct device *dev, void *data)
return vdev->desc == (void __iomem *)data; return vdev->desc == (void __iomem *)data;
} }
static struct _vop_vdev *vop_dc_to_vdev(struct mic_device_ctrl *dc)
{
return (struct _vop_vdev *)(unsigned long)readq(&dc->vdev);
}
static void _vop_handle_config_change(struct mic_device_desc __iomem *d, static void _vop_handle_config_change(struct mic_device_desc __iomem *d,
unsigned int offset, unsigned int offset,
struct vop_device *vpdev) struct vop_device *vpdev)
{ {
struct mic_device_ctrl __iomem *dc struct mic_device_ctrl __iomem *dc
= (void __iomem *)d + _vop_aligned_desc_size(d); = (void __iomem *)d + _vop_aligned_desc_size(d);
struct _vop_vdev *vdev = (struct _vop_vdev *)readq(&dc->vdev); struct _vop_vdev *vdev = vop_dc_to_vdev(dc);
if (ioread8(&dc->config_change) != MIC_VIRTIO_PARAM_CONFIG_CHANGED) if (ioread8(&dc->config_change) != MIC_VIRTIO_PARAM_CONFIG_CHANGED)
return; return;
...@@ -588,7 +593,7 @@ static int _vop_remove_device(struct mic_device_desc __iomem *d, ...@@ -588,7 +593,7 @@ static int _vop_remove_device(struct mic_device_desc __iomem *d,
{ {
struct mic_device_ctrl __iomem *dc struct mic_device_ctrl __iomem *dc
= (void __iomem *)d + _vop_aligned_desc_size(d); = (void __iomem *)d + _vop_aligned_desc_size(d);
struct _vop_vdev *vdev = (struct _vop_vdev *)readq(&dc->vdev); struct _vop_vdev *vdev = vop_dc_to_vdev(dc);
u8 status; u8 status;
int ret = -1; int ret = -1;
......
...@@ -712,16 +712,17 @@ static int vop_vringh_copy(struct vop_vdev *vdev, struct vringh_kiov *iov, ...@@ -712,16 +712,17 @@ static int vop_vringh_copy(struct vop_vdev *vdev, struct vringh_kiov *iov,
while (len && iov->i < iov->used) { while (len && iov->i < iov->used) {
struct kvec *kiov = &iov->iov[iov->i]; struct kvec *kiov = &iov->iov[iov->i];
unsigned long daddr = (unsigned long)kiov->iov_base;
partlen = min(kiov->iov_len, len); partlen = min(kiov->iov_len, len);
if (read) if (read)
ret = vop_virtio_copy_to_user(vdev, ubuf, partlen, ret = vop_virtio_copy_to_user(vdev, ubuf, partlen,
(u64)kiov->iov_base, daddr,
kiov->iov_len, kiov->iov_len,
vr_idx); vr_idx);
else else
ret = vop_virtio_copy_from_user(vdev, ubuf, partlen, ret = vop_virtio_copy_from_user(vdev, ubuf, partlen,
(u64)kiov->iov_base, daddr,
kiov->iov_len, kiov->iov_len,
vr_idx); vr_idx);
if (ret) { if (ret) {
......
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