From a9a79dfec239568bdbf778242f8fcd10bcc5b9e2 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Fri, 15 Apr 2011 15:51:59 -0700 Subject: ata: Convert ata__printk(KERN_ to ata__ Saves text by removing nearly duplicated text format strings by creating ata__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 Signed-off-by: Jeff Garzik --- drivers/ata/sata_sil24.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'drivers/ata/sata_sil24.c') 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, return 0; err: - ata_link_printk(link, KERN_ERR, "softreset failed (%s)\n", reason); + ata_link_err(link, "softreset failed (%s)\n", reason); return -EIO; } @@ -714,8 +714,8 @@ static int sil24_hardreset(struct ata_link *link, unsigned int *class, * This happens often after PM DMA CS errata. */ if (pp->do_port_rst) { - ata_port_printk(ap, KERN_WARNING, "controller in dubious " - "state, performing PORT_RST\n"); + ata_port_warn(ap, + "controller in dubious state, performing PORT_RST\n"); writel(PORT_CS_PORT_RST, port + PORT_CTRL_STAT); ata_msleep(ap, 10); @@ -773,7 +773,7 @@ static int sil24_hardreset(struct ata_link *link, unsigned int *class, goto retry; } - ata_link_printk(link, KERN_ERR, "hardreset failed (%s)\n", reason); + ata_link_err(link, "hardreset failed (%s)\n", reason); return -EIO; } @@ -925,7 +925,7 @@ static void sil24_pmp_attach(struct ata_port *ap) if (sata_pmp_gscr_vendor(gscr) == 0x11ab && sata_pmp_gscr_devid(gscr) == 0x4140) { - ata_port_printk(ap, KERN_INFO, + ata_port_info(ap, "disabling NCQ support due to sil24-mv4140 quirk\n"); ap->flags &= ~ATA_FLAG_NCQ; } @@ -946,8 +946,7 @@ static int sil24_pmp_hardreset(struct ata_link *link, unsigned int *class, rc = sil24_init_port(link->ap); if (rc) { - ata_link_printk(link, KERN_ERR, - "hardreset failed (port not ready)\n"); + ata_link_err(link, "hardreset failed (port not ready)\n"); return rc; } @@ -1141,8 +1140,8 @@ static inline void sil24_host_intr(struct ata_port *ap) /* spurious interrupts are expected if PCIX_IRQ_WOC */ if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit()) - ata_port_printk(ap, KERN_INFO, "spurious interrupt " - "(slot_stat 0x%x active_tag %d sactive 0x%x)\n", + ata_port_info(ap, + "spurious interrupt (slot_stat 0x%x active_tag %d sactive 0x%x)\n", slot_stat, ap->link.active_tag, ap->link.sactive); } -- cgit