From 38e9e81f4c81c75799b002d5811de7241b307676 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 28 Aug 2017 08:47:41 +0200 Subject: x86/gdt: Use bitfields for initialization The GDT entry related code uses two ways to access entries via union fields: - bitfields - macros which initialize the two 16-bit parts of the entry by magic shift and mask operations. Clean it up and only use the bitfields to initialize and access entries. ( The old access patterns were partly done due to GCC optimizing bitfield accesses in a horrible way - that's mostly fixed these days and clarity of code in such low level accessors is very important. ) Signed-off-by: Thomas Gleixner Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Link: http://lkml.kernel.org/r/20170828064958.197673367@linutronix.de Signed-off-by: Ingo Molnar --- arch/x86/math-emu/fpu_system.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/x86/math-emu') diff --git a/arch/x86/math-emu/fpu_system.h b/arch/x86/math-emu/fpu_system.h index 2319a257ec32..699f329f1d40 100644 --- a/arch/x86/math-emu/fpu_system.h +++ b/arch/x86/math-emu/fpu_system.h @@ -49,7 +49,7 @@ static inline unsigned long seg_get_base(struct desc_struct *d) static inline unsigned long seg_get_limit(struct desc_struct *d) { - return ((unsigned long)d->limit << 16) | d->limit0; + return ((unsigned long)d->limit1 << 16) | d->limit0; } static inline unsigned long seg_get_granularity(struct desc_struct *d) -- cgit v1.2.3-59-g8ed1b