Re: [PATCH 3/4] PCI: shpchp: Cleanup logging and debug wrappers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 16, 2024 at 06:10:11PM +0200, Ilpo Järvinen wrote:
> 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.

I think it's great to get rid of the module param.  Can you include
a hint about how users of shpchp_debug should now enable debug prints?

The one I have in my notes is to set CONFIG_DYNAMIC_DEBUG=y and boot
with 'dyndbg="file drivers/pci/* +p"'.

> 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.

> -#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)

The above are unused, aren't they?  Can we make a separate patch to
remove these, for ease of describing and reviewing?

Bjorn




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux