aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic/vop/vop_main.c
diff options
context:
space:
mode:
authorVincent Whitchurch <vincent.whitchurch@axis.com>2019-01-16 17:32:51 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-22 11:43:17 +0100
commit8216e7e367043182fe121b6dec5e7dbe9d3231cd (patch)
treefa4335c33f978ce8096647d9b11eb787d7c68873 /drivers/misc/mic/vop/vop_main.c
parentvop: vringh: Do not crash if no DMA channel (diff)
downloadlinux-dev-8216e7e367043182fe121b6dec5e7dbe9d3231cd.tar.xz
linux-dev-8216e7e367043182fe121b6dec5e7dbe9d3231cd.zip
vop: Fix handling of >32 feature bits
This is needed, for example, for VIRTIO_F_IOMMU_PLATFORM. Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mic/vop/vop_main.c')
-rw-r--r--drivers/misc/mic/vop/vop_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/mic/vop/vop_main.c b/drivers/misc/mic/vop/vop_main.c
index 1a9b410f4190..47a096ddc6fe 100644
--- a/drivers/misc/mic/vop/vop_main.c
+++ b/drivers/misc/mic/vop/vop_main.c
@@ -117,7 +117,7 @@ _vop_total_desc_size(struct mic_device_desc __iomem *desc)
static u64 vop_get_features(struct virtio_device *vdev)
{
unsigned int i, bits;
- u32 features = 0;
+ u64 features = 0;
struct mic_device_desc __iomem *desc = to_vopvdev(vdev)->desc;
u8 __iomem *in_features = _vop_vq_features(desc);
int feature_len = ioread8(&desc->feature_len);
@@ -125,7 +125,7 @@ static u64 vop_get_features(struct virtio_device *vdev)
bits = min_t(unsigned, feature_len, sizeof(vdev->features)) * 8;
for (i = 0; i < bits; i++)
if (ioread8(&in_features[i / 8]) & (BIT(i % 8)))
- features |= BIT(i);
+ features |= BIT_ULL(i);
return features;
}