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_inic162x.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_inic162x.c')
-rw-r--r-- | drivers/ata/sata_inic162x.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c index 83019e61e368..7a5667daf0d0 100644 --- a/drivers/ata/sata_inic162x.c +++ b/drivers/ata/sata_inic162x.c | |||
@@ -396,9 +396,8 @@ static void inic_host_intr(struct ata_port *ap) | |||
396 | } | 396 | } |
397 | 397 | ||
398 | spurious: | 398 | spurious: |
399 | ata_port_printk(ap, KERN_WARNING, "unhandled interrupt: " | 399 | ata_port_warn(ap, "unhandled interrupt: cmd=0x%x irq_stat=0x%x idma_stat=0x%x\n", |
400 | "cmd=0x%x irq_stat=0x%x idma_stat=0x%x\n", | 400 | qc ? qc->tf.command : 0xff, irq_stat, idma_stat); |
401 | qc ? qc->tf.command : 0xff, irq_stat, idma_stat); | ||
402 | } | 401 | } |
403 | 402 | ||
404 | static irqreturn_t inic_interrupt(int irq, void *dev_instance) | 403 | static irqreturn_t inic_interrupt(int irq, void *dev_instance) |
@@ -619,8 +618,9 @@ static int inic_hardreset(struct ata_link *link, unsigned int *class, | |||
619 | 618 | ||
620 | rc = sata_link_resume(link, timing, deadline); | 619 | rc = sata_link_resume(link, timing, deadline); |
621 | if (rc) { | 620 | if (rc) { |
622 | ata_link_printk(link, KERN_WARNING, "failed to resume " | 621 | ata_link_warn(link, |
623 | "link after reset (errno=%d)\n", rc); | 622 | "failed to resume link after reset (errno=%d)\n", |
623 | rc); | ||
624 | return rc; | 624 | return rc; |
625 | } | 625 | } |
626 | 626 | ||
@@ -632,8 +632,9 @@ static int inic_hardreset(struct ata_link *link, unsigned int *class, | |||
632 | rc = ata_wait_after_reset(link, deadline, inic_check_ready); | 632 | rc = ata_wait_after_reset(link, deadline, inic_check_ready); |
633 | /* link occupied, -ENODEV too is an error */ | 633 | /* link occupied, -ENODEV too is an error */ |
634 | if (rc) { | 634 | if (rc) { |
635 | ata_link_printk(link, KERN_WARNING, "device not ready " | 635 | ata_link_warn(link, |
636 | "after hardreset (errno=%d)\n", rc); | 636 | "device not ready after hardreset (errno=%d)\n", |
637 | rc); | ||
637 | return rc; | 638 | return rc; |
638 | } | 639 | } |
639 | 640 | ||