[PATCH 01/20] mm: Change type of vmf->virtual_address

2016-11-01 Thread Jan Kara
Every single user of vmf->virtual_address typed that entry to unsigned
long before doing anything with it. So just change the type of that
entry to unsigned long immediately.

Signed-off-by: Jan Kara 
---
 arch/powerpc/platforms/cell/spufs/file.c |  4 ++--
 arch/x86/entry/vdso/vma.c|  4 ++--
 drivers/char/agp/alpha-agp.c |  2 +-
 drivers/char/mspec.c |  2 +-
 drivers/dax/dax.c|  2 +-
 drivers/gpu/drm/armada/armada_gem.c  |  2 +-
 drivers/gpu/drm/drm_vm.c |  9 -
 drivers/gpu/drm/etnaviv/etnaviv_gem.c|  7 +++
 drivers/gpu/drm/exynos/exynos_drm_gem.c  |  5 ++---
 drivers/gpu/drm/gma500/framebuffer.c |  2 +-
 drivers/gpu/drm/gma500/gem.c |  5 ++---
 drivers/gpu/drm/i915/i915_gem.c  |  5 ++---
 drivers/gpu/drm/msm/msm_gem.c|  7 +++
 drivers/gpu/drm/omapdrm/omap_gem.c   | 17 +++--
 drivers/gpu/drm/tegra/gem.c  |  4 ++--
 drivers/gpu/drm/ttm/ttm_bo_vm.c  |  2 +-
 drivers/gpu/drm/udl/udl_gem.c|  5 ++---
 drivers/gpu/drm/vgem/vgem_drv.c  |  2 +-
 drivers/media/v4l2-core/videobuf-dma-sg.c|  5 ++---
 drivers/misc/cxl/context.c   |  2 +-
 drivers/misc/sgi-gru/grumain.c   |  2 +-
 drivers/staging/android/ion/ion.c|  2 +-
 drivers/staging/lustre/lustre/llite/vvp_io.c |  8 +---
 drivers/xen/privcmd.c|  2 +-
 fs/dax.c |  4 ++--
 include/linux/mm.h   |  2 +-
 mm/memory.c  |  7 +++
 27 files changed, 55 insertions(+), 65 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/file.c 
b/arch/powerpc/platforms/cell/spufs/file.c
index 06254467e4dd..f7b33a477b95 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -236,7 +236,7 @@ static int
 spufs_mem_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
struct spu_context *ctx = vma->vm_file->private_data;
-   unsigned long address = (unsigned long)vmf->virtual_address;
+   unsigned long address = vmf->virtual_address;
unsigned long pfn, offset;
 
offset = vmf->pgoff << PAGE_SHIFT;
@@ -355,7 +355,7 @@ static int spufs_ps_fault(struct vm_area_struct *vma,
down_read(>mm->mmap_sem);
} else {
area = ctx->spu->problem_phys + ps_offs;
-   vm_insert_pfn(vma, (unsigned long)vmf->virtual_address,
+   vm_insert_pfn(vma, vmf->virtual_address,
(area + offset) >> PAGE_SHIFT);
spu_context_trace(spufs_ps_fault__insert, ctx, ctx->spu);
}
diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index f840766659a8..113e0155c6b5 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -157,7 +157,7 @@ static int vvar_fault(const struct vm_special_mapping *sm,
return VM_FAULT_SIGBUS;
 
if (sym_offset == image->sym_vvar_page) {
-   ret = vm_insert_pfn(vma, (unsigned long)vmf->virtual_address,
+   ret = vm_insert_pfn(vma, vmf->virtual_address,
__pa_symbol(&__vvar_page) >> PAGE_SHIFT);
} else if (sym_offset == image->sym_pvclock_page) {
struct pvclock_vsyscall_time_info *pvti =
@@ -165,7 +165,7 @@ static int vvar_fault(const struct vm_special_mapping *sm,
if (pvti && vclock_was_used(VCLOCK_PVCLOCK)) {
ret = vm_insert_pfn(
vma,
-   (unsigned long)vmf->virtual_address,
+   vmf->virtual_address,
__pa(pvti) >> PAGE_SHIFT);
}
}
diff --git a/drivers/char/agp/alpha-agp.c b/drivers/char/agp/alpha-agp.c
index 199b8e99f7d7..537b1dc14c9f 100644
--- a/drivers/char/agp/alpha-agp.c
+++ b/drivers/char/agp/alpha-agp.c
@@ -19,7 +19,7 @@ static int alpha_core_agp_vm_fault(struct vm_area_struct *vma,
unsigned long pa;
struct page *page;
 
-   dma_addr = (unsigned long)vmf->virtual_address - vma->vm_start
+   dma_addr = vmf->virtual_address - vma->vm_start
+ agp->aperture.bus_base;
pa = agp->ops->translate(agp, dma_addr);
 
diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c
index f3f92d5fcda0..36eb17c16951 100644
--- a/drivers/char/mspec.c
+++ b/drivers/char/mspec.c
@@ -227,7 +227,7 @@ mspec_fault(struct vm_area_struct *vma, struct vm_fault 
*vmf)
 * be because another thread has installed the pte first, so it
 * is no problem.
 */
-   vm_insert_pfn(vma, (unsigned long)vmf->virtual_address, pfn);
+   

Re: [PATCH 01/20] mm: Change type of vmf->virtual_address

2016-10-14 Thread Ross Zwisler
On Tue, Sep 27, 2016 at 06:08:05PM +0200, Jan Kara wrote:
> Every single user of vmf->virtual_address typed that entry to unsigned
> long before doing anything with it. So just change the type of that
> entry to unsigned long immediately.
> 
> Signed-off-by: Jan Kara 

Reviewed-by: Ross Zwisler 
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm


Re: [PATCH 01/20] mm: Change type of vmf->virtual_address

2016-09-30 Thread Christoph Hellwig
Looks fine,

Reviewed-by: Christoph Hellwig 
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm