From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org,
Karolina Stolarek <karolina.stolarek@oracle.com>,
linux-kernel@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org,
"Mahesh J Salgaonkar" <mahesh@linux.ibm.com>,
"Oliver O'Halloran" <oohall@gmail.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH 3/4] PCI: shpchp: Cleanup logging and debug wrappers
Date: Mon, 16 Dec 2024 18:10:11 +0200 [thread overview]
Message-ID: <20241216161012.1774-4-ilpo.jarvinen@linux.intel.com> (raw)
In-Reply-To: <20241216161012.1774-1-ilpo.jarvinen@linux.intel.com>
The shpchp hotplug driver defines logging wrappers ctrl_*() and another
set of wrappers with generic names which are just duplicates of
existing generic printk() wrappers. Only the former are useful to
preserve as they handle the controller dereferencing (the latter are
also unused).
The "shpchp_debug" module parameter is used to enable debug logging.
The generic ability to turn on/off debug prints dynamically covers this
usecase already so there is no need to module specific debug handling.
The ctrl_dbg() wrapper also uses a low-level pci_printk() despite
always using KERN_DEBUG level.
Convert ctrl_dbg() to use the pci_dbg() and remove "shpchp_debug" check
from it.
Removing the non-ctrl variants of logging wrappers and "shpchp_debug"
module parameter as they are no longer used.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/pci/hotplug/shpchp.h | 18 +-----------------
drivers/pci/hotplug/shpchp_core.c | 3 ---
2 files changed, 1 insertion(+), 20 deletions(-)
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index f0e2d2d54d71..f9e57dce010b 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -33,24 +33,8 @@ extern bool shpchp_poll_mode;
extern int shpchp_poll_time;
extern bool shpchp_debug;
-#define dbg(format, arg...) \
-do { \
- if (shpchp_debug) \
- printk(KERN_DEBUG "%s: " format, MY_NAME, ## arg); \
-} while (0)
-#define err(format, arg...) \
- printk(KERN_ERR "%s: " format, MY_NAME, ## arg)
-#define info(format, arg...) \
- printk(KERN_INFO "%s: " format, MY_NAME, ## arg)
-#define warn(format, arg...) \
- printk(KERN_WARNING "%s: " format, MY_NAME, ## arg)
-
#define ctrl_dbg(ctrl, format, arg...) \
- do { \
- if (shpchp_debug) \
- pci_printk(KERN_DEBUG, ctrl->pci_dev, \
- format, ## arg); \
- } while (0)
+ pci_dbg(ctrl->pci_dev, format, ## arg);
#define ctrl_err(ctrl, format, arg...) \
pci_err(ctrl->pci_dev, format, ## arg)
#define ctrl_info(ctrl, format, arg...) \
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
index a10ce7be7f51..0c341453afc6 100644
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -22,7 +22,6 @@
#include "shpchp.h"
/* Global variables */
-bool shpchp_debug;
bool shpchp_poll_mode;
int shpchp_poll_time;
@@ -33,10 +32,8 @@ int shpchp_poll_time;
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
-module_param(shpchp_debug, bool, 0644);
module_param(shpchp_poll_mode, bool, 0644);
module_param(shpchp_poll_time, int, 0644);
-MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not");
MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not");
MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds");
--
2.39.5
next prev parent reply other threads:[~2024-12-16 16:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-16 16:10 [PATCH 0/4] PCI: pci_printk() removal (+ related cleanups) Ilpo Järvinen
2024-12-16 16:10 ` [PATCH 1/4] PCI: shpchp: Remove logging from module init/exit functions Ilpo Järvinen
2024-12-16 16:10 ` [PATCH 2/4] PCI: shpchp: Change dbg() -> ctrl_dbg() Ilpo Järvinen
2024-12-16 16:10 ` Ilpo Järvinen [this message]
2025-02-13 22:04 ` [PATCH 3/4] PCI: shpchp: Cleanup logging and debug wrappers Bjorn Helgaas
2025-02-14 14:37 ` Ilpo Järvinen
2024-12-16 16:10 ` [PATCH 4/4] PCI: Descope pci_printk() to aer_printk() Ilpo Järvinen
2025-02-13 22:10 ` Bjorn Helgaas
2025-02-14 11:56 ` Ilpo Järvinen
2025-02-14 20:37 ` Bjorn Helgaas
2025-02-13 22:14 ` [PATCH 0/4] PCI: pci_printk() removal (+ related cleanups) 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=20241216161012.1774-4-ilpo.jarvinen@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=karolina.stolarek@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mahesh@linux.ibm.com \
--cc=oohall@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).