summaryrefslogtreecommitdiff
path: root/arch/s390/lib/uaccess_pt.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2014-01-22 17:49:30 +0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2014-02-21 11:50:13 +0400
commitcfa785e623577cdad2aa721acb23bd3a95eced9a (patch)
tree30fcb9b2f2153f08f66dd27b0a51a64b657b7717 /arch/s390/lib/uaccess_pt.c
parent137a14f434705a366cc94b2b32f2488c975863ad (diff)
downloadlinux-cfa785e623577cdad2aa721acb23bd3a95eced9a.tar.xz
s390/uaccess: normalize order of parameters of indirect uaccess function calls
For some unknown reason the indirect uaccess functions on s390 implement a different parameter order than what is usual. e.g.: unsigned long copy_to_user(void *to, const void *from, unsigned long n); vs. size_t (*copy_to_user)(size_t n, void __user * to, const void *from); Let's get rid of this confusing parameter reordering. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/lib/uaccess_pt.c')
-rw-r--r--arch/s390/lib/uaccess_pt.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c
index 61ebcc9ccb34..2fa696b39b56 100644
--- a/arch/s390/lib/uaccess_pt.c
+++ b/arch/s390/lib/uaccess_pt.c
@@ -22,7 +22,7 @@
#define SLR "slgr"
#endif
-static size_t strnlen_kernel(size_t count, const char __user *src)
+static size_t strnlen_kernel(const char __user *src, size_t count)
{
register unsigned long reg0 asm("0") = 0UL;
unsigned long tmp1, tmp2;
@@ -42,8 +42,8 @@ static size_t strnlen_kernel(size_t count, const char __user *src)
return count;
}
-static size_t copy_in_kernel(size_t count, void __user *to,
- const void __user *from)
+static size_t copy_in_kernel(void __user *to, const void __user *from,
+ size_t count)
{
unsigned long tmp1;
@@ -211,26 +211,26 @@ fault:
return 0;
}
-static size_t copy_from_user_pt(size_t n, const void __user *from, void *to)
+static size_t copy_from_user_pt(void *to, const void __user *from, size_t n)
{
size_t rc;
if (segment_eq(get_fs(), KERNEL_DS))
- return copy_in_kernel(n, (void __user *) to, from);
+ return copy_in_kernel((void __user *) to, from, n);
rc = __user_copy_pt((unsigned long) from, to, n, 0);
if (unlikely(rc))
memset(to + n - rc, 0, rc);
return rc;
}
-static size_t copy_to_user_pt(size_t n, void __user *to, const void *from)
+static size_t copy_to_user_pt(void __user *to, const void *from, size_t n)
{
if (segment_eq(get_fs(), KERNEL_DS))
- return copy_in_kernel(n, to, (void __user *) from);
+ return copy_in_kernel(to, (void __user *) from, n);
return __user_copy_pt((unsigned long) to, (void *) from, n, 1);
}
-static size_t clear_user_pt(size_t n, void __user *to)
+static size_t clear_user_pt(void __user *to, size_t n)
{
void *zpage = (void *) empty_zero_page;
long done, size, ret;
@@ -242,7 +242,7 @@ static size_t clear_user_pt(size_t n, void __user *to)
else
size = n - done;
if (segment_eq(get_fs(), KERNEL_DS))
- ret = copy_in_kernel(n, to, (void __user *) zpage);
+ ret = copy_in_kernel(to, (void __user *) zpage, n);
else
ret = __user_copy_pt((unsigned long) to, zpage, size, 1);
done += size;
@@ -253,7 +253,7 @@ static size_t clear_user_pt(size_t n, void __user *to)
return 0;
}
-static size_t strnlen_user_pt(size_t count, const char __user *src)
+static size_t strnlen_user_pt(const char __user *src, size_t count)
{
unsigned long uaddr = (unsigned long) src;
struct mm_struct *mm = current->mm;
@@ -263,7 +263,7 @@ static size_t strnlen_user_pt(size_t count, const char __user *src)
if (unlikely(!count))
return 0;
if (segment_eq(get_fs(), KERNEL_DS))
- return strnlen_kernel(count, src);
+ return strnlen_kernel(src, count);
if (!mm)
return 0;
done = 0;
@@ -289,8 +289,8 @@ fault:
goto retry;
}
-static size_t strncpy_from_user_pt(size_t count, const char __user *src,
- char *dst)
+static size_t strncpy_from_user_pt(char *dst, const char __user *src,
+ size_t count)
{
size_t done, len, offset, len_str;
@@ -301,7 +301,7 @@ static size_t strncpy_from_user_pt(size_t count, const char __user *src,
offset = (size_t)src & ~PAGE_MASK;
len = min(count - done, PAGE_SIZE - offset);
if (segment_eq(get_fs(), KERNEL_DS)) {
- if (copy_in_kernel(len, (void __user *) dst, src))
+ if (copy_in_kernel((void __user *) dst, src, len))
return -EFAULT;
} else {
if (__user_copy_pt((unsigned long) src, dst, len, 0))
@@ -315,8 +315,8 @@ static size_t strncpy_from_user_pt(size_t count, const char __user *src,
return done;
}
-static size_t copy_in_user_pt(size_t n, void __user *to,
- const void __user *from)
+static size_t copy_in_user_pt(void __user *to, const void __user *from,
+ size_t n)
{
struct mm_struct *mm = current->mm;
unsigned long offset_max, uaddr, done, size, error_code;
@@ -326,7 +326,7 @@ static size_t copy_in_user_pt(size_t n, void __user *to,
int write_user;
if (segment_eq(get_fs(), KERNEL_DS))
- return copy_in_kernel(n, to, from);
+ return copy_in_kernel(to, from, n);
if (!mm)
return n;
done = 0;