]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
x86/fpu: Remove the 'start_pos' parameter from the __copy_xstate_to_*() functions
authorIngo Molnar <mingo@kernel.org>
Sat, 23 Sep 2017 12:59:50 +0000 (14:59 +0200)
committerIngo Molnar <mingo@kernel.org>
Sun, 24 Sep 2017 11:04:31 +0000 (13:04 +0200)
'start_pos' is always 0, so remove it and remove the pointless check of 'pos < 0'
which can not ever be true as 'pos' is unsigned ...

No change in functionality.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Eric Biggers <ebiggers3@gmail.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
Link: http://lkml.kernel.org/r/20170923130016.21448-8-mingo@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/fpu/xstate.c

index 9647e7256179d50d5aef9238956bd83f7bd3f8c2..1f50fdaf4c5a63e269d9a43d2164e240fa290c58 100644 (file)
@@ -927,9 +927,9 @@ int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
 static inline int
 __copy_xstate_to_kernel(void *kbuf,
                        const void *data,
-                       unsigned int pos, unsigned int count, int start_pos, int end_pos)
+                       unsigned int pos, unsigned int count, int end_pos)
 {
-       if ((count == 0) || (pos < start_pos))
+       if (!count)
                return 0;
 
        if (end_pos < 0 || pos < end_pos) {
@@ -972,7 +972,7 @@ int copy_xstate_to_kernel(void *kbuf, struct xregs_state *xsave, unsigned int po
        offset = offsetof(struct xregs_state, header);
        size = sizeof(header);
 
-       ret = __copy_xstate_to_kernel(kbuf, &header, offset, size, 0, count);
+       ret = __copy_xstate_to_kernel(kbuf, &header, offset, size, count);
        if (ret)
                return ret;
 
@@ -986,7 +986,7 @@ int copy_xstate_to_kernel(void *kbuf, struct xregs_state *xsave, unsigned int po
                        offset = xstate_offsets[i];
                        size = xstate_sizes[i];
 
-                       ret = __copy_xstate_to_kernel(kbuf, src, offset, size, 0, count);
+                       ret = __copy_xstate_to_kernel(kbuf, src, offset, size, count);
                        if (ret)
                                return ret;
 
@@ -1002,7 +1002,7 @@ int copy_xstate_to_kernel(void *kbuf, struct xregs_state *xsave, unsigned int po
        offset = offsetof(struct fxregs_state, sw_reserved);
        size = sizeof(xstate_fx_sw_bytes);
 
-       ret = __copy_xstate_to_kernel(kbuf, xstate_fx_sw_bytes, offset, size, 0, count);
+       ret = __copy_xstate_to_kernel(kbuf, xstate_fx_sw_bytes, offset, size, count);
        if (ret)
                return ret;
 
@@ -1010,9 +1010,9 @@ int copy_xstate_to_kernel(void *kbuf, struct xregs_state *xsave, unsigned int po
 }
 
 static inline int
-__copy_xstate_to_user(void __user *ubuf, const void *data, unsigned int pos, unsigned int count, int start_pos, int end_pos)
+__copy_xstate_to_user(void __user *ubuf, const void *data, unsigned int pos, unsigned int count, int end_pos)
 {
-       if ((count == 0) || (pos < start_pos))
+       if (!count)
                return 0;
 
        if (end_pos < 0 || pos < end_pos) {
@@ -1055,7 +1055,7 @@ int copy_xstate_to_user(void __user *ubuf, struct xregs_state *xsave, unsigned i
        offset = offsetof(struct xregs_state, header);
        size = sizeof(header);
 
-       ret = __copy_xstate_to_user(ubuf, &header, offset, size, 0, count);
+       ret = __copy_xstate_to_user(ubuf, &header, offset, size, count);
        if (ret)
                return ret;
 
@@ -1069,7 +1069,7 @@ int copy_xstate_to_user(void __user *ubuf, struct xregs_state *xsave, unsigned i
                        offset = xstate_offsets[i];
                        size = xstate_sizes[i];
 
-                       ret = __copy_xstate_to_user(ubuf, src, offset, size, 0, count);
+                       ret = __copy_xstate_to_user(ubuf, src, offset, size, count);
                        if (ret)
                                return ret;
 
@@ -1085,7 +1085,7 @@ int copy_xstate_to_user(void __user *ubuf, struct xregs_state *xsave, unsigned i
        offset = offsetof(struct fxregs_state, sw_reserved);
        size = sizeof(xstate_fx_sw_bytes);
 
-       ret = __copy_xstate_to_user(ubuf, xstate_fx_sw_bytes, offset, size, 0, count);
+       ret = __copy_xstate_to_user(ubuf, xstate_fx_sw_bytes, offset, size, count);
        if (ret)
                return ret;