diff options
author | Joe Perches <joe@perches.com> | 2011-04-15 15:51:59 -0700 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2011-07-23 17:57:36 -0400 |
commit | a9a79dfec239568bdbf778242f8fcd10bcc5b9e2 (patch) | |
tree | 620648585f89cdb589d1625431f8c21ef70a9258 /drivers/ata | |
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')
31 files changed, 526 insertions, 521 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index dda85116343..85f7b148f1a 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -540,9 +540,8 @@ static int ahci_sb600_softreset(struct ata_link *link, unsigned int *class, if (rc == -EIO) { irq_sts = readl(port_mmio + PORT_IRQ_STAT); if (irq_sts & PORT_IRQ_BAD_PMP) { - ata_link_printk(link, KERN_WARNING, - "applying SB600 PMP SRST workaround " - "and retrying\n"); + ata_link_warn(link, + "applying SB600 PMP SRST workaround and retrying\n"); rc = ahci_do_softreset(link, class, 0, deadline, ahci_check_ready); } diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c index 721d38bfa33..7df56ec3181 100644 --- a/drivers/ata/ata_generic.c +++ b/drivers/ata/ata_generic.c @@ -81,14 +81,13 @@ static int generic_set_mode(struct ata_link *link, struct ata_device **unused) xfer_mask |= ata_xfer_mode2mask(XFER_MW_DMA_0); } - ata_dev_printk(dev, KERN_INFO, "configured for %s\n", - name); + ata_dev_info(dev, "configured for %s\n", name); dev->xfer_mode = ata_xfer_mask2mode(xfer_mask); dev->xfer_shift = ata_xfer_mode2shift(dev->xfer_mode); dev->flags &= ~ATA_DFLAG_PIO; } else { - ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); + ata_dev_info(dev, "configured for PIO\n"); dev->xfer_mode = XFER_PIO_0; dev->xfer_shift = ATA_SHIFT_PIO; dev->flags |= ATA_DFLAG_PIO; diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 39761f50a3e..c102d7d6428 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -286,10 +286,10 @@ static ssize_t ahci_read_em_buffer(struct device *dev, /* the count should not be larger than PAGE_SIZE */ if (count > PAGE_SIZE) { if (printk_ratelimit()) - ata_port_printk(ap, KERN_WARNING, - "EM read buffer size too large: " - "buffer size %u, page size %lu\n", - hpriv->em_buf_sz, PAGE_SIZE); + ata_port_warn(ap, + "EM read buffer size too large: " + "buffer size %u, page size %lu\n", + hpriv->em_buf_sz, PAGE_SIZE); count = PAGE_SIZE; } @@ -1124,8 +1124,8 @@ static void ahci_dev_config(struct ata_device *dev) if (hpriv->flags & AHCI_HFLAG_SECT255) { dev->max_sectors = 255; - ata_dev_printk(dev, KERN_INFO, - "SB600 AHCI: limiting to 255 sectors per cmd\n"); + ata_dev_info(dev, + "SB600 AHCI: limiting to 255 sectors per cmd\n"); } } @@ -1249,8 +1249,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class, /* prepare for SRST (AHCI-1.1 10.4.1) */ rc = ahci_kick_engine(ap); if (rc && rc != -EOPNOTSUPP) - ata_link_printk(link, KERN_WARNING, - "failed to reset engine (errno=%d)\n", rc); + ata_link_warn(link, "failed to reset engine (errno=%d)\n", rc); ata_tf_init(link->device, &tf); @@ -1283,8 +1282,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class, * be trusted. Treat device readiness timeout as link * offline. */ - ata_link_printk(link, KERN_INFO, - "device not ready, treating as offline\n"); + ata_link_info(link, "device not ready, treating as offline\n"); *class = ATA_DEV_NONE; } else if (rc) { /* link occupied, -ENODEV too is an error */ @@ -1297,7 +1295,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class, return 0; fail: - ata_link_printk(link, KERN_ERR, "softreset failed (%s)\n", reason); + ata_link_err(link, "softreset failed (%s)\n", reason); return rc; } @@ -1966,7 +1964,7 @@ static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg) if (rc == 0) ahci_power_down(ap); else { - ata_port_printk(ap, KERN_ERR, "%s (%d)\n", emsg, rc); + ata_port_err(ap, "%s (%d)\n", emsg, rc); ahci_start_port(ap); } @@ -2061,7 +2059,7 @@ static void ahci_port_stop(struct ata_port *ap) /* de-initialize port */ rc = ahci_deinit_port(ap, &emsg); if (rc) - ata_port_printk(ap, KERN_WARNING, "%s (%d)\n", emsg, rc); + ata_port_warn(ap, "%s (%d)\n", emsg, rc); } void ahci_print_info(struct ata_host *host, const char *scc_s) diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index a791b8ce629..e0a5b555cee 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -332,25 +332,22 @@ int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *gtm) rc = -EINVAL; if (ACPI_FAILURE(status)) { - ata_port_printk(ap, KERN_ERR, - "ACPI get timing mode failed (AE 0x%x)\n", - status); + ata_port_err(ap, "ACPI get timing mode failed (AE 0x%x)\n", + status); goto out_free; } out_obj = output.pointer; if (out_obj->type != ACPI_TYPE_BUFFER) { - ata_port_printk(ap, KERN_WARNING, - "_GTM returned unexpected object type 0x%x\n", - out_obj->type); + ata_port_warn(ap, "_GTM returned unexpected object type 0x%x\n", + out_obj->type); goto out_free; } if (out_obj->buffer.length != sizeof(struct ata_acpi_gtm)) { - ata_port_printk(ap, KERN_ERR, - "_GTM returned invalid length %d\n", - out_obj->buffer.length); + ata_port_err(ap, "_GTM returned invalid length %d\n", + out_obj->buffer.length); goto out_free; } @@ -402,8 +399,8 @@ int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm) if (status == AE_NOT_FOUND) return -ENOENT; if (ACPI_FAILURE(status)) { - ata_port_printk(ap, KERN_ERR, - "ACPI set timing mode failed (status=0x%x)\n", status); + ata_port_err(ap, "ACPI set timing mode failed (status=0x%x)\n", + status); return -EINVAL; } return 0; @@ -450,8 +447,8 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf) output.pointer = NULL; /* ACPI-CA sets this; save/free it later */ if (ata_msg_probe(ap)) - ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n", - __func__, ap->port_no); + ata_dev_dbg(dev, "%s: ENTER: port#: %d\n", + __func__, ap->port_no); /* _GTF has no input parameters */ status = acpi_evaluate_object(dev->acpi_handle, "_GTF", NULL, &output); @@ -459,9 +456,8 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf) if (ACPI_FAILURE(status)) { if (status != AE_NOT_FOUND) { - ata_dev_printk(dev, KERN_WARNING, - "_GTF evaluation failed (AE 0x%x)\n", - status); + ata_dev_warn(dev, "_GTF evaluation failed (AE 0x%x)\n", + status); rc = -EINVAL; } goto out_free; @@ -469,27 +465,24 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf) if (!output.length || !output.pointer) { if (ata_msg_probe(ap)) - ata_dev_printk(dev, KERN_DEBUG, "%s: Run _GTF: " - "length or ptr is NULL (0x%llx, 0x%p)\n", - __func__, - (unsigned long long)output.length, - output.pointer); + ata_dev_dbg(dev, "%s: Run _GTF: length or ptr is NULL (0x%llx, 0x%p)\n", + __func__, + (unsigned long long)output.length, + output.pointer); rc = -EINVAL; goto out_free; } if (out_obj->type != ACPI_TYPE_BUFFER) { - ata_dev_printk(dev, KERN_WARNING, - "_GTF unexpected object type 0x%x\n", - out_obj->type); + ata_dev_warn(dev, "_GTF unexpected object type 0x%x\n", + out_obj->type); rc = -EINVAL; goto out_free; } if (out_obj->buffer.length % REGS_PER_GTF) { - ata_dev_printk(dev, KERN_WARNING, - "unexpected _GTF length (%d)\n", - out_obj->buffer.length); + ata_dev_warn(dev, "unexpected _GTF length (%d)\n", + out_obj->buffer.length); rc = -EINVAL; goto out_free; } @@ -499,9 +492,8 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf) if (gtf) { *gtf = (void *)out_obj->buffer.pointer; if (ata_msg_probe(ap)) - ata_dev_printk(dev, KERN_DEBUG, - "%s: returning gtf=%p, gtf_count=%d\n", - __func__, *gtf, rc); + ata_dev_dbg(dev, "%s: returning gtf=%p, gtf_count=%d\n", + __func__, *gtf, rc); } return rc; @@ -811,8 +803,8 @@ static int ata_acpi_push_id(struct ata_device *dev) union acpi_object in_params[1]; if (ata_msg_probe(ap)) - ata_dev_printk(dev, KERN_DEBUG, "%s: ix = %d, port#: %d\n", - __func__, dev->devno, ap->port_no); + ata_dev_dbg(dev, "%s: ix = %d, port#: %d\n", + __func__, dev->devno, ap->port_no); /* Give the drive Identify data to the drive via the _SDD method */ /* _SDD: set up input parameters */ @@ -832,8 +824,7 @@ static int ata_acpi_push_id(struct ata_device *dev) return -ENOENT; if (ACPI_FAILURE(status)) { - ata_dev_printk(dev, KERN_WARNING, - "ACPI _SDD failed (AE 0x%x)\n", status); + ata_dev_warn(dev, "ACPI _SDD failed (AE 0x%x)\n", status); return -EIO; } @@ -983,8 +974,8 @@ int ata_acpi_on_devcfg(struct ata_device *dev) if (nr_executed) { rc = ata_dev_reread_id(dev, 0); if (rc < 0) { - ata_dev_printk(dev, KERN_ERR, "failed to IDENTIFY " - "after ACPI commands\n"); + ata_dev_err(dev, + "failed to IDENTIFY after ACPI commands\n"); return rc; } } @@ -1002,8 +993,7 @@ int ata_acpi_on_devcfg(struct ata_device *dev) return rc; } - ata_dev_printk(dev, KERN_WARNING, - "ACPI: failed the second time, disabled\n"); + ata_dev_warn(dev, "ACPI: failed the second time, disabled\n"); dev->acpi_handle = NULL; /* We can safely continue if no _GTF command has been executed diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 481089c85a9..ef5612e4288 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -335,8 +335,7 @@ void ata_force_cbl(struct ata_port *ap) continue; ap->cbl = fe->param.cbl; - ata_port_printk(ap, KERN_NOTICE, - "FORCE: cable set to %s\n", fe->param.name); + ata_port_notice(ap, "FORCE: cable set to %s\n", fe->param.name); return; } } @@ -378,8 +377,7 @@ static void ata_force_link_limits(struct ata_link *link) /* only honor the first spd limit */ if (!did_spd && fe->param.spd_limit) { link->hw_sata_spd_limit = (1 << fe->param.spd_limit) - 1; - ata_link_printk(link, KERN_NOTICE, - "FORCE: PHY spd limit set to %s\n", + ata_link_notice(link, "FORCE: PHY spd limit set to %s\n", fe->param.name); did_spd = true; } @@ -387,7 +385,7 @@ static void ata_force_link_limits(struct ata_link *link) /* let lflags stack */ if (fe->param.lflags) { link->flags |= fe->param.lflags; - ata_link_printk(link, KERN_NOTICE, + ata_link_notice(link, "FORCE: link flag 0x%x forced -> 0x%x\n", fe->param.lflags, link->flags); } @@ -442,8 +440,8 @@ static void ata_force_xfermask(struct ata_device *dev) dev->pio_mask = pio_mask; } - ata_dev_printk(dev, KERN_NOTICE, - "FORCE: xfer_mask set to %s\n", fe->param.name); + ata_dev_notice(dev, "FORCE: xfer_mask set to %s\n", + fe->param.name); return; } } @@ -486,8 +484,8 @@ static void ata_force_horkage(struct ata_device *dev) dev->horkage |= fe->param.horkage_on; dev->horkage &= ~fe->param.horkage_off; - ata_dev_printk(dev, KERN_NOTICE, - "FORCE: horkage modified (%s)\n", fe->param.name); + ata_dev_notice(dev, "FORCE: horkage modified (%s)\n", + fe->param.name); } } @@ -711,8 +709,8 @@ u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev) sect = tf->lbal; if (!sect) { - ata_dev_printk(dev, KERN_WARNING, "device reported " - "invalid CHS sector 0\n"); + ata_dev_warn(dev, + "device reported invalid CHS sector 0\n"); sect = 1; /* oh well */ } @@ -1230,8 +1228,9 @@ static int ata_read_native_max_address(struct ata_device *dev, u64 *max_sectors) err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); if (err_mask) { - ata_dev_printk(dev, KERN_WARNING, "failed to read native " - "max address (err_mask=0x%x)\n", err_mask); + ata_dev_warn(dev, + "failed to read native max address (err_mask=0x%x)\n", + err_mask); if (err_mask == AC_ERR_DEV && (tf.feature & ATA_ABORTED)) return -EACCES; return -EIO; @@ -1292,8 +1291,9 @@ static int ata_set_max_sectors(struct ata_device *dev, u64 new_sectors) err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); if (err_mask) { - ata_dev_printk(dev, KERN_WARNING, "failed to set " - "max address (err_mask=0x%x)\n", err_mask); + ata_dev_warn(dev, + "failed to set max address (err_mask=0x%x)\n", + err_mask); if (err_mask == AC_ERR_DEV && (tf.feature & (ATA_ABORTED | ATA_IDNF))) return -EACCES; @@ -1336,8 +1336,8 @@ static int ata_hpa_resize(struct ata_device *dev) * be unlocked, skip HPA resizing. */ if (rc == -EACCES || !unlock_hpa) { - ata_dev_printk(dev, KERN_WARNING, "HPA support seems " - "broken, skipping HPA handling\n"); + ata_dev_warn(dev, + "HPA support seems broken, skipping HPA handling\n"); dev->horkage |= ATA_HORKAGE_BROKEN_HPA; /* we can continue if device aborted the command */ @@ -1355,14 +1355,13 @@ static int ata_hpa_resize(struct ata_device *dev) return 0; if (native_sectors > sectors) - ata_dev_printk(dev, KERN_INFO, + ata_dev_info(dev, "HPA detected: current %llu, native %llu\n", (unsigned long long)sectors, (unsigned long long)native_sectors); else if (native_sectors < sectors) - ata_dev_printk(dev, KERN_WARNING, - "native sectors (%llu) is smaller than " - "sectors (%llu)\n", + ata_dev_warn(dev, + "native sectors (%llu) is smaller than sectors (%llu)\n", (unsigned long long)native_sectors, (unsigned long long)sectors); return 0; @@ -1372,10 +1371,10 @@ static int ata_hpa_resize(struct ata_device *dev) rc = ata_set_max_sectors(dev, native_sectors); if (rc == -EACCES) { /* if device aborted the command, skip HPA resizing */ - ata_dev_printk(dev, KERN_WARNING, "device aborted resize " - "(%llu -> %llu), skipping HPA handling\n", - (unsigned long long)sectors, - (unsigned long long)native_sectors); + ata_dev_warn(dev, + "device aborted resize (%llu -> %llu), skipping HPA handling\n", + (unsigned long long)sectors, + (unsigned long long)native_sectors); dev->horkage |= ATA_HORKAGE_BROKEN_HPA; return 0; } else if (rc) @@ -1384,14 +1383,14 @@ static int ata_hpa_resize(struct ata_device *dev) /* re-read IDENTIFY data */ rc = ata_dev_reread_id(dev, 0); if (rc) { - ata_dev_printk(dev, KERN_ERR, "failed to re-read IDENTIFY " - "data after HPA resizing\n"); + ata_dev_err(dev, + "failed to re-read IDENTIFY data after HPA resizing\n"); return rc; } if (print_info) { u64 new_sectors = ata_id_n_sectors(dev->id); - ata_dev_printk(dev, KERN_INFO, + ata_dev_info(dev, "HPA unlocked: %llu -> %llu, native %llu\n", (unsigned long long)sectors, (unsigned long long)new_sectors, @@ -1655,8 +1654,8 @@ unsigned ata_exec_internal_sg(struct ata_device *dev, ata_qc_complete(qc); if (ata_msg_warn(ap)) - ata_dev_printk(dev, KERN_WARNING, - "qc timeout (cmd 0x%x)\n", command); + ata_dev_warn(dev, "qc timeout (cmd 0x%x)\n", + command); } spin_unlock_irqrestore(ap->lock, flags); @@ -1870,7 +1869,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, int rc; if (ata_msg_ctl(ap)) - ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __func__); + ata_dev_dbg(dev, "%s: ENTER\n", __func__); retry: ata_tf_init(dev, &tf); @@ -1909,14 +1908,13 @@ retry: if (err_mask) { if (err_mask & AC_ERR_NODEV_HINT) { - ata_dev_printk(dev, KERN_DEBUG, - "NODEV after polling detection\n"); + ata_dev_dbg(dev, "NODEV after polling detection\n"); return -ENOENT; } if (is_semb) { - ata_dev_printk(dev, KERN_INFO, "IDENTIFY failed on " - "device w/ SEMB sig, disabled\n"); + ata_dev_info(dev, + "IDENTIFY failed on device w/ SEMB sig, disabled\n"); /* SEMB is not supported yet */ *p_class = ATA_DEV_SEMB_UNSUP; return 0; @@ -1942,8 +1940,8 @@ retry: * both flavors of IDENTIFYs which happens * sometimes with phantom devices. */ - ata_dev_printk(dev, KERN_DEBUG, - "both IDENTIFYs aborted, assuming NODEV\n"); + ata_dev_dbg(dev, + "both IDENTIFYs aborted, assuming NODEV\n"); return -ENOENT; } @@ -1953,9 +1951,9 @@ retry: } if (dev->horkage & ATA_HORKAGE_DUMP_ID) { - ata_dev_printk(dev, KERN_DEBUG, "dumping IDENTIFY data, " - "class=%d may_fallback=%d tried_spinup=%d\n", - class, may_fallback, tried_spinup); + ata_dev_dbg(dev, "dumping IDENTIFY data, " + "class=%d may_fallback=%d tried_spinup=%d\n", + class, may_fallback, tried_spinup); print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 2, id, ATA_ID_WORDS * sizeof(*id), true); } @@ -2034,8 +2032,8 @@ retry: err_out: if (ata_msg_warn(ap)) - ata_dev_printk(dev, KERN_WARNING, "failed to IDENTIFY " - "(%s, err_mask=0x%x)\n", reason, err_mask); + ata_dev_warn(dev, "failed to IDENTIFY (%s, err_mask=0x%x)\n", + reason, err_mask); return rc; } @@ -2065,9 +2063,8 @@ static int ata_do_link_spd_horkage(struct ata_device *dev) * guaranteed by setting sata_spd_limit to target_limit above. */ if (plink->sata_spd > target) { - ata_dev_printk(dev, KERN_INFO, - "applying link speed limit horkage to %s\n", - sata_spd_string(target)); + ata_dev_info(dev, "applying link speed limit horkage to %s\n", + sata_spd_string(target)); return -EAGAIN; } return 0; @@ -2110,8 +2107,9 @@ static int ata_dev_config_ncq(struct ata_device *dev, err_mask = ata_dev_set_feature(dev, SETFEATURES_SATA_ENABLE, SATA_FPDMA_AA); if (err_mask) { - ata_dev_printk(dev, KERN_ERR, "failed to enable AA" - "(error_mask=0x%x)\n", err_mask); + ata_dev_err(dev, + "failed to enable AA (error_mask=0x%x)\n", + err_mask); if (err_mask != AC_ERR_DEV) { dev->horkage |= ATA_HORKAGE_BROKEN_FPDMA_AA; return -EIO; @@ -2154,31 +2152,28 @@ int ata_dev_configure(struct ata_device *dev) int rc; if (!ata_dev_enabled(dev) && ata_msg_info(ap)) { - ata_dev_printk(dev, KERN_INFO, "%s: ENTER/EXIT -- nodev\n", - __func__); + ata_dev_info(dev, "%s: ENTER/EXIT -- nodev\n", __func__); return 0; } if (ata_msg_probe(ap)) - ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __func__); + ata_dev_dbg(dev, "%s: ENTER\n", __func__); /* set horkage */ dev->horkage |= ata_dev_blacklisted(dev); ata_force_horkage(dev); if (dev->horkage & ATA_HORKAGE_DISABLE) { - ata_dev_printk(dev, KERN_INFO, - "unsupported device, disabling\n"); + ata_dev_info(dev, "unsupported device, disabling\n"); ata_dev_disable(dev); return 0; } if ((!atapi_enabled || (ap->flags & ATA_FLAG_NO_ATAPI)) && dev->class == ATA_DEV_ATAPI) { - ata_dev_printk(dev, KERN_WARNING, - "WARNING: ATAPI is %s, device ignored.\n", - atapi_enabled ? "not supported with this driver" - : "disabled"); + ata_dev_warn(dev, "WARNING: ATAPI is %s, device ignored\n", + atapi_enabled ? "not supported with this driver" + : "disabled"); ata_dev_disable(dev); return 0; } @@ -2199,12 +2194,12 @@ int ata_dev_configure(struct ata_device *dev) /* print device capabilities */ if (ata_msg_probe(ap)) - ata_dev_printk(dev, KERN_DEBUG, - "%s: cfg 49:%04x 82:%04x 83:%04x 84:%04x " - "85:%04x 86:%04x 87:%04x 88:%04x\n", - __func__, - id[49], id[82], id[83], id[84], - id[85], id[86], id[87], id[88]); + ata_dev_dbg(dev, + "%s: cfg 49:%04x 82:%04x 83:%04x 84:%04x " + "85:%04x 86:%04x 87:%04x 88:%04x\n", + __func__, + id[49], id[82], id[83], id[84], + id[85], id[86], id[87], id[88]); /* initialize to-be-configured parameters */ dev->flags &= ~ATA_DFLAG_CFG_MASK; @@ -2238,17 +2233,15 @@ int ata_dev_configure(struct ata_device *dev) if (ata_id_is_cfa(id)) { /* CPRM may make this media unusable */ if (id[ATA_ID_CFA_KEY_MGMT] & 1) - ata_dev_printk(dev, KERN_WARNING, - "supports DRM functions and may " - "not be fully accessible.\n"); + ata_dev_warn(dev, + "supports DRM functions and may not be fully accessible\n"); snprintf(revbuf, 7, "CFA"); } else { snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id)); /* Warn the user if the device has TPM extensions */ if (ata_id_has_tpm(id)) - ata_dev_printk(dev, KERN_WARNING, - "supports DRM functions and may " - "not be fully accessible.\n"); + ata_dev_warn(dev, + "supports DRM functions and may not be fully accessible\n"); } dev->n_sectors = ata_id_n_sectors(id); @@ -2285,12 +2278,11 @@ int ata_dev_configure(struct ata_device *dev) /* print device info to dmesg */ if (ata_msg_drv(ap) && print_info) { - ata_dev_printk(dev, KERN_INFO, - "%s: %s, %s, max %s\n", - revbuf, modelbuf, fwrevbuf, - ata_mode_string(xfer_mask)); - ata_dev_printk(dev, KERN_INFO, - "%Lu sectors, multi %u: %s %s\n", + ata_dev_info(dev, "%s: %s, %s, max %s\n", + revbuf, modelbuf, fwrevbuf, + ata_mode_string(xfer_mask)); + ata_dev_info(dev, + "%llu sectors, multi %u: %s %s\n", (unsigned long long)dev->n_sectors, dev->multi_count, lba_desc, ncq_desc); } @@ -2311,15 +2303,14 @@ int ata_dev_configure(struct ata_device *dev) /* print device info to dmesg */ if (ata_msg_drv(ap) && print_info) { - ata_dev_printk(dev, KERN_INFO, - "%s: %s, %s, max %s\n", - revbuf, modelbuf, fwrevbuf, - ata_mode_string(xfer_mask)); - ata_dev_printk(dev, KERN_INFO, - "%Lu sectors, multi %u, CHS %u/%u/%u\n", - (unsigned long long)dev->n_sectors, - dev->multi_count, dev->cylinders, - dev->heads, dev->sectors); + ata_dev_info(dev, "%s: %s, %s, max %s\n", + revbuf, modelbuf, fwrevbuf, + ata_mode_string(xfer_mask)); + ata_dev_info(dev, + "%llu sectors, multi %u, CHS %u/%u/%u\n", + (unsigned long long)dev->n_sectors, + dev->multi_count, dev->cylinders, + dev->heads, dev->sectors); } } @@ -2336,8 +2327,7 @@ int ata_dev_configure(struct ata_device *dev) rc = atapi_cdb_len(id); if ((rc < 12) || (rc > ATAPI_CDB_LEN)) { if (ata_msg_warn(ap)) - ata_dev_printk(dev, KERN_WARNING, - "unsupported CDB len\n"); + ata_dev_warn(dev, "unsupported CDB len\n"); rc = -EINVAL; goto err_out_nosup; } @@ -2358,9 +2348,9 @@ int ata_dev_configure(struct ata_device *dev) err_mask = ata_dev_set_feature(dev, SETFEATURES_SATA_ENABLE, SATA_AN); if (err_mask) - ata_dev_printk(dev, KERN_ERR, - "failed to enable ATAPI AN " - "(err_mask=0x%x)\n", err_mask); + ata_dev_err(dev, + "failed to enable ATAPI AN (err_mask=0x%x)\n", + err_mask); else { dev->flags |= ATA_DFLAG_AN; atapi_an_string = ", ATAPI AN"; @@ -2379,12 +2369,12 @@ int ata_dev_configure(struct ata_device *dev) /* print device info to dmesg */ if (ata_msg_drv(ap) && print_info) - ata_dev_printk(dev, KERN_INFO, - "ATAPI: %s, %s, max %s%s%s%s\n", - modelbuf, fwrevbuf, - ata_mode_string(xfer_mask), - cdb_intr_string, atapi_an_string, - dma_dir_string); + ata_dev_info(dev, + "ATAPI: %s, %s, max %s%s%s%s\n", + modelbuf, fwrevbuf, + ata_mode_string(xfer_mask), + cdb_intr_string, atapi_an_string, + dma_dir_string); } /* determine max_sectors */ @@ -2396,8 +2386,7 @@ int ata_dev_configure(struct ata_device *dev) 200 sectors */ if (ata_dev_knobble(dev)) { if (ata_msg_drv(ap) && print_info) - ata_dev_printk(dev, KERN_INFO, - "applying bridge limits\n"); + ata_dev_info(dev, "applying bridge limits\n"); dev->udma_mask &= ATA_UDMA5; dev->max_sectors = ATA_MAX_SECTORS; } @@ -2423,26 +2412,23 @@ int ata_dev_configure(struct ata_device *dev) bugs */ if (print_info) { - ata_dev_printk(dev, KERN_WARNING, + ata_dev_warn(dev, "Drive reports diagnostics failure. This may indicate a drive\n"); - ata_dev_printk(dev, KERN_WARNING, + ata_dev_warn(dev, "fault or invalid emulation. Contact drive vendor for information.\n"); } } if ((dev->horkage & ATA_HORKAGE_FIRMWARE_WARN) && print_info) { - ata_dev_printk(dev, KERN_WARNING, "WARNING: device requires " - "firmware update to be fully functional.\n"); - ata_dev_printk(dev, KERN_WARNING, " contact the vendor " - "or visit http://ata.wiki.kernel.org.\n"); + ata_dev_warn(dev, "WARNING: device requires firmware update to be fully functional\n"); + ata_dev_warn(dev, " contact the vendor or visit http://ata.wiki.kernel.org\n"); } return 0; err_out_nosup: if (ata_msg_probe(ap)) - ata_dev_printk(dev, KERN_DEBUG, - "%s: EXIT, err\n", __func__); + ata_dev_dbg(dev, "%s: EXIT, err\n", __func__); return rc; } @@ -2663,13 +2649,11 @@ static void sata_print_link_status(struct ata_link *link) if (ata_phys_link_online(link)) { tmp = (sstatus >> 4) & 0xf; - ata_link_printk(link, KERN_INFO, - "SATA link up %s (SStatus %X SControl %X)\n", - sata_spd_string(tmp), sstatus, scontrol); + ata_link_info(link, "SATA link up %s (SStatus %X SControl %X)\n", + sata_spd_string(tmp), sstatus, scontrol); } else { - ata_link_printk(link, KERN_INFO, - "SATA link down (SStatus %X SControl %X)\n", - sstatus, scontrol); + ata_link_info(link, "SATA link down (SStatus %X SControl %X)\n", + sstatus, scontrol); } } @@ -2758,8 +2742,8 @@ int sata_down_spd_limit(struct ata_link *link, u32 spd_limit) link->sata_spd_limit = mask; - ata_link_printk(link, KERN_WARNING, "limiting SATA link speed to %s\n", - sata_spd_string(fls(mask))); + ata_link_warn(link, "limiting SATA link speed to %s\n", + sata_spd_string(fls(mask))); return 0; } @@ -3136,8 +3120,7 @@ int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel) snprintf(buf, sizeof(buf), "%s", ata_mode_string(xfer_mask)); - ata_dev_printk(dev, KERN_WARNING, - "limiting speed to %s\n", buf); + ata_dev_warn(dev, "limiting speed to %s\n", buf); } ata_unpack_xfermask(xfer_mask, &dev->pio_mask, &dev->mwdma_mask, @@ -3164,9 +3147,9 @@ static int ata_dev_set_mode(struct ata_device *dev) dev_err_whine = " (SET_XFERMODE skipped)"; else { if (nosetxfer) - ata_dev_printk(dev, KERN_WARNING, - "NOSETXFER but PATA detected - can't " - "skip SETXFER, might malfunction\n"); + ata_dev_warn(dev, + "NOSETXFER but PATA detected - can't " + "skip SETXFER, might malfunction\n"); err_mask = ata_ |