linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Frederick Lawler <fred@fredlawl.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
	Lukas Wunner <lukas@wunner.de>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Keith Busch <keith.busch@intel.com>,
	Dongdong Liu <liudongdong3@huawei.com>,
	Sven Van Asbroeck <thesven73@gmail.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bjorn Helgaas <bhelgaas@google.com>
Subject: [PATCH 07/10] PCI: pciehp: Log messages with pci_dev, not pcie_device
Date: Thu,  9 May 2019 09:14:53 -0500	[thread overview]
Message-ID: <20190509141456.223614-8-helgaas@kernel.org> (raw)
In-Reply-To: <20190509141456.223614-1-helgaas@kernel.org>

From: Frederick Lawler <fred@fredlawl.com>

Log messages with pci_dev, not pcie_device.  Factor out common message
prefixes with dev_fmt().

Example output change:

  - pciehp 0000:00:06.0:pcie004: Slot(0) Powering on due to button press
  + pcieport 0000:00:06.0: pciehp: Slot(0) Powering on due to button press

Link: https://lore.kernel.org/lkml/20190503035946.23608-7-fred@fredlawl.com
Signed-off-by: Frederick Lawler <fred@fredlawl.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/hotplug/pciehp.h      | 16 ++++++++--------
 drivers/pci/hotplug/pciehp_core.c |  7 +++++--
 drivers/pci/hotplug/pciehp_ctrl.c |  2 ++
 drivers/pci/hotplug/pciehp_hpc.c  |  2 ++
 drivers/pci/hotplug/pciehp_pci.c  |  2 ++
 5 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
index af5d9f92e6d5..2f0295b48d5d 100644
--- a/drivers/pci/hotplug/pciehp.h
+++ b/drivers/pci/hotplug/pciehp.h
@@ -35,22 +35,22 @@ extern int pciehp_poll_time;
  * enable debug messages.
  */
 #define dbg(format, arg...)						\
-	pr_debug("%s: " format, MY_NAME, ## arg);
+	pr_debug(format, ## arg);
 #define err(format, arg...)						\
-	printk(KERN_ERR "%s: " format, MY_NAME, ## arg)
+	pr_err(format, ## arg)
 #define info(format, arg...)						\
-	printk(KERN_INFO "%s: " format, MY_NAME, ## arg)
+	pr_info(format, ## arg)
 #define warn(format, arg...)						\
-	printk(KERN_WARNING "%s: " format, MY_NAME, ## arg)
+	pr_warn(format, ## arg)
 
 #define ctrl_dbg(ctrl, format, arg...)					\
-	dev_dbg(&ctrl->pcie->device, format, ## arg)
+	pci_dbg(ctrl->pcie->port, format, ## arg)
 #define ctrl_err(ctrl, format, arg...)					\
-	dev_err(&ctrl->pcie->device, format, ## arg)
+	pci_err(ctrl->pcie->port, format, ## arg)
 #define ctrl_info(ctrl, format, arg...)					\
-	dev_info(&ctrl->pcie->device, format, ## arg)
+	pci_info(ctrl->pcie->port, format, ## arg)
 #define ctrl_warn(ctrl, format, arg...)					\
-	dev_warn(&ctrl->pcie->device, format, ## arg)
+	pci_warn(ctrl->pcie->port, format, ## arg)
 
 #define SLOT_NAME_SIZE 10
 
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
index 6ff204c435bf..b85b22880c50 100644
--- a/drivers/pci/hotplug/pciehp_core.c
+++ b/drivers/pci/hotplug/pciehp_core.c
@@ -17,6 +17,9 @@
  *   Dely Sy <dely.l.sy@intel.com>"
  */
 
+#define pr_fmt(fmt) "pciehp: " fmt
+#define dev_fmt pr_fmt
+
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -179,14 +182,14 @@ static int pciehp_probe(struct pcie_device *dev)
 
 	if (!dev->port->subordinate) {
 		/* Can happen if we run out of bus numbers during probe */
-		dev_err(&dev->device,
+		pci_err(dev->port,
 			"Hotplug bridge without secondary bus, ignoring\n");
 		return -ENODEV;
 	}
 
 	ctrl = pcie_init(dev);
 	if (!ctrl) {
-		dev_err(&dev->device, "Controller initialization failed\n");
+		pci_err(dev->port, "Controller initialization failed\n");
 		return -ENODEV;
 	}
 	set_service_data(dev, ctrl);
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index 3f3df4c29f6e..bf81f977a751 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -13,6 +13,8 @@
  *
  */
 
+#define dev_fmt(fmt) "pciehp: " fmt
+
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/pm_runtime.h>
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index e121f1c06c21..913c7e66504f 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -12,6 +12,8 @@
  * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com>
  */
 
+#define dev_fmt(fmt) "pciehp: " fmt
+
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/jiffies.h>
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index b9c1396db6fe..d17f3bf36f70 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -13,6 +13,8 @@
  *
  */
 
+#define dev_fmt(fmt) "pciehp: " fmt
+
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/pci.h>
-- 
2.21.0.1020.gf2820cf01a-goog


  parent reply	other threads:[~2019-05-09 14:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09 14:14 [PATCH v4 00/10] PCI: Log with pci_dev, not pcie_device Bjorn Helgaas
2019-05-09 14:14 ` [PATCH 01/10] PCI/AER: Replace dev_printk(KERN_DEBUG) with dev_info() Bjorn Helgaas
2019-05-09 17:36   ` Andy Shevchenko
2019-05-09 21:08     ` Bjorn Helgaas
2019-05-09 14:14 ` [PATCH 02/10] PCI/PME: " Bjorn Helgaas
2019-05-09 17:35   ` Andy Shevchenko
2019-05-09 18:31     ` Joe Perches
2019-05-09 21:12       ` Bjorn Helgaas
2019-05-10  2:22         ` Joe Perches
2019-05-09 14:14 ` [PATCH 03/10] PCI/DPC: Log messages with pci_dev, not pcie_device Bjorn Helgaas
2019-05-09 17:39   ` Andy Shevchenko
2019-05-09 21:18     ` Bjorn Helgaas
2019-05-09 14:14 ` [PATCH 04/10] PCI/AER: " Bjorn Helgaas
2019-05-09 17:42   ` Andy Shevchenko
2019-05-09 21:44     ` Bjorn Helgaas
2019-05-09 14:14 ` [PATCH 05/10] PCI: pciehp: Remove pciehp_debug uses Bjorn Helgaas
2019-05-09 14:14 ` [PATCH 06/10] PCI: pciehp: Replace pciehp_debug module param with dyndbg Bjorn Helgaas
2019-05-09 14:14 ` Bjorn Helgaas [this message]
2019-05-09 14:14 ` [PATCH 08/10] PCI: pciehp: Remove unused dbg/err/info/warn() wrappers Bjorn Helgaas
2019-05-09 14:14 ` [PATCH 09/10] PCI: pciehp: Remove pointless PCIE_MODULE_NAME definition Bjorn Helgaas
2019-05-09 14:14 ` [PATCH 10/10] PCI: pciehp: Remove pointless MY_NAME definition Bjorn Helgaas
2019-05-09 15:07 ` [PATCH v4 00/10] PCI: Log with pci_dev, not pcie_device Keith Busch
2019-05-09 17:10 ` Bjorn Helgaas
2019-05-09 17:49 ` Andy Shevchenko
2019-05-09 21:49   ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190509141456.223614-8-helgaas@kernel.org \
    --to=helgaas@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=fred@fredlawl.com \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=liudongdong3@huawei.com \
    --cc=lukas@wunner.de \
    --cc=mika.westerberg@linux.intel.com \
    --cc=thesven73@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).