Skip to content

Commit

Permalink
tile: avoid a "label not used" warning in do_page_fault()
Browse files Browse the repository at this point in the history
There are two different ifdef cases where the label is used,
but if neither is true, the label is unused and the compiler
generates a warning.

Refactor the code the way x86 does so that there is a
do_page_fault() that just does exception handling for
context tracking, and make __do_page_fault() a static inline
so that various cases can just return instead of doing a
jump to "done".

Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
  • Loading branch information
Chris Metcalf committed Jun 4, 2015
1 parent 9ae4d6b commit 5316a64
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions arch/tile/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,10 @@ struct intvec_state do_page_fault_ics(struct pt_regs *regs, int fault_num,
* interrupt away appropriately and return immediately. We can't do
* page faults for user code while in kernel mode.
*/
void do_page_fault(struct pt_regs *regs, int fault_num,
unsigned long address, unsigned long write)
static inline void __do_page_fault(struct pt_regs *regs, int fault_num,
unsigned long address, unsigned long write)
{
int is_page_fault;
enum ctx_state prev_state = exception_enter();

#ifdef CONFIG_KPROBES
/*
Expand All @@ -713,7 +712,7 @@ void do_page_fault(struct pt_regs *regs, int fault_num,
*/
if (notify_die(DIE_PAGE_FAULT, "page fault", regs, -1,
regs->faultnum, SIGSEGV) == NOTIFY_STOP)
goto done;
return;
#endif

#ifdef __tilegx__
Expand Down Expand Up @@ -835,18 +834,22 @@ void do_page_fault(struct pt_regs *regs, int fault_num,
async->is_fault = is_page_fault;
async->is_write = write;
async->address = address;
goto done;
return;
}
}
#endif

handle_page_fault(regs, fault_num, is_page_fault, address, write);
}

done:
void do_page_fault(struct pt_regs *regs, int fault_num,
unsigned long address, unsigned long write)
{
enum ctx_state prev_state = exception_enter();
__do_page_fault(regs, fault_num, address, write);
exception_exit(prev_state);
}


#if CHIP_HAS_TILE_DMA()
/*
* This routine effectively re-issues asynchronous page faults
Expand Down

0 comments on commit 5316a64

Please sign in to comment.