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

Commit 91394eb0 authored by Roland McGrath's avatar Roland McGrath Committed by Ingo Molnar
Browse files

x86: use get_desc_base



This changes a couple of places to use the get_desc_base function.
They were duplicating the same calculation with different equivalent code.

Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 859c0a5b
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -85,11 +85,6 @@ asmlinkage long sys32_set_thread_area(struct user_desc __user *u_info)
 * Get the current Thread-Local Storage area:
 */

#define GET_BASE(desc) ( \
	(((desc)->a >> 16) & 0x0000ffff) | \
	(((desc)->b << 16) & 0x00ff0000) | \
	( (desc)->b        & 0xff000000)   )

#define GET_LIMIT(desc) ( \
	((desc)->a & 0x0ffff) | \
	 ((desc)->b & 0xf0000) )
@@ -117,7 +112,7 @@ int do_get_thread_area(struct thread_struct *t, struct user_desc __user *u_info)

	memset(&info, 0, sizeof(struct user_desc));
	info.entry_number = idx;
	info.base_addr = GET_BASE(desc);
	info.base_addr = get_desc_base(desc);
	info.limit = GET_LIMIT(desc);
	info.seg_32bit = GET_32BIT(desc);
	info.contents = GET_CONTENTS(desc);
+1 −5
Original line number Diff line number Diff line
@@ -464,11 +464,7 @@ static inline void set_32bit_tls(struct task_struct *t, int tls, u32 addr)

static inline u32 read_32bit_tls(struct task_struct *t, int tls)
{
	struct desc_struct *desc = (void *)t->thread.tls_array;
	desc += tls;
	return desc->base0 | 
		(((u32)desc->base1) << 16) | 
		(((u32)desc->base2) << 24);
	return get_desc_base(&t->thread.tls_array[tls]);
}

/*