]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SCSI] aic7xxx: introduce "dont_generate_debug_code" keyword in aicasm parser
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 22 Sep 2008 21:56:40 +0000 (14:56 -0700)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 23 Oct 2008 16:42:12 +0000 (11:42 -0500)
aic7xxx still contains ~30kb of dead code if pretty printing of registers
is requested. These patches deal with it.

Size differences:

   text    data     bss     dec     hex filename
DEBUG_ENABLE+PRETTY_PRINT:
 234697    2362    1188  238247   3a2a7 linux-2.6.26-rc8-/drivers/scsi/aic7xxx/built-in.o
 205092    2362    1188  208642   32f02 linux-2.6.26-rc8/drivers/scsi/aic7xxx/built-in.o
NO_DEBUG_ENABLE+PRETTY_PRINT:
 227272    2362    1172  230806   38596 linux-2.6.26-rc8-/drivers/scsi/aic7xxx/built-in.o
 197671    2362    1172  201205   311f5 linux-2.6.26-rc8/drivers/scsi/aic7xxx/built-in.o
DEBUG_ENABLE+NO_PRETTY_PRINT:
 192457    2362    1188  196007   2fda7 linux-2.6.26-rc8-/drivers/scsi/aic7xxx/built-in.o
 192457    2362    1188  196007   2fda7 linux-2.6.26-rc8/drivers/scsi/aic7xxx/built-in.o
NO_DEBUG_ENABLE+NO_PRETTY_PRINT:
 185040    2362    1172  188574   2e09e linux-2.6.26-rc8-/drivers/scsi/aic7xxx/built-in.o
 185040    2362    1172  188574   2e09e linux-2.6.26-rc8/drivers/scsi/aic7xxx/built-in.o

This patch:

Introduce "dont_generate_debug_code" keyword in aicasm parser.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h

index 81be6a261cc8503a0853699b9e6719139cb9b5f6..e4064433842e62d8c876d478658b5d2597493007 100644 (file)
@@ -147,6 +147,8 @@ void yyerror(const char *string);
 
 %token T_ACCESS_MODE
 
+%token T_DONT_GENERATE_DEBUG_CODE
+
 %token T_MODES
 
 %token T_DEFINE
@@ -357,6 +359,7 @@ reg_attribute:
 |      size
 |      count
 |      access_mode
+|      dont_generate_debug_code
 |      modes
 |      field_defn
 |      enum_defn
@@ -410,6 +413,13 @@ access_mode:
        }
 ;
 
+dont_generate_debug_code:
+       T_DONT_GENERATE_DEBUG_CODE
+       {
+               cur_symbol->dont_generate_debug_code = 1;
+       }
+;
+
 modes:
        T_MODES mode_list
        {
index 2c7f02daf88d21387967be473c660dcc9a2c1a0e..93c8667cd704dd0af10d85a32e2806422ccecfce 100644 (file)
@@ -164,6 +164,7 @@ download            { return T_DOWNLOAD; }
 address                        { return T_ADDRESS; }
 count                  { return T_COUNT; }
 access_mode            { return T_ACCESS_MODE; }
+dont_generate_debug_code { return T_DONT_GENERATE_DEBUG_CODE; }
 modes                  { return T_MODES; }
 RW|RO|WO               {
                                 if (strcmp(yytext, "RW") == 0)
index fcd357872b43d0e360456e732dbdb868f7eb013c..078ed600f47ab14bec403cc44633ef27520ba03d 100644 (file)
@@ -539,6 +539,9 @@ symtable_dump(FILE *ofile, FILE *dfile)
        aic_print_include(dfile, stock_include_file);
        SLIST_FOREACH(curnode, &registers, links) {
 
+               if (curnode->symbol->dont_generate_debug_code)
+                       continue;
+
                switch(curnode->symbol->type) {
                case REGISTER:
                case SCBLOC:
index 05190c1a2fb779b880efbb2cc672b65da2058e4c..2ba73ae7c7774f362bf80391ae999ec8b3fff02b 100644 (file)
@@ -137,7 +137,8 @@ typedef struct symbol {
                struct label_info *linfo;
                struct cond_info  *condinfo;
                struct macro_info *macroinfo;
-       }info;
+       } info;
+       int     dont_generate_debug_code;
 } symbol_t;
 
 typedef struct symbol_ref {