Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[sfrench/cifs-2.6.git] / arch / sh64 / mm / fault.c
index f08d0eaf6497d34c716d8f0c5ee4baf2aa4eb27c..4dd8ee8f01ce61e63558556cea363e7a250a210a 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/mman.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/interrupt.h>
 
 #include <asm/system.h>
@@ -154,7 +153,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
         * If we're in an interrupt or have no user
         * context, we must not take the fault..
         */
-       if (in_interrupt() || !mm)
+       if (in_atomic() || !mm)
                goto no_context;
 
        /* TLB misses upon some cache flushes get done under cli() */
@@ -277,7 +276,7 @@ bad_area:
                        show_regs(regs);
 #endif
                }
-               if (tsk->pid == 1) {
+               if (is_init(tsk)) {
                        panic("INIT had user mode bad_area\n");
                }
                tsk->thread.address = address;
@@ -319,14 +318,14 @@ no_context:
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
-       if (current->pid == 1) {
+       if (is_init(current)) {
                panic("INIT out of memory\n");
                yield();
                goto survive;
        }
        printk("fault:Out of memory\n");
        up_read(&mm->mmap_sem);
-       if (current->pid == 1) {
+       if (is_init(current)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;