atmel_serial: fix bugs in probe() error path and remove()
[pv_ops_mirror.git] / arch / alpha / mm / extable.c
blobdc7aeda157734737f71d8a0b7dd3a7bfc7fbbcab
1 /*
2 * linux/arch/alpha/mm/extable.c
3 */
5 #include <linux/module.h>
6 #include <asm/uaccess.h>
8 void sort_extable(struct exception_table_entry *start,
9 struct exception_table_entry *finish)
13 const struct exception_table_entry *
14 search_extable(const struct exception_table_entry *first,
15 const struct exception_table_entry *last,
16 unsigned long value)
18 while (first <= last) {
19 const struct exception_table_entry *mid;
20 unsigned long mid_value;
22 mid = (last - first) / 2 + first;
23 mid_value = (unsigned long)&mid->insn + mid->insn;
24 if (mid_value == value)
25 return mid;
26 else if (mid_value < value)
27 first = mid+1;
28 else
29 last = mid-1;
32 return NULL;