summaryrefslogtreecommitdiffstats
path: root/drivers/uio
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2013-10-27 21:53:40 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-29 16:51:57 -0700
commite6418fcc8adaa5c3911295cbe7ddd368b9788616 (patch)
treed50409fad508cefafd39d62fc0b4beb519810bc5 /drivers/uio
parent75f0aef6220dc1e73bed238e57b20544ef4f38ec (diff)
downloadlinux-e6418fcc8adaa5c3911295cbe7ddd368b9788616.tar.gz
linux-e6418fcc8adaa5c3911295cbe7ddd368b9788616.tar.bz2
linux-e6418fcc8adaa5c3911295cbe7ddd368b9788616.zip
uio: Pass pointers to virt_to_page(), not integers
Most architectures define virt_to_page() as a macro that casts its argument such that an argument of type unsigned long will be accepted without complaint. However, the proper type is void *, and passing unsigned long results in a warning on MIPS. Compile-tested only. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/uio')
-rw-r--r--drivers/uio/uio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index c8e45add506e..e221f13fcb61 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -605,6 +605,7 @@ static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
struct uio_device *idev = vma->vm_private_data;
struct page *page;
unsigned long offset;
+ void *addr;
int mi = uio_find_mem_index(vma);
if (mi < 0)
@@ -616,10 +617,11 @@ static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
*/
offset = (vmf->pgoff - mi) << PAGE_SHIFT;
+ addr = (void *)(unsigned long)idev->info->mem[mi].addr + offset;
if (idev->info->mem[mi].memtype == UIO_MEM_LOGICAL)
- page = virt_to_page(idev->info->mem[mi].addr + offset);
+ page = virt_to_page(addr);
else
- page = vmalloc_to_page((void *)(unsigned long)idev->info->mem[mi].addr + offset);
+ page = vmalloc_to_page(addr);
get_page(page);
vmf->page = page;
return 0;