proc: fix sparse warnings in pagemap_read()
authorMilind Arun Choudhary <milindchoudhary@gmail.com>
Fri, 20 Feb 2009 13:56:45 +0000 (16:56 +0300)
committerAlexey Dobriyan <adobriyan@gmail.com>
Mon, 30 Mar 2009 21:14:22 +0000 (01:14 +0400)
fs/proc/task_mmu.c:696:12: warning: cast removes address space of expression
fs/proc/task_mmu.c:696:9: warning: incorrect type in assignment (different address spaces)
fs/proc/task_mmu.c:696:9:    expected unsigned long long [noderef] [usertype] <asn:1>*out
fs/proc/task_mmu.c:696:9:    got unsigned long long [usertype] *<noident>
fs/proc/task_mmu.c:697:12: warning: cast removes address space of expression
fs/proc/task_mmu.c:697:9: warning: incorrect type in assignment (different address spaces)
fs/proc/task_mmu.c:697:9:    expected unsigned long long [noderef] [usertype] <asn:1>*end
fs/proc/task_mmu.c:697:9:    got unsigned long long [usertype] *<noident>
fs/proc/task_mmu.c:723:12: warning: cast removes address space of expression
fs/proc/task_mmu.c:723:26: error: subtraction of different types can't work (different address spaces)
fs/proc/task_mmu.c:725:24: error: subtraction of different types can't work (different address spaces)

Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
fs/proc/task_mmu.c

index 94063840832ad99709d4ca878d9aff8704ac6424..b0ae0be4801f821f81c872299c135f55e6fb377c 100644 (file)
@@ -693,8 +693,8 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
                goto out_pages;
        }
 
-       pm.out = (u64 *)buf;
-       pm.end = (u64 *)(buf + count);
+       pm.out = (u64 __user *)buf;
+       pm.end = (u64 __user *)(buf + count);
 
        pagemap_walk.pmd_entry = pagemap_pte_range;
        pagemap_walk.pte_hole = pagemap_pte_hole;
@@ -720,9 +720,9 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
        if (ret == PM_END_OF_BUFFER)
                ret = 0;
        /* don't need mmap_sem for these, but this looks cleaner */
-       *ppos += (char *)pm.out - buf;
+       *ppos += (char __user *)pm.out - buf;
        if (!ret)
-               ret = (char *)pm.out - buf;
+               ret = (char __user *)pm.out - buf;
 
 out_pages:
        for (; pagecount; pagecount--) {