mm: use vmf->address instead of of vmf->virtual_address
Every single user of vmf->virtual_address typed that entry to unsigned long before doing anything with it so the type of virtual_address does not really provide us any additional safety. Just use masked vmf->address which already has the appropriate type. Link: http://lkml.kernel.org/r/1479460644-25076-3-git-send-email-jack@suse.cz Signed-off-by: Jan Kara <jack@suse.cz> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -236,7 +236,6 @@ 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 pfn, offset;
|
||||
|
||||
offset = vmf->pgoff << PAGE_SHIFT;
|
||||
@@ -244,7 +243,7 @@ spufs_mem_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
return VM_FAULT_SIGBUS;
|
||||
|
||||
pr_debug("spufs_mem_mmap_fault address=0x%lx, offset=0x%lx\n",
|
||||
address, offset);
|
||||
vmf->address, offset);
|
||||
|
||||
if (spu_acquire(ctx))
|
||||
return VM_FAULT_NOPAGE;
|
||||
@@ -256,7 +255,7 @@ spufs_mem_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
vma->vm_page_prot = pgprot_noncached_wc(vma->vm_page_prot);
|
||||
pfn = (ctx->spu->local_store_phys + offset) >> PAGE_SHIFT;
|
||||
}
|
||||
vm_insert_pfn(vma, address, pfn);
|
||||
vm_insert_pfn(vma, vmf->address, pfn);
|
||||
|
||||
spu_release(ctx);
|
||||
|
||||
@@ -355,8 +354,7 @@ static int spufs_ps_fault(struct vm_area_struct *vma,
|
||||
down_read(¤t->mm->mmap_sem);
|
||||
} else {
|
||||
area = ctx->spu->problem_phys + ps_offs;
|
||||
vm_insert_pfn(vma, (unsigned long)vmf->virtual_address,
|
||||
(area + offset) >> PAGE_SHIFT);
|
||||
vm_insert_pfn(vma, vmf->address, (area + offset) >> PAGE_SHIFT);
|
||||
spu_context_trace(spufs_ps_fault__insert, ctx, ctx->spu);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user