The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] HSI: cmt_speech: use vma_pages().
@ 2016-05-21 13:19 Muhammad Falak R Wani
  2016-05-30  5:13 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Muhammad Falak R Wani @ 2016-05-21 13:19 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Oleg Nesterov, Andrew Morton, Kirill A. Shutemov, open list

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

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
---
 drivers/hsi/clients/cmt_speech.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hsi/clients/cmt_speech.c b/drivers/hsi/clients/cmt_speech.c
index 95638df..b16cfa4 100644
--- a/drivers/hsi/clients/cmt_speech.c
+++ b/drivers/hsi/clients/cmt_speech.c
@@ -1275,7 +1275,7 @@ static int cs_char_mmap(struct file *file, struct vm_area_struct *vma)
 	if (vma->vm_end < vma->vm_start)
 		return -EINVAL;
 
-	if (((vma->vm_end - vma->vm_start) >> PAGE_SHIFT) != 1)
+	if (vma_pages(vma) != 1)
 		return -EINVAL;
 
 	vma->vm_flags |= VM_IO | VM_DONTDUMP | VM_DONTEXPAND;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-30  5:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-21 13:19 [PATCH] HSI: cmt_speech: use vma_pages() Muhammad Falak R Wani
2016-05-30  5:13 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox