Skip to contentSkip to conversation

debloat aic7xxx and aic79xx drivers

PATCH In review Denys Vlasenko 3 participants 9 messages Aug 31, 2007 – Sep 24, 2007 SCSI

lore
Share & tools
lore
#0 lore raw

cover debloat aic7xxx and aic79xx drivers

Quoted 6 lines · Hannes Reinecke
Quoted 5 lines · Jan Engelhardt
Quoted 4 lines · Matthew Wilcox
Quoted 3 lines

Well, you can send it to Linus/Andrew, that will usually upset people and they start commenting on it. Or they don't, and everything is fine. (The "default y" approach so to speak ;-)

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

The problem is that we don't really have a maintainer for the aic7xyz drivers any more. Volunteers welcome. NOT IT!

Take it before someone else does!

Well, the semi-official maintainers are James B. and me.

So I might as well do it officially.

Cool.

Thanks to Arjan's insistence, I also took a look at adding statics and unexpectedly discovered yet another 50 kbytes of dead code (I'm not kidding).

Attached are three patches which fix that:

text data bss dec hex filename

 261433   50018    1172  312623   4c52f linux-2.6.23-rc1.org.t/drivers/scsi/aic7xxx/built-in.o
 199654   50018    1172  250844   3d3dc linux-2.6.23-rc1.aic.t/drivers/scsi/aic7xxx/built-in.o
 184014   21314    1172  206500   326a4 linux-2.6.23-rc1.aic1.t/drivers/scsi/aic7xxx/built-in.o
 202378    2850    1172  206400   32640 linux-2.6.23-rc1.aic2.t/drivers/scsi/aic7xxx/built-in.o
1-debloat.patch    deinlines a lot of functions
2-addstatic.patch  adds statics, #ifdefs out huge amount of unused code, adds consts
3-addconst.patch   adds more consts

make namespacecheck goes from 400+ functions to:
drivers/scsi/aic7xxx/aic79xx_core.o
ahd_inq
ahd_inw
ahd_outq
ahd_outw
drivers/scsi/aic7xxx/aic79xx_osm.o
ahd_insb
drivers/scsi/aic7xxx/aic7xxx_core.o
ahc_inq
ahc_outq
drivers/scsi/aic7xxx/aic7xxx_osm.o
ahc_insb

None of these patches actually touch any logic, code changes are pretty minimal.

Compile tested and applies cleanly to 2.6.23-rc1, applies with some fuzz to 2.6.23-rc3.

Please propagate to mainline.
--
vda

#1 lore raw

PATCH 1/3 debloat aic7xxx and aic79xx drivers

Quoted 11 lines · Denys Vlasenko

Attached are three patches which fix that:

text data bss dec hex filename

 261433   50018    1172  312623   4c52f linux-2.6.23-rc1.org.t/drivers/scsi/aic7xxx/built-in.o
 199654   50018    1172  250844   3d3dc linux-2.6.23-rc1.aic.t/drivers/scsi/aic7xxx/built-in.o
 184014   21314    1172  206500   326a4 linux-2.6.23-rc1.aic1.t/drivers/scsi/aic7xxx/built-in.o
 202378    2850    1172  206400   32640 linux-2.6.23-rc1.aic2.t/drivers/scsi/aic7xxx/built-in.o
1-debloat.patch    deinlines a lot of functions
2-addstatic.patch  adds statics, #ifdefs out huge amount of unused code, adds consts
3-addconst.patch   adds more consts

--
vda

#2 lore raw

PATCH 2/3 debloat aic7xxx and aic79xx drivers

Quoted 9 lines · Denys Vlasenko
Quoted 8 lines · Denys Vlasenko

Attached are three patches which fix that:

text data bss dec hex filename

 261433   50018    1172  312623   4c52f linux-2.6.23-rc1.org.t/drivers/scsi/aic7xxx/built-in.o
 199654   50018    1172  250844   3d3dc linux-2.6.23-rc1.aic.t/drivers/scsi/aic7xxx/built-in.o
 184014   21314    1172  206500   326a4 linux-2.6.23-rc1.aic1.t/drivers/scsi/aic7xxx/built-in.o
 202378    2850    1172  206400   32640 linux-2.6.23-rc1.aic2.t/drivers/scsi/aic7xxx/built-in.o
Quoted 3 lines
Quoted 3 lines
1-debloat.patch    deinlines a lot of functions
2-addstatic.patch  adds statics, #ifdefs out huge amount of unused code, adds consts
3-addconst.patch   adds more consts

--
vda

#3 lore raw

PATCH 3/3 debloat aic7xxx and aic79xx drivers

Quoted 10 lines · Denys Vlasenko
Quoted 9 lines · Denys Vlasenko
Quoted 8 lines · Denys Vlasenko

Attached are three patches which fix that:

text data bss dec hex filename

 261433   50018    1172  312623   4c52f linux-2.6.23-rc1.org.t/drivers/scsi/aic7xxx/built-in.o
 199654   50018    1172  250844   3d3dc linux-2.6.23-rc1.aic.t/drivers/scsi/aic7xxx/built-in.o
 184014   21314    1172  206500   326a4 linux-2.6.23-rc1.aic1.t/drivers/scsi/aic7xxx/built-in.o
 202378    2850    1172  206400   32640 linux-2.6.23-rc1.aic2.t/drivers/scsi/aic7xxx/built-in.o
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
1-debloat.patch    deinlines a lot of functions
2-addstatic.patch  adds statics, #ifdefs out huge amount of unused code, adds consts
3-addconst.patch   adds more consts

--
vda

#7 lore raw
In reply to Denys Vlasenko
Quoted 10 lines · Denys Vlasenko

text data bss dec hex filename

 261433   50018    1172  312623   4c52f linux-2.6.23-rc1.org.t/drivers/scsi/aic7xxx/built-in.o
 199654   50018    1172  250844   3d3dc linux-2.6.23-rc1.aic.t/drivers/scsi/aic7xxx/built-in.o
 184014   21314    1172  206500   326a4 linux-2.6.23-rc1.aic1.t/drivers/scsi/aic7xxx/built-in.o
 202378    2850    1172  206400   32640 linux-2.6.23-rc1.aic2.t/drivers/scsi/aic7xxx/built-in.o
1-debloat.patch    deinlines a lot of functions
2-addstatic.patch  adds statics, #ifdefs out huge amount of unused code, adds consts
3-addconst.patch   adds more consts

Yowza. Looking at aic1->aic2, it looks like 20K became 'const', and only 3K *wasn't* 'const'?

#8 lore raw
Quoted 8 lines · On Friday 31 August 2007 17:27, [email protected] wrote:
Quoted 7 lines · Denys Vlasenko

text data bss dec hex filename

 261433   50018    1172  312623   4c52f linux-2.6.23-rc1.org.t/drivers/scsi/aic7xxx/built-in.o
 199654   50018    1172  250844   3d3dc linux-2.6.23-rc1.aic.t/drivers/scsi/aic7xxx/built-in.o
 184014   21314    1172  206500   326a4 linux-2.6.23-rc1.aic1.t/drivers/scsi/aic7xxx/built-in.o
 202378    2850    1172  206400   32640 linux-2.6.23-rc1.aic2.t/drivers/scsi/aic7xxx/built-in.o
Quoted 6 lines
Quoted 3 lines
1-debloat.patch    deinlines a lot of functions
2-addstatic.patch  adds statics, #ifdefs out huge amount of unused code, adds consts
3-addconst.patch   adds more consts

Yowza. Looking at aic1->aic2, it looks like 20K became 'const', and only 3K *wasn't* 'const'?

Exactly. There are firmware images/patches and a lot of structures with char* members pointing to text/messages.

Btw, aic94xx driver needs the same treatment.
--
vda

#6 lore raw
In reply to Denys Vlasenko
Quoted 9 lines · Denys Vlasenko
Quoted 8 lines · Denys Vlasenko

Attached are three patches which fix that:

text data bss dec hex filename

 261433   50018    1172  312623   4c52f linux-2.6.23-rc1.org.t/drivers/scsi/aic7xxx/built-in.o
 199654   50018    1172  250844   3d3dc linux-2.6.23-rc1.aic.t/drivers/scsi/aic7xxx/built-in.o
 184014   21314    1172  206500   326a4 linux-2.6.23-rc1.aic1.t/drivers/scsi/aic7xxx/built-in.o
 202378    2850    1172  206400   32640 linux-2.6.23-rc1.aic2.t/drivers/scsi/aic7xxx/built-in.o
Quoted 7 lines
Quoted 3 lines
1-debloat.patch    deinlines a lot of functions
2-addstatic.patch  adds statics, #ifdefs out huge amount of unused code, adds consts
3-addconst.patch   adds more consts

--
vda

Signature · 8 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw
In reply to Denys Vlasenko
Quoted 10 lines · Denys Vlasenko
Quoted 9 lines · Denys Vlasenko
Quoted 8 lines · Denys Vlasenko

Attached are three patches which fix that:

text data bss dec hex filename

 261433   50018    1172  312623   4c52f linux-2.6.23-rc1.org.t/drivers/scsi/aic7xxx/built-in.o
 199654   50018    1172  250844   3d3dc linux-2.6.23-rc1.aic.t/drivers/scsi/aic7xxx/built-in.o
 184014   21314    1172  206500   326a4 linux-2.6.23-rc1.aic1.t/drivers/scsi/aic7xxx/built-in.o
 202378    2850    1172  206400   32640 linux-2.6.23-rc1.aic2.t/drivers/scsi/aic7xxx/built-in.o
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
1-debloat.patch    deinlines a lot of functions
2-addstatic.patch  adds statics, #ifdefs out huge amount of unused code, adds consts
3-addconst.patch   adds more consts

Have you checked the sequence assembler, too? It doesn't help much to edit the *.shipped files; someone might just run the assembler again and we're back to square one ...

Apart from this:

Cheers,

Hannes

Signature · 8 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
In reply to Denys Vlasenko
Quoted 11 lines · Denys Vlasenko
Quoted 10 lines · Denys Vlasenko
Quoted 9 lines · Denys Vlasenko
Quoted 8 lines · Denys Vlasenko

Attached are three patches which fix that:

text data bss dec hex filename

 261433   50018    1172  312623   4c52f linux-2.6.23-rc1.org.t/drivers/scsi/aic7xxx/built-in.o
 199654   50018    1172  250844   3d3dc linux-2.6.23-rc1.aic.t/drivers/scsi/aic7xxx/built-in.o
 184014   21314    1172  206500   326a4 linux-2.6.23-rc1.aic1.t/drivers/scsi/aic7xxx/built-in.o
 202378    2850    1172  206400   32640 linux-2.6.23-rc1.aic2.t/drivers/scsi/aic7xxx/built-in.o
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
1-debloat.patch    deinlines a lot of functions
2-addstatic.patch  adds statics, #ifdefs out huge amount of unused code, adds consts
3-addconst.patch   adds more consts

Cheers,

Hannes

Signature · 8 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html