[01/10] PCI/AER: Replace dev_printk(KERN_DEBUG) with dev_info()
diff mbox series

Message ID 20190509141456.223614-2-helgaas@kernel.org
State In Next
Commit 63c587d41a51f38898ab2985b3ac17c253b80beb
Headers show
Series
  • PCI: Log with pci_dev, not pcie_device
Related show

Commit Message

Bjorn Helgaas May 9, 2019, 2:14 p.m. UTC
From: Frederick Lawler <fred@fredlawl.com>

Replace dev_printk(KERN_DEBUG) with dev_info() or dev_err() to be more
consistent with other logging.

These could be converted to dev_dbg(), but that depends on
CONFIG_DYNAMIC_DEBUG and DEBUG, and we want most of these messages to
*always* be in the dmesg log.

Also remove a redundant kzalloc() failure message.

Link: https://lore.kernel.org/lkml/20190503035946.23608-2-fred@fredlawl.com
Signed-off-by: Frederick Lawler <fred@fredlawl.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/pcie/aer.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

Comments

Andy Shevchenko May 9, 2019, 5:36 p.m. UTC | #1
On Thu, May 9, 2019 at 5:17 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> From: Frederick Lawler <fred@fredlawl.com>
>
> Replace dev_printk(KERN_DEBUG) with dev_info() or dev_err() to be more
> consistent with other logging.
>
> These could be converted to dev_dbg(), but that depends on
> CONFIG_DYNAMIC_DEBUG and DEBUG, and we want most of these messages to
> *always* be in the dmesg log.
>
> Also remove a redundant kzalloc() failure message.

> +               pci_info(parent, "can't find device of ID%04x\n",
> +                        e_info->id);

Would it be a chance to take them one line instead of two?

> +               dev_err(device, "request AER IRQ %d failed\n",
> +                       dev->irq);

Ditto.
Bjorn Helgaas May 9, 2019, 9:08 p.m. UTC | #2
On Thu, May 09, 2019 at 08:36:16PM +0300, Andy Shevchenko wrote:
> On Thu, May 9, 2019 at 5:17 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
> >
> > From: Frederick Lawler <fred@fredlawl.com>
> >
> > Replace dev_printk(KERN_DEBUG) with dev_info() or dev_err() to be more
> > consistent with other logging.
> >
> > These could be converted to dev_dbg(), but that depends on
> > CONFIG_DYNAMIC_DEBUG and DEBUG, and we want most of these messages to
> > *always* be in the dmesg log.
> >
> > Also remove a redundant kzalloc() failure message.
> 
> > +               pci_info(parent, "can't find device of ID%04x\n",
> > +                        e_info->id);
> 
> Would it be a chance to take them one line instead of two?
> 
> > +               dev_err(device, "request AER IRQ %d failed\n",
> > +                       dev->irq);
> 
> Ditto.

Indeed, fixed, thanks!

Patch
diff mbox series

diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index f8fc2114ad39..74f872e4e0cc 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -964,8 +964,8 @@  static bool find_source_device(struct pci_dev *parent,
 	pci_walk_bus(parent->subordinate, find_device_iter, e_info);
 
 	if (!e_info->error_dev_num) {
-		pci_printk(KERN_DEBUG, parent, "can't find device of ID%04x\n",
-			   e_info->id);
+		pci_info(parent, "can't find device of ID%04x\n",
+			 e_info->id);
 		return false;
 	}
 	return true;
@@ -1379,18 +1379,17 @@  static int aer_probe(struct pcie_device *dev)
 	struct device *device = &dev->device;
 
 	rpc = devm_kzalloc(device, sizeof(struct aer_rpc), GFP_KERNEL);
-	if (!rpc) {
-		dev_printk(KERN_DEBUG, device, "alloc AER rpc failed\n");
+	if (!rpc)
 		return -ENOMEM;
-	}
+
 	rpc->rpd = dev->port;
 	set_service_data(dev, rpc);
 
 	status = devm_request_threaded_irq(device, dev->irq, aer_irq, aer_isr,
 					   IRQF_SHARED, "aerdrv", dev);
 	if (status) {
-		dev_printk(KERN_DEBUG, device, "request AER IRQ %d failed\n",
-			   dev->irq);
+		dev_err(device, "request AER IRQ %d failed\n",
+			dev->irq);
 		return status;
 	}
 
@@ -1419,7 +1418,7 @@  static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
 	pci_write_config_dword(dev, pos + PCI_ERR_ROOT_COMMAND, reg32);
 
 	rc = pci_bus_error_reset(dev);
-	pci_printk(KERN_DEBUG, dev, "Root Port link has been reset\n");
+	pci_info(dev, "Root Port link has been reset\n");
 
 	/* Clear Root Error Status */
 	pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &reg32);