mm: don't include asm/pgtable.h if linux/mm.h is already included
[platform/kernel/linux-starfive.git] / arch / sparc / kernel / ptrace_64.c
index c9d41a9..7122efb 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/context_tracking.h>
 
 #include <asm/asi.h>
-#include <asm/pgtable.h>
 #include <linux/uaccess.h>
 #include <asm/psrcompat.h>
 #include <asm/visasm.h>
@@ -572,19 +571,13 @@ static int genregs32_get(struct task_struct *target,
                        for (; count > 0 && pos < 32; count--) {
                                if (access_process_vm(target,
                                                      (unsigned long)
-                                                     &reg_window[pos],
+                                                     &reg_window[pos++],
                                                      &reg, sizeof(reg),
                                                      FOLL_FORCE)
                                    != sizeof(reg))
                                        return -EFAULT;
-                               if (access_process_vm(target,
-                                                     (unsigned long) u,
-                                                     &reg, sizeof(reg),
-                                                     FOLL_FORCE | FOLL_WRITE)
-                                   != sizeof(reg))
+                               if (put_user(reg, u++))
                                        return -EFAULT;
-                               pos++;
-                               u++;
                        }
                }
        }
@@ -684,12 +677,7 @@ static int genregs32_set(struct task_struct *target,
                        }
                } else {
                        for (; count > 0 && pos < 32; count--) {
-                               if (access_process_vm(target,
-                                                     (unsigned long)
-                                                     u,
-                                                     &reg, sizeof(reg),
-                                                     FOLL_FORCE)
-                                   != sizeof(reg))
+                               if (get_user(reg, u++))
                                        return -EFAULT;
                                if (access_process_vm(target,
                                                      (unsigned long)