[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190429001708.GM14616@google.com>
Date: Sun, 28 Apr 2019 19:17:08 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: fred@...dlawl.com
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
mika.westerberg@...ux.intel.com, lukas@...ner.de,
andriy.shevchenko@...ux.intel.com, keith.busch@...el.com,
mr.nuke.me@...il.com, liudongdong3@...wei.com, thesven73@...il.com
Subject: Re: [PATCH 4/4] PCI/portdrv: Add dev_fmt() to port drivers
On Sat, Apr 27, 2019 at 02:13:04PM -0500, fred@...dlawl.com wrote:
> From: Frederick Lawler <fred@...dlawl.com>
>
> Add dev_fmt() to port drivers.
>
> Signed-off-by: Frederick Lawler <fred@...dlawl.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@...el.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@...ah.com>,<kristen.c.accardi@...el.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@...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@...el.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@...k.pl>, Novell Inc.
> */
>
> +#define dev_fmt(fmt) "PME: " fmt
> +
> #include <linux/pci.h>
> #include <linux/kernel.h>
> #include <linux/errno.h>
> --
> 2.17.1
>
Powered by blists - more mailing lists