Commit 09729a9919fdaf137995b0f19cbd401e22229cac
Committed by
Alexey Dobriyan
1 parent
1681bc30f2
Exists in
master
and in
7 other branches
proc: fix sparse warnings in pagemap_read()
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>
Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff
fs/proc/task_mmu.c
... | ... | @@ -693,8 +693,8 @@ |
693 | 693 | goto out_pages; |
694 | 694 | } |
695 | 695 | |
696 | - pm.out = (u64 *)buf; | |
697 | - pm.end = (u64 *)(buf + count); | |
696 | + pm.out = (u64 __user *)buf; | |
697 | + pm.end = (u64 __user *)(buf + count); | |
698 | 698 | |
699 | 699 | pagemap_walk.pmd_entry = pagemap_pte_range; |
700 | 700 | pagemap_walk.pte_hole = pagemap_pte_hole; |
701 | 701 | |
... | ... | @@ -720,9 +720,9 @@ |
720 | 720 | if (ret == PM_END_OF_BUFFER) |
721 | 721 | ret = 0; |
722 | 722 | /* don't need mmap_sem for these, but this looks cleaner */ |
723 | - *ppos += (char *)pm.out - buf; | |
723 | + *ppos += (char __user *)pm.out - buf; | |
724 | 724 | if (!ret) |
725 | - ret = (char *)pm.out - buf; | |
725 | + ret = (char __user *)pm.out - buf; | |
726 | 726 | |
727 | 727 | out_pages: |
728 | 728 | for (; pagecount; pagecount--) { |