aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-04-15 18:51:59 -0400
committerJeff Garzik <jgarzik@pobox.com>2011-07-23 17:57:36 -0400
commita9a79dfec239568bdbf778242f8fcd10bcc5b9e2 (patch)
tree620648585f89cdb589d1625431f8c21ef70a9258 /drivers/ata/libata-scsi.c
parenta44fec1fce5d5d14cc3ac4545b8da346394de666 (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/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 927f968e99d9..46d087f08607 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1108,8 +1108,7 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
1108 /* configure draining */ 1108 /* configure draining */
1109 buf = kmalloc(ATAPI_MAX_DRAIN, q->bounce_gfp | GFP_KERNEL); 1109 buf = kmalloc(ATAPI_MAX_DRAIN, q->bounce_gfp | GFP_KERNEL);
1110 if (!buf) { 1110 if (!buf) {
1111 ata_dev_printk(dev, KERN_ERR, 1111 ata_dev_err(dev, "drain buffer allocation failed\n");
1112 "drain buffer allocation failed\n");
1113 return -ENOMEM; 1112 return -ENOMEM;
1114 } 1113 }
1115 1114
@@ -1127,7 +1126,7 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
1127 * IDENTIFY_PACKET is executed as ATA_PROT_PIO. 1126 * IDENTIFY_PACKET is executed as ATA_PROT_PIO.
1128 */ 1127 */
1129 if (sdev->sector_size > PAGE_SIZE) 1128 if (sdev->sector_size > PAGE_SIZE)
1130 ata_dev_printk(dev, KERN_WARNING, 1129 ata_dev_warn(dev,
1131 "sector_size=%u > PAGE_SIZE, PIO may malfunction\n", 1130 "sector_size=%u > PAGE_SIZE, PIO may malfunction\n",
1132 sdev->sector_size); 1131 sdev->sector_size);
1133 1132
@@ -1784,8 +1783,7 @@ static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd,
1784 if (cmd->sc_data_direction == DMA_FROM_DEVICE || 1783 if (cmd->sc_data_direction == DMA_FROM_DEVICE ||
1785 cmd->sc_data_direction == DMA_TO_DEVICE) { 1784 cmd->sc_data_direction == DMA_TO_DEVICE) {
1786 if (unlikely(scsi_bufflen(cmd) < 1)) { 1785 if (unlikely(scsi_bufflen(cmd) < 1)) {
1787 ata_dev_printk(dev, KERN_WARNING, 1786 ata_dev_warn(dev, "WARNING: zero len r/w req\n");
1788 "WARNING: zero len r/w req\n");
1789 goto err_did; 1787 goto err_did;
1790 } 1788 }
1791 1789
@@ -2969,9 +2967,8 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
2969 * with the cached multi_count of libata 2967 * with the cached multi_count of libata
2970 */ 2968 */
2971 if (multi_count != dev->multi_count) 2969 if (multi_count != dev->multi_count)
2972 ata_dev_printk(dev, KERN_WARNING, 2970 ata_dev_warn(dev, "invalid multi_count %u ignored\n",
2973 "invalid multi_count %u ignored\n", 2971 multi_count);
2974 multi_count);
2975 } 2972 }
2976 2973
2977 /* 2974 /*
@@ -3466,9 +3463,8 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)
3466 goto repeat; 3463 goto repeat;
3467 } 3464 }
3468 3465
3469 ata_port_printk(ap, KERN_ERR, "WARNING: synchronous SCSI scan " 3466 ata_port_err(ap,
3470 "failed without making any progress,\n" 3467 "WARNING: synchronous SCSI scan failed without making any progress, switching to async\n");
3471 " switching to async\n");
3472 } 3468 }
3473 3469
3474 queue_delayed_work(system_long_wq, &ap->hotplug_task, 3470 queue_delayed_work(system_long_wq, &ap->hotplug_task,
@@ -3550,8 +3546,8 @@ static void ata_scsi_remove_dev(struct ata_device *dev)
3550 mutex_unlock(&ap->scsi_host->scan_mutex); 3546 mutex_unlock(&ap->scsi_host->scan_mutex);
3551 3547
3552 if (sdev) { 3548 if (sdev) {
3553 ata_dev_printk(dev, KERN_INFO, "detaching (SCSI %s)\n", 3549 ata_dev_info(dev, "detaching (SCSI %s)\n",
3554 dev_name(&sdev->sdev_gendev)); 3550 dev_name(&sdev->sdev_gendev));
3555 3551
3556 scsi_remove_device(sdev); 3552 scsi_remove_device(sdev);
3557 scsi_device_put(sdev); 3553 scsi_device_put(sdev);