diff mbox

[OPW,kernel] x86: mm: Remove runtime extable sort logic.

Message ID 20141006180159.GA29081@winterfell
State New, archived
Headers show

Commit Message

Iulia Manda Oct. 6, 2014, 6:01 p.m. UTC
This patch removes runtime extable sort logic for x86 architecture by
verifying the CONFIG_BUILDTIME_EXTABLE_SORT symbol,
inside function body. At compile time, this only transforms the function into
an empty one.

Also, the static cmp_ex function becomes unused, so it has to be removed
at compile time.

Bloat-o-meter output:

add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-89 (-89)
function                                     old     new   delta
cmp_ex                                         5       -      -5
sort_extable                                  85       1     -84

Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
---
 arch/x86/mm/extable.c |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Iulia Manda Oct. 6, 2014, 6:04 p.m. UTC | #1
This patch affects on the x86 architecture since I need some help for
cross compilation for the other arches that define the same function.
diff mbox

Patch

diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
index 903ec1e..835aa3b 100644
--- a/arch/x86/mm/extable.c
+++ b/arch/x86/mm/extable.c
@@ -106,6 +106,7 @@  search_extable(const struct exception_table_entry *first,
  * the exception tables of modules that get loaded.
  *
  */
+#ifndef CONFIG_BUILDTIME_EXTABLE_SORT
 static int cmp_ex(const void *a, const void *b)
 {
 	const struct exception_table_entry *x = a, *y = b;
@@ -119,10 +120,12 @@  static int cmp_ex(const void *a, const void *b)
 	 */
 	return x->insn - y->insn;
 }
+#endif
 
 void sort_extable(struct exception_table_entry *start,
 		  struct exception_table_entry *finish)
 {
+#ifndef CONFIG_BUILDTIME_EXTABLE_SORT
 	struct exception_table_entry *p;
 	int i;
 
@@ -146,6 +149,7 @@  void sort_extable(struct exception_table_entry *start,
 		p->fixup -= i;
 		i += 4;
 	}
+#endif
 }
 
 #ifdef CONFIG_MODULES