Message ID | 20190427191304.32502-4-fred@fredlawl.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | PCI: Use PCIe service name in dmesg logs | expand |
On Sat, Apr 27, 2019 at 02:13:03PM -0500, fred@fredlawl.com wrote: > Now that all uses for the ctrl_*() printk wrappers are removed from > files and replaces with pci_*() or pr_*() printk wrappers, remove the > unused macro definitions. In addition to that, remove the MY_NAME macro. > extern bool pciehp_debug; How it's used after all? > -#define dbg(format, arg...) \ > -do { \ > - if (pciehp_debug) \ > - printk(KERN_DEBUG "%s: " format, MY_NAME, ## arg); \ > -} while (0) > -#define ctrl_dbg(ctrl, format, arg...) \ > - do { \ > - if (pciehp_debug) \ > - dev_printk(KERN_DEBUG, &ctrl->pcie->device, \ > - format, ## arg); \ > - } while (0) Besides ruining the pciehp_debug support this will make unequivalent behaviour.
On Sun, Apr 28, 2019 at 06:55:36PM +0300, Andy Shevchenko wrote: > On Sat, Apr 27, 2019 at 02:13:03PM -0500, fred@fredlawl.com wrote: > > Now that all uses for the ctrl_*() printk wrappers are removed from > > files and replaces with pci_*() or pr_*() printk wrappers, remove the > > unused macro definitions. In addition to that, remove the MY_NAME macro. > > > extern bool pciehp_debug; > > How it's used after all? > > > -#define dbg(format, arg...) \ > > -do { \ > > - if (pciehp_debug) \ > > - printk(KERN_DEBUG "%s: " format, MY_NAME, ## arg); \ > > -} while (0) > > > -#define ctrl_dbg(ctrl, format, arg...) \ > > - do { \ > > - if (pciehp_debug) \ > > - dev_printk(KERN_DEBUG, &ctrl->pcie->device, \ > > - format, ## arg); \ > > - } while (0) > > Besides ruining the pciehp_debug support this will make unequivalent behaviour. I'm not super attached to pciehp_debug. But perhaps pciehp is one place where it would make sense to use pci_dbg(). There are a lot of uses of ctrl_dbg() and some of them look like they're too low-level to just convert to pci_info(), e.g., info about every command we write to the controller. We probably don't need all that info all the time. But if we want to keep it, maybe we could convert it to use pci_dbg() and the dynamic debug stuff. I'm pretty sure the dyndbg syntax is complicated enough to enable pciehp logging specifically. Then we could use that instead of the pciehp-specific module parameter. Bjorn
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index 506e1d923a1f..7d3a32a1504a 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h @@ -25,37 +25,10 @@ #include "../pcie/portdrv.h" -#define MY_NAME "pciehp" - extern bool pciehp_poll_mode; extern int pciehp_poll_time; extern bool pciehp_debug; -#define dbg(format, arg...) \ -do { \ - if (pciehp_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 (pciehp_debug) \ - dev_printk(KERN_DEBUG, &ctrl->pcie->device, \ - format, ## arg); \ - } while (0) -#define ctrl_err(ctrl, format, arg...) \ - dev_err(&ctrl->pcie->device, format, ## arg) -#define ctrl_info(ctrl, format, arg...) \ - dev_info(&ctrl->pcie->device, format, ## arg) -#define ctrl_warn(ctrl, format, arg...) \ - dev_warn(&ctrl->pcie->device, format, ## arg) - #define SLOT_NAME_SIZE 10 /** diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 5e5631fd0171..28a132a0d9db 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -47,7 +47,7 @@ static inline int pciehp_request_irq(struct controller *ctrl) /* Installs the interrupt handler */ retval = request_threaded_irq(irq, pciehp_isr, pciehp_ist, - IRQF_SHARED, MY_NAME, ctrl); + IRQF_SHARED, "pciehp", ctrl); if (retval) pci_err(pdev, "Cannot get irq %d for the hotplug controller\n", irq);