lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YbJgXKf6NkbHgy5A@rocinante>
Date:   Thu, 9 Dec 2021 21:00:28 +0100
From:   Krzysztof WilczyƄski <kw@...ux.com>
To:     Joe Perches <joe@...ches.com>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org,
        linux-kernel@...r.kernel.org, Jean Delvare <jdelvare@...e.de>
Subject: Re: [PATCH v2 1/1] PCI: Introduce pci_bus_*() printing macros when
 device is not available

Hi Andy and Joe,

[...]
> > > > +#define pci_bus_printk(level, bus, devfn, fmt, arg...) \
> > > > +	printk(level "pci %04x:%02x:%02x.%d: " fmt, \
> > > > +	       pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), ##arg)
> > > 
> > > I have a small preference for using ... and __VA_ARGS___
> > 
> > It contradicts what other macros in the pci.h do.
> > So I will stick with current solution for the sake of consistency.
> 
> There's always this possibility.
> 
> And this: (cheers)
> ---
>  include/linux/pci.h | 58 ++++++++++++++++++++++++++++++-----------------------
>  1 file changed, 33 insertions(+), 25 deletions(-)
> 
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 0ce26850470ef..1dc34f6eaeda7 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -2456,30 +2456,38 @@ void pci_uevent_ers(struct pci_dev *pdev, enum  pci_ers_result err_type);
>  /* Provide the legacy pci_dma_* API */
>  #include <linux/pci-dma-compat.h>
>  
> -#define pci_printk(level, pdev, fmt, arg...) \
> -	dev_printk(level, &(pdev)->dev, fmt, ##arg)
> -
> -#define pci_emerg(pdev, fmt, arg...)	dev_emerg(&(pdev)->dev, fmt, ##arg)
> -#define pci_alert(pdev, fmt, arg...)	dev_alert(&(pdev)->dev, fmt, ##arg)
> -#define pci_crit(pdev, fmt, arg...)	dev_crit(&(pdev)->dev, fmt, ##arg)
> -#define pci_err(pdev, fmt, arg...)	dev_err(&(pdev)->dev, fmt, ##arg)
> -#define pci_warn(pdev, fmt, arg...)	dev_warn(&(pdev)->dev, fmt, ##arg)
> -#define pci_notice(pdev, fmt, arg...)	dev_notice(&(pdev)->dev, fmt, ##arg)
> -#define pci_info(pdev, fmt, arg...)	dev_info(&(pdev)->dev, fmt, ##arg)
> -#define pci_dbg(pdev, fmt, arg...)	dev_dbg(&(pdev)->dev, fmt, ##arg)
> -
> -#define pci_notice_ratelimited(pdev, fmt, arg...) \
> -	dev_notice_ratelimited(&(pdev)->dev, fmt, ##arg)
> -
> -#define pci_info_ratelimited(pdev, fmt, arg...) \
> -	dev_info_ratelimited(&(pdev)->dev, fmt, ##arg)
> -
> -#define pci_WARN(pdev, condition, fmt, arg...) \
> -	WARN(condition, "%s %s: " fmt, \
> -	     dev_driver_string(&(pdev)->dev), pci_name(pdev), ##arg)
> -
> -#define pci_WARN_ONCE(pdev, condition, fmt, arg...) \
> -	WARN_ONCE(condition, "%s %s: " fmt, \
> -		  dev_driver_string(&(pdev)->dev), pci_name(pdev), ##arg)
> +#define pci_printk(level, pdev, fmt, ...)				\
> +	dev_printk(level, &(pdev)->dev, fmt, ##__VA_ARGS__)
> +
> +#define pci_emerg(pdev, fmt, ...)					\
> +	dev_emerg(&(pdev)->dev, fmt, ##__VA_ARGS__)
> +#define pci_alert(pdev, fmt, ...)					\
> +	dev_alert(&(pdev)->dev, fmt, ##__VA_ARGS__)
> +#define pci_crit(pdev, fmt, ...)					\
> +	dev_crit(&(pdev)->dev, fmt, ##__VA_ARGS__)
> +#define pci_err(pdev, fmt, ...)						\
> +	dev_err(&(pdev)->dev, fmt, ##__VA_ARGS__)
> +#define pci_warn(pdev, fmt, ...)					\
> +	dev_warn(&(pdev)->dev, fmt, ##__VA_ARGS__)
> +#define pci_notice(pdev, fmt, ...)					\
> +	dev_notice(&(pdev)->dev, fmt, ##__VA_ARGS__)
> +#define pci_info(pdev, fmt, ...)					\
> +	dev_info(&(pdev)->dev, fmt, ##__VA_ARGS__)
> +#define pci_dbg(pdev, fmt, ...)						\
> +	dev_dbg(&(pdev)->dev, fmt, ##__VA_ARGS__)
> +
> +#define pci_notice_ratelimited(pdev, fmt, ...)				\
> +	dev_notice_ratelimited(&(pdev)->dev, fmt, ##__VA_ARGS__)
> +#define pci_info_ratelimited(pdev, fmt, ...)				\
> +	dev_info_ratelimited(&(pdev)->dev, fmt, ##__VA_ARGS__)
> +
> +#define pci_WARN(pdev, condition, fmt, ...)				\
> +	WARN(condition, "%s %s: " fmt,					\
> +	     dev_driver_string(&(pdev)->dev), pci_name(pdev),		\
> +	     ##__VA_ARGS__)
> +#define pci_WARN_ONCE(pdev, condition, fmt, ...)			\
> +	WARN_ONCE(condition, "%s %s: " fmt,				\
> +		  dev_driver_string(&(pdev)->dev), pci_name(pdev),	\
> +		  ##__VA_ARGS__)
>  
>  #endif /* LINUX_PCI_H */

I think both things look nice!

So perhaps meet in-between here?  Two patches in a small series: one adds
new useful macros from Andy, and the other updates current macros as per
Joe's feedback/preference?  I am sure Bjorn wouldn't mind (hopefully).

	Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ