[PATCH 3/4] MIPS: uasm: Constify insn_table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The insn_table is an array of constant structures and as such should be
declared const.

This change saves 1088 bytes of kernel text at the expense of 64 bytes
of kernel data on a pistachio_defconfig:
Before:
   text	   data	    bss	    dec	    hex	filename
7187103	1772760	 470224	9430087	 8fe447	vmlinux
After:
   text	   data	    bss	    dec	    hex	filename
7186015	1772824	 470224	9429063	 8fe047	vmlinux

Signed-off-by: Matt Redfearn <matt.redfearn@xxxxxxxxxx>
---

 arch/mips/mm/uasm-mips.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/mm/uasm-mips.c b/arch/mips/mm/uasm-mips.c
index 763d3f1edb8a..17a7fc4dae8d 100644
--- a/arch/mips/mm/uasm-mips.c
+++ b/arch/mips/mm/uasm-mips.c
@@ -48,7 +48,7 @@
 
 #include "uasm.c"
 
-static struct insn insn_table[] = {
+static const struct insn insn_table[] = {
 	{ insn_addiu, M(addiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM },
 	{ insn_addu, M(spec_op, 0, 0, 0, 0, addu_op), RS | RT | RD },
 	{ insn_andi, M(andi_op, 0, 0, 0, 0, 0), RS | RT | UIMM },
@@ -195,7 +195,7 @@ static inline u32 build_jimm(u32 arg)
  */
 static void build_insn(u32 **buf, enum opcode opc, ...)
 {
-	struct insn *ip = NULL;
+	const struct insn *ip = NULL;
 	unsigned int i;
 	va_list ap;
 	u32 op;
-- 
2.7.4





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux