aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_mv.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/sata_mv.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/sata_mv.c')
-rw-r--r--drivers/ata/sata_mv.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index bea717a22e32..b0e45d29244f 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1190,7 +1190,7 @@ static void mv_wait_for_edma_empty_idle(struct ata_port *ap)
1190 break; 1190 break;
1191 udelay(per_loop); 1191 udelay(per_loop);
1192 } 1192 }
1193 /* ata_port_printk(ap, KERN_INFO, "%s: %u+ usecs\n", __func__, i); */ 1193 /* ata_port_info(ap, "%s: %u+ usecs\n", __func__, i); */
1194} 1194}
1195 1195
1196/** 1196/**
@@ -1228,7 +1228,7 @@ static int mv_stop_edma(struct ata_port *ap)
1228 pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN; 1228 pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN;
1229 mv_wait_for_edma_empty_idle(ap); 1229 mv_wait_for_edma_empty_idle(ap);
1230 if (mv_stop_edma_engine(port_mmio)) { 1230 if (mv_stop_edma_engine(port_mmio)) {
1231 ata_port_printk(ap, KERN_ERR, "Unable to stop eDMA\n"); 1231 ata_port_err(ap, "Unable to stop eDMA\n");
1232 err = -EIO; 1232 err = -EIO;
1233 } 1233 }
1234 mv_edma_cfg(ap, 0, 0); 1234 mv_edma_cfg(ap, 0, 0);
@@ -1382,7 +1382,7 @@ static void mv6_dev_config(struct ata_device *adev)
1382 if (adev->flags & ATA_DFLAG_NCQ) { 1382 if (adev->flags & ATA_DFLAG_NCQ) {
1383 if (sata_pmp_attached(adev->link->ap)) { 1383 if (sata_pmp_attached(adev->link->ap)) {
1384 adev->flags &= ~ATA_DFLAG_NCQ; 1384 adev->flags &= ~ATA_DFLAG_NCQ;
1385 ata_dev_printk(adev, KERN_INFO, 1385 ata_dev_info(adev,
1386 "NCQ disabled for command-based switching\n"); 1386 "NCQ disabled for command-based switching\n");
1387 } 1387 }
1388 } 1388 }
@@ -2225,9 +2225,8 @@ static unsigned int mv_send_fis(struct ata_port *ap, u32 *fis, int nwords)
2225 2225
2226 /* See if it worked */ 2226 /* See if it worked */
2227 if ((ifstat & 0x3000) != 0x1000) { 2227 if ((ifstat & 0x3000) != 0x1000) {
2228 ata_port_printk(ap, KERN_WARNING, 2228 ata_port_warn(ap, "%s transmission error, ifstat=%08x\n",
2229 "%s transmission error, ifstat=%08x\n", 2229 __func__, ifstat);
2230 __func__, ifstat);
2231 return AC_ERR_OTHER; 2230 return AC_ERR_OTHER;
2232 } 2231 }
2233 return 0; 2232 return 0;
@@ -2342,9 +2341,9 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc)
2342 */ 2341 */
2343 if (limit_warnings > 0 && (qc->nbytes / qc->sect_size) > 1) { 2342 if (limit_warnings > 0 && (qc->nbytes / qc->sect_size) > 1) {
2344 --limit_warnings; 2343 --limit_warnings;
2345 ata_link_printk(qc->dev->link, KERN_WARNING, DRV_NAME 2344 ata_link_warn(qc->dev->link, DRV_NAME
2346 ": attempting PIO w/multiple DRQ: " 2345 ": attempting PIO w/multiple DRQ: "
2347 "this may fail due to h/w errata\n"); 2346 "this may fail due to h/w errata\n");
2348 } 2347 }
2349 /* drop through */ 2348 /* drop through */
2350 case ATA_PROT_NODATA: 2349 case ATA_PROT_NODATA:
@@ -2499,20 +2498,20 @@ static int mv_handle_fbs_ncq_dev_err(struct ata_port *ap)
2499 } 2498 }
2500 failed_links = hweight16(new_map); 2499 failed_links = hweight16(new_map);
2501 2500
2502 ata_port_printk(ap, KERN_INFO, "%s: pmp_map=%04x qc_map=%04x " 2501 ata_port_info(ap,
2503 "failed_links=%d nr_active_links=%d\n", 2502 "%s: pmp_map=%04x qc_map=%04x failed_links=%d nr_active_links=%d\n",
2504 __func__, pp->delayed_eh_pmp_map, 2503 __func__, pp->delayed_eh_pmp_map,
2505 ap->qc_active, failed_links, 2504 ap->qc_active, failed_links,
2506 ap->nr_active_links); 2505 ap->nr_active_links);
2507 2506
2508 if (ap->nr_active_links <= failed_links && mv_req_q_empty(ap)) { 2507 if (ap->nr_active_links <= failed_links && mv_req_q_empty(ap)) {
2509 mv_process_crpb_entries(ap, pp); 2508 mv_process_crpb_entries(ap, pp);
2510 mv_stop_edma(ap); 2509 mv_stop_edma(ap);
2511 mv_eh_freeze(ap); 2510 mv_eh_freeze(ap);
2512 ata_port_printk(ap, KERN_INFO, "%s: done\n", __func__); 2511 ata_port_info(ap, "%s: done\n", __func__);
2513 return 1; /* handled */ 2512 return 1; /* handled */
2514 } 2513 }
2515 ata_port_printk(ap, KERN_INFO, "%s: waiting\n", __func__); 2514 ata_port_info(ap, "%s: waiting\n", __func__);
2516 return 1; /* handled */ 2515 return 1; /* handled */
2517} 2516}
2518 2517
@@ -2554,9 +2553,8 @@ static int mv_handle_dev_err(struct ata_port *ap, u32 edma_err_cause)
2554 * and we cannot handle it here. 2553 * and we cannot handle it here.
2555 */ 2554 */
2556 if (edma_err_cause & EDMA_ERR_SELF_DIS) { 2555 if (edma_err_cause & EDMA_ERR_SELF_DIS) {
2557 ata_port_printk(ap, KERN_WARNING, 2556 ata_port_warn(ap, "%s: err_cause=0x%x pp_flags=0x%x\n",
2558 "%s: err_cause=0x%x pp_flags=0x%x\n", 2557 __func__, edma_err_cause, pp->pp_flags);
2559 __func__, edma_err_cause, pp->pp_flags);
2560 return 0; /* not handled */ 2558 return 0; /* not handled */
2561 } 2559 }
2562 return mv_handle_fbs_ncq_dev_err(ap); 2560 return mv_handle_fbs_ncq_dev_err(ap);
@@ -2567,9 +2565,8 @@ static int mv_handle_dev_err(struct ata_port *ap, u32 edma_err_cause)
2567 * and we cannot handle it here. 2565 * and we cannot handle it here.
2568 */ 2566 */
2569 if (!(edma_err_cause & EDMA_ERR_SELF_DIS)) { 2567 if (!(edma_err_cause & EDMA_ERR_SELF_DIS)) {
2570 ata_port_printk(ap, KERN_WARNING, 2568 ata_port_warn(ap, "%s: err_cause=0x%x pp_flags=0x%x\n",
2571 "%s: err_cause=0x%x pp_flags=0x%x\n", 2569 __func__, edma_err_cause, pp->pp_flags);
2572 __func__, edma_err_cause, pp->pp_flags);
2573 return 0; /* not handled */ 2570 return 0; /* not handled */
2574 } 2571 }
2575 return mv_handle_fbs_non_ncq_dev_err(ap); 2572 return mv_handle_fbs_non_ncq_dev_err(ap);