From: Bjorn Helgaas <helgaas@kernel.org>
To: fred@fredlawl.com
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
mika.westerberg@linux.intel.com, lukas@wunner.de,
andriy.shevchenko@linux.intel.com, keith.busch@intel.com,
mr.nuke.me@gmail.com, liudongdong3@huawei.com,
thesven73@gmail.com
Subject: Re: [PATCH 4/4] PCI/portdrv: Add dev_fmt() to port drivers
Date: Sun, 28 Apr 2019 19:17:08 -0500 [thread overview]
Message-ID: <20190429001708.GM14616@google.com> (raw)
In-Reply-To: <20190427191304.32502-5-fred@fredlawl.com>
On Sat, Apr 27, 2019 at 02:13:04PM -0500, fred@fredlawl.com wrote:
> From: Frederick Lawler <fred@fredlawl.com>
>
> Add dev_fmt() to port drivers.
>
> Signed-off-by: Frederick Lawler <fred@fredlawl.com>
> ---
> drivers/pci/hotplug/pciehp_core.c | 3 +++
> drivers/pci/hotplug/pciehp_ctrl.c | 2 ++
> drivers/pci/hotplug/pciehp_hpc.c | 3 +++
> drivers/pci/hotplug/pciehp_pci.c | 2 ++
> drivers/pci/pcie/aer.c | 3 +++
> drivers/pci/pcie/aer_inject.c | 2 ++
> drivers/pci/pcie/bw_notification.c | 2 ++
> drivers/pci/pcie/dpc.c | 2 ++
> drivers/pci/pcie/pme.c | 2 ++
> 9 files changed, 21 insertions(+)
>
> diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
> index 430a47556813..b07d713fd4bd 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(fmt) pr_fmt(fmt)
This should be in the same patch that converts from using the pcie_device
to the pci_dev. That way the "pciehp" that came from the pcie_device is
atomically replaced with the "pciehp" from pr_fmt()/dev_fmt().
If you do it in separate patches, there's an intermediate stage where
there's no prefix at all, and we want to avoid that.
BTW, in most cases you can simply do this, which is slightly simpler:
#define dev_fmt pr_fmt
> #include <linux/moduleparam.h>
> #include <linux/kernel.h>
> #include <linux/slab.h>
> diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
> index 345c02b1e8d7..969a9c72f65d 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 28a132a0d9db..f2a3da105f5b 100644
> --- a/drivers/pci/hotplug/pciehp_hpc.c
> +++ b/drivers/pci/hotplug/pciehp_hpc.c
> @@ -12,6 +12,9 @@
> * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com>
> */
>
> +#define pr_fmt(fmt) "pciehp: " fmt
> +#define dev_fmt(fmt) pr_fmt(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 55967ce567f6..04ccd535aca7 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>
> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> index 224d878a28b4..6fd67285423d 100644
> --- a/drivers/pci/pcie/aer.c
> +++ b/drivers/pci/pcie/aer.c
> @@ -12,6 +12,9 @@
> * Andrew Patterson <andrew.patterson@hp.com>
> */
>
> +#define pr_fmt(fmt) "AER: " fmt
> +#define dev_fmt(fmt) pr_fmt(fmt)
> +
> #include <linux/cper.h>
> #include <linux/pci.h>
> #include <linux/pci-acpi.h>
> diff --git a/drivers/pci/pcie/aer_inject.c b/drivers/pci/pcie/aer_inject.c
> index 610b617ae600..d4f6d49acd0c 100644
> --- a/drivers/pci/pcie/aer_inject.c
> +++ b/drivers/pci/pcie/aer_inject.c
> @@ -12,6 +12,8 @@
> * Huang Ying <ying.huang@intel.com>
> */
>
> +#define dev_fmt(fmt) "AER: " fmt
> +
> #include <linux/module.h>
> #include <linux/init.h>
> #include <linux/irq.h>
> diff --git a/drivers/pci/pcie/bw_notification.c b/drivers/pci/pcie/bw_notification.c
> index d2eae3b7cc0f..a4bb90562cd5 100644
> --- a/drivers/pci/pcie/bw_notification.c
> +++ b/drivers/pci/pcie/bw_notification.c
> @@ -14,6 +14,8 @@
> * and warns when links become degraded in operation.
> */
>
> +#define dev_fmt(fmt) "BWN: " fmt
> +
> #include "../pci.h"
> #include "portdrv.h"
>
> diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
> index 72659286191b..b3c10cdc508a 100644
> --- a/drivers/pci/pcie/dpc.c
> +++ b/drivers/pci/pcie/dpc.c
> @@ -6,6 +6,8 @@
> * Copyright (C) 2016 Intel Corp.
> */
>
> +#define dev_fmt(fmt) "DPC: " fmt
> +
> #include <linux/aer.h>
> #include <linux/delay.h>
> #include <linux/interrupt.h>
> diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
> index 54d593d10396..d6698423a6d6 100644
> --- a/drivers/pci/pcie/pme.c
> +++ b/drivers/pci/pcie/pme.c
> @@ -7,6 +7,8 @@
> * Copyright (C) 2009 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
> */
>
> +#define dev_fmt(fmt) "PME: " fmt
> +
> #include <linux/pci.h>
> #include <linux/kernel.h>
> #include <linux/errno.h>
> --
> 2.17.1
>
prev parent reply other threads:[~2019-04-29 0:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-27 19:13 [PATCH 0/4] PCI: Use PCIe service name in dmesg logs fred
2019-04-27 19:13 ` [PATCH 1/4] PCI: Replace dev_*() printk wrappers with pci_*() printk wrappers fred
2019-04-28 15:43 ` Andy Shevchenko
2019-04-30 22:25 ` Frederick Lawler
2019-04-29 0:02 ` Bjorn Helgaas
2019-04-29 0:52 ` Bjorn Helgaas
2019-04-30 22:26 ` Frederick Lawler
2019-04-27 19:13 ` [PATCH 2/4] PCI: pciehp: Replace ctrl_*() with pci_*() fred
2019-04-27 20:03 ` Lukas Wunner
2019-04-29 0:36 ` Bjorn Helgaas
2019-04-27 19:13 ` [PATCH 3/4] PCI: pciehp: Remove unused macro definitions fred
2019-04-28 15:55 ` Andy Shevchenko
2019-04-29 0:13 ` Bjorn Helgaas
2019-04-27 19:13 ` [PATCH 4/4] PCI/portdrv: Add dev_fmt() to port drivers fred
2019-04-29 0:17 ` Bjorn Helgaas [this message]
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=20190429001708.GM14616@google.com \
--to=helgaas@kernel.org \
--cc=andriy.shevchenko@linux.intel.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=mr.nuke.me@gmail.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