[alsa-devel] [PATCH 00/16] treewide: Convert dev_printk(KERN_<LEVEL> to dev_<level>(
dev_<level> create smaller objects than dev_printk(KERN_<LEVEL>. Convert non-debug calls to this form.
Joe Perches (16): tile: Convert dev_printk(KERN_<LEVEL> to dev_<level>( ata: Convert dev_printk(KERN_<LEVEL> to dev_<level>( drivers: base: Convert dev_printk(KERN_<LEVEL> to dev_<level>( block: Convert dev_printk(KERN_<LEVEL> to dev_<level>( pcmcia: Convert dev_printk(KERN_<LEVEL> to dev_<level>( dma: Convert dev_printk(KERN_<LEVEL> to dev_<level>( gpu: Convert dev_printk(KERN_<LEVEL> to dev_<level>( i2c: Convert dev_printk(KERN_<LEVEL> to dev_<level>( wireless: Convert dev_printk(KERN_<LEVEL> to dev_<level>( ethernet: Convert dev_printk(KERN_<LEVEL> to dev_<level>( pci: Convert dev_printk(KERN_<LEVEL> to dev_<level>( scsi: Convert dev_printk(KERN_<LEVEL> to dev_<level>( usb: Convert dev_printk(KERN_<LEVEL> to dev_<level>( tile: Convert dev_printk(KERN_<LEVEL> to dev_<level>( watchdog: Convert dev_printk(KERN_<LEVEL> to dev_<level>( tile: Convert dev_printk(KERN_<LEVEL> to dev_<level>(
arch/tile/kernel/pci_gx.c | 15 ++--- drivers/ata/pata_cmd64x.c | 6 +- drivers/base/attribute_container.c | 2 +- drivers/base/devres.c | 4 +- drivers/block/umem.c | 97 ++++++++++++-------------- drivers/char/pcmcia/cm4040_cs.c | 5 +- drivers/dma/at_hdmac_regs.h | 8 +- drivers/dma/iop-adma.c | 45 ++++++------ drivers/dma/mv_xor.c | 62 ++++++++---------- drivers/gpu/drm/gma500/cdv_intel_crt.c | 3 +- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 7 +- drivers/gpu/drm/gma500/psb_intel_lvds.c | 7 +- drivers/gpu/drm/i915/intel_opregion.c | 8 +- drivers/i2c/busses/i2c-piix4.c | 5 +- drivers/net/ethernet/chelsio/cxgb3/common.h | 7 +- drivers/net/ethernet/marvell/pxa168_eth.c | 7 +- drivers/net/wireless/at76c50x-usb.c | 85 +++++++++++------------ drivers/net/wireless/iwlegacy/common.h | 5 +- drivers/net/wireless/iwlwifi/pcie/trans.c | 28 +++----- drivers/pci/irq.c | 10 ++-- drivers/pci/pci-stub.c | 2 +- drivers/pci/pcie/aspm.c | 7 +-- drivers/pcmcia/cistpl.c | 10 +-- drivers/pcmcia/cs.c | 28 +++----- drivers/pcmcia/ds.c | 38 +++++------ drivers/pcmcia/pcmcia_cis.c | 4 +- drivers/pcmcia/pcmcia_resource.c | 11 +-- drivers/pcmcia/rsrc_nonstatic.c | 24 +++---- drivers/pcmcia/ti113x.h | 80 +++++++++++------------ drivers/pcmcia/yenta_socket.c | 61 ++++++++--------- drivers/scsi/53c700.c | 2 +- drivers/scsi/aic7xxx/aic79xx_osm_pci.c | 4 +- drivers/scsi/aic7xxx/aic7xxx_osm_pci.c | 4 +- drivers/scsi/aic94xx/aic94xx_tmf.c | 4 +- drivers/scsi/bfa/bfad.c | 32 ++++----- drivers/scsi/fcoe/fcoe_sysfs.c | 3 +- drivers/scsi/lasi700.c | 2 +- drivers/scsi/libsas/sas_task.c | 9 +-- drivers/scsi/lpfc/lpfc_attr.c | 8 +- drivers/scsi/lpfc/lpfc_debugfs.h | 6 +- drivers/scsi/lpfc/lpfc_hbadisc.c | 4 +- drivers/scsi/lpfc/lpfc_init.c | 45 ++++++------- drivers/scsi/mpt2sas/mpt2sas_transport.c | 91 ++++++++++++------------- drivers/scsi/mvsas/mv_64xx.c | 2 +- drivers/scsi/mvsas/mv_chips.h | 8 +- drivers/scsi/mvsas/mv_init.c | 14 ++-- drivers/scsi/mvsas/mv_sas.c | 9 +-- drivers/scsi/pm8001/pm8001_init.c | 10 +-- drivers/scsi/pm8001/pm8001_sas.c | 4 +- drivers/scsi/raid_class.c | 8 +- drivers/scsi/scsi_scan.c | 3 +- drivers/scsi/scsi_transport_fc.c | 31 ++++----- drivers/scsi/scsi_transport_sas.c | 7 +- drivers/scsi/sni_53c710.c | 2 +- drivers/scsi/zalon.c | 4 +- drivers/usb/core/hub.c | 2 +- drivers/virtio/virtio_balloon.c | 7 +- drivers/watchdog/mpcore_wdt.c | 19 +++--- sound/pci/asihpi/hpidspcd.c | 22 +++---- sound/pci/asihpi/hpioctl.c | 17 ++--- 60 files changed, 485 insertions(+), 579 deletions(-)
dev_<level> calls take less code than dev_printk(KERN_<LEVEL> and reducing object size is good. Coalesce multiline formats for easier grep. Coalesce segmented single line formats too.
Signed-off-by: Joe Perches joe@perches.com --- sound/pci/asihpi/hpidspcd.c | 22 +++++++++------------- sound/pci/asihpi/hpioctl.c | 17 ++++++++--------- 2 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/sound/pci/asihpi/hpidspcd.c b/sound/pci/asihpi/hpidspcd.c index 456a758..ac91637 100644 --- a/sound/pci/asihpi/hpidspcd.c +++ b/sound/pci/asihpi/hpidspcd.c @@ -49,14 +49,12 @@ short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code, err = request_firmware(&firmware, fw_name, &dev->dev);
if (err || !firmware) { - dev_printk(KERN_ERR, &dev->dev, - "%d, request_firmware failed for %s\n", err, - fw_name); + dev_err(&dev->dev, "%d, request_firmware failed for %s\n", + err, fw_name); goto error1; } if (firmware->size < sizeof(header)) { - dev_printk(KERN_ERR, &dev->dev, "Header size too small %s\n", - fw_name); + dev_err(&dev->dev, "Header size too small %s\n", fw_name); goto error2; } memcpy(&header, firmware->data, sizeof(header)); @@ -64,7 +62,7 @@ short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code, if ((header.type != 0x45444F43) || /* "CODE" */ (header.adapter != adapter) || (header.size != firmware->size)) { - dev_printk(KERN_ERR, &dev->dev, + dev_err(&dev->dev, "Invalid firmware header size %d != file %zd\n", header.size, firmware->size); goto error2; @@ -72,17 +70,15 @@ short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code,
if ((header.version >> 9) != (HPI_VER >> 9)) { /* Consider even and subsequent odd minor versions to be compatible */ - dev_printk(KERN_ERR, &dev->dev, - "Incompatible firmware version " - "DSP image %X != Driver %X\n", header.version, - HPI_VER); + dev_err(&dev->dev, "Incompatible firmware version DSP image %X != Driver %X\n", + header.version, HPI_VER); goto error2; }
if (header.version != HPI_VER) { - dev_printk(KERN_INFO, &dev->dev, - "Firmware: release version mismatch DSP image %X != Driver %X\n", - header.version, HPI_VER); + dev_info(&dev->dev, + "Firmware: release version mismatch DSP image %X != Driver %X\n", + header.version, HPI_VER); }
HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name); diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c index 6091562..8f96749 100644 --- a/sound/pci/asihpi/hpioctl.c +++ b/sound/pci/asihpi/hpioctl.c @@ -326,7 +326,7 @@ int __devinit asihpi_adapter_probe(struct pci_dev *pci_dev, pci_dev->subsystem_device, pci_dev->devfn);
if (pci_enable_device(pci_dev) < 0) { - dev_printk(KERN_ERR, &pci_dev->dev, + dev_err(&pci_dev->dev, "pci_enable_device failed, disabling device\n"); return -EIO; } @@ -398,9 +398,8 @@ int __devinit asihpi_adapter_probe(struct pci_dev *pci_dev, mutex_init(&adapters[adapter_index].mutex); pci_set_drvdata(pci_dev, &adapters[adapter_index]);
- dev_printk(KERN_INFO, &pci_dev->dev, - "probe succeeded for ASI%04X HPI index %d\n", - adapter.adapter->type, adapter_index); + dev_info(&pci_dev->dev, "probe succeeded for ASI%04X HPI index %d\n", + adapter.adapter->type, adapter_index);
return 0;
@@ -448,11 +447,11 @@ void __devexit asihpi_adapter_remove(struct pci_dev *pci_dev)
pci_set_drvdata(pci_dev, NULL); if (1) - dev_printk(KERN_INFO, &pci_dev->dev, - "remove %04x:%04x,%04x:%04x,%04x," " HPI index %d.\n", - pci_dev->vendor, pci_dev->device, - pci_dev->subsystem_vendor, pci_dev->subsystem_device, - pci_dev->devfn, pa->adapter->index); + dev_info(&pci_dev->dev, + "remove %04x:%04x,%04x:%04x,%04x, HPI index %d\n", + pci_dev->vendor, pci_dev->device, + pci_dev->subsystem_vendor, pci_dev->subsystem_device, + pci_dev->devfn, pa->adapter->index);
memset(pa, 0, sizeof(*pa)); }
At Sun, 28 Oct 2012 01:05:54 -0700, Joe Perches wrote:
dev_<level> calls take less code than dev_printk(KERN_<LEVEL> and reducing object size is good. Coalesce multiline formats for easier grep. Coalesce segmented single line formats too.
Signed-off-by: Joe Perches joe@perches.com
Thanks, applied.
Takashi
sound/pci/asihpi/hpidspcd.c | 22 +++++++++------------- sound/pci/asihpi/hpioctl.c | 17 ++++++++--------- 2 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/sound/pci/asihpi/hpidspcd.c b/sound/pci/asihpi/hpidspcd.c index 456a758..ac91637 100644 --- a/sound/pci/asihpi/hpidspcd.c +++ b/sound/pci/asihpi/hpidspcd.c @@ -49,14 +49,12 @@ short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code, err = request_firmware(&firmware, fw_name, &dev->dev);
if (err || !firmware) {
dev_printk(KERN_ERR, &dev->dev,
"%d, request_firmware failed for %s\n", err,
fw_name);
dev_err(&dev->dev, "%d, request_firmware failed for %s\n",
goto error1; } if (firmware->size < sizeof(header)) {err, fw_name);
dev_printk(KERN_ERR, &dev->dev, "Header size too small %s\n",
fw_name);
goto error2; } memcpy(&header, firmware->data, sizeof(header));dev_err(&dev->dev, "Header size too small %s\n", fw_name);
@@ -64,7 +62,7 @@ short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code, if ((header.type != 0x45444F43) || /* "CODE" */ (header.adapter != adapter) || (header.size != firmware->size)) {
dev_printk(KERN_ERR, &dev->dev,
goto error2;dev_err(&dev->dev, "Invalid firmware header size %d != file %zd\n", header.size, firmware->size);
@@ -72,17 +70,15 @@ short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code,
if ((header.version >> 9) != (HPI_VER >> 9)) { /* Consider even and subsequent odd minor versions to be compatible */
dev_printk(KERN_ERR, &dev->dev,
"Incompatible firmware version "
"DSP image %X != Driver %X\n", header.version,
HPI_VER);
dev_err(&dev->dev, "Incompatible firmware version DSP image %X != Driver %X\n",
header.version, HPI_VER);
goto error2; }
if (header.version != HPI_VER) {
dev_printk(KERN_INFO, &dev->dev,
"Firmware: release version mismatch DSP image %X != Driver %X\n",
header.version, HPI_VER);
dev_info(&dev->dev,
"Firmware: release version mismatch DSP image %X != Driver %X\n",
header.version, HPI_VER);
}
HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name);
diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c index 6091562..8f96749 100644 --- a/sound/pci/asihpi/hpioctl.c +++ b/sound/pci/asihpi/hpioctl.c @@ -326,7 +326,7 @@ int __devinit asihpi_adapter_probe(struct pci_dev *pci_dev, pci_dev->subsystem_device, pci_dev->devfn);
if (pci_enable_device(pci_dev) < 0) {
dev_printk(KERN_ERR, &pci_dev->dev,
return -EIO; }dev_err(&pci_dev->dev, "pci_enable_device failed, disabling device\n");
@@ -398,9 +398,8 @@ int __devinit asihpi_adapter_probe(struct pci_dev *pci_dev, mutex_init(&adapters[adapter_index].mutex); pci_set_drvdata(pci_dev, &adapters[adapter_index]);
- dev_printk(KERN_INFO, &pci_dev->dev,
"probe succeeded for ASI%04X HPI index %d\n",
adapter.adapter->type, adapter_index);
dev_info(&pci_dev->dev, "probe succeeded for ASI%04X HPI index %d\n",
adapter.adapter->type, adapter_index);
return 0;
@@ -448,11 +447,11 @@ void __devexit asihpi_adapter_remove(struct pci_dev *pci_dev)
pci_set_drvdata(pci_dev, NULL); if (1)
dev_printk(KERN_INFO, &pci_dev->dev,
"remove %04x:%04x,%04x:%04x,%04x," " HPI index %d.\n",
pci_dev->vendor, pci_dev->device,
pci_dev->subsystem_vendor, pci_dev->subsystem_device,
pci_dev->devfn, pa->adapter->index);
dev_info(&pci_dev->dev,
"remove %04x:%04x,%04x:%04x,%04x, HPI index %d\n",
pci_dev->vendor, pci_dev->device,
pci_dev->subsystem_vendor, pci_dev->subsystem_device,
pci_dev->devfn, pa->adapter->index);
memset(pa, 0, sizeof(*pa));
}
1.7.8.112.g3fd21
participants (2)
-
Joe Perches
-
Takashi Iwai