Skip to content

Commit

Permalink
[ARM] do_bad_area() always takes current and current->active_mm
Browse files Browse the repository at this point in the history
Since do_bad_area() always takes the currently active task and
(supposed to) take the currently active MM, there's no point passing
them to this function.  Instead, obtain references to them inside
do_bad_area().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Sep 27, 2006
1 parent 80878d6 commit e5beac3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mm/alignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
/*
* We got a fault - fix it up, or die.
*/
do_bad_area(current, current->mm, addr, fsr, regs);
do_bad_area(addr, fsr, regs);
return 0;

swp:
Expand Down
15 changes: 6 additions & 9 deletions arch/arm/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,11 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
force_sig_info(sig, &si, tsk);
}

void
do_bad_area(struct task_struct *tsk, struct mm_struct *mm, unsigned long addr,
unsigned int fsr, struct pt_regs *regs)
void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
{
struct task_struct *tsk = current;
struct mm_struct *mm = tsk->active_mm;

/*
* If we are in kernel mode at this point, we
* have no context to handle this fault with.
Expand Down Expand Up @@ -319,7 +320,6 @@ static int
do_translation_fault(unsigned long addr, unsigned int fsr,
struct pt_regs *regs)
{
struct task_struct *tsk;
unsigned int index;
pgd_t *pgd, *pgd_k;
pmd_t *pmd, *pmd_k;
Expand Down Expand Up @@ -351,9 +351,7 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
return 0;

bad_area:
tsk = current;

do_bad_area(tsk, tsk->active_mm, addr, fsr, regs);
do_bad_area(addr, fsr, regs);
return 0;
}

Expand All @@ -364,8 +362,7 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
static int
do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
{
struct task_struct *tsk = current;
do_bad_area(tsk, tsk->active_mm, addr, fsr, regs);
do_bad_area(addr, fsr, regs);
return 0;
}

Expand Down
5 changes: 1 addition & 4 deletions arch/arm/mm/fault.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
void do_bad_area(struct task_struct *tsk, struct mm_struct *mm,
unsigned long addr, unsigned int fsr, struct pt_regs *regs);

void show_pte(struct mm_struct *mm, unsigned long addr);
void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs);

unsigned long search_exception_table(unsigned long addr);

0 comments on commit e5beac3

Please sign in to comment.