[PATCH v2 7/9] PCI: hotplug: Prefer CONFIG_DYNAMIC_DEBUG/DEBUG for dmesg logs

From: Frederick Lawler
Date: Fri May 03 2019 - 00:01:19 EST


dbg() and ctrl_dbg() requires pciehp_debug module parameter to be set
for debug log purposes. There are niche situations in pciehp_hpc.c where
pciehp_debug is used: dbg_ctrl(), and pci_bus_check_dev().

Enabling CONFIG_DYNAMIC_DEBUG/DEBUG is well known for logging debug
information. Therefore, prefer pr/pci_dbg() for debug information, and
reserve pciehp_debug for niche situations.

Signed-off-by: Frederick Lawler <fred@xxxxxxxxxxxx>
---
drivers/pci/hotplug/pciehp.h | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
index 78325c8d961e..e852aa478802 100644
--- a/drivers/pci/hotplug/pciehp.h
+++ b/drivers/pci/hotplug/pciehp.h
@@ -32,10 +32,7 @@ extern int pciehp_poll_time;
extern bool pciehp_debug;

#define dbg(format, arg...) \
-do { \
- if (pciehp_debug) \
- pr_info(format, ## arg); \
-} while (0)
+ pr_debug(format, ## arg);
#define err(format, arg...) \
pr_err(format, ## arg)
#define info(format, arg...) \
@@ -44,11 +41,7 @@ do { \
pr_warn(format, ## arg)

#define ctrl_dbg(ctrl, format, arg...) \
- do { \
- if (pciehp_debug) \
- pci_info(ctrl->pcie->port, \
- format, ## arg); \
- } while (0)
+ pci_dbg(ctrl->pcie->port, format, ## arg)
#define ctrl_err(ctrl, format, arg...) \
pci_err(ctrl->pcie->port, format, ## arg)
#define ctrl_info(ctrl, format, arg...) \
--
2.17.1