Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit deef79ef authored by Harvey Harrison's avatar Harvey Harrison Committed by Ingo Molnar
Browse files

x86: fix sparse error in traps_32.c



This was being used to ensure the proper alignment of the FXSAVE/FXRSTOR data.
This would create a sparse error in the _correct_ cases, hiding further
warnings.  Use BUILD_BUG_ON instead.

Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 4a5a77d1
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -1176,17 +1176,12 @@ void __init trap_init(void)
#endif
	set_trap_gate(19,&simd_coprocessor_error);

	if (cpu_has_fxsr) {
	/*
	 * Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned.
		 * Generates a compile-time "error: zero width for bit-field" if
		 * the alignment is wrong.
	 * Generate a build-time error if the alignment is wrong.
	 */
		struct fxsrAlignAssert {
			int _:!(offsetof(struct task_struct,
					thread.i387.fxsave) & 15);
		};

	BUILD_BUG_ON(offsetof(struct task_struct, thread.i387.fxsave) & 15);
	if (cpu_has_fxsr) {
		printk(KERN_INFO "Enabling fast FPU save and restore... ");
		set_in_cr4(X86_CR4_OSFXSR);
		printk("done.\n");