summaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/extable.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/mm/extable.c')
-rw-r--r--arch/mips/mm/extable.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/arch/mips/mm/extable.c b/arch/mips/mm/extable.c
index c46568ab1..a92fdc482 100644
--- a/arch/mips/mm/extable.c
+++ b/arch/mips/mm/extable.c
@@ -29,27 +29,24 @@ search_one_table(const struct exception_table_entry *first,
return 0;
}
-unsigned long search_exception_table(unsigned long addr)
+unsigned long
+search_exception_table(unsigned long addr)
{
- unsigned ret;
-#ifdef CONFIG_MODULES
- struct module *mp;
-#endif
+ unsigned long ret;
- /* Search the kernel's table first. */
- ret = search_one_table(__start___ex_table,
- __stop___ex_table-1, addr);
- if (ret)
- return ret;
-
-#ifdef CONFIG_MODULES
+#ifndef CONFIG_MODULES
+ /* There is only the kernel to search. */
+ ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr);
+ if (ret) return ret;
+#else
+ /* The kernel is the last "module" -- no need to treat it special. */
+ struct module *mp;
for (mp = module_list; mp != NULL; mp = mp->next) {
- if (mp->exceptinfo.start != NULL) {
- ret = search_one_table(mp->exceptinfo.start,
- mp->exceptinfo.stop-1, addr);
- if (ret)
- return ret;
- }
+ if (mp->ex_table_start == NULL)
+ continue;
+ ret = search_one_table(mp->ex_table_start,
+ mp->ex_table_end - 1, addr);
+ if (ret) return ret;
}
#endif