Hi Jonathan, ...
> @@ -1361,21 +1361,27 @@ static long intel_vgpu_ioctl(struct vfio_device
> *vfio_dev, unsigned int cmd,
> if (copy_from_user(&hdr, (void __user *)arg, minsz))
> return -EFAULT;
>
> + if (hweight32(hdr.flags & VFIO_IRQ_SET_DATA_TYPE_MASK) != 1 ||
> + hweight32(hdr.flags & VFIO_IRQ_SET_ACTION_TYPE_MASK) != 1)
How about using:
if (!is_power_of_2(...) ||
!is_power_of_2(...))
The rest looks good.
Andi
> + return -EINVAL;
