Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=91394eb0975b3771dde7071a0825c6df6c20ff8a
Commit:     91394eb0975b3771dde7071a0825c6df6c20ff8a
Parent:     859c0a5b9ca8eba2d65fa42f02505d76f8a712c7
Author:     Roland McGrath <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:30:45 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:30:45 2008 +0100

    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: Roland McGrath <[EMAIL PROTECTED]>
    Cc: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
    
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/ia32/tls32.c        |    7 +------
 arch/x86/kernel/process_64.c |    6 +-----
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/arch/x86/ia32/tls32.c b/arch/x86/ia32/tls32.c
index 1cc4340..cac4b26 100644
--- a/arch/x86/ia32/tls32.c
+++ b/arch/x86/ia32/tls32.c
@@ -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);
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index aa9414e..9ea1d75 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -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]);
 }
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to