Thread (140 messages) 140 messages, 10 authors, 19d ago

Re: [PATCH 19/30] mm: use linear_page_[index, delta]() consistently

From: Gregory Price <gourry@gourry.net>
Date: 2026-07-09 15:56:00
Also in: damon, dri-devel, kvm, linux-arm-msm, linux-fsdevel, linux-iommu, linux-mm, linux-perf-users, linux-tegra, lkml, nvdimm

On Mon, Jun 29, 2026 at 01:23:30PM +0100, Lorenzo Stoakes wrote:
There are a number of places where we open code what linear_page_index()
and linear_page_delta() calculate.

Replace this code with the appropriate functions for consistency.

No functional change intended.

Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
one nit

Reviewed-by: Gregory Price <gourry@gourry.net>

...
quoted hunk ↗ jump to hunk
diff --git a/drivers/comedi/comedi_fops.c b/drivers/comedi/comedi_fops.c
index c09bbe04be6c..536c25d8dcee 100644
--- a/drivers/comedi/comedi_fops.c
+++ b/drivers/comedi/comedi_fops.c
@@ -25,6 +25,7 @@
 #include <linux/fs.h>
 #include <linux/comedi/comedidev.h>
 #include <linux/cdev.h>
+#include <linux/pagemap.h>
 
 #include <linux/io.h>
 #include <linux/uaccess.h>
@@ -2462,7 +2463,7 @@ static int comedi_vm_access(struct vm_area_struct *vma, unsigned long addr,
 {
 	struct comedi_buf_map *bm = vma->vm_private_data;
 	unsigned long offset =
-	    addr - vma->vm_start + (vma->vm_pgoff << PAGE_SHIFT);
+	    addr - vma->vm_start + (vma_start_pgoff(vma) << PAGE_SHIFT);
 
Obviously correct, but was this intended for a different patch?

~Gregory
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help