Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6004b7b authored by Muhammad Falak R Wani's avatar Muhammad Falak R Wani Committed by Sebastian Reichel
Browse files

HSI: cmt_speech: use vma_pages().



Replace explicit computation of vma page count by a call to
vma_pages()

Signed-off-by: default avatarMuhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent 1a695a90
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1275,7 +1275,7 @@ static int cs_char_mmap(struct file *file, struct vm_area_struct *vma)
	if (vma->vm_end < vma->vm_start)
	if (vma->vm_end < vma->vm_start)
		return -EINVAL;
		return -EINVAL;


	if (((vma->vm_end - vma->vm_start) >> PAGE_SHIFT) != 1)
	if (vma_pages(vma) != 1)
		return -EINVAL;
		return -EINVAL;


	vma->vm_flags |= VM_IO | VM_DONTDUMP | VM_DONTEXPAND;
	vma->vm_flags |= VM_IO | VM_DONTDUMP | VM_DONTEXPAND;