]> git.baikalelectronics.ru Git - kernel.git/commit
x86/fpu: Improve the initialization logic of 'err' around xstate_fault() constraints
authorIngo Molnar <mingo@kernel.org>
Mon, 25 May 2015 09:59:35 +0000 (11:59 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 25 May 2015 10:49:38 +0000 (12:49 +0200)
commitf136d561a05230ad1e8d7cb50a74816327031dcb
tree0d18add6677728299f34cd781206cb51d5591d45
parent29ba270c578f33587660f678e16e20fd176c284a
x86/fpu: Improve the initialization logic of 'err' around xstate_fault() constraints

There's a confusing aspect of how xstate_fault() constraints are
handled by the FPU register/memory copying functions in
fpu/internal.h: they use "0" (0) to signal that the asm code
will not always set 'err' to a valid value.

But 'err' is already initialized to 0 in C code, which is duplicated
by the asm() constraint. Should the initialization value ever be
changed, it might become subtly inconsistent with the not too clear
asm() constraint.

Use 'err' as the value of the input variable instead, to clarify
this all.

Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/fpu/internal.h