Merge master.kernel.org:/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw
[pandora-kernel.git] / arch / um / sys-i386 / ldt.c
index 1fa09a7..49057d8 100644 (file)
@@ -3,8 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/stddef.h"
-#include "linux/config.h"
 #include "linux/sched.h"
 #include "linux/slab.h"
 #include "linux/types.h"
@@ -107,7 +105,7 @@ long write_ldt_entry(struct mm_id * mm_idp, int func, struct user_desc * desc,
                 * So we need to switch child's mm into our userspace, then
                 * later switch back.
                 *
-                * Note: I'm unshure: should interrupts be disabled here?
+                * Note: I'm unsure: should interrupts be disabled here?
                 */
                if(!current->active_mm || current->active_mm == &init_mm ||
                   mm_idp != &current->active_mm->context.skas.id)
@@ -129,9 +127,7 @@ long write_ldt_entry(struct mm_id * mm_idp, int func, struct user_desc * desc,
                        pid = userspace_pid[cpu];
                }
 
-               res = ptrace(PTRACE_LDT, pid, 0, (unsigned long) &ldt_op);
-               if(res)
-                       res = errno;
+               res = os_ptrace_ldt(pid, 0, (unsigned long) &ldt_op);
 
                if(proc_mm)
                        put_cpu();
@@ -181,8 +177,7 @@ static long read_ldt_from_host(void __user * ptr, unsigned long bytecount)
         */
 
        cpu = get_cpu();
-       res = ptrace(PTRACE_LDT, userspace_pid[cpu], 0,
-                    (unsigned long) &ptrace_ldt);
+       res = os_ptrace_ldt(userspace_pid[cpu], 0, (unsigned long) &ptrace_ldt);
        put_cpu();
        if(res < 0)
                goto out;
@@ -427,9 +422,8 @@ void ldt_get_host_info(void)
                        size++;
        }
 
-       if(size < sizeof(dummy_list)/sizeof(dummy_list[0])) {
+       if(size < ARRAY_SIZE(dummy_list))
                host_ldt_entries = dummy_list;
-       }
        else {
                size = (size + 1) * sizeof(dummy_list[0]);
                host_ldt_entries = (short *)kmalloc(size, GFP_KERNEL);