sparc32: cleanup mm/fault_32.c

- remove unused variables
- fix coding style issues that hurts my eyes

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Sam Ravnborg
2012-05-15 19:02:08 +02:00
committed by David S. Miller
parent c7020eb466
commit 70168dfa1c
2 changed files with 44 additions and 52 deletions

View File

@@ -361,8 +361,6 @@ void srmmu_mapiorange(unsigned int bus, unsigned long xpa,
unsigned long xva, unsigned int len); unsigned long xva, unsigned int len);
void srmmu_unmapiorange(unsigned long virt_addr, unsigned int len); void srmmu_unmapiorange(unsigned long virt_addr, unsigned int len);
extern int invalid_segment;
/* Encode and de-code a swap entry */ /* Encode and de-code a swap entry */
static inline unsigned long __swp_type(swp_entry_t entry) static inline unsigned long __swp_type(swp_entry_t entry)
{ {

View File

@@ -30,22 +30,13 @@
#include <asm/traps.h> #include <asm/traps.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
extern int prom_node_root;
int show_unhandled_signals = 1; int show_unhandled_signals = 1;
/* At boot time we determine these two values necessary for setting /* At boot time we determine these two values necessary for setting
* up the segment maps and page table entries (pte's). * up the segment maps and page table entries (pte's).
*/ */
int num_segmaps, num_contexts; int num_contexts;
int invalid_segment;
/* various Virtual Address Cache parameters we find at boot time... */
int vac_size, vac_linesize, vac_do_hw_vac_flushes;
int vac_entries_per_context, vac_entries_per_segment;
int vac_entries_per_page;
/* Return how much physical memory we have. */ /* Return how much physical memory we have. */
unsigned long probe_memory(void) unsigned long probe_memory(void)
@@ -62,15 +53,16 @@ unsigned long probe_memory(void)
static void unhandled_fault(unsigned long, struct task_struct *, static void unhandled_fault(unsigned long, struct task_struct *,
struct pt_regs *) __attribute__ ((noreturn)); struct pt_regs *) __attribute__ ((noreturn));
static void unhandled_fault(unsigned long address, struct task_struct *tsk, static void __noreturn unhandled_fault(unsigned long address,
struct task_struct *tsk,
struct pt_regs *regs) struct pt_regs *regs)
{ {
if ((unsigned long) address < PAGE_SIZE) { if ((unsigned long) address < PAGE_SIZE) {
printk(KERN_ALERT printk(KERN_ALERT
"Unable to handle kernel NULL pointer dereference\n"); "Unable to handle kernel NULL pointer dereference\n");
} else { } else {
printk(KERN_ALERT "Unable to handle kernel paging request " printk(KERN_ALERT "Unable to handle kernel paging request at virtual address %08lx\n",
"at virtual address %08lx\n", address); address);
} }
printk(KERN_ALERT "tsk->{mm,active_mm}->context = %08lx\n", printk(KERN_ALERT "tsk->{mm,active_mm}->context = %08lx\n",
(tsk->mm ? tsk->mm->context : tsk->active_mm->context)); (tsk->mm ? tsk->mm->context : tsk->active_mm->context));
@@ -177,11 +169,10 @@ static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault)
if (text_fault) if (text_fault)
return regs->pc; return regs->pc;
if (regs->psr & PSR_PS) { if (regs->psr & PSR_PS)
insn = *(unsigned int *) regs->pc; insn = *(unsigned int *) regs->pc;
} else { else
__get_user(insn, (unsigned int *) regs->pc); __get_user(insn, (unsigned int *) regs->pc);
}
return safe_compute_effective_address(regs, insn); return safe_compute_effective_address(regs, insn);
} }
@@ -324,14 +315,16 @@ no_context:
g2 = regs->u_regs[UREG_G2]; g2 = regs->u_regs[UREG_G2];
if (!from_user) { if (!from_user) {
fixup = search_extables_range(regs->pc, &g2); fixup = search_extables_range(regs->pc, &g2);
if (fixup > 10) { /* Values below are reserved for other things */ /* Values below 10 are reserved for other things */
if (fixup > 10) {
extern const unsigned __memset_start[]; extern const unsigned __memset_start[];
extern const unsigned __memset_end[]; extern const unsigned __memset_end[];
extern const unsigned __csum_partial_copy_start[]; extern const unsigned __csum_partial_copy_start[];
extern const unsigned __csum_partial_copy_end[]; extern const unsigned __csum_partial_copy_end[];
#ifdef DEBUG_EXCEPTIONS #ifdef DEBUG_EXCEPTIONS
printk("Exception: PC<%08lx> faddr<%08lx>\n", regs->pc, address); printk("Exception: PC<%08lx> faddr<%08lx>\n",
regs->pc, address);
printk("EX_TABLE: insn<%08lx> fixup<%08x> g2<%08lx>\n", printk("EX_TABLE: insn<%08lx> fixup<%08x> g2<%08lx>\n",
regs->pc, fixup, g2); regs->pc, fixup, g2);
#endif #endif
@@ -395,6 +388,7 @@ vmalloc_fault:
if (pmd_present(*pmd) || !pmd_present(*pmd_k)) if (pmd_present(*pmd) || !pmd_present(*pmd_k))
goto bad_area_nosemaphore; goto bad_area_nosemaphore;
*pmd = *pmd_k; *pmd = *pmd_k;
return; return;
} }