Re: [Xen-devel] [PATCH v2] xen: add new hypercall buffer mapping device

From: Andrew Cooper
Date: Mon Jun 18 2018 - 04:18:37 EST


On 18/06/18 15:36, Juergen Gross wrote:
> +static int privcmd_buf_mmap(struct file *file, struct vm_area_struct *vma)
> +{
> + struct privcmd_buf_private *file_priv = file->private_data;
> + struct privcmd_buf_vma_private *vma_priv;
> + unsigned long count = vma_pages(vma);
> + unsigned int i;
> + int ret = 0;
> +
> + if (!(vma->vm_flags & VM_SHARED) || count > (unsigned long)limit ||

You don't need the unsigned long cast, as limit will be promoted
automatically.

Otherwise, LGTM.

~Andrew