[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <88645f5ea8202784a8baaf389e592aeb8c505e8e.1552921225.git.jrdr.linux@gmail.com>
Date: Tue, 16 Apr 2019 17:19:44 +0530
From: Souptick Joarder <jrdr.linux@...il.com>
To: akpm@...ux-foundation.org, willy@...radead.org, mhocko@...e.com,
kirill.shutemov@...ux.intel.com, vbabka@...e.cz, riel@...riel.com,
sfr@...b.auug.org.au, rppt@...ux.vnet.ibm.com,
peterz@...radead.org, linux@...linux.org.uk, robin.murphy@....com,
iamjoonsoo.kim@....com, treding@...dia.com, keescook@...omium.org,
m.szyprowski@...sung.com, stefanr@...6.in-berlin.de,
hjc@...k-chips.com, heiko@...ech.de, airlied@...ux.ie,
oleksandr_andrushchenko@...m.com, joro@...tes.org,
pawel@...iak.com, kyungmin.park@...sung.com, mchehab@...nel.org,
boris.ostrovsky@...cle.com, jgross@...e.com
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-arm-kernel@...ts.infradead.org,
linux1394-devel@...ts.sourceforge.net,
dri-devel@...ts.freedesktop.org,
linux-rockchip@...ts.infradead.org, xen-devel@...ts.xen.org,
iommu@...ts.linux-foundation.org, linux-media@...r.kernel.org,
Souptick Joarder <jrdr.linux@...il.com>
Subject: [REBASE PATCH v5 3/9] drivers/firewire/core-iso.c: Convert to use vm_map_pages_zero()
Convert to use vm_map_pages_zero() to map range of kernel memory
to user vma.
This driver has ignored vm_pgoff and mapped the entire pages. We
could later "fix" these drivers to behave according to the normal
vm_pgoff offsetting simply by removing the _zero suffix on the
function name and if that causes regressions, it gives us an easy
way to revert.
Signed-off-by: Souptick Joarder <jrdr.linux@...il.com>
---
drivers/firewire/core-iso.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c
index 35e784c..5414eb1 100644
--- a/drivers/firewire/core-iso.c
+++ b/drivers/firewire/core-iso.c
@@ -107,19 +107,8 @@ int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
int fw_iso_buffer_map_vma(struct fw_iso_buffer *buffer,
struct vm_area_struct *vma)
{
- unsigned long uaddr;
- int i, err;
-
- uaddr = vma->vm_start;
- for (i = 0; i < buffer->page_count; i++) {
- err = vm_insert_page(vma, uaddr, buffer->pages[i]);
- if (err)
- return err;
-
- uaddr += PAGE_SIZE;
- }
-
- return 0;
+ return vm_map_pages_zero(vma, buffer->pages,
+ buffer->page_count);
}
void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
--
1.9.1
Powered by blists - more mailing lists