ata: Convert ata_<foo>_printk(KERN_<LEVEL> to ata_<foo>_<level>
authorJoe Perches <joe@perches.com>
Fri, 15 Apr 2011 22:51:59 +0000 (15:51 -0700)
committerJeff Garzik <jgarzik@pobox.com>
Sat, 23 Jul 2011 21:57:36 +0000 (17:57 -0400)
commita9a79dfec239568bdbf778242f8fcd10bcc5b9e2
tree620648585f89cdb589d1625431f8c21ef70a9258
parenta44fec1fce5d5d14cc3ac4545b8da346394de666
ata: Convert ata_<foo>_printk(KERN_<LEVEL> to ata_<foo>_<level>

Saves text by removing nearly duplicated text format strings by
creating ata_<foo>_printk functions and printf extension %pV.

ata defconfig size shrinks ~5% (~8KB), allyesconfig ~2.5% (~13KB)

Format string duplication comes from:

 #define ata_link_printk(link, lv, fmt, args...) do { \
       if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link)    \
               printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id,   \
                      (link)->pmp , ##args); \
       else \
               printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \
       } while(0)

Coalesce long formats.

$ size drivers/ata/built-in.*
   text    data     bss     dec     hex filename
 544969   73893  116584  735446   b38d6 drivers/ata/built-in.allyesconfig.ata.o
 558429   73893  117864  750186   b726a drivers/ata/built-in.allyesconfig.dev_level.o
 141328   14689    4220  160237   271ed drivers/ata/built-in.defconfig.ata.o
 149567   14689    4220  168476   2921c drivers/ata/built-in.defconfig.dev_level.o

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
32 files changed:
drivers/ata/ahci.c
drivers/ata/ata_generic.c
drivers/ata/libahci.c
drivers/ata/libata-acpi.c
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
drivers/ata/libata-pmp.c
drivers/ata/libata-scsi.c
drivers/ata/libata-sff.c
drivers/ata/pata_ali.c
drivers/ata/pata_amd.c
drivers/ata/pata_bf54x.c
drivers/ata/pata_icside.c
drivers/ata/pata_it821x.c
drivers/ata/pata_ixp4xx_cf.c
drivers/ata/pata_legacy.c
drivers/ata/pata_macio.c
drivers/ata/pata_octeon_cf.c
drivers/ata/pata_pcmcia.c
drivers/ata/pata_platform.c
drivers/ata/pata_rz1000.c
drivers/ata/pata_samsung_cf.c
drivers/ata/pata_scc.c
drivers/ata/pata_via.c
drivers/ata/sata_fsl.c
drivers/ata/sata_inic162x.c
drivers/ata/sata_mv.c
drivers/ata/sata_nv.c
drivers/ata/sata_sil.c
drivers/ata/sata_sil24.c
drivers/ata/sata_via.c
include/linux/libata.h