diff options
Diffstat (limited to 'arch/s390/mm/maccess.c')
-rw-r--r-- | arch/s390/mm/maccess.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/arch/s390/mm/maccess.c b/arch/s390/mm/maccess.c index d1e0e0c7a7e2..2a2e35416d2f 100644 --- a/arch/s390/mm/maccess.c +++ b/arch/s390/mm/maccess.c | |||
@@ -128,7 +128,7 @@ void memcpy_absolute(void *dest, void *src, size_t count) | |||
128 | /* | 128 | /* |
129 | * Copy memory from kernel (real) to user (virtual) | 129 | * Copy memory from kernel (real) to user (virtual) |
130 | */ | 130 | */ |
131 | int copy_to_user_real(void __user *dest, void *src, size_t count) | 131 | int copy_to_user_real(void __user *dest, void *src, unsigned long count) |
132 | { | 132 | { |
133 | int offs = 0, size, rc; | 133 | int offs = 0, size, rc; |
134 | char *buf; | 134 | char *buf; |
@@ -152,32 +152,6 @@ out: | |||
152 | } | 152 | } |
153 | 153 | ||
154 | /* | 154 | /* |
155 | * Copy memory from user (virtual) to kernel (real) | ||
156 | */ | ||
157 | int copy_from_user_real(void *dest, void __user *src, size_t count) | ||
158 | { | ||
159 | int offs = 0, size, rc; | ||
160 | char *buf; | ||
161 | |||
162 | buf = (char *) __get_free_page(GFP_KERNEL); | ||
163 | if (!buf) | ||
164 | return -ENOMEM; | ||
165 | rc = -EFAULT; | ||
166 | while (offs < count) { | ||
167 | size = min(PAGE_SIZE, count - offs); | ||
168 | if (copy_from_user(buf, src + offs, size)) | ||
169 | goto out; | ||
170 | if (memcpy_real(dest + offs, buf, size)) | ||
171 | goto out; | ||
172 | offs += size; | ||
173 | } | ||
174 | rc = 0; | ||
175 | out: | ||
176 | free_page((unsigned long) buf); | ||
177 | return rc; | ||
178 | } | ||
179 | |||
180 | /* | ||
181 | * Check if physical address is within prefix or zero page | 155 | * Check if physical address is within prefix or zero page |
182 | */ | 156 | */ |
183 | static int is_swapped(unsigned long addr) | 157 | static int is_swapped(unsigned long addr) |