diff options
author | Joe Perches <joe@perches.com> | 2011-04-15 18:51:59 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2011-07-23 17:57:36 -0400 |
commit | a9a79dfec239568bdbf778242f8fcd10bcc5b9e2 (patch) | |
tree | 620648585f89cdb589d1625431f8c21ef70a9258 /drivers/ata/sata_sil24.c | |
parent | a44fec1fce5d5d14cc3ac4545b8da346394de666 (diff) |
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>
Diffstat (limited to 'drivers/ata/sata_sil24.c')
-rw-r--r-- | drivers/ata/sata_sil24.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index 164d52ed6b62..792e93688f7e 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c | |||
@@ -694,7 +694,7 @@ static int sil24_softreset(struct ata_link *link, unsigned int *class, | |||
694 | return 0; | 694 | return 0; |
695 | 695 | ||
696 | err: | 696 | err: |
697 | ata_link_printk(link, KERN_ERR, "softreset failed (%s)\n", reason); | 697 | ata_link_err(link, "softreset failed (%s)\n", reason); |
698 | return -EIO; | 698 | return -EIO; |
699 | } | 699 | } |
700 | 700 | ||
@@ -714,8 +714,8 @@ static int sil24_hardreset(struct ata_link *link, unsigned int *class, | |||
714 | * This happens often after PM DMA CS errata. | 714 | * This happens often after PM DMA CS errata. |
715 | */ | 715 | */ |
716 | if (pp->do_port_rst) { | 716 | if (pp->do_port_rst) { |
717 | ata_port_printk(ap, KERN_WARNING, "controller in dubious " | 717 | ata_port_warn(ap, |
718 | "state, performing PORT_RST\n"); | 718 | "controller in dubious state, performing PORT_RST\n"); |
719 | 719 | ||
720 | writel(PORT_CS_PORT_RST, port + PORT_CTRL_STAT); | 720 | writel(PORT_CS_PORT_RST, port + PORT_CTRL_STAT); |
721 | ata_msleep(ap, 10); | 721 | ata_msleep(ap, 10); |
@@ -773,7 +773,7 @@ static int sil24_hardreset(struct ata_link *link, unsigned int *class, | |||
773 | goto retry; | 773 | goto retry; |
774 | } | 774 | } |
775 | 775 | ||
776 | ata_link_printk(link, KERN_ERR, "hardreset failed (%s)\n", reason); | 776 | ata_link_err(link, "hardreset failed (%s)\n", reason); |
777 | return -EIO; | 777 | return -EIO; |
778 | } | 778 | } |
779 | 779 | ||
@@ -925,7 +925,7 @@ static void sil24_pmp_attach(struct ata_port *ap) | |||
925 | 925 | ||
926 | if (sata_pmp_gscr_vendor(gscr) == 0x11ab && | 926 | if (sata_pmp_gscr_vendor(gscr) == 0x11ab && |
927 | sata_pmp_gscr_devid(gscr) == 0x4140) { | 927 | sata_pmp_gscr_devid(gscr) == 0x4140) { |
928 | ata_port_printk(ap, KERN_INFO, | 928 | ata_port_info(ap, |
929 | "disabling NCQ support due to sil24-mv4140 quirk\n"); | 929 | "disabling NCQ support due to sil24-mv4140 quirk\n"); |
930 | ap->flags &= ~ATA_FLAG_NCQ; | 930 | ap->flags &= ~ATA_FLAG_NCQ; |
931 | } | 931 | } |
@@ -946,8 +946,7 @@ static int sil24_pmp_hardreset(struct ata_link *link, unsigned int *class, | |||
946 | 946 | ||
947 | rc = sil24_init_port(link->ap); | 947 | rc = sil24_init_port(link->ap); |
948 | if (rc) { | 948 | if (rc) { |
949 | ata_link_printk(link, KERN_ERR, | 949 | ata_link_err(link, "hardreset failed (port not ready)\n"); |
950 | "hardreset failed (port not ready)\n"); | ||
951 | return rc; | 950 | return rc; |
952 | } | 951 | } |
953 | 952 | ||
@@ -1141,8 +1140,8 @@ static inline void sil24_host_intr(struct ata_port *ap) | |||
1141 | 1140 | ||
1142 | /* spurious interrupts are expected if PCIX_IRQ_WOC */ | 1141 | /* spurious interrupts are expected if PCIX_IRQ_WOC */ |
1143 | if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit()) | 1142 | if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit()) |
1144 | ata_port_printk(ap, KERN_INFO, "spurious interrupt " | 1143 | ata_port_info(ap, |
1145 | "(slot_stat 0x%x active_tag %d sactive 0x%x)\n", | 1144 | "spurious interrupt (slot_stat 0x%x active_tag %d sactive 0x%x)\n", |
1146 | slot_stat, ap->link.active_tag, ap->link.sactive); | 1145 | slot_stat, ap->link.active_tag, ap->link.sactive); |
1147 | } | 1146 | } |
1148 | 1147 | ||