diff options
author | Joe MacDonald <joe.macdonald@windriver.com> | 2012-08-21 04:22:28 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-10 00:37:31 -0400 |
commit | 6b5e7229bbd59f0cfce7015fd46736fc93d8c8c3 (patch) | |
tree | 123e1d096d08b19db3ec32e9272a8a81335fdc7c /arch/powerpc/mm | |
parent | 11f63d3fb9c4257b1f005db8d11deba9f992bdf6 (diff) |
powerpc/mm: Match variable types to API
sys_subpage_prot() takes an unsigned long for 'addr' then does some stuff
with it and the result is stored in a signed int, i, which is eventually
used as the size parameter in a copy_from_user call. Update 'i' to be an
unsigned long as well and since 'nw' is used in a size_t context which,
depending on whether this is 32- or 64-bit may be unsigned int or unsigned
long, switch that to a size_t and always be right.
Finally, since we're in the neighbourhood, make the same changes to
subpage_prot_clear().
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/subpage-prot.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c index e4f8f1fc81a..7c415ddde94 100644 --- a/arch/powerpc/mm/subpage-prot.c +++ b/arch/powerpc/mm/subpage-prot.c | |||
@@ -95,7 +95,8 @@ static void subpage_prot_clear(unsigned long addr, unsigned long len) | |||
95 | struct mm_struct *mm = current->mm; | 95 | struct mm_struct *mm = current->mm; |
96 | struct subpage_prot_table *spt = &mm->context.spt; | 96 | struct subpage_prot_table *spt = &mm->context.spt; |
97 | u32 **spm, *spp; | 97 | u32 **spm, *spp; |
98 | int i, nw; | 98 | unsigned long i; |
99 | size_t nw; | ||
99 | unsigned long next, limit; | 100 | unsigned long next, limit; |
100 | 101 | ||
101 | down_write(&mm->mmap_sem); | 102 | down_write(&mm->mmap_sem); |
@@ -144,7 +145,8 @@ long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map) | |||
144 | struct mm_struct *mm = current->mm; | 145 | struct mm_struct *mm = current->mm; |
145 | struct subpage_prot_table *spt = &mm->context.spt; | 146 | struct subpage_prot_table *spt = &mm->context.spt; |
146 | u32 **spm, *spp; | 147 | u32 **spm, *spp; |
147 | int i, nw; | 148 | unsigned long i; |
149 | size_t nw; | ||
148 | unsigned long next, limit; | 150 | unsigned long next, limit; |
149 | int err; | 151 | int err; |
150 | 152 | ||